diff -Nru faac-1.26/aclocal.m4 faac-1.28/aclocal.m4 --- faac-1.26/aclocal.m4 2007-10-15 08:11:32.000000000 +0000 +++ faac-1.28/aclocal.m4 2009-02-10 08:36:56.000000000 +0000 @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.10 -*- Autoconf -*- +# generated automatically by aclocal 1.9.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006 Free Software Foundation, Inc. +# 2005 Free Software Foundation, Inc. # This file 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. @@ -11,14 +11,9 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. -m4_if(m4_PACKAGE_VERSION, [2.61],, -[m4_fatal([this file was generated for autoconf 2.61. -You have another version of autoconf. If you want to use that, -you should regenerate the build system entirely.], [63])]) - # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -# serial 51 Debian 1.5.24-1 AC_PROG_LIBTOOL +# serial 48 Debian 1.5.22-4 AC_PROG_LIBTOOL # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) @@ -181,7 +176,7 @@ test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= @@ -268,9 +263,8 @@ # Check for compiler boilerplate output or warnings with # the simple compiler test code. AC_DEFUN([_LT_COMPILER_BOILERPLATE], -[AC_REQUIRE([LT_AC_PROG_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext +[ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* @@ -282,9 +276,8 @@ # Check for linker boilerplate output or warnings with # the simple link test code. AC_DEFUN([_LT_LINKER_BOILERPLATE], -[AC_REQUIRE([LT_AC_PROG_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext +[ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* @@ -300,20 +293,12 @@ # If we don't find anything, use the default library path according # to the aix ld manual. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], -[AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi],[]) +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_AC_SYS_LIBPATH_AIX @@ -544,17 +529,13 @@ rm -rf conftest* ;; -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ -s390*-*linux*|sparc*-*linux*) +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; @@ -571,9 +552,6 @@ ;; *64-bit*) case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; @@ -645,7 +623,7 @@ AC_CACHE_CHECK([$1], [$2], [$2=no ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. @@ -686,12 +664,11 @@ # ------------------------------------------------------------ # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], -[AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_CACHE_CHECK([$1], [$2], +[AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" - echo "$lt_simple_link_test_code" > conftest.$ac_ext + printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings @@ -805,27 +782,24 @@ fi ;; *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - teststring= - # Add a significant safety factor because C++ compilers can tack on massive - # amounts of additional arguments before passing them to the linker. - # It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac ]) @@ -1052,8 +1026,7 @@ # --------------------------------- # Check to see if options -c and -o are simultaneously supported by compiler AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], -[AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no @@ -1061,7 +1034,7 @@ mkdir conftest cd conftest mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or @@ -1201,7 +1174,6 @@ darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" - old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) @@ -1219,8 +1191,7 @@ # ----------------------------- # PORTME Fill in your ld.so characteristics AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], -[AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_MSG_CHECKING([dynamic linker characteristics]) +[AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= @@ -1234,58 +1205,20 @@ version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" -m4_if($1,[],[ if test "$GCC" = yes; then - case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'` + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else - lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[[lt_foo]]++; } - if (lt_freq[[lt_foo]] == 1) { print lt_foo; } -}'` - sys_lib_search_path_spec=`echo $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi]) +fi need_lib_prefix=unknown hardcode_into_libs=no @@ -1442,8 +1375,12 @@ shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - m4_if([$1], [],[ - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; @@ -1497,7 +1434,7 @@ shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; - *) # from 4.6 on, and DragonFly + freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; @@ -1560,7 +1497,7 @@ postinstall_cmds='chmod 555 $lib' ;; -interix[[3-9]]*) +interix3*) version_type=linux need_lib_prefix=no need_version=no @@ -1631,7 +1568,7 @@ # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -1737,10 +1674,6 @@ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; -rdos*) - dynamic_linker=no - ;; - solaris*) version_type=linux need_lib_prefix=no @@ -1846,8 +1779,7 @@ # _LT_AC_TAGCONFIG # ---------------- AC_DEFUN([_LT_AC_TAGCONFIG], -[AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_ARG_WITH([tags], +[AC_ARG_WITH([tags], [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], [include additional configurations @<:@automatic@:>@])], [tagnames="$withval"]) @@ -2108,7 +2040,7 @@ # AC_PATH_TOOL_PREFIX # ------------------- -# find a file program which can recognize shared library +# find a file program which can recognise shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_MSG_CHECKING([for $1]) @@ -2171,7 +2103,7 @@ # AC_PATH_MAGIC # ------------- -# find a file program which can recognize a shared library +# find a file program which can recognise a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then @@ -2318,7 +2250,7 @@ # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], -[AC_CACHE_CHECK([how to recognize dependent libraries], +[AC_CACHE_CHECK([how to recognise dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= @@ -2357,15 +2289,9 @@ mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump', - # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi + # func_win32_libid shell function, so use a weaker test based on 'objdump'. + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) @@ -2410,7 +2336,7 @@ esac ;; -interix[[3-9]]*) +interix3*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; @@ -2460,10 +2386,6 @@ lt_cv_deplibs_check_method=pass_all ;; -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - solaris*) lt_cv_deplibs_check_method=pass_all ;; @@ -2516,7 +2438,7 @@ lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do @@ -2732,10 +2654,10 @@ _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" +lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' +lt_simple_link_test_code='int main(){return(0);}\n' _LT_AC_SYS_COMPILER @@ -2837,10 +2759,10 @@ _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" +lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' +lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER @@ -2986,7 +2908,7 @@ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 - : + _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported @@ -3145,10 +3067,10 @@ case $cc_basename in xlc*) output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) @@ -3231,7 +3153,9 @@ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in - hppa*64*|ia64*) ;; + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + ;; *) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; @@ -3299,7 +3223,7 @@ ;; esac ;; - interix[[3-9]]*) + interix3*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' @@ -3419,29 +3343,6 @@ # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - - # Not sure whether something based on - # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 - # would be better. - output_verbose_link_cmd='echo' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - esac - ;; esac ;; lynxos*) @@ -3480,20 +3381,16 @@ _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) - if test -f /usr/libexec/ld.so; then - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd='echo' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi + output_verbose_link_cmd='echo' ;; osf3*) case $cc_basename in @@ -3655,10 +3552,15 @@ case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes @@ -3705,12 +3607,6 @@ fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - ;; - esac fi ;; esac @@ -3954,7 +3850,7 @@ # PORTME: override above test on systems where it is broken ifelse([$1],[CXX], [case $host_os in -interix[[3-9]]*) +interix3*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_AC_TAGVAR(predep_objects,$1)= @@ -3962,46 +3858,13 @@ _LT_AC_TAGVAR(postdeps,$1)= ;; -linux*) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - # - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - if test "$solaris_use_stlport4" != yes; then - _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; - solaris*) case $cc_basename in CC*) - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. - if test "$solaris_use_stlport4" != yes; then - _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi + _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun' ;; esac ;; @@ -4050,17 +3913,10 @@ _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code="\ - subroutine t - return - end -" +lt_simple_compile_test_code=" subroutine t\n return\n end\n" # Code to be used in simple link tests -lt_simple_link_test_code="\ - program t - end -" +lt_simple_link_test_code=" program t\n end\n" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER @@ -4139,10 +3995,10 @@ _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}" +lt_simple_compile_test_code="class foo {}\n" # Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER @@ -4195,7 +4051,7 @@ _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" @@ -4284,7 +4140,6 @@ _LT_AC_TAGVAR(module_cmds, $1) \ _LT_AC_TAGVAR(module_expsym_cmds, $1) \ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \ - _LT_AC_TAGVAR(fix_srcfile_path, $1) \ _LT_AC_TAGVAR(exclude_expsyms, $1) \ _LT_AC_TAGVAR(include_expsyms, $1); do @@ -4331,7 +4186,7 @@ # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: @@ -4656,7 +4511,7 @@ sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path=$lt_fix_srcfile_path +fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" # Set to yes if exported symbols are required. always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) @@ -4739,7 +4594,6 @@ # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([LT_AC_PROG_SED]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. @@ -4966,14 +4820,12 @@ # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | cygwin* | os2* | pw32*) + mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) @@ -4985,7 +4837,7 @@ # DJGPP does not support shared libraries at all _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; - interix[[3-9]]*) + interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; @@ -5121,14 +4973,6 @@ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - esac ;; esac ;; @@ -5249,15 +5093,13 @@ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2*) + mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; @@ -5267,7 +5109,7 @@ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; - interix[[3-9]]*) + interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; @@ -5325,7 +5167,7 @@ esac ;; - mingw* | cygwin* | pw32* | os2*) + mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' @@ -5377,22 +5219,6 @@ # All Alpha code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C 5.9 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='' - ;; - esac - ;; esac ;; @@ -5402,10 +5228,6 @@ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - rdos*) - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - solaris*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' @@ -5500,8 +5322,7 @@ # ------------------------------------ # See if the linker supports building shared libraries. AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], -[AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in @@ -5518,7 +5339,7 @@ _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' ;; linux* | k*bsd*-gnu) _LT_AC_TAGVAR(link_all_deplibs, $1)=no @@ -5660,7 +5481,7 @@ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -5678,7 +5499,7 @@ fi ;; - interix[[3-9]]*) + interix3*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' @@ -5693,7 +5514,7 @@ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in @@ -5711,22 +5532,13 @@ ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - *) - tmp_sharedflag='-shared' ;; - esac - _LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi _LT_AC_TAGVAR(link_all_deplibs, $1)=no else @@ -5767,7 +5579,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 @@ -5886,7 +5698,7 @@ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 - : + _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported @@ -5979,7 +5791,7 @@ # The linker will automatically build a .lib file if we build a DLL. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. - _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; @@ -6021,10 +5833,10 @@ case $cc_basename in xlc*) output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) @@ -6186,28 +5998,24 @@ ;; openbsd*) - if test -f /usr/libexec/ld.so; then - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else - _LT_AC_TAGVAR(ld_shlibs, $1)=no + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac fi ;; @@ -6266,16 +6074,17 @@ case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' - fi - ;; + case $wlarc in + '') + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; + *) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; @@ -6332,7 +6141,7 @@ fi ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -6407,7 +6216,7 @@ # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $rm conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest @@ -6510,30 +6319,6 @@ [AC_CHECK_TOOL(RC, windres, no) ]) - -# Cheap backport of AS_EXECUTABLE_P and required macros -# from Autoconf 2.59; we should not use $as_executable_p directly. - -# _AS_TEST_PREPARE -# ---------------- -m4_ifndef([_AS_TEST_PREPARE], -[m4_defun([_AS_TEST_PREPARE], -[if test -x / >/dev/null 2>&1; then - as_executable_p='test -x' -else - as_executable_p='test -f' -fi -])])# _AS_TEST_PREPARE - -# AS_EXECUTABLE_P -# --------------- -# Check whether a file is executable. -m4_ifndef([AS_EXECUTABLE_P], -[m4_defun([AS_EXECUTABLE_P], -[AS_REQUIRE([_AS_TEST_PREPARE])dnl -$as_executable_p $1[]dnl -])])# AS_EXECUTABLE_P - # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # @@ -6554,13 +6339,12 @@ test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do - if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done -IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris @@ -6593,11 +6377,10 @@ done ]) SED=$lt_cv_path_SED -AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ]) -# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -6607,29 +6390,14 @@ # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. -# (This private macro should not be called outside this file.) -AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.10' -dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to -dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.10], [], - [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl -]) - -# _AM_AUTOCONF_VERSION(VERSION) -# ----------------------------- -# aclocal traces this macro to find the Autoconf version. -# This is a private macro too. Using m4_define simplifies -# the logic in aclocal, which can simply ignore this definition. -m4_define([_AM_AUTOCONF_VERSION], []) +AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- -# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.10])dnl -_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) + [AM_AUTOMAKE_VERSION([1.9.6])]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- @@ -6686,14 +6454,14 @@ # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file 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. -# serial 8 +# serial 7 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- @@ -6702,10 +6470,8 @@ [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE])dnl -AC_SUBST([$1_FALSE])dnl -_AM_SUBST_NOTMAKE([$1_TRUE])dnl -_AM_SUBST_NOTMAKE([$1_FALSE])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' @@ -6719,14 +6485,15 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file 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. -# serial 9 +# serial 8 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -6754,7 +6521,6 @@ ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) @@ -6820,7 +6586,6 @@ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} 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 sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then @@ -6873,8 +6638,7 @@ AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH])dnl -_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- @@ -6899,9 +6663,8 @@ # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue @@ -6960,8 +6723,8 @@ # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -6984,20 +6747,16 @@ # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.60])dnl +[AC_PREREQ([2.58])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) - fi +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # test whether we have cygpath @@ -7017,9 +6776,6 @@ AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl -dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, - [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl @@ -7055,10 +6811,6 @@ [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES(OBJC)], - [define([AC_PROG_OBJC], - defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) ]) @@ -7094,7 +6846,7 @@ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} +install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. @@ -7172,14 +6924,14 @@ # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file 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. -# serial 5 +# serial 4 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ @@ -7195,7 +6947,6 @@ # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([missing])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then @@ -7206,7 +6957,7 @@ fi ]) -# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -7214,23 +6965,60 @@ # AM_PROG_MKDIR_P # --------------- -# Check for `mkdir -p'. +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. +# +# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories +# created by `make install' are always world readable, even if the +# installer happens to have an overly restrictive umask (e.g. 077). +# This was a mistake. There are at least two reasons why we must not +# use `-m 0755': +# - it causes special bits like SGID to be ignored, +# - it may be too restrictive (some setups expect 775 directories). +# +# Do not use -m 0755 and let people choose whatever they expect by +# setting umask. +# +# We cannot accept any implementation of `mkdir' that recognizes `-p'. +# Some implementations (such as Solaris 8's) are not thread-safe: if a +# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' +# concurrently, both version can detect that a/ is missing, but only +# one can create it and the other will error out. Consequently we +# restrict ourselves to GNU make (using the --version option ensures +# this.) AC_DEFUN([AM_PROG_MKDIR_P], -[AC_PREREQ([2.60])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, -dnl while keeping a definition of mkdir_p for backward compatibility. -dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. -dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of -dnl Makefile.ins that do not define MKDIR_P, so we do our own -dnl adjustment using top_builddir (which is defined more often than -dnl MKDIR_P). -AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl -case $mkdir_p in - [[\\/$]]* | ?:[[\\/]]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac -]) +[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi +AC_SUBST([mkdir_p])]) # Helper functions for option handling. -*- Autoconf -*- @@ -7342,21 +7130,9 @@ if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006 Free Software Foundation, Inc. -# -# This file 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. - -# _AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- -# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. -# This macro is traced by Automake. -AC_DEFUN([_AM_SUBST_NOTMAKE]) - # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. diff -Nru faac-1.26/ChangeLog faac-1.28/ChangeLog --- faac-1.26/ChangeLog 2005-02-02 07:47:27.000000000 +0000 +++ faac-1.28/ChangeLog 2009-02-02 23:29:33.000000000 +0000 @@ -1,2864 +1,6 @@ -2005-02-02 sur - * libfaac: - Directory kiss_fft added to the repository - - * libfaac/kiss_fft/README.kiss_fft: - Instructions how to download and install kiss_fft library. - - * libfaac/coder.h: - Added DRM-compatible FRAMLE_LEN, BLOCK_LEN_LONG, BLOCK_LEN_SHORT definitions. - - * libfaac/fft.c: - Added interface to kiss_fft library to implement FFT for 960 transform length. - - * libfaac/fft.h: - Added interface to kiss_fft library to implement FFT for 960 transform length. - - * libfaac/filtbank.c: - 960 transform length implemented. - - * libfaac/filtbank.h: - NFLAT_LS definition changed to be 1024/960 transform length compatible. - - * libfaac/huffman.c: - Fixed bug in Huffman_End. - - * libfaac/libfaac_dll_drm.sln: - Win32 Visual Studio solution file to build DRM-compatible libfaac. - This is experimental code, please do not use this project to build 'ordinary' libfaac. - - * libfaac/libfaac_dll_drm.vcproj: - Win32 Visual Studio project file to build DRM-compatible libfaac. - This is experimental code, please do not use this project to build 'ordinary' libfaac. - - * libfaac/libfaacdrm.def: - Win32 module definition file for libfaac_dll_drm project. - - * libfaac/util.c: - Minor changes to make code 1024/960 transform length compatible. - -2004-08-19 menno - * frontend/main.c: - Removed stupid comment in help of FAAC. RAW AAC files are USELESS, - it seems that already some people encoded their collection using - the -r option. - typo, it's not bad to have this option, but people should be warned - that they can get severe playback problems with RAW AAC files (anything - other then 44100 will not be decoded properly unless you know that it - has that samplerate). Seeking is also not possible on these files. - -2004-08-06 danchr - * frontend/main.c: - TNS is no longer enabled by default (reported by guruboolez) - documentation fixes in frontend - default to mp4 for *.m4b as well - -2004-08-02 danchr - * configure.in, common/mp4v2/Makefile.am: - linux portability fixes - - * frontend/main.c: - NetBSD portability fix + fixing metadata bugs w/ sscanf(). - *BSD portability fix. - fix --shortctl documentation. - -2004-07-28 danchr - * Makefile.am, bootstrap, configure.in, - frontend/: Makefile.am, main.c, - common/Makefile.am, common/mp4v2/Makefile.am: - Darwin portability fixes, should help on Linux too - -2004-07-27 menno - * common/mp4v2: - Directory /cvsroot/faac/faac/common/mp4v2 added to the repository - - * common/mp4v2/: - 3gp.cpp API_CHANGES INTERNALS Makefile.am README TODO - atom_bitr.cpp atom_co64.cpp atom_cprt.cpp atom_ctts.cpp - atom_d263.cpp atom_damr.cpp atom_dimm.cpp atom_dinf.cpp - atom_dmax.cpp atom_dmed.cpp atom_dref.cpp atom_drep.cpp - atom_edts.cpp atom_elst.cpp atom_enca.cpp atom_encv.cpp - atom_esds.cpp atom_free.cpp atom_frma.cpp atom_ftyp.cpp - atom_hdlr.cpp atom_hinf.cpp atom_hmhd.cpp atom_hnti.cpp - atom_iKMS.cpp atom_iSFM.cpp atom_iods.cpp atom_maxr.cpp - atom_mdat.cpp atom_mdhd.cpp atom_mdia.cpp atom_meta.cpp - atom_mfhd.cpp atom_minf.cpp atom_moof.cpp atom_moov.cpp - atom_mp4a.cpp atom_mp4s.cpp atom_mp4v.cpp atom_mvex.cpp - atom_mvhd.cpp atom_nmhd.cpp atom_nump.cpp atom_payt.cpp - atom_pmax.cpp atom_root.cpp atom_rtp.cpp atom_s263.cpp - atom_samr.cpp atom_sawb.cpp atom_schi.cpp atom_schm.cpp - atom_sdp.cpp atom_sinf.cpp atom_smhd.cpp atom_snro.cpp - atom_stbl.cpp atom_stco.cpp atom_stdp.cpp atom_stsc.cpp - atom_stsd.cpp atom_stsh.cpp atom_stss.cpp atom_stsz.cpp - atom_stts.cpp atom_tfhd.cpp atom_tims.cpp atom_tkhd.cpp - atom_tmax.cpp atom_tmin.cpp atom_tpyl.cpp atom_traf.cpp - atom_trak.cpp atom_tref.cpp atom_treftype.cpp atom_trex.cpp - atom_trpy.cpp atom_trun.cpp atom_tsro.cpp atom_udta.cpp - atom_url.cpp atom_urn.cpp atom_vmhd.cpp atoms.h - descriptors.cpp descriptors.h isma.cpp libmp4v260.dsp - libmp4v2_st60.dsp mp4.cpp mp4.h mp4array.h mp4atom.cpp - mp4atom.h mp4common.h mp4container.cpp mp4container.h - mp4descriptor.cpp mp4descriptor.h mp4file.cpp mp4file.h - mp4file_io.cpp mp4info.cpp mp4meta.cpp mp4property.cpp - mp4property.h mp4track.cpp mp4track.h mp4util.cpp mp4util.h - mpeg4ip.h mpeg4ip_version.h need_for_win32.c - ocidescriptors.cpp ocidescriptors.h odcommands.cpp - odcommands.h qosqualifiers.cpp qosqualifiers.h rtphint.cpp - rtphint.h, - frontend/: faac.dsw, faac.dsp, libfaac/libfaac.dsp, - plugins/cooledit/: Cfaac.h, FAAC.dsp, FAAC.dsw, - plugins/winamp/: Cfaac.h, out_FAAC.dsp, out_FAAC.dsw: - Moved mp4v2 library to faac module and updated to newest version - Will require some changes for linux makefiles I guess - - * configure.in: - small linux patch - -2004-07-18 corrados - * libfaac/frame.c: - New bandwidth settings for DRM, improved quantization - quality adaptation (almost constant bit-rate now). - -2004-07-13 corrados - * libfaac/frame.c bitstream.c: - bug fix with new object type definitions - -2004-07-12 corrados - * libfaac/: huffman.h, huffman.c, aacquant.c: - VCB11 fixes - -2004-07-08 corrados - * libfaac/: psychkni.c, frame.c, bitstream.c: - New scalefactorband table for 960 transform length, - bug fix in HCR - -2004-07-08 menno - * plugins/winamp/: .cvsignore, CRegistry.cpp, CRegistry.h, Cfaac.cpp, - Cfaac.h, FAAC.rc, Out_faac.cpp, RESOURCE.H, defines.h, mpeg4ip-v.bmp, - out_FAAC.sln, out_FAAC.vcproj, CTag.cpp, CTag.h, EncDialog.cpp, - EncDialog.h, id3v2.ico: - Updated plugins for FAAC - - * plugins/cooledit/: .cvsignore, CRegistry.cpp, CRegistry.h, Cfaac.cpp, - Cfaac.h, Cfaad.cpp, Cfaad.h, FAAC.rc, FAAC.sln, FAAC.vcproj, - Faac.cpp, Faad.cpp, Main.cpp, aacInfoLib.dsp, aacInfoLib.vcproj, - defines.h, mpeg4ip-v.bmp, resource.h, CTag.cpp, CTag.h, DecDialog.cpp, - DecDialog.h, EncDialog.cpp, EncDialog.h, id3v2.ico: - Updated plugins for FAAC - -2004-07-04 corrados - * libfaac/: huffman.c, frame.c, coder.h, bitstream.h, bitstream.c, aacquant.c, - include/: faaccfg.h, faac.h: - made faac compliant with Digital Radio Mondiale (DRM) (DRM macro must be set). - implemented HCR tool, VCB11, CRC, scalable bitstream order. - note: VCB11 only uses codebook 11! TODO: implement codebooks 16-32. - 960 transform length is not yet implemented (TODO)! Use 1024 for - encoding and 960 for decoding, resulting in a lot of artefacts. - -2004-05-13 menno - * plugins/winamp/: CRegistry.cpp, CRegistry.h, Cfaac.cpp, Cfaac.h, - FAAC.rc, Open.bmp, Out_faac.cpp, RESOURCE.H, ReadMe.txt, defines.h, - out_FAAC.sln, out_FAAC.vcproj: - New plugins for FAAC with tagging - - * plugins/cooledit/: CRegistry.cpp, CRegistry.h, Cfaac.cpp, Cfaac.h, - Cfaad.cpp, FAAC.rc, FAAC.sln, FAAC.vcproj, Faac.cpp, Main.cpp, - Readme.txt, defines.h, resource.h, Open.bmp: - New plugins for FAAC with tagging - -2004-05-03 danchr - * libfaac/:frame.c, version.h: - bump version to unstable 1.24+ - - * frontend/main.c: - fix documentation bugs (per Hans-Jürgen's suggestions) - enable (preliminary) multiple output file support - -2004-04-23 danchr - * libfaac/version.h: - removing beta status - -2004-04-22 danchr - * frontend/main.c: - set copyright notice to my full name - -2004-04-16 menno - * plugins/winamp/: CRegistry.cpp, CRegistry.h, FAAC.rc, Open.bmp, - Out_faac.cpp, RESOURCE.H, ReadMe.txt, defines.h, out_FAAC.dsp, - out_FAAC.dsw, AudioCoding.bmp, Cfaac.h, Email.bmp, mpeg4ip-v.bmp, - Cfaac.cpp: - New out_faac Winamp output filter code - - * plugins/cooledit/: CRegistry.cpp, CRegistry.h, FAAC.dsp, - FAAC.dsw, FAAC.rc, Faac.cpp, Faad.cpp, Main.cpp, Readme.txt, - TypeDef.h, aacInfoLib.dsp, defines.h, resource.h, Cfaac.cpp, - Cfaac.h, Cfaad.cpp, Cfaad.h: - New cooledit filter code - -2004-04-16 danchr - * configure.in, frontend/: getopt.c, main.c: - change -a to -b - Darwin portability fixes - Make LTP imply MPEG-4 AAC - silence a few warnings - - * frontend/main.c: - don't use stderr on Windows - -2004-04-13 danchr - * frontend/main.c: - compilation and composer patch by Jordan Breeding - undocumented single-letter switches removed - numerous bug-fixes - - * libfaac/:frame.c, version.h: - clarify release <> unstable status - -2004-04-03 danchr - * frontend/main.c: - non-backwards compatible revamp of the FAAC command line - interface. - cover art metadata support based on patch by Jordan Breeding - make TNS default - fix typo + add GIF support - -2004-04-02 danchr - * libfaac/: fft.c, fft.h, frame.c, version.h: - fix name clash w/ libavcodec: fft_init -> fft_initialize - bump version number to 1.24 beta - -2004-03-29 danchr - * frontend/main.c: - MP4 bug fixes by Jordan Breeding (jordan breeding - (at) mac com). - Document long options for metadata - they are much - more intuitive. - -2004-03-27 danchr - * frontend/main.c: - minor compile-time bugfix for Win32 - -2004-03-24 danchr - * configure.in, frontend/: Makefile.am, main.c: - silence a few warnings and fix a few mem. leaks. - make it possible to disable stripping (needed for - profiling and debugging). - - * frontend/main.c: - prettify the way stream format is handled - this just - *might* fix a bug. - - * frontend/main.c: - fixing WIN32 -> _WIN32 - -2004-03-17 danchr - * frontend/main.c: - New signal handler. Disabled on Windows, although it - *should* work. - Separated handling of stream format and output format. - Bitrate + file format displayed on stderr. - knik and myself added to the copyright header. - - * libfaac/frame.c: - Automatic, untuned setting of lowpass for VBR. - -2004-03-15 knik - * INSTALL, configure.in, frontend/main.c: - improved MP4 support by Dan Christiansen - - * libfaac/frame.c: - fixed copyright notice - -2004-03-03 knik - * configure.in, frontend/: input.c, main.c: - libmp4v2 autocont detection and mp4 metadata support - by Dan Christiansen - -2004-02-14 knik - * frontend/main.c: - Print help and exit when unknown option is specified - -2004-01-12 knik - * frontend/faac.c: - removed unused file - -2003-12-19 stux - * configure.in, frontend/main.c, libfaac/util.h: - i've added sms00's OSX patch to faac - -2003-12-17 knik - * libfaac/frame.c: - changed default cutoff to 16k - - * libfaac/aacquant.c: - changed quantizer factor because of new default cutoff - - * libfaac/version.h: - 1.23.5 - -2003-12-14 ca5e - * frontend/main.c, plugins/foo_faac/foo_faac.cpp: - Gapless MP4 handling method changed again... - -2003-12-13 ca5e - * frontend/main.c, plugins/foo_faac/foo_faac.cpp: - Improved gapless encoding - -2003-12-11 ca5e - * plugins/foo_faac/: foo_faac.cpp, foo_faac.dsp, foo_faac.rc, - resource.h: - Added average bitrate control and some extra console infos - -2003-12-10 knik - * libfaac/psychkni.c: - lowered short block switching threshold - - * libfaac/version.h: - 1.23.4 - -2003-11-29 knik - * ChangeLog: - updated from CVS - -2003-11-24 knik - * frontend/main.c: - using new version info interface - - * libfaac/frame.h, include/faac.h: - A safe version of faacEncGetVersion() without string length problem. - - * libfaac/frame.c: - A safe version of faacEncGetVersion() without string length problem. - Removed Stux from copyright notice. I don't think he contributed something very - substantial to faac and this is not the right place to list all contributors. - - * libfaac/: filtbank.c, filtbank.h, tns.c, tns.h: - static prototypes removed from header - - * README, docs/faac.html: - Added a few names to contributor list, but still it doesn't seem to be very complete. - -2003-11-16 stux - * README: - added a new Contributor ;) - - * libfaac/: fft.c, fft.h, filtbank.c, filtbank.h, frame.c, frame.h, - psych.h, psychkni.c, version.h: - moved global tables from fft.c into hEncoder FFT_Tables. Add fft_init and fft_terminate, flowed through all necessary changes. This should remove at least one instance of a memory leak, and fix some thread-safety problems. Version update to 1.23.3 - -2003-11-15 stux - * include/faac.h, libfaac/frame.c, libfaac/frame.h, - libfaac/libfaac.def, libfaac/version.h: - added FaacEncGetVersion(), version 1.23.2, added myself to faacCopyright :-P, does vanity know no bound ;) - -2003-11-13 knik - * frontend/main.c: - raw input bugfix - -2003-11-10 knik - * libfaac/version.h: - 1.23.1 - - * libfaac/frame.c: - Allowed independent bitRate and bandWidth setting. - Small fixes. - -2003-11-03 knik - * configure.in: - added AC_PREREQ(2.50) - -2003-10-30 knik - * libfaac/version.h: - 1.23.0 - - * libfaac/aacquant.c: - improved psymodel/quantizer - -2003-10-29 stux - * include/faaccfg.h, libfaac/frame.c, libfaac/version.h: - Added channel_map to FaacEncHandle, facilitates free generalised channel remapping in the faac core. Default is straight-through, should be *zero* performance hit... and even probably an immeasurable performance gain, updated FAAC_CFG_VERSION to 104 and FAAC_VERSION to 1.22.0 - -2003-10-17 knik - * configure.in: - fixed CFLAGS setting - - * frontend/: input.c, main.c: - fixed raw input - -2003-10-17 ca5e - * plugins/foo_faac/foo_faac.cpp, frontend/faac.dsp: - Gapless mode change - -2003-10-17 knik - * configure.in, libfaac/Makefile.am, frontend/Makefile.am: - CFLAGS setting moved to configure - -2003-10-14 ca5e - * plugins/foo_faac/: foo_faac.cpp, foo_faac.rc, resource.h: - Fixed AAC object type selection, some minor cleanups - -2003-10-14 menno - * libfaac/bitstream.c: - bugfix LTP - -2003-10-12 knik - * libfaac/version.h: - 1.21.2 - - * libfaac/: aacquant.h, frame.c: - average bitrate control made more stable - - * libfaac/frame.c, libfaac/frame.h, frontend/main.c: - more accurate average bitrate control - -2003-10-04 knik - * Makefile.am, configure.in, include/Makefile.am: - library headers included in automake stuff - -2003-10-02 ca5e - * plugins/foo_faac/foo_faac.cpp: - Removed writing of gapless info for raw AAC files - Added few more pre set samplerates to drop-down list - -2003-09-24 knik - * frontend/main.c: - Added option to enforce block type. - - * include/: faac.h, faaccfg.h: - config struct definition moved to faaccfg.h - - * libfaac/frame.h: - config struct definition moved to faaccfg.h. - - * libfaac/frame.c: - faacEncStruct: quantizer specific data enclosed in AACQuantCfg structure. - Added config option to enforce block type. - - * libfaac/aacquant.h: - faacEncStruct: quantizer specific data enclosed in AACQuantCfg structure. - - * libfaac/aacquant.c: - faacEncStruct: quantizer specific data enclosed in AACQuantCfg structure. - Fixed normal/takehiro_hack conditional compilation. - -2003-09-17 ca5e - * plugins/foo_faac/foo_faac.cpp: - Fix for last fix... - -2003-09-14 ca5e - * plugins/foo_faac/: foo_faac.cpp, foo_faac.dsp: - version 0.3.1, fixed potential memory access violation - -2003-09-08 knik - * frontend/Makefile.am: - faac.c replaced by main.c - - * frontend/main.c: - conditional libmp4v2 compilation - - * libfaac/version.h: - 1.21.1 beta - - * libfaac/aacquant.c: - fixed noise allocation - -2003-09-07 ca5e - * frontend/main.c: - length calculations/silence padding changed to match current libfaac behavior - changed tabs to spaces, fixes to indentation - -2003-09-07 knik - * libfaac/version.h: - 1.21 beta - - * libfaac/frame.c: - Updated psymodel call. Updated bitrate/cutoff mapping table. - - * libfaac/fft.c: - reduced arrays size - - * libfaac/aacquant.c: - modified distortion allocation - - * libfaac/: psych.h, psychkni.c: - Better block switch. Removed long fft code. - -2003-09-05 knik - * ChangeLog: - updated - -2003-08-23 knik - * libfaac/frame.c, frontend/faac.c: - last frame moved back to the library - -2003-08-18 knik - * libfaac/version.h: - 1.20.1 beta - - * libfaac/aacquant.c: - gave less distortion to short blocks - - * libfaac/psychkni.c: - fixed a nasty sample shift causing the block switch to fail in some cases - - * frontend/: Makefile.am, faac.c: - second CLI frontend cloned from main.c - -2003-08-17 menno - * plugins/foo_faac/: foo_faac.cpp, foo_faac.dsp, foo_faac.dsw, - foo_faac.rc, resource.h: - foo_faac plugin - - * frontend/: input.c, input.h, main.c: - fixes to MP4 files by Case - -2003-08-17 knik - * libfaac/version.h: - 1.20 beta - - * libfaac/aacquant.c: - improved noise allocation - -2003-08-16 menno - * frontend/: faac.dsp, faac.dsw, input.c, input.h, main.c: - Case: - - More input options - - MP4 output - -2003-08-15 knik - * frontend/main.c: - Option to add a number of silent frames at the end of output. - Small TNS option fix. - - * libfaac/frame.c: - removed single silent flush frame - -2003-08-11 menno - * libfaac/aacquant.c: - correct aacquant.c - - * libfaac/: aacquant.c, aacquant.h, frame.c, frame.h: - thread safety, some tables added to the encoder context - -2003-08-09 knik - * libfaac/frame.c: - LFE support enabled by default - -2003-08-08 menno - * libfaac/frame.c: - Small fix - -2003-08-07 knik - * docs/libfaac.html: - libfaac.pdf replacement - - * frontend/main.c: - fixed win32 crash with long filenames - - * libfaac/: frame.c, psychkni.c: - Better LFE support (reduced bandwidth) - -2003-08-03 knik - * libfaac/version.h: - 1.19 beta - - * plugins/winamp/Out_faac.cpp: - corrected faac library version print - -2003-08-02 stux - * include/faac.h, libfaac/frame.c, libfaac/frame.h, - libfaac/libfaac.def, libfaac/libfaac_dll.dsp: - added config.inputFormat, and associated defines and code, faac now handles native endian 16bit, 24bit and float input. Added faacEncGetDecoderSpecificInfo to the dll exports, needed for MP4. Updated DLL .dsp to compile without error. Updated CFG_VERSION to 102. Version number might need to be updated as the API has technically changed. Did not update libfaac.pdf - -2003-07-29 menno - * plugins/: cooledit/CRegistry.cpp, cooledit/FAAC.def, - cooledit/FAAC.dsp, cooledit/FAAC.rc, cooledit/Faac.cpp, - cooledit/Faad.cpp, cooledit/Main.cpp, cooledit/Structs.h, - cooledit/TypeDef.h, cooledit/aacInfoLib.dsp, cooledit/defines.h, - cooledit/resource.h, winamp/CRegistry.cpp, winamp/FAAC.rc, - winamp/Out_faac.cpp, winamp/RESOURCE.H, winamp/defines.h, - winamp/out_FAAC.dsp: - updated plugins to work with new faac - -2003-07-28 menno - * frontend/input.c, libfaac/libfaac.dsp: - compile fix for win32 - -2003-07-21 knik - * frontend/main.c: - Fixed LFE channel mapping. - -2003-07-16 knik - * libfaac/bitstream.c: - Used ID_FIL element to write libfaac info. - -2003-07-13 knik - * frontend/main.c: - Fixed -o, -m and -I option. - Print object type setting. - -2003-07-10 knik - * configure.in: - more types check - - * frontend/main.c: - Input channel remapping and 24-bit support. - - * frontend/input.h: - Updated to match input.c. - Better integer types support. - - * frontend/input.c: - 24-bit input support. - Multichannel input remapping. - WAVEFORMATEXTENSIBLE support. - - * include/faac.h, libfaac/frame.c, libfaac/frame.h: - 24-bit input - -2003-07-07 knik - * docs/faac.html: - more links - - * libfaac/psychkni.c: - division by zero fixed - -2003-06-26 knik - * docs/faac.html: - new faac readme - - * frontend/main.c: - TNS disabled by default. - Copyright info moved to library. - Print help to standard output. - - * libfaac/midside.h: - midside.c header - - * libfaac/midside.c: - new Mid/Side control - - * libfaac/: joint.c, joint.h, psychiso.c: - removed unused files - - * libfaac/Makefile.am: - joint.c renamed to midside.c - - * libfaac/version.h: - 1.18 beta - - * libfaac/psychkni.c: - New block type switch. - Removed M/S threshold support. - - * libfaac/psych.h: - PsyInfo: removed unused fields. - - * libfaac/ltp.c: - Fixed memory leak. - - * libfaac/frame.h: - faacEncConfiguration: added new field. - - * libfaac/frame.c: - Mid/Side support. - Copyright info moved from frontend. - Fixed memory leak. - - * libfaac/coder.h: - CoderInfo: added new fields. - - * libfaac/channels.h: - MSInfo: removed unused field. - - * libfaac/aacquant.h: - Added new functions. - - * libfaac/aacquant.c: - New mid/side support. - Short block sorting reorganized. - - * include/faac.h: - Copyright info moved from frontend. - -2003-06-21 knik - * frontend/main.c: - raw input support moved to input.c - - * frontend/: input.c, input.h: - improved raw input support with bigendian byteorder - -2003-05-26 knik - * ChangeLog: - More complete ChangeLog regenerated from CVS - -2003-05-12 knik - * libfaac/version.h: - 1.17 beta - - * libfaac/frame.c: - updated ABR table - - * libfaac/aacquant.c: - CalcAllowedDist: modified noise allocation - FixNoise: max-quant-value exit condition - -2003-05-10 knik - * bootstrap: - removed ./configure and make - - * README: - removed compilation instructions - - * INSTALL: - compilation instructions - - * frontend/main.c: - added approximate ABR option - - * libfaac/frame.c: - added approximate ABR setting - modified default cutoff - -2003-05-03 knik - * frontend/usage.txt: - removed obsolete file - -2003-05-01 knik - * TODO: - [no log message] - - * libfaac/version.h: - [no log message] - - * libfaac/coder.h: - CoderInfo: removed unused fields - - * libfaac/aacquant.c: - saved some bits by reducing max_sfb - removed unused funcs and vars - - * plugins/cooledit/Faac.cpp: - libfaac version number compatibility - - * libfaac/Makefile.am: - removed ISO psymodel - - * libfaac/frame.c: - removed ISO psyodel - disabled m/s coding - fixed default bandwidth - reduced max_sfb check - -2003-04-29 menno - * include/faac.h, plugins/cooledit/Faac.cpp, - plugins/cooledit/Structs.h: - made cooledit plugin compile again - C++ did not accept const in structs - -2003-04-13 knik - * frontend/main.c: - removed psymodel setting - - * libfaac/psychkni.c: - noise threshold changed to match new quantizer - block type switch fix - - * libfaac/aacquant.c: - improved quantizer (true VBR) - new noise allocation scheme (better psymodel) - - * libfaac/frame.c: - version number moved to version.h - - * libfaac/version.h: - version number file - -2003-03-27 knik - * include/faac.h: - updated interface - - * frontend/resource.h: - new symbols - - * frontend/maingui.c: - updated library interface - bitrate control replaced by quality control - improved status box - - * frontend/main.c: - updated library interface - -b bitrate option replaced with -q quality option - TNS enabled by default - - * frontend/faacgui.rc: - updated controls - - * libfaac/psychkni.c: - updated noise level - - * libfaac/frame.h: - updated library interface - - * libfaac/frame.c: - added quantizer quality and bandwidth setting - - * libfaac/aacquant.c: - improved quantizer params - -2003-03-26 knik - * frontend/input.c: - added typedef - - * configure.in: - replaced obsolete macro - -2003-03-24 menno - * libfaac/bitstream.c: - Fixed MPEG-4 ADTS headers to comply with latest spec change - -2003-02-25 menno - * frontend/: faacgui.dsp, faacgui.dsw, maingui.c: - Frontend now doesn't use libsndfile anymore - -2003-02-23 menno - * frontend/: faac.dsp, input.c: - fixes win32 compilation - -2003-02-09 menno - * libfaac/libfaac.dsp, libfaac/psychkni.c, - plugins/cooledit/FAAC.dsp, plugins/cooledit/Faad.cpp, - plugins/cooledit/aacInfoLib.dsp: - Updated interface function for mp4 AudioSpecificConfig - now is a lot cleaner to use - -2002-12-28 knik - * include/faac.h: - new version number - - * libfaac/psychkni.c: - The distortion limit calculation moved to quantizer. - Modified block type switch to produce more short blocks. - - * libfaac/aacquant.c: - The distortion limit calculation moved from psychkni to quantizer to be more - ISO model compatible. - -2002-12-23 knik - * frontend/main.c: - added some headers - - * frontend/input.c: - type size and endian conversion fix - - * configure.in: - check endianness and data types - -2002-12-15 menno - * frontend/: faac.dsp, faac.dsw, input.c, main.c: - Some portability changes - -2002-11-27 knik - * include/faac.h: - new version number - - * libfaac/psychkni.c: - updated noise threshold - - * libfaac/aacquant.c: - Noise calculation was definitely to quick. Now it should be more reasonable. - -2002-11-23 knik - * common/: getopt/COPYING, getopt/getopt.c, getopt/getopt.h, - libsndfile/AUTHORS, libsndfile/COPYING, libsndfile/ChangeLog, - libsndfile/INSTALL, libsndfile/Makefile.am, libsndfile/Makefile.in, - libsndfile/NEWS, libsndfile/README, libsndfile/TODO, - libsndfile/acconfig.h, libsndfile/aclocal.m4, - libsndfile/check_libsndfile.py, libsndfile/config.guess, - libsndfile/config.sub, libsndfile/configure, - libsndfile/configure.in, libsndfile/install-sh, - libsndfile/libsndfile.spec, libsndfile/libsndfile.spec.in, - libsndfile/ltconfig, libsndfile/ltmain.sh, libsndfile/missing, - libsndfile/mkinstalldirs, libsndfile/reconf, - libsndfile/MacOS/MacOS-readme.txt, libsndfile/MacOS/Makefile.am, - libsndfile/MacOS/Makefile.in, libsndfile/MacOS/config.h, - libsndfile/Win32/Makefile.am, libsndfile/Win32/Makefile.in, - libsndfile/Win32/README-Win32.txt, - libsndfile/Win32/README-Win32.txt.old, libsndfile/Win32/config.h, - libsndfile/Win32/libsndfile.dsp, libsndfile/Win32/libsndfile.dsw, - libsndfile/Win32/libsndfile.sln, - libsndfile/Win32/libsndfile.vcproj, libsndfile/Win32/unistd.h, - libsndfile/src/Makefile.am, libsndfile/src/Makefile.in, - libsndfile/src/aiff.c, libsndfile/src/alaw.c, libsndfile/src/au.c, - libsndfile/src/au.h, libsndfile/src/au_g72x.c, - libsndfile/src/common.c, libsndfile/src/common.h, - libsndfile/src/config.h.in, libsndfile/src/float32.c, - libsndfile/src/floatcast.h, libsndfile/src/ircam.c, - libsndfile/src/nist.c, libsndfile/src/paf.c, libsndfile/src/pcm.c, - libsndfile/src/raw.c, libsndfile/src/samplitude.c, - libsndfile/src/sfendian.h, libsndfile/src/sndfile.c, - libsndfile/src/sndfile.h, libsndfile/src/stamp-h.in, - libsndfile/src/svx.c, libsndfile/src/ulaw.c, libsndfile/src/voc.c, - libsndfile/src/wav.c, libsndfile/src/wav.h, - libsndfile/src/wav_gsm610.c, libsndfile/src/wav_ima_adpcm.c, - libsndfile/src/wav_ms_adpcm.c, libsndfile/src/G72x/ChangeLog, - libsndfile/src/G72x/Makefile.am, libsndfile/src/G72x/Makefile.in, - libsndfile/src/G72x/README, libsndfile/src/G72x/README.original, - libsndfile/src/G72x/g721.c, libsndfile/src/G72x/g723_16.c, - libsndfile/src/G72x/g723_24.c, libsndfile/src/G72x/g723_40.c, - libsndfile/src/G72x/g72x.c, libsndfile/src/G72x/g72x.h, - libsndfile/src/G72x/private.h, libsndfile/src/GSM610/COPYRIGHT, - libsndfile/src/GSM610/ChangeLog, libsndfile/src/GSM610/Makefile.am, - libsndfile/src/GSM610/Makefile.in, libsndfile/src/GSM610/README, - libsndfile/src/GSM610/add.c, libsndfile/src/GSM610/code.c, - libsndfile/src/GSM610/config.h, libsndfile/src/GSM610/decode.c, - libsndfile/src/GSM610/gsm.h, libsndfile/src/GSM610/gsm_create.c, - libsndfile/src/GSM610/gsm_decode.c, - libsndfile/src/GSM610/gsm_destroy.c, - libsndfile/src/GSM610/gsm_encode.c, - libsndfile/src/GSM610/gsm_option.c, - libsndfile/src/GSM610/long_term.c, libsndfile/src/GSM610/lpc.c, - libsndfile/src/GSM610/preprocess.c, - libsndfile/src/GSM610/private.h, libsndfile/src/GSM610/proto.h, - libsndfile/src/GSM610/rpe.c, libsndfile/src/GSM610/short_term.c, - libsndfile/src/GSM610/table.c, libsndfile/src/GSM610/unproto.h: - removed unused files - - * frontend/: getopt.c, getopt.h: - moved from common - - * frontend/: input.c, input.h: - libsndfile replacement - - * include/faac.h: - updated version number - - * frontend/main.c: - replaced libsndfile with input.c - improved bandwidth/bitrate calculation formula - - * frontend/Makefile.am: - replaced libsndfile by input.c - - * libfaac/psychkni.c: - noise threshold updated to fit new quantizer - improved block type switch - - * libfaac/fft.c: - rfft: made xi a local variable - - * libfaac/aacquant.h: - removed static declarations and unused structs - - * libfaac/aacquant.c: - OuterLoop replaced by FixNoise/BalanceEnergy routines - AACQuantize: - local variables instead of allocated and freed memory - SearchStepSize: - long/short block adjustment to run faster - - * configure.in: - removed libsndfile - added getopt.h check - -2002-11-01 menno - * libfaac/libfaac.vcproj, plugins/cooledit/FAAC.vcproj, - plugins/cooledit/Faad.cpp, plugins/cooledit/aacInfoLib.vcproj: - Small changes to the decoder interface: - every function that has a buffer as input now also has a parameter to give the size of that buffer. - -2002-10-11 menno - * common/libsndfile/Win32/libsndfile.sln, - common/libsndfile/Win32/libsndfile.vcproj, frontend/faac.sln, - frontend/faac.vcproj, frontend/faacgui.sln, - frontend/faacgui.vcproj, libfaac/libfaac.vcproj, - libfaac/libfaac_dll.sln, libfaac/libfaac_dll.vcproj, - plugins/aac_acm/aac_acm.sln, plugins/aac_acm/aac_acm.vcproj, - plugins/winamp/out_FAAC.sln, plugins/winamp/out_FAAC.vcproj: - Added VC7 project files - - * plugins/cooledit/: AudioCoding.bmp, CRegistry.cpp, CRegistry.h, - Email.bmp, FAAC.def, FAAC.dsp, FAAC.rc, FAAC.sln, FAAC.vcproj, - Faac.cpp, Faad.cpp, Main.cpp, Readme.txt, Structs.h, - aacInfoLib.vcproj, defines.h, mpeg4ip-v.bmp, resource.h: - Updated cooledit filter - - * libfaac/frame.c: - small bugfix - -2002-10-08 menno - * libfaac/: frame.c, psychiso.c: - Fixed some memory leakage - -2002-09-30 menno - * plugins/: cooledit/Aacinfo.cpp, cooledit/Config.cpp, - cooledit/Copying, cooledit/FAAC.def, cooledit/FAAC.dsp, - cooledit/FAAC.dsw, cooledit/FAAC.rc, cooledit/FAAD.DSP, - cooledit/FAAD.rc, cooledit/Faac.cpp, cooledit/Faad.cpp, - cooledit/Main.cpp, cooledit/aacInfoLib.dsp, - cooledit/aacInfoLib.dsw, cooledit/aacinfo.h, cooledit/defines.h, - cooledit/faad.def, cooledit/faad.dsw, winamp/AACINFO.Cpp, - winamp/AACINFO.H, winamp/CRegistry.cpp, winamp/CRegistry.h, - winamp/Config.cpp, winamp/Copying, winamp/OUT_FAAC.DEF, - winamp/Open.bmp, winamp/Out_faac.cpp, winamp/ReadMe.txt, - winamp/defines.h, winamp/out_FAAC.dsp, winamp/out_FAAC.dsw: - Latest changes to plugins by 4N - -2002-08-30 knik - * libfaac/huffman.c: - speed improvement - - * libfaac/aacquant.c: - extended outer loop exit condition to be faster - - * frontend/main.c: - misplaced #endif - -2002-08-23 menno - * plugins/cooledit/: Aacinfo.cpp, CRegistry.cpp, CRegistry.h, - FAAD.DSP, FAAD.rc, Faac.cpp, Faad.cpp, Logo.bmp, Main.cpp, - Readme.txt, Registry.cpp, Registry.h, aacinfo.h, bitmap1.bmp, - defines.h, faad.def: - Bugfixed Cooledit filter - -2002-08-21 knik - * libfaac/psychkni.c: - disabled long fft calculation as it is not used at the moment - long/short switch threshold fix and some memory improvements - - * libfaac/psychiso.c: - new fft function name - - * libfaac/filtbank.c: - new fft function names - - * libfaac/fft.h: - new function names - - * libfaac/fft.c: - new simplier and faster fft routine and correct real fft - new real fft is just a complex fft wrapper so it is slower than optimal but - by surprise it seems to be at least as fast as the old buggy function - -2002-08-21 menno - * libfaac/: libfaac.dsp, libfaac_dll.dsp: - Updated project files - -2002-08-19 knik - * libfaac/bitstream.h: - removed static declarations - - * libfaac/bitstream.c: - added static declarations - - * libfaac/frame.c: - added one additional flush frame - fixed sample buffer memory allocation - - * frontend/main.c: - automatic bitrate setting - more advanced status line - -2002-08-10 knik - * plugins/: cooledit/Faac.cpp, winamp/Out_faac.cpp: - version update - - * frontend/main.c, include/faac.h: - version update - -2002-08-09 knik - * libfaac/frame.c, libfaac/frame.h, include/faac.h, - frontend/main.c: - improved psychoacoustic model selection - -2002-08-07 knik - * frontend/main.c: - added psymodel selection and default bandwidth - - * include/faac.h: - added interface to psychoacoustic model - - * libfaac/psych.c: - renamed to psychiso - - * libfaac/psychkni.c: - new psychoacoustic model - - * libfaac/psychiso.c: - ISO psychoacoustic model renamed and added new interface to frame - - * libfaac/psych.h: - new interface to frame - - * libfaac/Makefile.am: - Introduced multiple psychoacoustic models - - * libfaac/frame.h: - removed static declaration - - * libfaac/frame.c: - new interface to psychoacoustic - - * libfaac/fft.c: - rsfft output was reversed i.e. high frequencies first - -2002-08-07 menno - * plugins/cooledit/Faad.cpp: - Cooledit filter compiles again - not sure if it works - -2002-05-26 menno - * plugins/winamp/: AACINFO.C, AACINFO.Cpp, Config.c, Config.cpp, - FAAC.rc, Logo.bmp, OUT.H, OUT_FAAC.DEF, Out_faac.c, Out_faac.cpp, - RESOURCE.H, out_FAAC.dsp, out_FAAC.dsw: - Fixes in faac winamp plugin - - * plugins/cooledit/: Aacinfo.cpp, Faac.cpp, Faad.cpp, Main.cpp, - aacinfo.h, resource.h: - Fixes in cooledit plugin - -2002-04-20 menno - * plugins/cooledit/: FAAD.DSP, FAAD.rc, Readme.txt, aacinfo.h, - faad.dsw, resource.h, Aacinfo.cpp, Config.cpp, Faac.cpp, Faad.cpp, - Main.cpp, Registry.cpp, Registry.h, aacinfo.c, faac.c, faad.c, - main.c, Config.c: - Updated cooledit code - plugin now supports MP4 files - -2002-04-17 menno - * plugins/cooledit/: FAAD.DSP, FAAD.rc, aacinfo.c, aacinfo.h, - faac.c, faad.c, faad.def, faad.dsw, resource.h: - Updated cooledit plugin to use the FAAD2 decoder - Thanks to Antonio - -2002-02-13 menno - * common/libsndfile/: AUTHORS, ChangeLog, Makefile.am, Makefile.in, - NEWS, README, TODO, acconfig.h, aclocal.m4, check_libsndfile.py, - config.guess, config.sub, configure, configure.in, libsndfile.spec, - ltconfig, ltmain.sh, mkinstalldirs, MacOS/MacOS-readme.txt, - MacOS/Makefile.in, MacOS/config.h, Win32/Makefile.in, - Win32/config.h, Win32/libsndfile.dsp, Win32/libsndfile.dsw, - doc/ChangeLog, doc/Makefile.am, doc/Makefile.in, doc/NEWS, - doc/api.html, doc/bugs.html, doc/index.html, doc/libsndfile.jpg, - doc/sfinfo.html, examples/Makefile.am, examples/Makefile.in, - examples/make_sine.c, examples/sfconvert.c, examples/sfhexdump.c, - examples/sfinfo.c, examples/sndfile2oct.c, examples/wav32_aiff24.c, - m4/Makefile.am, m4/Makefile.in, src/Makefile.am, src/Makefile.in, - src/aiff.c, src/alaw.c, src/alaw.h, src/au.c, src/au.h, - src/au_g72x.c, src/common.c, src/common.h, src/config.h.in, - src/float32.c, src/floatcast.h, src/ircam.c, src/newpcm.c, - src/nist.c, src/paf.c, src/pcm.c, src/pcm.h, src/raw.c, - src/samplitude.c, src/sfendian.h, src/sndfile.c, src/sndfile.h, - src/svx.c, src/ulaw.c, src/ulaw.h, src/voc.c, src/wav.c, src/wav.h, - src/wav_float.c, src/wav_gsm610.c, src/wav_ima_adpcm.c, - src/wav_ms_adpcm.c, src/G72x/ChangeLog, src/G72x/Makefile.in, - src/G72x/g72x.c, src/G72x/g72x.h, src/GSM610/ChangeLog, - src/GSM610/Makefile.in, src/GSM610/add.c, src/GSM610/code.c, - src/GSM610/config.h, src/GSM610/decode.c, src/GSM610/gsm.h, - src/GSM610/gsm_create.c, src/GSM610/gsm_decode.c, - src/GSM610/gsm_destroy.c, src/GSM610/gsm_encode.c, - src/GSM610/gsm_option.c, src/GSM610/long_term.c, src/GSM610/lpc.c, - src/GSM610/preprocess.c, src/GSM610/private.h, src/GSM610/proto.h, - src/GSM610/rpe.c, src/GSM610/short_term.c, src/GSM610/table.c, - src/GSM610/unproto.h, tests/Makefile.am, tests/Makefile.in, - tests/alaw_test.c, tests/double_test.c, tests/error_test.c, - tests/lossy_comp_test.c, tests/read_seek_test.c, tests/sftest.c, - tests/sfversion.c, tests/ulaw_test.c, tests/write_read_test.c: - Use latest version of libsndfile - -2002-01-18 menno - * plugins/aac_acm/codec.cpp: - bugfixes? - -2002-01-17 menno - * plugins/aac_acm/codec.cpp: - bugfix - - * plugins/aac_acm/: StdAfx.cpp, StdAfx.h, aac_acm.cpp, aac_acm.def, - aac_acm.dsp, aac_acm.dsw, aac_acm.inf, codec.cpp, codec.h, - msacmdrv.h: - AAC ACM codec - -2002-01-14 menno - * plugins/: cooledit/FAAD.rc, cooledit/faac.c, winamp/FAAC.rc, - winamp/Out_faac.c: - Changes in bitrate field - -2001-12-07 menno - * libfaac/: bitstream.c, bitstream.h: - Fixed LTP encoder - -2001-12-06 menno - * libfaac/: aacquant.c, ltp.c: - Fixed LTP encoder - -2001-11-29 menno - * libfaac/bitstream.c: - fix in bitstream writing - -2001-11-08 menno - * project/mingw32/: Makefile, faac.dev: - Updated makefiles for MingW32 and Dev-C++ as well as DJGPP - -2001-11-06 menno - * plugins/cooledit/faad.c: - bugfix by 4N - -2001-10-29 menno - * plugins/cooledit/: FAAD.DSP, aacinfo.c, aacinfo.h, faad.c, - faad.def, faad.dsw: - Updated cooledit plugin, now working correctly with new library interface - -2001-10-27 menno - * lcc/Makefile: - Updated project files for free compilers - -2001-10-26 menno - * ChangeLog, mingw32/Makefile, project/lcc/Makefile, - project/mingw32/Makefile: - Updated project files for free compilers - - * mingw32/Makefile: - Added makefile for MingW32 - - * plugins/cooledit/faad.c: - Fixed FAAD decoding first 2 silent frames - - * frontend/: faac.dsp, faacgui.dsp, faacgui.rc, main.c, maingui.c, - resource.h: - Enable RAW aac output in the frontends - -2001-10-22 menno - * .cvsignore, faac.dsw, plugins/cooledit/FAAD.DSP, - plugins/winamp/out_FAAC.dsp: - Added system wide workspace file - -2001-10-16 menno - * faac_wingui.nsi: - Removed wingui - - * ChangeLog: - Updated ChangeLog - - * wingui/: .cvsignore, AbstractJob.cpp, AbstractJob.h, - AbstractPageCtrlContent.cpp, AbstractPageCtrlContent.h, - AbstractPropertyPageContents.cpp, AbstractPropertyPageContents.h, - AskCreateDirectoryDialog.cpp, AskCreateDirectoryDialog.h, - ConcreteJobBase.cpp, ConcreteJobBase.h, - EncoderGeneralPageDialog.cpp, EncoderGeneralPageDialog.h, - EncoderGeneralPropertyPageContents.cpp, - EncoderGeneralPropertyPageContents.h, EncoderId3PageDialog.cpp, - EncoderId3PageDialog.h, EncoderId3PropertyPageContents.cpp, - EncoderId3PropertyPageContents.h, EncoderJob.cpp, EncoderJob.h, - EncoderJobProcessingManager.cpp, EncoderJobProcessingManager.h, - EncoderQualityPageDialog.cpp, EncoderQualityPageDialog.h, - EncoderQualityPropertyPageContents.cpp, - EncoderQualityPropertyPageContents.h, - FaacWinguiProgramSettings.cpp, FaacWinguiProgramSettings.h, - FileListQueryManager.cpp, FileListQueryManager.h, - FileMaskAssembler.cpp, FileMaskAssembler.h, FilePathCalc.cpp, - FilePathCalc.h, FileSerializable.cpp, FileSerializable.h, - FileSerializableJobList.cpp, FileSerializableJobList.h, - FloatingPropertyDialog.cpp, FloatingPropertyDialog.h, - FolderDialog.cpp, FolderDialog.h, Id3TagInfo.cpp, Id3TagInfo.h, - Job.cpp, Job.h, JobList.cpp, JobList.h, JobListCtrlDescribable.cpp, - JobListCtrlDescribable.h, JobListUpdatable.cpp, JobListUpdatable.h, - JobListsToConfigureSaver.cpp, JobListsToConfigureSaver.h, - JobProcessingDynamicUserInputInfo.cpp, - JobProcessingDynamicUserInputInfo.h, ListCtrlStateSaver.cpp, - ListCtrlStateSaver.h, Listobj.cpp, PageCheckboxCtrlContent.cpp, - PageCheckboxCtrlContent.h, PageComboBoxCtrlContent.cpp, - PageComboBoxCtrlContent.h, PageEditCtrlContent.cpp, - PageEditCtrlContent.h, PageRadioGroupCtrlContent.cpp, - PageRadioGroupCtrlContent.h, ProcessJobStatusDialog.cpp, - ProcessJobStatusDialog.h, ProcessingStartStopPauseInteractable.cpp, - ProcessingStartStopPauseInteractable.h, - ProcessingStatusDialogInfoFeedbackCallbackInterface.cpp, - ProcessingStatusDialogInfoFeedbackCallbackInterface.h, - PropertiesDummyParentDialog.cpp, PropertiesDummyParentDialog.h, - PropertiesTabParentDialog.cpp, PropertiesTabParentDialog.h, - ReadMe.txt, RecursiveDirectoryTraverser.cpp, - RecursiveDirectoryTraverser.h, SourceTargetFilePair.cpp, - SourceTargetFilePair.h, StdAfx.cpp, StdAfx.h, - SupportedPropertyPagesData.cpp, SupportedPropertyPagesData.h, - TItemList.cpp, TItemList.h, WindowUtil.cpp, WindowUtil.h, - faac_wingui.cpp, faac_wingui.dsp, faac_wingui.dsw, faac_wingui.h, - faac_wingui.rc, faac_winguiDlg.cpp, faac_winguiDlg.h, listobj.h, - resource.h, res/faac_wingui.ico, res/faac_wingui.rc2, - res/toolbarm.bmp: - Removed wingui - - * plugins/: cooledit/aacinfo.c, cooledit/aacinfo.h, - cooledit/faac.c, cooledit/resource.h, winamp/AACINFO.C, - winamp/AACINFO.H, winamp/FAAC.rc, winamp/Out_faac.c, - winamp/RESOURCE.H: - Bugfixes by 4N - -2001-10-11 menno - * ChangeLog, cooledit/.cvsignore, cooledit/Config.c, - cooledit/FAAD.DSP, cooledit/FAAD.rc, cooledit/Logo.bmp, - cooledit/Readme.txt, cooledit/aacinfo.c, cooledit/aacinfo.h, - cooledit/bitmap1.bmp, cooledit/faac.c, cooledit/faad.c, - cooledit/faad.def, cooledit/faad.dsw, cooledit/filters.h, - cooledit/main.c, cooledit/resource.h, plugins/cooledit/.cvsignore, - plugins/cooledit/Config.c, plugins/cooledit/FAAD.DSP, - plugins/cooledit/FAAD.rc, plugins/cooledit/Logo.bmp, - plugins/cooledit/Readme.txt, plugins/cooledit/aacinfo.c, - plugins/cooledit/aacinfo.h, plugins/cooledit/bitmap1.bmp, - plugins/cooledit/faac.c, plugins/cooledit/faad.c, - plugins/cooledit/faad.def, plugins/cooledit/faad.dsw, - plugins/cooledit/filters.h, plugins/cooledit/main.c, - plugins/cooledit/resource.h, plugins/winamp/.cvsignore, - plugins/winamp/AACINFO.C, plugins/winamp/AACINFO.H, - plugins/winamp/Config.c, plugins/winamp/FAAC.rc, - plugins/winamp/FILTERS.H, plugins/winamp/Logo.bmp, - plugins/winamp/OUT.H, plugins/winamp/Open.bmp, - plugins/winamp/Out_faac.c, plugins/winamp/RESOURCE.H, - plugins/winamp/ReadMe.txt, plugins/winamp/out_FAAC.dsp, - plugins/winamp/out_FAAC.dsw, winamp/.cvsignore, winamp/AACINFO.C, - winamp/AACINFO.H, winamp/Config.c, winamp/FAAC.H, winamp/FAAC.rc, - winamp/FILTERS.H, winamp/Logo.bmp, winamp/OUT.H, winamp/Open.bmp, - winamp/Out_faac.c, winamp/RESOURCE.H, winamp/ReadMe.txt, - winamp/out_FAAC.dsp, winamp/out_FAAC.dsw: - Structure changes to the CVS tree - -2001-10-07 menno - * common/libsndfile/src/common.h, common/libsndfile/src/sndfile.h, - common/libsndfile/src/wav.h, lcc/Makefile: - Made faac build on free LCC compiler - -2001-09-28 menno - * libfaac/: aacquant.c, psych.c: - Small bugfixes - -2001-09-21 eraser - * include/faac.h: - in previous header version was set to 1.5, fixed, now version 1.9 as before. - - * include/faac.h, libfaac/bitstream.c, libfaac/frame.c, - libfaac/frame.h: - added raw output format support - - * libfaac/psych.c: - added stdio.h in debug configuration, i dont like compiliers warning - -2001-09-09 menno - * libfaac/: frame.c, frame.h, psych.c, psych.h: - Stepped back to a MPEG type psychoacoustic model - -2001-09-07 menno - * include/faac.h, libfaac/frame.c, libfaac/frame.h: - Added creating of DecoderSpecificInfo - -2001-09-04 menno - * README, libfaac/backpred.c, libfaac/bitstream.c, - libfaac/bitstream.h, libfaac/channels.c, libfaac/filtbank.c, - libfaac/huffman.c, libfaac/huffman.h, libfaac/joint.c, - libfaac/ltp.c, libfaac/tns.c, libfaac/tns.h: - Made FAAC legal :-) - -2001-08-31 menno - * ChangeLog: - Updated ChangeLog - -2001-08-03 menno - * cooledit/Config.c, cooledit/FAAD.DSP, cooledit/FAAD.rc, - cooledit/Readme.txt, cooledit/aacinfo.c, cooledit/aacinfo.h, - cooledit/bitmap1.bmp, cooledit/faac.c, cooledit/faad.c, - cooledit/main.c, cooledit/resource.h, winamp/.cvsignore, - winamp/AACINFO.C, winamp/AACINFO.H, winamp/Config.c, winamp/FAAC.H, - winamp/FAAC.rc, winamp/FILTERS.H, winamp/Logo.bmp, winamp/OUT.H, - winamp/Open.bmp, winamp/Out_faac.c, winamp/RESOURCE.H, - winamp/ReadMe.txt, winamp/out_FAAC.dsp, winamp/out_FAAC.dsw: - Updated cooledit plugin - New winamp output plugin - -2001-07-12 menno - * cooledit/: FAAD.rc, Readme.txt, aacinfo.c, aacinfo.h, faac.c, - faad.c, faad.def, main.c, resource.h: - Major bugfixes to Cooledit filter - encoding now works - - * libfaac/: .cvsignore, libfaac.def, libfaac_dll.dsp, - libfaac_dll.dsw: - Added DLL project file for FAAC - -2001-07-08 menno - * cooledit/FAAD.DSP: - Correct processor used - - * cooledit/: FAAD.DSP, faacflt.dsp, faacflt.dsw, faad.def, - faad.dsw: - Fixed CoolEdit filter - - * libfaac/frame.c: - Small config bugfix - -2001-07-02 menno - * cooledit/: faac.c, faac.h, faacflt.dsp, faad.c, faad.h: - Fixes for compiling CoolEdit filter - - * ChangeLog: - ChangeLog update - - * cooledit/: .cvsignore, FAAD.rc, Logo.bmp, aacinfo.c, aacinfo.h, - faac.c, faac.h, faacflt.dsp, faacflt.dsw, faad.c, faad.h, - filters.h, main.c, resource.h: - Added CoolEdit filter - -2001-06-27 menno - * bootstrap: - Unix compile fix - - * bootstrap: - Unix compile fix - -2001-06-25 menno - * README: - Compilation help - - * frontend/main.c: - Fixed compilation problem - -2001-06-09 menno - * ChangeLog: - Updated ChangeLog - - * common/getopt/: COPYING, getopt.c, getopt.h: - Added getopt - - * TODO: - Another todo done ;-) - - * include/faac.h: - version number changed - - * frontend/: usage.txt, faac.dsp, main.c: - Big changes to command line encoder, now using getopt - NOTE: Options have changed, read usage.txt - -2001-06-08 menno - * TODO, todo.txt, frontend/main.c, frontend/maingui.c, - frontend/resource.h, include/faac.h, libfaac/aacquant.c, - libfaac/aacquant.h, libfaac/backpred.c, libfaac/backpred.h, - libfaac/bitstream.c, libfaac/bitstream.h, libfaac/channels.c, - libfaac/channels.h, libfaac/coder.h, libfaac/fft.c, - libfaac/filtbank.c, libfaac/filtbank.h, libfaac/frame.c, - libfaac/frame.h, libfaac/huffman.c, libfaac/huffman.h, - libfaac/hufftab.h, libfaac/joint.c, libfaac/joint.h, libfaac/ltp.c, - libfaac/ltp.h, libfaac/psych.c, libfaac/psych.h, libfaac/tns.c, - libfaac/tns.h, libfaac/util.c: - File renamed - - * bootstrap: - Fixed linux compilation - - * README: - Added README - -2001-06-06 menno - * include/faac.h: - version number upgraded - - * ChangeLog: - Updated ChangeLog - - * include/faac.h, libfaac/bitstream.c, libfaac/bitstream.h: - (I hope I have) fixed MPEG4 compatibility once and for all ;-) - -2001-05-31 menno - * ChangeLog: - Updated ChangeLog - - * frontend/main.c: - Bugfix for linux - -2001-05-30 menno - * COPYING, frontend/faacgui.dsp, frontend/main.c, - frontend/maingui.c, include/faac.h, libfaac/aacquant.c, - libfaac/aacquant.h, libfaac/backpred.c, libfaac/backpred.h, - libfaac/bitstream.c, libfaac/bitstream.h, libfaac/channels.c, - libfaac/channels.h, libfaac/coder.h, libfaac/fft.c, libfaac/fft.h, - libfaac/filtbank.c, libfaac/filtbank.h, libfaac/frame.c, - libfaac/frame.h, libfaac/huffman.c, libfaac/huffman.h, - libfaac/hufftab.h, libfaac/joint.c, libfaac/joint.h, libfaac/ltp.c, - libfaac/ltp.h, libfaac/psych.h, libfaac/tns.c, libfaac/tns.h, - libfaac/util.c, libfaac/util.h: - Changed license from GPL to LPGL - - * ChangeLog: - Added ChangeLog - - * include/faac.h: - Higher release version - - * bootstrap: - Fixed linux compilation - - * AUTHORS, NEWS, configure.in: - Fixed linux compilation - -2001-05-29 menno - * libfaac/bitstream.c: - Fixed bit counting, file length calculation works again - -2001-05-28 menno - * frontend/main.c, include/faac.h, libfaac/backpred.h, - libfaac/frame.c: - Small bugfix in backward predictor - - * libfaac/: bitstream.c, bitstream.h: - Changes for ISO MPEG4 compatibility (sorry :(( ) - Old MPEG4 files with ADTS header will not be playable anymore - -2001-05-18 menno - * docs/libfaac.pdf, include/faac.h: - Added encoder library interface documentation - - * todo.txt, libfaac/backpred.c, libfaac/backpred.h, - libfaac/coder.h, libfaac/util.c, libfaac/util.h: - Cleaned up backward prediction code - -2001-05-12 oxygene2000 - * Makefile, Makefile.am, bootstrap, configure.in, - frontend/Makefile, frontend/Makefile.am, libfaac/Makefile, - libfaac/Makefile.am: - - new makefile for unix-like systems (should also work with cygwin) - based on autoconf/-make and libtool - -2001-05-09 menno - * common/libsndfile/AUTHORS, common/libsndfile/COPYING, - common/libsndfile/ChangeLog, common/libsndfile/INSTALL, - common/libsndfile/Makefile.am, common/libsndfile/Makefile.in, - common/libsndfile/NEWS, common/libsndfile/README, - common/libsndfile/TODO, common/libsndfile/acconfig.h, - common/libsndfile/aclocal.m4, common/libsndfile/config.guess, - common/libsndfile/config.sub, common/libsndfile/configure, - common/libsndfile/configure.in, common/libsndfile/install-sh, - common/libsndfile/libsndfile.spec, - common/libsndfile/libsndfile.spec.in, common/libsndfile/ltconfig, - common/libsndfile/ltmain.sh, common/libsndfile/missing, - common/libsndfile/mkinstalldirs, common/libsndfile/reconf, - common/libsndfile/MacOS/MacOS-readme.txt, - common/libsndfile/MacOS/Makefile.am, - common/libsndfile/MacOS/Makefile.in, - common/libsndfile/MacOS/config.h, - common/libsndfile/Win32/Makefile.am, - common/libsndfile/Win32/Makefile.in, - common/libsndfile/Win32/README-Win32.txt, - common/libsndfile/Win32/README-Win32.txt.old, - common/libsndfile/Win32/config.h, - common/libsndfile/Win32/libsndfile.dsp, - common/libsndfile/Win32/libsndfile.dsw, - common/libsndfile/Win32/unistd.h, common/libsndfile/doc/ChangeLog, - common/libsndfile/doc/Makefile.am, - common/libsndfile/doc/Makefile.in, common/libsndfile/doc/NEWS, - common/libsndfile/doc/api.html, common/libsndfile/doc/bugs.html, - common/libsndfile/doc/index.html, - common/libsndfile/doc/libsndfile.jpg, - common/libsndfile/doc/sfinfo.html, - common/libsndfile/examples/Makefile.am, - common/libsndfile/examples/Makefile.in, - common/libsndfile/examples/make_sine.c, - common/libsndfile/examples/sfconvert.c, - common/libsndfile/examples/sfhexdump.c, - common/libsndfile/examples/sfinfo.c, - common/libsndfile/examples/sndfile2oct.c, - common/libsndfile/examples/wav32_aiff24.c, - common/libsndfile/m4/Makefile.am, common/libsndfile/m4/Makefile.in, - common/libsndfile/src/Makefile.am, - common/libsndfile/src/Makefile.in, common/libsndfile/src/aiff.c, - common/libsndfile/src/alaw.c, common/libsndfile/src/alaw.h, - common/libsndfile/src/au.c, common/libsndfile/src/au.h, - common/libsndfile/src/au_g72x.c, common/libsndfile/src/common.c, - common/libsndfile/src/common.h, common/libsndfile/src/config.h.in, - common/libsndfile/src/newpcm.c, common/libsndfile/src/paf.c, - common/libsndfile/src/pcm.c, common/libsndfile/src/pcm.h, - common/libsndfile/src/raw.c, common/libsndfile/src/sfendian.h, - common/libsndfile/src/sndfile.c, common/libsndfile/src/sndfile.h, - common/libsndfile/src/stamp-h.in, common/libsndfile/src/svx.c, - common/libsndfile/src/ulaw.c, common/libsndfile/src/ulaw.h, - common/libsndfile/src/wav.c, common/libsndfile/src/wav.h, - common/libsndfile/src/wav_float.c, - common/libsndfile/src/wav_gsm610.c, - common/libsndfile/src/wav_ima_adpcm.c, - common/libsndfile/src/wav_ms_adpcm.c, - common/libsndfile/src/G72x/ChangeLog, - common/libsndfile/src/G72x/Makefile.am, - common/libsndfile/src/G72x/Makefile.in, - common/libsndfile/src/G72x/README, - common/libsndfile/src/G72x/README.original, - common/libsndfile/src/G72x/g721.c, - common/libsndfile/src/G72x/g723_16.c, - common/libsndfile/src/G72x/g723_24.c, - common/libsndfile/src/G72x/g723_40.c, - common/libsndfile/src/G72x/g72x.c, - common/libsndfile/src/G72x/g72x.h, - common/libsndfile/src/G72x/private.h, - common/libsndfile/src/GSM610/COPYRIGHT, - common/libsndfile/src/GSM610/ChangeLog, - common/libsndfile/src/GSM610/Makefile.am, - common/libsndfile/src/GSM610/Makefile.in, - common/libsndfile/src/GSM610/README, - common/libsndfile/src/GSM610/add.c, - common/libsndfile/src/GSM610/code.c, - common/libsndfile/src/GSM610/config.h, - common/libsndfile/src/GSM610/decode.c, - common/libsndfile/src/GSM610/gsm.h, - common/libsndfile/src/GSM610/gsm_create.c, - common/libsndfile/src/GSM610/gsm_decode.c, - common/libsndfile/src/GSM610/gsm_destroy.c, - common/libsndfile/src/GSM610/gsm_encode.c, - common/libsndfile/src/GSM610/gsm_option.c, - common/libsndfile/src/GSM610/long_term.c, - common/libsndfile/src/GSM610/lpc.c, - common/libsndfile/src/GSM610/preprocess.c, - common/libsndfile/src/GSM610/private.h, - common/libsndfile/src/GSM610/proto.h, - common/libsndfile/src/GSM610/rpe.c, - common/libsndfile/src/GSM610/short_term.c, - common/libsndfile/src/GSM610/table.c, - common/libsndfile/src/GSM610/unproto.h, - common/libsndfile/tests/Makefile.am, - common/libsndfile/tests/Makefile.in, - common/libsndfile/tests/alaw_test.c, - common/libsndfile/tests/double_test.c, - common/libsndfile/tests/error_test.c, - common/libsndfile/tests/lossy_comp_test.c, - common/libsndfile/tests/read_seek_test.c, - common/libsndfile/tests/sftest.c, - common/libsndfile/tests/sfversion.c, - common/libsndfile/tests/ulaw_test.c, - common/libsndfile/tests/write_read_test.c, frontend/faac.dsp, - frontend/faac.dsw, frontend/faacgui.dsp, frontend/faacgui.dsw, - wingui/faac_wingui.dsp, wingui/faac_wingui.dsw: - Added libsndfile to the CVS tree, making compilation a lot easier - - * faac_wingui.nsi: - Fixed NSIS install script to avoid warnings - -2001-05-08 menno - * frontend/: faac.dsp, faacgui.dsp, faacgui.rc, main.c, maingui.c, - resource.h: - Better support for main profile in frontends - -2001-05-02 menno - * todo.txt, frontend/main.c, libfaac/bitstream.c, - libfaac/bitstream.h, libfaac/coder.h, libfaac/frame.c, - libfaac/libfaac.dsp, libfaac/backpred.c, libfaac/backpred.h: - Added support for MAIN AAC object type - -2001-04-29 flyingfox - * wingui/: EncoderJob.cpp, EncoderJob.h, - EncoderJobProcessingManager.cpp, EncoderJobProcessingManager.h, - EncoderQualityPageDialog.cpp, EncoderQualityPageDialog.h, - EncoderQualityPropertyPageContents.cpp, - EncoderQualityPropertyPageContents.h, faac_wingui.rc, resource.h: - - disabled job list persistence (file format incompatibility) - - disabled job list multiple selection (property merging is not working properly anyway) - - added MPEG version support - - changed AAC profile to AAC object type - - disabled LTP under MPEG version 2 (if LTP selected it will go back to LC) - -2001-04-27 flyingfox - * wingui/faac_wingui.dsp: - fixed debug build - - * wingui/EncoderJobProcessingManager.cpp: - fixed compile error - -2001-04-19 menno - * frontend/faacgui.rc, frontend/main.c, frontend/maingui.c, - frontend/resource.h, include/faac.h, libfaac/bitstream.c, - libfaac/bitstream.h, libfaac/frame.c, libfaac/frame.h, - libfaac/tns.c: - Changes in MPEG4 file format, mainly comments for clarification - -2001-04-11 menno - * frontend/faacgui.rc, frontend/main.c, frontend/maingui.c, - include/faac.h, libfaac/bitstream.c, libfaac/bitstream.h, - libfaac/coder.h, libfaac/frame.c, libfaac/frame.h, libfaac/ltp.c, - libfaac/tns.c, wingui/EncoderJobProcessingManager.cpp, - wingui/faac_wingui.rc: - Fixed MPEG4 object type problem - -2001-04-10 menno - * libfaac/tns.c: - Fixed another MPEG4/2 issue TNS order - - * wingui/: EncoderGeneralPageDialog.cpp, - EncoderGeneralPageDialog.h, EncoderJob.cpp, EncoderJob.h, - EncoderJobProcessingManager.cpp, EncoderJobProcessingManager.h, - Job.cpp, Job.h, JobListUpdatable.h, PageCheckboxCtrlContent.cpp, - PageCheckboxCtrlContent.h, PageComboBoxCtrlContent.cpp, - PageComboBoxCtrlContent.h, PageEditCtrlContent.cpp, - PageEditCtrlContent.h, PageRadioGroupCtrlContent.h, - RecursiveDirectoryTraverser.cpp, RecursiveDirectoryTraverser.h, - WindowUtil.cpp, WindowUtil.h, faac_wingui.dsp, faac_wingui.rc, - faac_winguiDlg.cpp, faac_winguiDlg.h, resource.h: - Big update of GUI - -2001-04-03 menno - * libfaac/bitstream.c: - Finally correct MPEG4 ADTS headers - - * libfaac/bitstream.c: - Re: ADTS layer fixed for MPEG-4 - - * libfaac/bitstream.c: - ADTS layer fixed for MPEG-4 - -2001-04-01 xfhobbes - * wingui/: AbstractJob.cpp, AbstractJob.h: - improved progress counter; - added general user input tracking during job list processing; - added column in the job list ctrl to display the outcome of job processing - - * wingui/: AskCreateDirectoryDialog.cpp, - AskCreateDirectoryDialog.h, JobProcessingDynamicUserInputInfo.cpp, - JobProcessingDynamicUserInputInfo.h: - added general user input tracking during job list processing and - question for target directory creation where appropriate - -2001-03-19 menno - * frontend/main.c, libfaac/bitstream.c: - Correct encoding of files other than 2 channel now - - * libfaac/frame.c: - Table data fix for 8kHz - -2001-03-18 xfhobbes - * wingui/faac_winguiDlg.cpp: - Moved beep after completed processing from individual beep for - every job to a global one per processing command. - - * wingui/: EncoderJobProcessingManager.cpp, - EncoderJobProcessingManager.h: - Rewrote DoProcessing() method to comply to rules of - Hungarian Notation and to common C++ code styles. - -2001-03-18 menno - * faac_wingui.nsi: - Changed NSIS installation script - now it supports opening of .jbl (joblist) files automatically - - * faac_wingui.nsi: - Added NSIS (www.nullsoft.com) installation script - -2001-03-18 xfhobbes - * wingui/: .cvsignore, AbstractJob.cpp, AbstractJob.h, - EncoderGeneralPageDialog.cpp, EncoderJob.cpp, EncoderJob.h, - EncoderJobProcessingManager.cpp, EncoderJobProcessingManager.h, - FloatingPropertyDialog.cpp, FloatingPropertyDialog.h, Job.cpp, - Listobj.cpp, ProcessJobStatusDialog.cpp, ProcessJobStatusDialog.h, - ProcessJobStatusDialog2.cpp, ProcessJobStatusDialog2.h, - ProcessingStatusDialogInfoFeedbackCallbackInterface.h, - RecursiveDirectoryTraverser.cpp, RecursiveDirectoryTraverser.h, - TItemList.h, faac_wingui.clw, faac_wingui.cpp, faac_wingui.dsp, - faac_wingui.h, faac_wingui.rc, faac_winguiDlg.cpp, - faac_winguiDlg.h, resource.h: - Major update: roughly consolidated filter job functionality, - added shell open support and several other things, - cleaned up scc files and ignore list - -2001-03-17 menno - * libfaac/bitstream.c, wingui/faac_wingui.clw: - Added MPEG2 AAC support (compile with MPEG2AAC defined) - make sure you don't use LTP when using MPEG2 AAC, - because it is not supported in MPEG2 AAC - -2001-03-15 menno - * wingui/Listobj.cpp: - Small bugfix - -2001-03-14 menno - * wingui/: .cvsignore, AbstractJob.cpp, AbstractJob.h, - AbstractPageCtrlContent.cpp, AbstractPageCtrlContent.h, - AbstractPropertyPageContents.cpp, AbstractPropertyPageContents.h, - ConcreteJobBase.cpp, ConcreteJobBase.h, - EncoderGeneralPageDialog.cpp, EncoderGeneralPageDialog.h, - EncoderGeneralPropertyPageContents.cpp, - EncoderGeneralPropertyPageContents.h, EncoderId3PageDialog.cpp, - EncoderId3PageDialog.h, EncoderId3PropertyPageContents.cpp, - EncoderId3PropertyPageContents.h, EncoderJob.cpp, EncoderJob.h, - EncoderJobProcessingManager.cpp, EncoderJobProcessingManager.h, - EncoderQualityPageDialog.cpp, EncoderQualityPageDialog.h, - EncoderQualityPropertyPageContents.cpp, - EncoderQualityPropertyPageContents.h, - FaacWinguiProgramSettings.cpp, FaacWinguiProgramSettings.h, - FileListQueryManager.cpp, FileListQueryManager.h, - FileMaskAssembler.cpp, FileMaskAssembler.h, FilePathCalc.cpp, - FilePathCalc.h, FileSerializable.cpp, FileSerializable.h, - FileSerializableJobList.cpp, FileSerializableJobList.h, - FloatingPropertyDialog.cpp, FloatingPropertyDialog.h, - FolderDialog.cpp, FolderDialog.h, Id3TagInfo.cpp, Id3TagInfo.h, - Job.cpp, Job.h, JobList.cpp, JobList.h, JobListCtrlDescribable.cpp, - JobListCtrlDescribable.h, JobListUpdatable.cpp, JobListUpdatable.h, - JobListsToConfigureSaver.cpp, JobListsToConfigureSaver.h, - ListCtrlStateSaver.cpp, ListCtrlStateSaver.h, Listobj.cpp, - PageCheckboxCtrlContent.cpp, PageCheckboxCtrlContent.h, - PageComboBoxCtrlContent.cpp, PageComboBoxCtrlContent.h, - PageEditCtrlContent.cpp, PageEditCtrlContent.h, - PageRadioGroupCtrlContent.cpp, PageRadioGroupCtrlContent.h, - ProcessJobStatusDialog.cpp, ProcessJobStatusDialog.h, - ProcessJobStatusDialog2.cpp, ProcessJobStatusDialog2.h, - ProcessingStartStopPauseInteractable.cpp, - ProcessingStartStopPauseInteractable.h, - ProcessingStatusDialogInfoFeedbackCallbackInterface.cpp, - ProcessingStatusDialogInfoFeedbackCallbackInterface.h, - PropertiesDummyParentDialog.cpp, PropertiesDummyParentDialog.h, - PropertiesTabParentDialog.cpp, PropertiesTabParentDialog.h, - ReadMe.txt, RecursiveDirectoryTraverser.cpp, - RecursiveDirectoryTraverser.h, SourceTargetFilePair.cpp, - SourceTargetFilePair.h, StdAfx.cpp, StdAfx.h, - SupportedPropertyPagesData.cpp, SupportedPropertyPagesData.h, - TItemList.cpp, TItemList.h, WindowUtil.cpp, WindowUtil.h, - faac_wingui.clw, faac_wingui.cpp, faac_wingui.dsp, faac_wingui.dsw, - faac_wingui.h, faac_wingui.rc, faac_winguiDlg.cpp, - faac_winguiDlg.h, listobj.h, resource.h, res/faac_wingui.ico, - res/faac_wingui.rc2, res/toolbarm.bmp: - New GUI application - -2001-03-13 menno - * frontend/.cvsignore, libfaac/.cvsignore: - Updated .cvsignore - -2001-03-12 menno - * frontend/main.c, frontend/maingui.c, include/faac.h, - libfaac/frame.c, libfaac/frame.h: - Small change in API - - * frontend/faac.dsp, frontend/faacgui.dsp, frontend/maingui.c, - libfaac/aacquant.c, libfaac/bitstream.c, libfaac/fft.c, - libfaac/filtbank.c, libfaac/frame.c, libfaac/huffman.c, - libfaac/libfaac.dsp, libfaac/ltp.c, libfaac/psych.c, libfaac/tns.c, - libfaac/util.h: - cleanup - -2001-03-06 menno - * frontend/faac.dsp, frontend/faacgui.dsp, frontend/faacgui.rc, - frontend/main.c, frontend/maingui.c, frontend/resource.h, - libfaac/psych.c: - -added profile selection - -some cleanup - - * libfaac/: aacquant.c, frame.c, frame.h, joint.c, joint.h, - psych.c: - Fix in reconstruction of spectrum before LTP buffer update - -2001-03-05 oxygene - * libfaac/Makefile: - Updated for LTP - - * libfaac/tns.c: - Included math.h for math functions in linux. - -2001-03-05 menno - * frontend/faac.dsp, frontend/maingui.c, frontend/usage.txt, - libfaac/ltp.c: - LTP speedup - - * todo.txt, frontend/faac.dsp, frontend/faacgui.rc, - frontend/main.c, frontend/maingui.c, frontend/resource.h, - include/faac.h, libfaac/aacquant.c, libfaac/aacquant.h, - libfaac/bitstream.c, libfaac/coder.h, libfaac/filtbank.c, - libfaac/filtbank.h, libfaac/frame.c, libfaac/frame.h, - libfaac/libfaac.dsp, libfaac/ltp.c, libfaac/ltp.h: - Added LTP - Needs some more refinement, but it works - -2001-03-02 menno - * frontend/main.c: - unix fix - -2001-03-01 oxygene - * frontend/Makefile, libfaac/Makefile: - Added support for TNS, fixed a typo - - * Makefile, frontend/Makefile, libfaac/Makefile: - Install and uninstall target added. Small change - -2001-03-01 menno - * frontend/main.c: - unix fix - -2001-02-28 menno - * frontend/: faacgui.rc, main.c, maingui.c, resource.h: - Support for TNS in frontends - - * include/faac.h, libfaac/aacquant.c, libfaac/bitstream.c, - libfaac/bitstream.h, libfaac/channels.c, libfaac/channels.h, - libfaac/coder.h, libfaac/filtbank.c, libfaac/filtbank.h, - libfaac/frame.c, libfaac/frame.h, libfaac/joint.c, - libfaac/libfaac.dsp, libfaac/psych.c, libfaac/psych.h, - libfaac/tns.c, libfaac/tns.h, libfaac/util.c, libfaac/util.h: - - added TNS support - - some other cleanups - -2001-02-26 oxygene - * libfaac/util.c: - Included math.h to make unix compiler happy - - * libfaac/psych.h: - Added min() and max() functions for unix - - * libfaac/channels.h: - Added min() function for unix - - * frontend/main.c: - Added min() function for unix. - -2001-02-25 menno - * frontend/faacgui.dsp, frontend/maingui.c, libfaac/filtbank.c, - libfaac/filtbank.h, libfaac/kbd_win.h: - Added calculation of KBD window - -2001-02-12 menno - * frontend/faac.dsp, frontend/faacgui.dsp, frontend/maingui.c, - frontend/resource.h, libfaac/frame.c, libfaac/psych.c, - libfaac/psych.h, libfaac/util.c, libfaac/util.h: - Different MS switching model - -2001-02-10 menno - * libfaac/: frame.c, util.c, util.h: - - Fixed scalefactor bandwidths (Thanks again to Ivan) - - Better checking of configuration - -2001-02-09 menno - * libfaac/frame.c: - Scalefactor bandwidth update (Thanks to Ivan) - -2001-02-08 menno - * libfaac/frame.c: - Fixed scalefactorband data (thanks to Ivan) - -2001-02-05 menno - * frontend/main.c: - changed LINUX -> __unix__ - -2001-02-04 oxygene2000 - * Makefile, frontend/.cvsignore, frontend/Makefile, - frontend/main.c, libfaac/.cvsignore, libfaac/Makefile, - libfaac/aacquant.c, libfaac/bitstream.c, libfaac/channels.h, - libfaac/coder.h, libfaac/fft.c, libfaac/filtbank.h, - libfaac/frame.h, libfaac/huffman.c, libfaac/psych.c, - libfaac/psych.h, libfaac/util.c: - - new Makefiles - - .cvsignore for a cleaner cvs-output - - // xyz -> /* xyz */ for ansi-c compliance - - minor fixes to work on linux - -2001-02-01 menno - * libfaac/: frame.c, psych.c: - Fixed memory leakage - - * libfaac/: frame.c, libfaac.dsp, psych.c, psych.h: - Completely new psychoacoustic model - -2001-01-25 menno - * frontend/maingui.c: - Small changes - - * frontend/maingui.c: - Encoding now done in a thread. Plus some other small changes. - -2001-01-24 menno - * frontend/: faacgui.rc, maingui.c, resource.h: - Minor changes to GUI - - * frontend/faacgui.dsp, frontend/faacgui.dsw, frontend/faacgui.rc, - frontend/maingui.c, frontend/resource.h, todo.txt: - Added graphical user interface - -2001-01-23 menno - * libfaac/bitstream.c, libfaac/bitstream.h, libfaac/frame.c, - libfaac/frame.h, todo.txt: - ADTS headers supported - - * libfaac/: joint.c, joint.h: - Fix to remove compiler warnings - -2001-01-19 menno - * libfaac/: aacquant.c, huffman.c, huffman.h: - Speedup in huffman coder - - * libfaac/psych.c: - Changed ATH formula - -2001-01-17 menno - * todo.txt, frontend/main.c, frontend/usage.txt, include/faac.h, - libfaac/filtbank.c, libfaac/filtbank.h, libfaac/frame.c, - libfaac/frame.h: - Added frequency cut off filter - - * Makefile, aac_se_enc.c, aac_se_enc.h, aacenc.h, bitstream.c, - bitstream.h, enc.h, enc_tf.c, encoder.c, faac.c, faac.dsp, - faac.dsw, faac_dll.dsp, fastfft.c, fastfft.h, huffman.c, huffman.h, - hufftab5.h, interface.h, ltp_enc.c, ltp_enc.h, mc_enc.c, mc_enc.h, - ms.c, ms.h, profiling.txt, psych.c, psych.h, pulse.c, pulse.h, - quant.c, quant.h, rateconv.c, rateconv.h, shape_win.h, tns.c, - tns.h, todo.txt, transfo.c, transfo.h, frontend/faac.dsp, - frontend/faac.dsw, frontend/main.c, frontend/usage.txt, - include/faac.h, libfaac/aacquant.c, libfaac/aacquant.h, - libfaac/bitstream.c, libfaac/bitstream.h, libfaac/channels.c, - libfaac/channels.h, libfaac/coder.h, libfaac/fft.c, libfaac/fft.h, - libfaac/filtbank.c, libfaac/filtbank.h, libfaac/frame.c, - libfaac/frame.h, libfaac/huffman.c, libfaac/huffman.h, - libfaac/hufftab.h, libfaac/joint.c, libfaac/joint.h, - libfaac/kbd_win.h, libfaac/libfaac.dsp, libfaac/psych.c, - libfaac/psych.h, libfaac/util.c, libfaac/util.h: - no message - -2000-12-04 menno - * faac.c: - Changed usage message a bit - -2000-11-10 menno - * enc_tf.c, psych.c, quant.c, quant.h: - Bugfix in psychoacoustics and window shape switching changed - -2000-11-07 menno - * enc_tf.c, quant.c, quant.h: - Quantizer update. No more quantizer crashes - -2000-11-01 menno - * aac_se_enc.c, enc_tf.c, ltp_enc.c, ltp_enc.h, mc_enc.c, mc_enc.h, - ms.c, ms.h, psych.c, psych.h, quant.c, quant.h, tns.c, tns.h: - Code reorganisation - -2000-10-31 menno - * enc_tf.c, interface.h, psych.c, psych.h, quant.h: - Cleanup: more sensible organisation - -2000-10-08 menno - * tables.h: - Removed unused file - - * enc_tf.c, psych.c, psych.h: - Bugfixed and commented psychoacoustic module - -2000-10-06 menno - * Makefile, aac_se_enc.c, aac_se_enc.h, bitstream.c, enc_tf.c, - faac.dsp, faac_dll.dsp, huffman.c, huffman.h, interface.h, - ltp_enc.c, ltp_enc.h, nok_ltp_common.h, nok_ltp_common_internal.h, - nok_ltp_enc.c, nok_ltp_enc.h, nok_pitch.c, nok_pitch.h, psych.c, - pulse.c, quant.c, quant.h, tns.c, tns.h, transfo.c: - Code cleanup - -2000-10-05 menno - * aac_se_enc.c, aac_se_enc.h, aacenc.h, all.h, bitstream.c, - block.h, enc.h, enc_tf.c, fastfft.h, huffman.c, huffman.h, - interface.h, mc_enc.h, ms.h, nok_ltp_common.h, nok_ltp_enc.c, - nok_ltp_enc.h, nok_pitch.c, psych.c, psych.h, quant.c, quant.h, - tf_main.h, tns.c, tns.h, transfo.c, transfo.h: - Big code cleanup - - * aac_se_enc.c, aac_se_enc.h, aacenc.h, all.h, bitstream.c, - bitstream.h, block.h, enc.h, enc_tf.c, encoder.c, faac.c, - fastfft.c, fastfft.h, huffman.c, huffman.h, hufftab5.h, - interface.h, mc_enc.c, mc_enc.h, ms.c, ms.h, nok_ltp_common.h, - nok_ltp_common_internal.h, nok_ltp_enc.c, nok_ltp_enc.h, - nok_pitch.c, nok_pitch.h, psych.c, psych.h, pulse.c, pulse.h, - quant.c, quant.h, shape_win.h, tf_main.h, tns.c, tns.h, transfo.c, - transfo.h: - Copyright message cleanup. CVS keywords added - -2000-10-04 menno - * encoder.c: - Wrong bits per frame got calculated - - * enc_tf.c, nok_ltp_enc.c, psych.c, rateconv.c: - LFE is now also working correctly - -2000-10-03 menno - * enc_tf.c, encoder.c, faac.c, nok_ltp_enc.c, psych.c, rateconv.c, - tf_main.h: - Multichannel fixes. All working now, except LFE channels - -2000-10-01 menno - * enc_tf.c, psych.c: - Small fix in LFE frequency cut-off - - * aacenc.h, enc_tf.c, encoder.c, faac.c, mc_enc.c, mc_enc.h, - psych.c: - Encoder LFE fixup. Should be working now, but no way to test it yet. - -2000-09-30 menno - * quant.c: - Some variable names changed (purely cosmetic) - -2000-09-28 menno - * encoder.c: - Release updates - -2000-09-27 menno - * profiling.txt: - no message - -2000-09-25 menno - * psych.c: - Small changes - - * enc_tf.c, quant.c: - Added VBR quantizer (but not working yet) - -2000-08-24 menno - * psych.c, psych.h: - Fixed a bug in MS threshold calculation - - * psych.c, quant.c: - Cleanup and small quality update - -2000-08-23 menno - * encoder.c, psych.c: - Different bark formula - -2000-08-20 menno - * Makefile: - Fixed Makefile - -2000-08-11 menno - * psych.c: - removed some redundant code - - * enc_tf.c, ms.c, psych.c: - Bugfixes and multichannel updates - -2000-08-10 menno - * is.c, is.h: - removed IS - - * ms.c, psych.c: - bugfix - - * faac.dsp, faac_dll.dsp, psych.h: - Cleanup - -2000-08-08 menno - * aacenc.h, all.h, enc_tf.c, encoder.c, faac.c, ms.c, ms.h, - quant.c: - Removed IS. It is useless - - * enc_tf.c, ms.c, ms.h, psych.c, psych.h: - Changed for multichannel support. And big cleanup - - * mc_enc.c, mc_enc.h: - Changed for multichannel support - -2000-07-22 prkoat - * encoder.c, faac.c: - Support for SCE (mono files) - -2000-05-18 menno - * enc_tf.c, psych.c, psych.h: - Tuned short block switching - -2000-05-16 menno - * encoder.c: - First go at multichannel support (not working at all, yet) - -2000-04-05 oxygene2000 - * faac.c: - - With -DLINUX faac shows the cpu-time needed to encode - not real-time, therefore better measurement is possible - - * pulse.h: - - Cosmetic change (gcc complains about missing newline at EOF) - - * Makefile, huffman.h, psych.h: - - Made it compile with gcc/linux again - -2000-03-29 menno - * enc_tf.c, psych.c, quant.c: - Quality update - -2000-03-28 menno - * huffman.c, huffman.h, quant.c, quant.h: - Moved a function - - * quant.c: - Small change - - * aac_qc.c, aac_qc.h, aac_se_enc.c, aac_se_enc.h, enc_tf.c, - faac.dsp, faac_dll.dsp, huffman.c, huffman.h, is.h, ms.h, pulse.c, - quant.c, quant.h: - Separated quantization and noiseless coding - - * encoder.c, faac.c: - Made TNS default again - -2000-03-23 lenox - * aac_se_enc.c, enc_tf.c: - restored gain control bits in the stream - -2000-03-22 lenox - * aacenc.h, encoder.c, faac.c: - added new parameters for 'block' mode - -2000-03-17 lenox - * aacenc.h, encoder.c, faac.c: - removed function faac_EncodeFinish() - -2000-03-13 lenox - * aacenc.h, encoder.c: - added support for block input (for DLL interface without input files) - -2000-03-12 lenox - * aac_qc.c, aac_se_enc.c, enc_tf.c, encoder.c, faac.c: - removed gain control & changed win32 defines - -2000-03-02 lenox - * aac_qc.c: - added gcc asm code - - * aac_qc.c: - new quantizer code for other than VC and BCB compilers - -2000-02-28 lenox - * ms.c, transfo.c: - improved readability of the code - - * aac_qc.c: - added BC asm compatibility - - * aac_qc.c, aac_qc.h, aac_se_enc.c, aac_se_enc.h, enc_tf.c, is.c, - is.h, ms.c, ms.h, nok_ltp_enc.c, nok_pitch.c, nok_pitch.h, psych.c, - psych.h, tns.c: - huge cleanup (for unused parameters and vars) - -2000-02-28 menno - * aac_se_enc.c: - Bugfix - -2000-02-28 lenox - * block.h, enc_tf.c, nok_ltp_common.h, nok_ltp_enc.c, - nok_ltp_enc.h, tns.c: - removed unused parameters - - * faac.c: - slightly changed arg parsing - -2000-02-27 menno - * aac_qc.c: - Changed short block quantization - -2000-02-24 menno - * psych.c: - Now using LAME's mid/side threshold calculation - -2000-02-24 thebard - * Makefile, psych.c: - Removed remainign thread and semephore code - - * Makefile, all.h, profiling.txt, psych.c, psych.h: - After more compilation, there is not any function thats taking - more than 10% of the total time (see the profile graph) - For fun I added threads to psy6, but since its only 7 seconds, - the constant rebuilds of the threads gain little improvement, - and will suck on non multiple cpu boxes, so I removed it. - -2000-02-23 thebard - * psych.c, psych.h: - Alterations so that we can thread functions for multiple CPU's - -2000-02-23 lenox - * encoder.c, faac.c: - fixed wildcards processing - -2000-02-23 menno - * psych.c, tns.c: - Quality update - - * Makefile, enc_tf.c, faac.dsp, faac_dll.dsp, winswitch.c, - winswitch.h: - Removed winswitch.c - -2000-02-23 thebard - * Makefile, profiling.txt: - Now encoding faster than realtime with suggested compiler - options in Makefile. Still alot of room left for assembler - and/or thread tweaking. - - * Makefile, profiling.txt: - Got run time down 100%. It looks like gcc is starving registers or causing - mosterous cache misses. More to come. - -2000-02-22 thebard - * aac_qc.c, profiling.txt: - inlined output_bits, not that it matters much in performance... - -2000-02-22 menno - * enc_tf.c: - Made ADTS quality same as other files quality - -2000-02-22 thebard - * Makefile, nok_ltp_enc.c, profiling.txt: - Macroized double_to_int. Shaved off a few seconds - (avoided all the function call overhead) - - * profiling.txt: - Added the profiling text file. - - * faac.c: - Changes the ending return to an exit so we can profile. - - * faac.c: - Timer now works correctly for unix. - - * Makefile, faac.c: - Makefile changes for default compile and nots on options, - Also added an include so that faac.c links. - -2000-02-19 lenox - * Makefile: - added faac.c - - * faac.c, faac.dsp, faac_dll.dsp: - added faac.c - - * aacenc.h, encoder.c: - restructure - -2000-02-19 oxygene - * Makefile: - Uninstall target added - -2000-02-18 menno - * faac_dll.dsp: - Added libsndfile.lib - -2000-02-18 lenox - * aacenc.h, enc.h, enc_tf.c, encoder.c: - new interface functions - - * rateconv.h, rateconv.c, nok_ltp_enc.c, aac_qc.c: - cleanup - -2000-02-17 menno - * aac_se_enc.c: - Removed some debug code - - * aac_qc.c, aac_se_enc.c, enc_tf.c, nok_ltp_enc.c: - Bugfixes for bit counting - -2000-02-17 lenox - * enc_tf.c, encoder.c: - added support for all headers - -2000-02-17 oxygene - * Makefile: - Install target added. - -2000-02-15 menno - * aac_qc.c, aac_qc.h, aac_se_enc.c, aac_se_enc.h, bitstream.c, - bitstream.h, enc_tf.c, encoder.c: - Added ADTS header writing - - * aacenc.h: - Fixed DLL - -2000-02-15 lenox - * aacenc.h, encoder.c: - new parsing function - -2000-02-15 menno - * aacenc.h, encoder.c: - Made DLL compile - -2000-02-15 lenox - * aacenc.h, enc.h, enc_tf.c, encoder.c: - restructure (aacconfig eliminated) - -2000-02-14 lenox - * Makefile, faac.dsp, faac_dll.dsp: - removed rdft stuff - - * rdft.h, rdft_spectrum.c, rdft_spectrum2.c: - removed rdft due to new real fft - - * enc_tf.c, fastfft.c, psych.c, transfo.c, transfo.h: - new rft (reference to fftw removed, sorry :) ) - -2000-02-09 oxygene2000 - * enc_tf.c, rdft_spectrum2.c: - Placed fftw_init/destroy where they have to be - Removed transfo.h as it isn't needed - Added rdft.h - - * rdft_spectrum2.c: - Another mistake, argh! - - * rdft.h, rdft_spectrum2.c: - Added fixed fftw-stuff. Use rdft_spectrum2.c instead of rdft_spectrum.c - and set -DUSE_FFTW in Makefile to enable it.. - Be sure that you have libfftw installed - fftw_init() and fftw_destroy() have to be placed elsewhere - (should only be run once in the program -> speed) - -2000-02-09 menno - * encoder.c: - Restored small mistakes. - -2000-02-09 lenox - * rdft.h: - fix to use without fttw - -2000-02-09 oxygene2000 - * encoder.c, rdft.h, rdft_spectrum.c, rdft_spectrum2.c: - Added additional implementation of rdft using fftw (from rank 1 to rank - >20 in my profiler = a lot faster) - -2000-02-08 oxygene2000 - * enc_tf.c: - Why calculating sqrt(2) if it is present as constant? - - * psych.c: - really small speed-up in psy_step6 - -2000-02-08 menno - * nok_pitch.c: - Made advantage of Oxygene2000's optimization, to use more accurate delay estimation - - * aac_qc.c: - Better quantization of short blocks - -2000-02-08 lenox - * enc_tf.c, fastfft.c, kbd_win.h, psych.c, shape_win.h, tf_main.h, - transfo.c, transfo.h: - removed old FFT & some restucture - -2000-02-07 menno - * psych.c: - Change in window switching parameters - -2000-02-07 lenox - * rdft_spectrum.c: - fixed bug with atan2() - -2000-02-07 menno - * psych.c: - Bug fix - - * aac_qc.h, enc_tf.c: - One step closer to window shape switching - - * psych.c: - Same change to short blocks as oxy2000 made to long blocks - - * encoder.c: - Changed command line (TNS is now off by default) - -2000-02-07 oxygene2000 - * Makefile: - Made more variables to tune gcc - -2000-02-07 menno - * enc_tf.c, psych.c, psych.h: - Changed last changes back, they made no difference - - * enc_tf.c, psych.c, psych.h: - Bugs fixed in psych - -2000-02-07 oxygene2000 - * psych.c: - Another speedup by solving calculations into something - more simple but equivalent - - * psych.c: - Commented out unused loop - -2000-02-07 lenox - * encoder.c: - some cleanup - - * transfo.c: - bugfix - - * all.h, block.h, enc_tf.c, nok_ltp_enc.c, tf_main.h, transfo.c: - added support for different window shapes - - * dolby_def.h, dolby_win.h: - cleanup - - * kbd_win.h: - added kbd window tables - -2000-02-07 oxygene2000 - * Makefile: - Fixed missing dependency rateconv.c - - * nok_pitch.c: - Speeded up estimate_delay - -2000-02-06 menno - * psych.c: - Quite some bug fixes - - * aac_qc.c: - Speedup - -2000-02-05 menno - * aac_qc.c, psych.c: - Psych changed and pulse coding updated - - * enc_tf.c, psych.c: - Bugfixes - - * ms.h: - Fixed lower bitrates (continued) - - * enc_tf.c, psych.c: - SMR values were one frame ahead of data. Big quality improvement. - - * aac_qc.c, tns.c: - More fixes - - * aac_qc.c, enc_tf.c, is.h, ms.c: - Fixed lower bitrate encoding - -2000-02-04 menno - * enc_tf.c, psych.c: - Window switching back to old - - * aac_qc.c, aac_qc.h: - Bugs fixed - - * psych.c: - Fixed mistake. This caused a very bad sound - - * Makefile, faac.dsp, faac_dll.dsp, psych.c, rdft_spectrum.c: - Psycho speedup - -2000-02-03 menno - * encoder.c: - Printing options to screen - - * aac_qc.c: - bugfix for blocks with only 0's - -2000-02-02 menno - * aac_qc.c, psych.c: - Serious bugfixes and speedups - - * bitstream.c, psych.c: - Bug fixes - - * aac_qc.c: - Big quantizer change - -2000-01-31 menno - * enc_tf.c, psych.c: - Reduced psycho complexity (same result) - -2000-01-31 lenox - * rateconv.c: - cleanup - - * transfo.c: - bugfix & cleanup - -2000-01-30 menno - * psych.c: - FFT change (cleanup) - -2000-01-29 lenox - * Makefile, faac.dsp, faac_dll.dsp: - removed imdct.c - - * imdct.c: - no message - - * enc_tf.c, nok_ltp_enc.c, tf_main.h, transfo.c: - changed T/F transformation - -2000-01-27 menno - * Makefile, enc_tf.c, faac.dsp, faac_dll.dsp, winswitch.c, - winswitch.h: - New block switching (sounds bad for now) - -2000-01-24 lenox - * enc_tf.c: - removed unneeded stuff for LTP off - -2000-01-24 menno - * enc_tf.c, ms.c: - Unneeded calls to functions removed - - * encoder.c: - Command line parsing fixed - -2000-01-21 menno - * encoder.c: - Bug fix - - * encoder.c: - Version upgraded - -2000-01-19 menno - * enc_tf.c, encoder.c: - LTP fixed and some other bugs. - -2000-01-18 menno - * encoder.c: - Oops - - * aacenc.h, enc_tf.c, encoder.c, imdct.c, tf_main.h: - Added frequency cut-off option (-c) - - * psych.c: - Fixed encoding of some samplerates - -2000-01-17 menno - * aac_qc.c, aacenc.h, enc_tf.c, encoder.c, faac.dsp, faac_dll.dsp, - rateconv.c, rateconv.h: - Added sampling rate conversion (-s), buggy with some sample rates - -2000-01-14 menno - * aac_qc.c, aacenc.h, enc_tf.c, encoder.c: - First attempt at doing PNS (use -pns). Also every bitrate - higher than 16kbps is now supported in step of 1kbps - -2000-01-12 menno - * imdct.c: - Cleanup - -2000-01-10 menno - * psych.c, psych.h: - All psycho values now calculated by formulas - - * enc_tf.c: - Small fix - - * tf_main.h: - Added support for all sampling rates - - * psych.c: - Full support of all sample rates, and some other fixes - -2000-01-09 menno - * enc_tf.c: - restored previous change - - * enc_tf.c: - Bugfix - -2000-01-09 lenox - * faac.dsp, faac_dll.dsp: - new dirs for output - -2000-01-08 lenox - * enc_tf.c, ms.c, nok_ltp_common_internal.h, nok_ltp_enc.c, - nok_pitch.c, psych.c, tns.c, transfo.c: - some cleanup - - * fastfft.c: - some cleanup - -2000-01-07 lenox - * psych.c: - fixed bug in block switching (was since 1.16) - -2000-01-07 menno - * aacenc.h, enc_tf.c, encoder.c: - Added option to disable LTP (-nl) - -2000-01-06 menno - * aac_qc.c, aac_qc.h, enc_tf.c: - Added support for PNS (but it is not used at the moment) - - * psych.c, psych.h: - Cleanup - - * nok_ltp_enc.c, nok_pitch.c: - Updated delay detection in LTP - - * aac_qc.c: - Fix - - * psych.c: - Mistake fixed - -2000-01-06 lenox - * fastfft.c, fastfft.h, psych.c, transfo.c, transfo.h: - new restructured mdct and fft - -2000-01-06 menno - * nok_pitch.c: - Divide by zero bugfix - - * aac_qc.c, psych.c: - Small quality fixes - - * enc_tf.c, psych.c: - Changed block switching - -2000-01-05 menno - * Makefile, aac_qc.h, aac_se_enc.c, aac_se_enc.h, all.h, enc_tf.c, - faac.dsp, faac_dll.dsp, imdct.c, is.c, is.h, psych.c, psych.h, - tns.c, transfo.c, transfo.h, nok_ltp_common.h, - nok_ltp_common_internal.h, nok_ltp_enc.c, nok_ltp_enc.h, - nok_pitch.c, nok_pitch.h: - Added Long Term Prediction (LTP), new decoder is needed for this - - * aac_back_pred.c, aac_back_pred.h: - Removed backward prediction - -2000-01-04 menno - * psych.c: - no message - -2000-01-03 lenox - * fastfft.c, psych.c, transfo.c, transfo.h: - Added 2048 FFT - -1999-12-30 menno - * psych.c, psych.h: - Structure cleanup - -1999-12-29 menno - * Makefile, enc_tf.c, faac.dsp, faac_dll.dsp, psych.c, psych.h, - fft.c: - Restored old FFT due to some serious bugs - -1999-12-23 menno - * psych.c: - Quality fix, in MS protection ratio calculation - - * psych.c: - Little fix - - * enc_tf.c: - Removed the need for 4 channel buffers. Now there are 2 - - * Makefile: - Added fft.c - - * psych.c: - Quick bugfix after latest update - - * faac.dsp, faac_dll.dsp, fft.c, psych.c, psych.h: - New fft in psycho model (fast) and new unpredictabilty measure calculation - - * enc_tf.c: - Fix in Mid/Side calculation - -1999-12-22 menno - * psych.c, psych.h: - Streamlined spreading function. Big speedup - - * encoder.c: - Changed the DLL interface version. - -1999-12-20 lenox - * aac_back_pred.c, aac_back_pred.h, enc.h, enc_tf.c, encoder.c, - psych.c, tf_main.h, tns.c, tns.h: - some cleanup - -1999-12-20 menno - * tns.h: - Changed TNS switching - -1999-12-20 lenox - * fastfft.c, fastfft.h, transfo.c, transfo.h: - some cleanup - -1999-12-20 menno - * aac_qc.c: - Very big speedup - - * ms.c: - Ooops, quick bugfix after latest changes gave an extra bug - - * aacenc.h, enc_tf.c, encoder.c, ms.h, tns.c, tns.h: - Added some extra options - - * ms.c: - Bugfix: MS first gave some distortion in the right channel. - Because the Side channel was incorrectly formed. - -1999-12-19 menno - * aac_qc.c: - Bugfix preventing memory overflow - - * aacenc.h, encoder.c: - Changed InputBuffer into double instead of float (less conversions) - -1999-12-19 lenox - * transfo.c, transfo.h: - new FFT code & converted vars to double - - * Makefile, faac.dsp, faac_dll.dsp: - added fastfft.c - - * fastfft.c, fastfft.h: - new FFT code - - * block.h: - removed reference to transfo.h - -1999-12-17 lenox - * Makefile: - removed util.c - -1999-12-16 menno - * enc_tf.c: - Put MSEnergy() after MSPreprocess(). Off course. - - * aac_back_pred.c, aac_qc.c, aac_se_enc.c, enc.h, enc_tf.c, - imdct.c, psych.c, tns.c: - Serious bugfix in psych.c and removed all global statics, - they are just normal global variables now. - - * encoder.c: - Fixed bug with calculating number of bytes from the number of bits. - - * enc_tf.c, ms.c, ms.h: - New and cleaner energy calculation in ms.c - - * psych.c, psych.h: - Code cleanup and one bugfix - - * encoder.c: - Fixed bug with bitBuffer and better ADIF header writing - -1999-12-15 lenox - * util.c, util.h: - no message - - * transfo.c, transfo.h: - some speed optimization and restructure - - * faac.dsp, faac_dll.dsp: - Removed util.c - -1999-12-13 menno - * enc_tf.c, imdct.c, psych.c, psych.h, tf_main.h: - some bugfixes - -1999-12-13 lenox - * transfo.c: - no message - - * aac_qc.c, aac_se_enc.c, bitstream.c, COPYING, encoder.c, imdct.c, - is.c, mc_enc.c, ms.c, psych.c, pulse.c, tns.c, faac.dsp, faac.dsw, - faac_dll.dsp, transfo.c, util.c: - Initial revision - - * aac_qc.c, aac_se_enc.c, bitstream.c, COPYING, encoder.c, imdct.c, - is.c, mc_enc.c, ms.c, psych.c, pulse.c, tns.c, faac.dsp, faac.dsw, - faac_dll.dsp, transfo.c, util.c: - no message - - * Makefile, aac_back_pred.h, enc_tf.c, aac_qc.h, aac_se_enc.h, - aacenc.h, all.h, bitstream.h, block.h, dolby_def.h, dolby_win.h, - enc.h, hufftab5.h, interface.h, is.h, mc_enc.h, ms.h, psych.h, - pulse.h, tables.h, tf_main.h, tns.h, transfo.h, util.h, - aac_back_pred.c: - Initial revision - - * Makefile, aac_back_pred.h, enc_tf.c, aac_qc.h, aac_se_enc.h, - aacenc.h, all.h, bitstream.h, block.h, dolby_def.h, dolby_win.h, - enc.h, hufftab5.h, interface.h, is.h, mc_enc.h, ms.h, psych.h, - pulse.h, tables.h, tf_main.h, tns.h, transfo.h, util.h, - aac_back_pred.c: - no message +2009-02-02 - Version 1.28 + * Prevent out of range scalefactors + * Updated to latest mpeg4ip mp4 file format library + * Added -s option to make the encoder output optimized mp4 layout + * Improved JPEG detection for album art + * Lot's of compilation issues solved diff -Nru faac-1.26/common/Makefile.in faac-1.28/common/Makefile.in --- faac-1.26/common/Makefile.in 2007-10-15 08:13:09.000000000 +0000 +++ faac-1.28/common/Makefile.in 2009-02-10 08:37:00.000000000 +0000 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005 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. @@ -13,11 +13,15 @@ # PARTICULAR PURPOSE. @SET_MAKE@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -44,18 +48,17 @@ DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = mp4v2 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ @@ -83,7 +86,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ -INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -95,7 +97,6 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -105,18 +106,21 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ -SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +USE_DRM_FALSE = @USE_DRM_FALSE@ +USE_DRM_TRUE = @USE_DRM_TRUE@ VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ +WITH_MP4V2_FALSE = @WITH_MP4V2_FALSE@ +WITH_MP4V2_TRUE = @WITH_MP4V2_TRUE@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -128,7 +132,6 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ -builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ @@ -156,11 +159,8 @@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ @WITH_MP4V2_FALSE@SUBDIRS = @WITH_MP4V2_TRUE@SUBDIRS = mp4v2 all: all-recursive @@ -202,6 +202,10 @@ clean-libtool: -rm -rf .libs _libs +distclean-libtool: + -rm -f libtool +uninstall-info-am: + # 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, @@ -233,7 +237,8 @@ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -$(RECURSIVE_CLEAN_TARGETS): +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ @@ -334,21 +339,22 @@ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(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 \ + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ @@ -362,7 +368,7 @@ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ + || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ @@ -370,8 +376,6 @@ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ @@ -411,7 +415,8 @@ distclean: distclean-recursive -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-tags +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags dvi: dvi-recursive @@ -425,20 +430,12 @@ install-data-am: -install-dvi: install-dvi-recursive - install-exec-am: -install-html: install-html-recursive - install-info: install-info-recursive install-man: -install-pdf: install-pdf-recursive - -install-ps: install-ps-recursive - installcheck-am: maintainer-clean: maintainer-clean-recursive @@ -457,24 +454,22 @@ ps-am: -uninstall-am: +uninstall-am: uninstall-info-am -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ - install-strip +uninstall-info: uninstall-info-recursive -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am check check-am clean clean-generic clean-libtool \ - ctags ctags-recursive distclean distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ + clean clean-generic clean-libtool clean-recursive ctags \ + ctags-recursive distclean distclean-generic distclean-libtool \ + distclean-recursive 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 \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am + maintainer-clean-generic maintainer-clean-recursive \ + mostlyclean mostlyclean-generic mostlyclean-libtool \ + mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-info-am # 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. diff -Nru faac-1.26/common/mp4v2/3gp.cpp faac-1.28/common/mp4v2/3gp.cpp --- faac-1.26/common/mp4v2/3gp.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/3gp.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -41,19 +41,6 @@ } } - m_fileName = MP4Stralloc(fileName); - m_mode = 'r'; - // first load meta-info into memory - Open("rb"); - ReadFromFile(); - - CacheProperties(); // of moov atom - - // now switch over to writing the new file - MP4Free(m_fileName); - // create a temporary file - m_fileName = MP4Stralloc(TempFileName()); - MakeFtypAtom( majorBrand ? majorBrand : (char*)brand, majorBrand ? minorVersion : _3GP_MINOR_VERSION, @@ -71,75 +58,49 @@ } } - - FILE* pReadFile = m_pFile; - m_pFile = NULL; - m_mode = 'w'; - - Open("wb"); - - SetIntegerProperty("moov.mvhd.modificationTime", - MP4GetAbsTimestamp()); - - // writing meta info in the optimal order - ((MP4RootAtom*)m_pRootAtom)->BeginOptimalWrite(); - - // write data in optimal order - RewriteMdat(pReadFile, m_pFile); - - // finish writing - ((MP4RootAtom*)m_pRootAtom)->FinishOptimalWrite(); - - // cleanup - fclose(m_pFile); - m_pFile = NULL; - fclose(pReadFile); - - // move temporary file into place - Rename(m_fileName, fileName); } void MP4File::MakeFtypAtom(char* majorBrand, u_int32_t minorVersion, char** supportedBrands, u_int32_t supportedBrandsCount) { bool rewriteNeeded = false; u_int32_t currentSupportedBrandsCount; - u_int64_t currentSize; u_int32_t i; - - MP4Atom* ftypAtom = m_pRootAtom->FindAtom("ftyp"); - ASSERT(ftypAtom); - - currentSize = ftypAtom->GetSize(); - + if (ftypAtom == NULL) { + ftypAtom = InsertChildAtom(m_pRootAtom, "ftyp", 0); + } + if (majorBrand == NULL) + return; MP4StringProperty* pMajorBrandProperty; - ftypAtom->FindProperty( - "ftyp.majorBrand", - (MP4Property**)&pMajorBrandProperty); + if (!ftypAtom->FindProperty( + "ftyp.majorBrand", + (MP4Property**)&pMajorBrandProperty)) + return; pMajorBrandProperty->SetValue(majorBrand); MP4Integer32Property* pMinorVersionProperty; - ftypAtom->FindProperty( - "ftype.minorVersion", - (MP4Property**)&pMinorVersionProperty); + if (!ftypAtom->FindProperty( + "ftype.minorVersion", + (MP4Property**)&pMinorVersionProperty)) + return; pMinorVersionProperty->SetValue(minorVersion); MP4Integer32Property* pCompatibleBrandsCountProperty; - ftypAtom->FindProperty( + if (!ftypAtom->FindProperty( "ftyp.compatibleBrandsCount", - (MP4Property**)&pCompatibleBrandsCountProperty); + (MP4Property**)&pCompatibleBrandsCountProperty)) return; currentSupportedBrandsCount = pCompatibleBrandsCountProperty->GetValue(); MP4TableProperty* pCompatibleBrandsProperty; - ftypAtom->FindProperty( + if (!ftypAtom->FindProperty( "ftyp.compatibleBrands", - (MP4Property**)&pCompatibleBrandsProperty); + (MP4Property**)&pCompatibleBrandsProperty)) return; MP4StringProperty* pBrandProperty = (MP4StringProperty*) pCompatibleBrandsProperty->GetProperty(0); diff -Nru faac-1.26/common/mp4v2/atom_amr.cpp faac-1.28/common/mp4v2/atom_amr.cpp --- faac-1.26/common/mp4v2/atom_amr.cpp 1970-01-01 00:00:00.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_amr.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -0,0 +1,65 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * 3GPP features implementation is based on 3GPP's TS26.234-v5.60, + * and was contributed by Ximpo Group Ltd. + * + * Portions created by Ximpo Group Ltd. are + * Copyright (C) Ximpo Group Ltd. 2003, 2004. All Rights Reserved. + * + * Contributor(s): + * Ximpo Group Ltd. mp4v2@ximpo.com + */ + +#include "mp4common.h" + +MP4AmrAtom::MP4AmrAtom(const char *type) + : MP4Atom(type) +{ + AddReserved("reserved1", 6); /* 0 */ + + AddProperty( /* 1 */ + new MP4Integer16Property("dataReferenceIndex")); + + AddReserved("reserved2", 16); /* 2 */ + + AddProperty( /* 3 */ + new MP4Integer16Property("timeScale")); + + AddReserved("reserved3", 2); /* 4 */ + + ExpectChildAtom("damr", Required, OnlyOne); +} + +void MP4AmrAtom::Generate() +{ + MP4Atom::Generate(); + + ((MP4Integer16Property*)m_pProperties[1])->SetValue(1); + + // property reserved2 has non-zero fixed values + static u_int8_t reserved2[16] = { + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x10, + 0x00, 0x00, 0x00, 0x00, + }; + m_pProperties[2]->SetReadOnly(false); + ((MP4BytesProperty*)m_pProperties[2])-> + SetValue(reserved2, sizeof(reserved2)); + m_pProperties[2]->SetReadOnly(true); +} diff -Nru faac-1.26/common/mp4v2/atom_avc1.cpp faac-1.28/common/mp4v2/atom_avc1.cpp --- faac-1.26/common/mp4v2/atom_avc1.cpp 1970-01-01 00:00:00.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_avc1.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -0,0 +1,81 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2004. All Rights Reserved. + * + * Contributor(s): + * Bill May wmay@cisco.com + */ + +#include "mp4common.h" + +MP4Avc1Atom::MP4Avc1Atom() + : MP4Atom("avc1") +{ + AddReserved("reserved1", 6); /* 0 */ + + AddProperty( /* 1 */ + new MP4Integer16Property("dataReferenceIndex")); + + AddReserved("reserved2", 16); /* 2 */ + + AddProperty( /* 3 */ + new MP4Integer16Property("width")); + AddProperty( /* 4 */ + new MP4Integer16Property("height")); + + AddReserved("reserved3", 14); /* 5 */ + + MP4StringProperty* pProp = + new MP4StringProperty("compressorName"); + pProp->SetFixedLength(32); + pProp->SetValue("AVC Coding"); + AddProperty(pProp); /* 6 */ + + AddReserved("reserved4", 4); /* 7 */ + + ExpectChildAtom("avcC", Required, OnlyOne); + ExpectChildAtom("btrt", Optional, OnlyOne); + // for now ExpectChildAtom("m4ds", Optional, OnlyOne); +} + +void MP4Avc1Atom::Generate() +{ + MP4Atom::Generate(); + + ((MP4Integer16Property*)m_pProperties[1])->SetValue(1); + + // property reserved3 has non-zero fixed values + static u_int8_t reserved3[14] = { + 0x00, 0x48, 0x00, 0x00, + 0x00, 0x48, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, + }; + m_pProperties[5]->SetReadOnly(false); + ((MP4BytesProperty*)m_pProperties[5])-> + SetValue(reserved3, sizeof(reserved3)); + m_pProperties[5]->SetReadOnly(true); + + // property reserved4 has non-zero fixed values + static u_int8_t reserved4[4] = { + 0x00, 0x18, 0xFF, 0xFF, + }; + m_pProperties[7]->SetReadOnly(false); + ((MP4BytesProperty*)m_pProperties[7])-> + SetValue(reserved4, sizeof(reserved4)); + m_pProperties[7]->SetReadOnly(true); +} + diff -Nru faac-1.26/common/mp4v2/atom_avcC.cpp faac-1.28/common/mp4v2/atom_avcC.cpp --- faac-1.26/common/mp4v2/atom_avcC.cpp 1970-01-01 00:00:00.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_avcC.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -0,0 +1,261 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2004. All Rights Reserved. + * + * Contributor(s): + * Bill May wmay@cisco.com + */ + +#include "mp4common.h" + +/* + * SizeTableProperty is a special version of the MP4TableProperty - + * the BytesProperty will need to set the value before it can read + * from the file + */ +class SizeTableProperty : public MP4TableProperty +{ + public: + SizeTableProperty(char *name, MP4IntegerProperty *pCountProperty) : + MP4TableProperty(name, pCountProperty) {}; + protected: + void ReadEntry(MP4File *pFile, u_int32_t index) { + // Each table has a size, followed by the length field + // first, read the length + m_pProperties[0]->Read(pFile, index); + MP4IntegerProperty *pIntProp = (MP4IntegerProperty *)m_pProperties[0]; + // set the size in the bytes property + MP4BytesProperty *pBytesProp = (MP4BytesProperty *)m_pProperties[1]; + pBytesProp->SetValueSize(pIntProp->GetValue(index), index); + // And read the bytes + m_pProperties[1]->Read(pFile, index); + }; +}; + +MP4AvcCAtom::MP4AvcCAtom() + : MP4Atom("avcC") +{ + MP4BitfieldProperty *pCount; + MP4TableProperty *pTable; + + AddProperty( new MP4Integer8Property("configurationVersion")); /* 0 */ + + AddProperty( new MP4Integer8Property("AVCProfileIndication")); /* 1 */ + + AddProperty( new MP4Integer8Property("profile_compatibility")); /* 2 */ + + AddProperty( new MP4Integer8Property("AVCLevelIndication")); /* 3 */ + + AddProperty( new MP4BitfieldProperty("reserved", 6)); /* 4 */ + AddProperty( new MP4BitfieldProperty("lengthSizeMinusOne", 2)); /* 5 */ + AddProperty( new MP4BitfieldProperty("reserved1", 3)); /* 6 */ + pCount = new MP4BitfieldProperty("numOfSequenceParameterSets", 5); + AddProperty(pCount); /* 7 */ + + pTable = new SizeTableProperty("sequenceEntries", pCount); + AddProperty(pTable); /* 8 */ + pTable->AddProperty(new MP4Integer16Property("sequenceParameterSetLength")); + pTable->AddProperty(new MP4BytesProperty("sequenceParameterSetNALUnit")); + + MP4Integer8Property *pCount2 = new MP4Integer8Property("numOfPictureParameterSets"); + AddProperty(pCount2); /* 9 */ + + pTable = new SizeTableProperty("pictureEntries", pCount2); + AddProperty(pTable); /* 10 */ + pTable->AddProperty(new MP4Integer16Property("pictureParameterSetLength")); + pTable->AddProperty(new MP4BytesProperty("pictureParameterSetNALUnit")); +} + +void MP4AvcCAtom::Generate() +{ + MP4Atom::Generate(); + + ((MP4Integer8Property*)m_pProperties[0])->SetValue(1); + + m_pProperties[4]->SetReadOnly(false); + ((MP4BitfieldProperty*)m_pProperties[4])->SetValue(0x3f); + m_pProperties[4]->SetReadOnly(true); + + m_pProperties[6]->SetReadOnly(false); + ((MP4BitfieldProperty*)m_pProperties[6])->SetValue(0x7); + m_pProperties[6]->SetReadOnly(true); +#if 0 + // property reserved4 has non-zero fixed values + static u_int8_t reserved4[4] = { + 0x00, 0x18, 0xFF, 0xFF, + }; + m_pProperties[7]->SetReadOnly(false); + ((MP4BytesProperty*)m_pProperties[7])-> + SetValue(reserved4, sizeof(reserved4)); + m_pProperties[7]->SetReadOnly(true); +#endif +} + +// +// Clone - clone my properties to destination atom +// +// this method simplifies duplicating avcC atom properties from +// source to destination file using a single API rather than +// having to copy each property. This API encapsulates the object +// so the application layer need not concern with each property +// thereby isolating any future changes to atom properties. +// +// ---------------------------------------- +// property description +// ---------------------------------------- +// +// 0 configurationVersion +// 1 AVCProfileIndication +// 2 profile_compatibility +// 3 AVCLevelIndication +// 4 reserved +// 5 lengthSizeMinusOne +// 6 reserved +// 7 number of SPS +// 8 SPS entries +// 9 number of PPS +// 10 PPS entries +// +// +void MP4AvcCAtom::Clone(MP4AvcCAtom *dstAtom) +{ + + MP4Property *dstProperty; + MP4TableProperty *pTable; + u_int16_t i16; + u_int64_t i32; + u_int64_t i64; + u_int8_t *tmp; + + // source pointer Property I16 + MP4Integer16Property *spPI16; + // source pointer Property Bytes + MP4BytesProperty *spPB; + + // dest pointer Property I16 + MP4Integer16Property *dpPI16; + // dest pointer Property Bytes + MP4BytesProperty *dpPB; + + + // start with defaults and reserved fields + dstAtom->Generate(); + + // 0, 4, 6 are now generated from defaults + // leaving 1, 2, 3, 5, 7, 8, 9, 10 to export + + dstProperty=dstAtom->GetProperty(1); + ((MP4Integer8Property *)dstProperty)->SetValue( + ((MP4Integer8Property *)m_pProperties[1])->GetValue()); + + dstProperty=dstAtom->GetProperty(2); + ((MP4Integer8Property *)dstProperty)->SetValue( + ((MP4Integer8Property *)m_pProperties[2])->GetValue()); + + dstProperty=dstAtom->GetProperty(3); + ((MP4Integer8Property *)dstProperty)->SetValue( + ((MP4Integer8Property *)m_pProperties[3])->GetValue()); + + dstProperty=dstAtom->GetProperty(5); + ((MP4BitfieldProperty *)dstProperty)->SetValue( + ((MP4BitfieldProperty *)m_pProperties[5])->GetValue()); + + // + // 7 and 8 are related SPS (one set of sequence parameters) + // + // first the count bitfield + // + dstProperty=dstAtom->GetProperty(7); + dstProperty->SetReadOnly(false); + ((MP4BitfieldProperty *)dstProperty)->SetValue( + ((MP4BitfieldProperty *)m_pProperties[7])->GetValue()); + dstProperty->SetReadOnly(true); + + // next export SPS Length and NAL bytes */ + + // first source pointers + pTable = (MP4TableProperty *) m_pProperties[8]; + spPI16 = (MP4Integer16Property *)pTable->GetProperty(0); + spPB = (MP4BytesProperty *)pTable->GetProperty(1); + + // now dest pointers + dstProperty=dstAtom->GetProperty(8); + pTable = (MP4TableProperty *) dstProperty; + dpPI16 = (MP4Integer16Property *)pTable->GetProperty(0); + dpPB = (MP4BytesProperty *)pTable->GetProperty(1); + + // sps length + i16 = spPI16->GetValue(); + i64 = i16; + // FIXME - this leaves m_maxNumElements =2 + // but src atom m_maxNumElements is 1 + dpPI16->InsertValue(i64, 0); + + // export byte array + i32 = i16; + // copy bytes to local buffer + tmp = (u_int8_t *)MP4Malloc(i32); + ASSERT(tmp != NULL); + spPB->CopyValue(tmp, 0); + // set element count + dpPB->SetCount(1); + // copy bytes + dpPB->SetValue(tmp, i32, 0); + MP4Free((void *)tmp); + + // + // 9 and 10 are related PPS (one set of picture parameters) + // + // first the integer8 count + // + dstProperty=dstAtom->GetProperty(9); + dstProperty->SetReadOnly(false); + ((MP4Integer8Property *)dstProperty)->SetValue( + ((MP4Integer8Property *)m_pProperties[9])->GetValue()); + dstProperty->SetReadOnly(true); + + // next export PPS Length and NAL bytes */ + + // first source pointers + pTable = (MP4TableProperty *) m_pProperties[10]; + spPI16 = (MP4Integer16Property *)pTable->GetProperty(0); + spPB = (MP4BytesProperty *)pTable->GetProperty(1); + + // now dest pointers + dstProperty=dstAtom->GetProperty(10); + pTable = (MP4TableProperty *) dstProperty; + dpPI16 = (MP4Integer16Property *)pTable->GetProperty(0); + dpPB = (MP4BytesProperty *)pTable->GetProperty(1); + + // pps length + i16 = spPI16->GetValue(); + i64 = i16; + dpPI16->InsertValue(i64, 0); + + // export byte array + i32 = i16; + // copy bytes to local buffer + tmp = (u_int8_t *)MP4Malloc(i32); + ASSERT(tmp != NULL); + spPB->CopyValue(tmp, 0); + // set element count + dpPB->SetCount(1); + // copy bytes + dpPB->SetValue(tmp, i32, 0); + MP4Free((void *)tmp); +} + + diff -Nru faac-1.26/common/mp4v2/atom_bitr.cpp faac-1.28/common/mp4v2/atom_bitr.cpp --- faac-1.26/common/mp4v2/atom_bitr.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_bitr.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * 3GPP features implementation is based on 3GPP's TS26.234-v5.60, - * and was contributed by Ximpo Group Ltd. - * - * Portions created by Ximpo Group Ltd. are - * Copyright (C) Ximpo Group Ltd. 2003, 2004. All Rights Reserved. - * - * Contributor(s): - * Ximpo Group Ltd. mp4v2@ximpo.com - */ - -#include "mp4common.h" - -MP4BitrAtom::MP4BitrAtom() - : MP4Atom("bitr") -{ - AddProperty( /* 0 */ - new MP4Integer32Property("avgBitrate")); - - AddProperty( /* 1 */ - new MP4Integer32Property("maxBitrate")); - - -} - diff -Nru faac-1.26/common/mp4v2/atom_co64.cpp faac-1.28/common/mp4v2/atom_co64.cpp --- faac-1.26/common/mp4v2/atom_co64.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_co64.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4Co64Atom::MP4Co64Atom() - : MP4Atom("co64") -{ - AddVersionAndFlags(); - - MP4Integer32Property* pCount = - new MP4Integer32Property("entryCount"); - AddProperty(pCount); - - MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); - AddProperty(pTable); - - pTable->AddProperty( - new MP4Integer64Property("chunkOffset")); -} diff -Nru faac-1.26/common/mp4v2/atom_cprt.cpp faac-1.28/common/mp4v2/atom_cprt.cpp --- faac-1.26/common/mp4v2/atom_cprt.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_cprt.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4CprtAtom::MP4CprtAtom() - : MP4Atom("cprt") -{ - AddVersionAndFlags(); - AddProperty( - new MP4Integer16Property("language")); - AddProperty( - new MP4StringProperty("notice")); -} diff -Nru faac-1.26/common/mp4v2/atom_ctts.cpp faac-1.28/common/mp4v2/atom_ctts.cpp --- faac-1.26/common/mp4v2/atom_ctts.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_ctts.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4CttsAtom::MP4CttsAtom() - : MP4Atom("ctts") -{ - AddVersionAndFlags(); - - MP4Integer32Property* pCount = - new MP4Integer32Property("entryCount"); - AddProperty(pCount); - - MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); - AddProperty(pTable); - - pTable->AddProperty( - new MP4Integer32Property("sampleCount")); - pTable->AddProperty( - new MP4Integer32Property("sampleOffset")); -} diff -Nru faac-1.26/common/mp4v2/atom_dimm.cpp faac-1.28/common/mp4v2/atom_dimm.cpp --- faac-1.26/common/mp4v2/atom_dimm.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_dimm.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4DimmAtom::MP4DimmAtom() - : MP4Atom("dimm") -{ - AddProperty( // bytes of immediate data - new MP4Integer64Property("bytes")); -} diff -Nru faac-1.26/common/mp4v2/atom_dinf.cpp faac-1.28/common/mp4v2/atom_dinf.cpp --- faac-1.26/common/mp4v2/atom_dinf.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_dinf.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4DinfAtom::MP4DinfAtom() - : MP4Atom("dinf") -{ - ExpectChildAtom("dref", Required, OnlyOne); -} diff -Nru faac-1.26/common/mp4v2/atom_dmax.cpp faac-1.28/common/mp4v2/atom_dmax.cpp --- faac-1.26/common/mp4v2/atom_dmax.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_dmax.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4DmaxAtom::MP4DmaxAtom() - : MP4Atom("dmax") -{ - AddProperty( // max packet duration - new MP4Integer32Property("milliSecs")); -} diff -Nru faac-1.26/common/mp4v2/atom_dmed.cpp faac-1.28/common/mp4v2/atom_dmed.cpp --- faac-1.26/common/mp4v2/atom_dmed.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_dmed.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4DmedAtom::MP4DmedAtom() - : MP4Atom("dmed") -{ - AddProperty( // bytes sent from media data - new MP4Integer64Property("bytes")); -} diff -Nru faac-1.26/common/mp4v2/atom_dref.cpp faac-1.28/common/mp4v2/atom_dref.cpp --- faac-1.26/common/mp4v2/atom_dref.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_dref.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -33,6 +33,7 @@ ExpectChildAtom("url ", Optional, Many); ExpectChildAtom("urn ", Optional, Many); + ExpectChildAtom("alis", Optional, Many); } void MP4DrefAtom::Read() diff -Nru faac-1.26/common/mp4v2/atom_drep.cpp faac-1.28/common/mp4v2/atom_drep.cpp --- faac-1.26/common/mp4v2/atom_drep.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_drep.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4DrepAtom::MP4DrepAtom() - : MP4Atom("drep") -{ - AddProperty( // bytes of repeated data - new MP4Integer64Property("bytes")); -} diff -Nru faac-1.26/common/mp4v2/atom_edts.cpp faac-1.28/common/mp4v2/atom_edts.cpp --- faac-1.26/common/mp4v2/atom_edts.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_edts.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4EdtsAtom::MP4EdtsAtom() - : MP4Atom("edts") -{ - ExpectChildAtom("elst", Required, OnlyOne); -} diff -Nru faac-1.26/common/mp4v2/atom_encv.cpp faac-1.28/common/mp4v2/atom_encv.cpp --- faac-1.26/common/mp4v2/atom_encv.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_encv.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -48,6 +48,7 @@ ExpectChildAtom("esds", Required, OnlyOne); ExpectChildAtom("sinf", Required, OnlyOne); + ExpectChildAtom("avcC", Optional, OnlyOne); } void MP4EncvAtom::Generate() diff -Nru faac-1.26/common/mp4v2/atom_esds.cpp faac-1.28/common/mp4v2/atom_esds.cpp --- faac-1.26/common/mp4v2/atom_esds.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_esds.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4EsdsAtom::MP4EsdsAtom() - : MP4Atom("esds") -{ - AddVersionAndFlags(); - AddProperty( - new MP4DescriptorProperty(NULL, - MP4ESDescrTag, 0, Required, OnlyOne)); -} diff -Nru faac-1.26/common/mp4v2/atom_free.cpp faac-1.28/common/mp4v2/atom_free.cpp --- faac-1.26/common/mp4v2/atom_free.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_free.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -37,7 +37,13 @@ bool use64 = (GetSize() > (0xFFFFFFFF - 8)); BeginWrite(use64); +#if 1 + for (uint64_t ix = 0; ix < GetSize(); ix++) { + m_pFile->WriteUInt8(0); + } +#else m_pFile->SetPosition(m_pFile->GetPosition() + GetSize()); +#endif FinishWrite(use64); } diff -Nru faac-1.26/common/mp4v2/atom_frma.cpp faac-1.28/common/mp4v2/atom_frma.cpp --- faac-1.26/common/mp4v2/atom_frma.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_frma.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Alix Marchandise-Franquet alix@cisco.com - * - * Add the OriginalFormatBox for ISMACrypt - * contains the original format of the data (i.e. decrypted format) - */ - -#include "mp4common.h" - -MP4FrmaAtom::MP4FrmaAtom() - : MP4Atom("frma") -{ - AddProperty( /* 0 */ - new MP4Integer32Property("data-format")); -} diff -Nru faac-1.26/common/mp4v2/atom_gmin.cpp faac-1.28/common/mp4v2/atom_gmin.cpp --- faac-1.26/common/mp4v2/atom_gmin.cpp 1970-01-01 00:00:00.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_gmin.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -0,0 +1,49 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * Contributer has declined to give copyright information, and gives + * it freely to the world. + * + * Contributor(s): + */ + +#include "mp4common.h" + +MP4GminAtom::MP4GminAtom() + : MP4Atom("gmin") +{ + + AddVersionAndFlags(); /* 0, 1 */ + + AddProperty(new MP4Integer16Property("graphicsMode")); /* 2 */ + AddProperty(new MP4Integer16Property("opColorRed")); /* 3 */ + AddProperty(new MP4Integer16Property("opColorGreen")); /* 4 */ + AddProperty(new MP4Integer16Property("opColorBlue")); /* 5 */ + AddProperty(new MP4Integer16Property("balance")); /* 6 */ + AddReserved("reserved", 2); /* 7 */ + +} + +void MP4GminAtom::Generate() +{ + + MP4Atom::Generate(); + + ((MP4Integer16Property*)m_pProperties[2])->SetValue(0x0040); + ((MP4Integer16Property*)m_pProperties[3])->SetValue(0x8000); + ((MP4Integer16Property*)m_pProperties[4])->SetValue(0x8000); + ((MP4Integer16Property*)m_pProperties[5])->SetValue(0x8000); + ((MP4Integer16Property*)m_pProperties[6])->SetValue(0x0000); + +} + diff -Nru faac-1.26/common/mp4v2/atom_hdlr.cpp faac-1.28/common/mp4v2/atom_hdlr.cpp --- faac-1.26/common/mp4v2/atom_hdlr.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_hdlr.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -42,13 +42,15 @@ { // read all the properties but the "name" field ReadProperties(0, 5); + uint64_t pos = m_pFile->GetPosition(); + uint64_t end = GetEnd(); + if (pos == end) return; // take a peek at the next byte u_int8_t strLength; m_pFile->PeekBytes(&strLength, 1); - // if the value matches the remaining atom length - if (m_pFile->GetPosition() + strLength + 1 == GetEnd()) { + if (pos + strLength + 1 == end) { // read a counted string MP4StringProperty* pNameProp = (MP4StringProperty*)m_pProperties[5]; diff -Nru faac-1.26/common/mp4v2/atom_hmhd.cpp faac-1.28/common/mp4v2/atom_hmhd.cpp --- faac-1.26/common/mp4v2/atom_hmhd.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_hmhd.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4HmhdAtom::MP4HmhdAtom() - : MP4Atom("hmhd") -{ - AddVersionAndFlags(); - - AddProperty( - new MP4Integer16Property("maxPduSize")); - AddProperty( - new MP4Integer16Property("avgPduSize")); - AddProperty( - new MP4Integer32Property("maxBitRate")); - AddProperty( - new MP4Integer32Property("avgBitRate")); - AddProperty( - new MP4Integer32Property("slidingAvgBitRate")); -} diff -Nru faac-1.26/common/mp4v2/atom_href.cpp faac-1.28/common/mp4v2/atom_href.cpp --- faac-1.26/common/mp4v2/atom_href.cpp 1970-01-01 00:00:00.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_href.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -0,0 +1,40 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2005. All Rights Reserved. + * + * Contributor(s): + * Bill May wmay@cisco.com + */ + +#include "mp4common.h" + +MP4HrefAtom::MP4HrefAtom() + : MP4Atom("href") +{ + AddReserved("reserved1", 6); /* 0 */ + + AddProperty( /* 1 */ + new MP4Integer16Property("dataReferenceIndex")); + ExpectChildAtom("burl", Optional, OnlyOne); +} + +void MP4HrefAtom::Generate() +{ + MP4Atom::Generate(); + + ((MP4Integer16Property*)m_pProperties[1])->SetValue(1); + +} diff -Nru faac-1.26/common/mp4v2/atom_iKMS.cpp faac-1.28/common/mp4v2/atom_iKMS.cpp --- faac-1.26/common/mp4v2/atom_iKMS.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_iKMS.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Alix Marchandise-Franquet alix@cisco.com - * - * ISMAKMSBox for ISMACrypt - * Do we care about the string length? Do we need to handle the null-term - * issue like in the hdlr atom? - */ - -#include "mp4common.h" - -MP4IKMSAtom::MP4IKMSAtom() - : MP4Atom("iKMS") -{ - AddVersionAndFlags(); /* 0, 1 */ - MP4StringProperty* pProp = new MP4StringProperty("kms_URI"); - AddProperty(pProp); /* 2 */ -} diff -Nru faac-1.26/common/mp4v2/atom_iods.cpp faac-1.28/common/mp4v2/atom_iods.cpp --- faac-1.26/common/mp4v2/atom_iods.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_iods.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4IodsAtom::MP4IodsAtom() - : MP4Atom("iods") -{ - AddVersionAndFlags(); - AddProperty( - new MP4DescriptorProperty(NULL, - MP4FileIODescrTag, MP4FileODescrTag, Required, OnlyOne)); -} diff -Nru faac-1.26/common/mp4v2/atom_iSFM.cpp faac-1.28/common/mp4v2/atom_iSFM.cpp --- faac-1.26/common/mp4v2/atom_iSFM.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_iSFM.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Alix Marchandise-Franquet alix@cisco.com - * - * ISMASampleFormatBox for ISMACrypt - */ - -#include "mp4common.h" - -MP4ISFMAtom::MP4ISFMAtom() - : MP4Atom("iSFM") -{ - AddVersionAndFlags(); /* 0, 1 */ - AddProperty( /* 2 */ - new MP4BitfieldProperty("selective-encryption", 1)); - AddProperty( /* 3 */ - new MP4BitfieldProperty("reserved", 7)); - AddProperty( /* 4 */ - new MP4Integer8Property("key-indicator-length")); - AddProperty( /* 5 */ - new MP4Integer8Property("IV-length")); -} diff -Nru faac-1.26/common/mp4v2/atom_maxr.cpp faac-1.28/common/mp4v2/atom_maxr.cpp --- faac-1.26/common/mp4v2/atom_maxr.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_maxr.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4MaxrAtom::MP4MaxrAtom() - : MP4Atom("maxr") -{ - AddProperty( - new MP4Integer32Property("granularity")); - AddProperty( - new MP4Integer32Property("bytes")); -} diff -Nru faac-1.26/common/mp4v2/atom_mdia.cpp faac-1.28/common/mp4v2/atom_mdia.cpp --- faac-1.26/common/mp4v2/atom_mdia.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_mdia.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4MdiaAtom::MP4MdiaAtom() - : MP4Atom("mdia") -{ - ExpectChildAtom("mdhd", Required, OnlyOne); - ExpectChildAtom("hdlr", Required, OnlyOne); - ExpectChildAtom("minf", Required, OnlyOne); -} diff -Nru faac-1.26/common/mp4v2/atom_meta.cpp faac-1.28/common/mp4v2/atom_meta.cpp --- faac-1.26/common/mp4v2/atom_meta.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_meta.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -23,42 +23,15 @@ #include "mp4common.h" -MP4MetaAtom::MP4MetaAtom() - : MP4Atom("meta") +MP4Meta1Atom::MP4Meta1Atom(const char *name) + : MP4Atom(name) { - AddVersionAndFlags(); /* 0, 1 */ - - ExpectChildAtom("hdlr", Required, OnlyOne); - ExpectChildAtom("ilst", Required, OnlyOne); -} - -MP4MeanAtom::MP4MeanAtom() - : MP4Atom("mean") -{ - AddVersionAndFlags(); /* 0, 1 */ + AddVersionAndFlags(); /* 0, 1 */ - AddProperty( - new MP4BytesProperty("metadata")); /* 2 */ + AddProperty(new MP4BytesProperty("metadata")); /* 2 */ } -void MP4MeanAtom::Read() -{ - // calculate size of the metadata from the atom size - ((MP4BytesProperty*)m_pProperties[2])->SetValueSize(m_size - 4); - - MP4Atom::Read(); -} - -MP4NameAtom::MP4NameAtom() - : MP4Atom("name") -{ - AddVersionAndFlags(); /* 0, 1 */ - - AddProperty( - new MP4BytesProperty("metadata")); /* 2 */ -} - -void MP4NameAtom::Read() +void MP4Meta1Atom::Read() { // calculate size of the metadata from the atom size ((MP4BytesProperty*)m_pProperties[2])->SetValueSize(m_size - 4); @@ -84,114 +57,28 @@ MP4Atom::Read(); } -MP4IlstAtom::MP4IlstAtom() - : MP4Atom("ilst") -{ - ExpectChildAtom("\251nam", Optional, OnlyOne); /* name */ - ExpectChildAtom("\251ART", Optional, OnlyOne); /* artist */ - ExpectChildAtom("\251wrt", Optional, OnlyOne); /* writer */ - ExpectChildAtom("\251alb", Optional, OnlyOne); /* album */ - ExpectChildAtom("\251day", Optional, OnlyOne); /* date */ - ExpectChildAtom("\251too", Optional, OnlyOne); /* tool */ - ExpectChildAtom("\251cmt", Optional, OnlyOne); /* comment */ - ExpectChildAtom("\251gen", Optional, OnlyOne); /* custom genre */ - ExpectChildAtom("trkn", Optional, OnlyOne); /* tracknumber */ - ExpectChildAtom("disk", Optional, OnlyOne); /* disknumber */ - ExpectChildAtom("gnre", Optional, OnlyOne); /* genre (ID3v1 index + 1) */ - ExpectChildAtom("cpil", Optional, OnlyOne); /* compilation */ - ExpectChildAtom("tmpo", Optional, OnlyOne); /* BPM */ - ExpectChildAtom("covr", Optional, OnlyOne); /* cover art */ - ExpectChildAtom("----", Optional, Many); /* ---- free form */ -} - -MP4DashAtom::MP4DashAtom() - : MP4Atom("----") -{ - ExpectChildAtom("mean", Required, OnlyOne); - ExpectChildAtom("name", Required, OnlyOne); - ExpectChildAtom("data", Required, OnlyOne); -} - -MP4NamAtom::MP4NamAtom() - : MP4Atom("\251nam") -{ - ExpectChildAtom("data", Required, OnlyOne); -} - -MP4ArtAtom::MP4ArtAtom() - : MP4Atom("\251ART") -{ - ExpectChildAtom("data", Required, OnlyOne); -} -MP4WrtAtom::MP4WrtAtom() - : MP4Atom("\251wrt") +// MP4Meta2Atom is for \251nam and \251cmt flags, which appear differently +// in .mov and in itunes file. In .movs, they appear under udata, in +// itunes, they appear under ilst. +MP4Meta2Atom::MP4Meta2Atom (const char *name) : MP4Atom(name) { - ExpectChildAtom("data", Required, OnlyOne); } -MP4AlbAtom::MP4AlbAtom() - : MP4Atom("\251alb") +void MP4Meta2Atom::Read () { - ExpectChildAtom("data", Required, OnlyOne); -} + MP4Atom *parent = GetParentAtom(); + if (ATOMID(parent->GetType()) == ATOMID("udta")) { + // add data property + AddReserved("reserved2", 4); /* 0 */ -MP4CmtAtom::MP4CmtAtom() - : MP4Atom("\251cmt") -{ - ExpectChildAtom("data", Required, OnlyOne); -} - -MP4TrknAtom::MP4TrknAtom() - : MP4Atom("trkn") -{ - ExpectChildAtom("data", Required, OnlyOne); -} - -MP4DiskAtom::MP4DiskAtom() - : MP4Atom("disk") -{ - ExpectChildAtom("data", Required, OnlyOne); -} - -MP4DayAtom::MP4DayAtom() - : MP4Atom("\251day") -{ - ExpectChildAtom("data", Required, OnlyOne); -} - -MP4GenAtom::MP4GenAtom() - : MP4Atom("\251gen") -{ - ExpectChildAtom("data", Required, OnlyOne); -} - -MP4TooAtom::MP4TooAtom() - : MP4Atom("\251too") -{ - ExpectChildAtom("data", Required, OnlyOne); -} - -MP4GnreAtom::MP4GnreAtom() - : MP4Atom("gnre") -{ - ExpectChildAtom("data", Optional, OnlyOne); -} - -MP4CpilAtom::MP4CpilAtom() - : MP4Atom("cpil") -{ - ExpectChildAtom("data", Required, OnlyOne); -} - -MP4TmpoAtom::MP4TmpoAtom() - : MP4Atom("tmpo") -{ + AddProperty( + new MP4BytesProperty("metadata")); /* 1 */ + ((MP4BytesProperty*)m_pProperties[1])->SetValueSize(m_size - 4); + } else { ExpectChildAtom("data", Required, OnlyOne); + } + MP4Atom::Read(); } -MP4CovrAtom::MP4CovrAtom() - : MP4Atom("covr") -{ - ExpectChildAtom("data", Required, OnlyOne); -} + diff -Nru faac-1.26/common/mp4v2/atom_mfhd.cpp faac-1.28/common/mp4v2/atom_mfhd.cpp --- faac-1.26/common/mp4v2/atom_mfhd.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_mfhd.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4MfhdAtom::MP4MfhdAtom() - : MP4Atom("mfhd") -{ - AddVersionAndFlags(); /* 0, 1 */ - AddProperty( /* 2 */ - new MP4Integer32Property("sequenceNumber")); -} - diff -Nru faac-1.26/common/mp4v2/atom_minf.cpp faac-1.28/common/mp4v2/atom_minf.cpp --- faac-1.26/common/mp4v2/atom_minf.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_minf.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4MinfAtom::MP4MinfAtom() - : MP4Atom("minf") -{ - ExpectChildAtom("vmhd", Optional, OnlyOne); - ExpectChildAtom("smhd", Optional, OnlyOne); - ExpectChildAtom("hmhd", Optional, OnlyOne); - ExpectChildAtom("nmhd", Optional, OnlyOne); - ExpectChildAtom("dinf", Required, OnlyOne); - ExpectChildAtom("stbl", Required, OnlyOne); -} diff -Nru faac-1.26/common/mp4v2/atom_moof.cpp faac-1.28/common/mp4v2/atom_moof.cpp --- faac-1.26/common/mp4v2/atom_moof.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_moof.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4MoofAtom::MP4MoofAtom() - : MP4Atom("moof") -{ - ExpectChildAtom("mfhd", Required, OnlyOne); - ExpectChildAtom("traf", Optional, Many); -} - diff -Nru faac-1.26/common/mp4v2/atom_moov.cpp faac-1.28/common/mp4v2/atom_moov.cpp --- faac-1.26/common/mp4v2/atom_moov.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_moov.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4MoovAtom::MP4MoovAtom() - : MP4Atom("moov") -{ - ExpectChildAtom("mvhd", Required, OnlyOne); - ExpectChildAtom("iods", Required, OnlyOne); - ExpectChildAtom("trak", Required, Many); - ExpectChildAtom("udta", Optional, Many); - ExpectChildAtom("mvex", Optional, OnlyOne); -} - diff -Nru faac-1.26/common/mp4v2/atom_mvex.cpp faac-1.28/common/mp4v2/atom_mvex.cpp --- faac-1.26/common/mp4v2/atom_mvex.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_mvex.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4MvexAtom::MP4MvexAtom() - : MP4Atom("mvex") -{ - ExpectChildAtom("trex", Required, Many); -} diff -Nru faac-1.26/common/mp4v2/atom_nmhd.cpp faac-1.28/common/mp4v2/atom_nmhd.cpp --- faac-1.26/common/mp4v2/atom_nmhd.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_nmhd.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4NmhdAtom::MP4NmhdAtom() - : MP4Atom("nmhd") -{ - AddVersionAndFlags(); -} diff -Nru faac-1.26/common/mp4v2/atom_nump.cpp faac-1.28/common/mp4v2/atom_nump.cpp --- faac-1.26/common/mp4v2/atom_nump.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_nump.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4NumpAtom::MP4NumpAtom() - : MP4Atom("nump") -{ - AddProperty( // packets sent - new MP4Integer64Property("packets")); -} diff -Nru faac-1.26/common/mp4v2/atom_ohdr.cpp faac-1.28/common/mp4v2/atom_ohdr.cpp --- faac-1.26/common/mp4v2/atom_ohdr.cpp 1970-01-01 00:00:00.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_ohdr.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -0,0 +1,92 @@ +/** \file atom_ohdr.cpp + + \author Danijel Kopcinovic (danijel.kopcinovic@adnecto.net) +*/ + +#include "mp4common.h" + +/*! \brief Patch class for read/write operations when string is 0-length. + + We want to use string property, but mpeg4ip doesn't support ohdr way of + encoding of string (in ohdr atom we first have 3 lengths of 3 strings and + then their string values, and it cannot be simulated with any of the + current mpeg4ip string property parameters), so we have to write our own + Read() and Write() routines. +*/ +class OhdrMP4StringProperty: public MP4StringProperty { +public: + /*! \brief Constructor. + + \param name name of the property. + \param useCountedFormat counted format flag. + \param useUnicode unicode flag. + */ + OhdrMP4StringProperty(char* name, bool useCountedFormat = false, + bool useUnicode = false): MP4StringProperty(name, useCountedFormat, + useUnicode) { + } + + /*! \brief Read property from file. + + \param pFile input, file handle. + \param index input, index to read. + */ + void Read(MP4File* pFile, u_int32_t index = 0) { + MP4Free(m_values[index]); + m_values[index] = (char*)MP4Calloc(m_fixedLength + 1); + (void)pFile->ReadBytes((u_int8_t*)m_values[index], m_fixedLength); + } + + /*! \brief Write property to file. + + \param pFile input, file handle. + \param index input, index to write. + */ + void Write(MP4File* pFile, u_int32_t index = 0) { + pFile->WriteBytes((u_int8_t*)m_values[index], m_fixedLength); + } +}; + +/*! \brief OMA DRM headers atom. + + Contained in OMA DRM key management atom. It must contain content identifier. +*/ +/*! \brief Constructor. +*/ +MP4OhdrAtom::MP4OhdrAtom(): MP4Atom("ohdr") { + AddVersionAndFlags(); + + AddProperty(new MP4Integer8Property("EncryptionMethod")); + AddProperty(new MP4Integer8Property("EncryptionPadding")); + AddProperty(new MP4Integer64Property("PlaintextLength")); + AddProperty(new MP4Integer16Property("ContentIDLength")); + AddProperty(new MP4Integer16Property("RightsIssuerURLLength")); + AddProperty(new MP4Integer16Property("TextualHeadersLength")); + AddProperty(new OhdrMP4StringProperty("ContentID")); + AddProperty(new OhdrMP4StringProperty("RightsIssuerURL")); + AddProperty(new MP4BytesProperty("TextualHeaders")); +} + +MP4OhdrAtom::~MP4OhdrAtom() { +} + +/*! \brief Read atom. +*/ +void MP4OhdrAtom::Read() { + ReadProperties(0, 8); + MP4Property* lProperty; + MP4Property* property; + lProperty = GetProperty(5); + property = GetProperty(8); + ((OhdrMP4StringProperty*)property)->SetFixedLength( + ((MP4Integer16Property*)lProperty)->GetValue()); + lProperty = GetProperty(6); + property = GetProperty(9); + ((OhdrMP4StringProperty*)property)->SetFixedLength( + ((MP4Integer16Property*)lProperty)->GetValue()); + lProperty = GetProperty(7); + property = GetProperty(10); + ((MP4BytesProperty*)property)->SetFixedSize( + ((MP4Integer16Property*)lProperty)->GetValue()); + ReadProperties(8, 3); +} diff -Nru faac-1.26/common/mp4v2/atom_payt.cpp faac-1.28/common/mp4v2/atom_payt.cpp --- faac-1.26/common/mp4v2/atom_payt.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_payt.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4PaytAtom::MP4PaytAtom() - : MP4Atom("payt") -{ - AddProperty( - new MP4Integer32Property("payloadNumber")); - AddProperty( - new MP4StringProperty("rtpMap", Counted)); -} diff -Nru faac-1.26/common/mp4v2/atom_pmax.cpp faac-1.28/common/mp4v2/atom_pmax.cpp --- faac-1.26/common/mp4v2/atom_pmax.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_pmax.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4PmaxAtom::MP4PmaxAtom() - : MP4Atom("pmax") -{ - AddProperty( // max packet size - new MP4Integer32Property("bytes")); -} diff -Nru faac-1.26/common/mp4v2/atom_root.cpp faac-1.28/common/mp4v2/atom_root.cpp --- faac-1.26/common/mp4v2/atom_root.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_root.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -24,8 +24,8 @@ MP4RootAtom::MP4RootAtom() : MP4Atom(NULL) { - ExpectChildAtom("ftyp", Required, OnlyOne); ExpectChildAtom("moov", Required, OnlyOne); + ExpectChildAtom("ftyp", Optional, OnlyOne); ExpectChildAtom("mdat", Optional, Many); ExpectChildAtom("free", Optional, Many); ExpectChildAtom("skip", Optional, Many); @@ -85,6 +85,7 @@ } } ASSERT(i < size); + ASSERT(pMoovAtom != NULL); // rewrite moov so that updated chunkOffsets are written to disk m_pFile->SetPosition(pMoovAtom->GetStart()); diff -Nru faac-1.26/common/mp4v2/atom_rtp.cpp faac-1.28/common/mp4v2/atom_rtp.cpp --- faac-1.26/common/mp4v2/atom_rtp.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_rtp.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -120,6 +120,7 @@ // read sdp string, length is implicit in size of atom u_int64_t size = GetEnd() - m_pFile->GetPosition(); char* data = (char*)MP4Malloc(size + 1); + ASSERT(data != NULL); m_pFile->ReadBytes((u_int8_t*)data, size); data[size] = '\0'; ((MP4StringProperty*)m_pProperties[1])->SetValue(data); diff -Nru faac-1.26/common/mp4v2/atom_samr.cpp faac-1.28/common/mp4v2/atom_samr.cpp --- faac-1.26/common/mp4v2/atom_samr.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_samr.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * 3GPP features implementation is based on 3GPP's TS26.234-v5.60, - * and was contributed by Ximpo Group Ltd. - * - * Portions created by Ximpo Group Ltd. are - * Copyright (C) Ximpo Group Ltd. 2003, 2004. All Rights Reserved. - * - * Contributor(s): - * Ximpo Group Ltd. mp4v2@ximpo.com - */ - -#include "mp4common.h" - -MP4SamrAtom::MP4SamrAtom() - : MP4Atom("samr") -{ - AddReserved("reserved1", 6); /* 0 */ - - AddProperty( /* 1 */ - new MP4Integer16Property("dataReferenceIndex")); - - AddReserved("reserved2", 16); /* 2 */ - - AddProperty( /* 3 */ - new MP4Integer16Property("timeScale")); - - AddReserved("reserved3", 2); /* 4 */ - - ExpectChildAtom("damr", Required, OnlyOne); -} - -void MP4SamrAtom::Generate() -{ - MP4Atom::Generate(); - - ((MP4Integer16Property*)m_pProperties[1])->SetValue(1); - - // property reserved2 has non-zero fixed values - static u_int8_t reserved2[16] = { - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x02, 0x00, 0x10, - 0x00, 0x00, 0x00, 0x00, - }; - m_pProperties[2]->SetReadOnly(false); - ((MP4BytesProperty*)m_pProperties[2])-> - SetValue(reserved2, sizeof(reserved2)); - m_pProperties[2]->SetReadOnly(true); -} diff -Nru faac-1.26/common/mp4v2/atom_sawb.cpp faac-1.28/common/mp4v2/atom_sawb.cpp --- faac-1.26/common/mp4v2/atom_sawb.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_sawb.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * 3GPP features implementation is based on 3GPP's TS26.234-v5.60, - * and was contributed by Ximpo Group Ltd. - * - * Portions created by Ximpo Group Ltd. are - * Copyright (C) Ximpo Group Ltd. 2003, 2004. All Rights Reserved. - * - * Contributor(s): - * Ximpo Group Ltd. mp4v2@ximpo.com - */ - -#include "mp4common.h" - -MP4SawbAtom::MP4SawbAtom() - : MP4Atom("sawb") -{ - AddReserved("reserved1", 6); /* 0 */ - - AddProperty( /* 1 */ - new MP4Integer16Property("dataReferenceIndex")); - - AddReserved("reserved2", 16); /* 2 */ - - AddProperty( /* 3 */ - new MP4Integer16Property("timeScale")); - - AddReserved("reserved3", 2); /* 4 */ - - ExpectChildAtom("damr", Required, OnlyOne); -} - -void MP4SawbAtom::Generate() -{ - MP4Atom::Generate(); - - ((MP4Integer16Property*)m_pProperties[1])->SetValue(1); - - // property reserved2 has non-zero fixed values - static u_int8_t reserved2[16] = { - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x02, 0x00, 0x10, - 0x00, 0x00, 0x00, 0x00, - }; - m_pProperties[2]->SetReadOnly(false); - ((MP4BytesProperty*)m_pProperties[2])-> - SetValue(reserved2, sizeof(reserved2)); - m_pProperties[2]->SetReadOnly(true); -} diff -Nru faac-1.26/common/mp4v2/atom_schi.cpp faac-1.28/common/mp4v2/atom_schi.cpp --- faac-1.26/common/mp4v2/atom_schi.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_schi.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Alix Marchandise-Franquet alix@cisco.com - * - * SchemeInformationBox for ISMACrypt - */ - -#include "mp4common.h" - -MP4SchiAtom::MP4SchiAtom() - : MP4Atom("schi") -{ - // not sure if this is child atoms or table of boxes - // get clarification on spec 9.1.2.5 - ExpectChildAtom("iKMS", Required, OnlyOne); - ExpectChildAtom("iSFM", Required, OnlyOne); -} diff -Nru faac-1.26/common/mp4v2/atom_schm.cpp faac-1.28/common/mp4v2/atom_schm.cpp --- faac-1.26/common/mp4v2/atom_schm.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_schm.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Alix Marchandise-Franquet alix@cisco.com - * - * Add the SchemeTypeBox for ISMACrypt - */ - -#include "mp4common.h" - -MP4SchmAtom::MP4SchmAtom() - : MP4Atom("schm") -{ - AddVersionAndFlags(); /* 0, 1 */ - AddProperty( /* 2 */ - new MP4Integer32Property("scheme_type")); - AddProperty( /* 3 */ - new MP4Integer32Property("scheme_version")); - // browser URI if flags set, TODO -} diff -Nru faac-1.26/common/mp4v2/atom_sdp.cpp faac-1.28/common/mp4v2/atom_sdp.cpp --- faac-1.26/common/mp4v2/atom_sdp.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_sdp.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -32,6 +32,7 @@ // read sdp string, length is implicit in size of atom u_int64_t size = GetEnd() - m_pFile->GetPosition(); char* data = (char*)MP4Malloc(size + 1); + ASSERT(data != NULL); m_pFile->ReadBytes((u_int8_t*)data, size); data[size] = '\0'; ((MP4StringProperty*)m_pProperties[0])->SetValue(data); diff -Nru faac-1.26/common/mp4v2/atoms.h faac-1.28/common/mp4v2/atoms.h --- faac-1.26/common/mp4v2/atoms.h 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atoms.h 2009-01-25 01:14:34.000000000 +0000 @@ -13,7 +13,7 @@ * * The Initial Developer of the Original Code is Cisco Systems Inc. * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001 - 2004. All Rights Reserved. + * Copyright (C) Cisco Systems Inc. 2001 - 2005. All Rights Reserved. * * 3GPP features implementation is based on 3GPP's TS26.234-v5.60, * and was contributed by Ximpo Group Ltd. @@ -24,6 +24,7 @@ * Contributor(s): * Dave Mackie dmackie@cisco.com * Ximpo Group Ltd. mp4v2@ximpo.com + * Bill May wmay@cisco.com */ #ifndef __MP4_ATOMS_INCLUDED__ @@ -51,56 +52,13 @@ void WriteAtomType(const char* type, bool onlyOne); }; -class MP4FtypAtom : public MP4Atom { -public: - MP4FtypAtom(); - void Generate(); - void Read(); -}; - -class MP4MdatAtom : public MP4Atom { -public: - MP4MdatAtom(); - void Read(); - void Write(); -}; - -class MP4MoovAtom : public MP4Atom { -public: - MP4MoovAtom(); -}; - -class MP4MvhdAtom : public MP4Atom { -public: - MP4MvhdAtom(); - void Generate(); - void Read(); -protected: - void AddProperties(u_int8_t version); -}; - -class MP4IodsAtom : public MP4Atom { -public: - MP4IodsAtom(); -}; - -class MP4TrakAtom : public MP4Atom { -public: - MP4TrakAtom(); -}; - -class MP4TkhdAtom : public MP4Atom { -public: - MP4TkhdAtom(); - void Generate(); - void Read(); -protected: - void AddProperties(u_int8_t version); -}; - -class MP4TrefAtom : public MP4Atom { -public: - MP4TrefAtom(); +/*********************************************************************** + * Common atom classes - standard for anything that just contains atoms + * and non-maleable properties, treftype and url + ***********************************************************************/ +class MP4StandardAtom : public MP4Atom { + public: + MP4StandardAtom(const char *name); }; class MP4TrefTypeAtom : public MP4Atom { @@ -109,86 +67,77 @@ void Read(); }; -class MP4MdiaAtom : public MP4Atom { -public: - MP4MdiaAtom(); -}; - -class MP4MdhdAtom : public MP4Atom { -public: - MP4MdhdAtom(); - void Generate(); - void Read(); -protected: - void AddProperties(u_int8_t version); -}; - -class MP4HdlrAtom : public MP4Atom { +class MP4UrlAtom : public MP4Atom { public: - MP4HdlrAtom(); + MP4UrlAtom(const char *type="url "); void Read(); + void Write(); }; -class MP4MinfAtom : public MP4Atom { -public: - MP4MinfAtom(); +/*********************************************************************** + * Sound and Video atoms - use the generic atoms when possible + * (MP4SoundAtom and MP4VideoAtom) + ***********************************************************************/ +class MP4SoundAtom : public MP4Atom { + public: + MP4SoundAtom(const char *atomid); + void Generate(); + void Read(); +protected: + void AddProperties(u_int8_t version); }; -class MP4VmhdAtom : public MP4Atom { -public: - MP4VmhdAtom(); - void Generate(); +class MP4VideoAtom : public MP4Atom { + public: + MP4VideoAtom(const char *atomid); + void Generate(); }; -class MP4SmhdAtom : public MP4Atom { -public: - MP4SmhdAtom(); +class MP4AmrAtom : public MP4Atom { + public: + MP4AmrAtom(const char *type); + void Generate(); }; -class MP4HmhdAtom : public MP4Atom { -public: - MP4HmhdAtom(); -}; +// H.264 atoms -class MP4NmhdAtom : public MP4Atom { -public: - MP4NmhdAtom(); +class MP4Avc1Atom : public MP4Atom { + public: + MP4Avc1Atom(); + void Generate(); }; -class MP4DinfAtom : public MP4Atom { -public: - MP4DinfAtom(); +class MP4AvcCAtom : public MP4Atom { + public: + MP4AvcCAtom(); + void Generate(); + void Clone(MP4AvcCAtom *dstAtom); }; -class MP4DrefAtom : public MP4Atom { -public: - MP4DrefAtom(); - void Read(); -}; -class MP4UrlAtom : public MP4Atom { -public: - MP4UrlAtom(); - void Read(); - void Write(); +class MP4D263Atom : public MP4Atom { + public: + MP4D263Atom(); + void Generate(); + void Write(); }; - -class MP4UrnAtom : public MP4Atom { -public: - MP4UrnAtom(); - void Read(); + +class MP4DamrAtom : public MP4Atom { + public: + MP4DamrAtom(); + void Generate(); }; -class MP4StblAtom : public MP4Atom { +class MP4EncaAtom : public MP4Atom { public: - MP4StblAtom(); - void Generate(); + MP4EncaAtom(); + void Generate(); }; -class MP4StsdAtom : public MP4Atom { +class MP4EncvAtom : public MP4Atom { public: - MP4StsdAtom(); - void Read(); + MP4EncvAtom(); + void Generate(); }; class MP4Mp4aAtom : public MP4Atom { @@ -209,89 +158,121 @@ void Generate(); }; -class MP4EsdsAtom : public MP4Atom { -public: - MP4EsdsAtom(); + +class MP4S263Atom : public MP4Atom { + public: + MP4S263Atom(); + void Generate(); }; + + + +/************************************************************************ + * Specialized Atoms + ************************************************************************/ -class MP4SttsAtom : public MP4Atom { +class MP4DataAtom : public MP4Atom { public: - MP4SttsAtom(); + MP4DataAtom(); + void Read(); }; -class MP4CttsAtom : public MP4Atom { +class MP4DrefAtom : public MP4Atom { public: - MP4CttsAtom(); + MP4DrefAtom(); + void Read(); }; -class MP4StszAtom : public MP4Atom { +class MP4ElstAtom : public MP4Atom { public: - MP4StszAtom(); + MP4ElstAtom(); + void Generate(); void Read(); - void Write(); +protected: + void AddProperties(u_int8_t version); }; -class MP4StscAtom : public MP4Atom { +class MP4FreeAtom : public MP4Atom { public: - MP4StscAtom(); + MP4FreeAtom(); void Read(); + void Write(); }; -class MP4StcoAtom : public MP4Atom { +class MP4FtypAtom : public MP4Atom { public: - MP4StcoAtom(); + MP4FtypAtom(); + void Generate(); + void Read(); }; -class MP4Co64Atom : public MP4Atom { +class MP4GminAtom : public MP4Atom { public: - MP4Co64Atom(); + MP4GminAtom(); + void Generate(); }; -class MP4StssAtom : public MP4Atom { +class MP4HdlrAtom : public MP4Atom { public: - MP4StssAtom(); + MP4HdlrAtom(); + void Read(); }; -class MP4StshAtom : public MP4Atom { +class MP4HinfAtom : public MP4Atom { public: - MP4StshAtom(); + MP4HinfAtom(); + void Generate(); }; -class MP4StdpAtom : public MP4Atom { +class MP4HntiAtom : public MP4Atom { public: - MP4StdpAtom(); + MP4HntiAtom(); void Read(); }; -class MP4EdtsAtom : public MP4Atom { + +class MP4MdatAtom : public MP4Atom { public: - MP4EdtsAtom(); + MP4MdatAtom(); + void Read(); + void Write(); }; -class MP4ElstAtom : public MP4Atom { +class MP4MdhdAtom : public MP4Atom { public: - MP4ElstAtom(); + MP4MdhdAtom(); void Generate(); void Read(); protected: void AddProperties(u_int8_t version); }; -class MP4UdtaAtom : public MP4Atom { -public: - MP4UdtaAtom(); - void Read(); +class MP4Meta1Atom : public MP4Atom { + public: + MP4Meta1Atom(const char *name); + void Read(); }; -class MP4CprtAtom : public MP4Atom { -public: - MP4CprtAtom(); +class MP4Meta2Atom : public MP4Atom { + public: + MP4Meta2Atom(const char *name); + void Read(); }; - -class MP4HntiAtom : public MP4Atom { + +class MP4MvhdAtom : public MP4Atom { public: - MP4HntiAtom(); + MP4MvhdAtom(); + void Generate(); void Read(); +protected: + void AddProperties(u_int8_t version); +}; + +class MP4OhdrAtom : public MP4Atom { + public: + MP4OhdrAtom(); + ~MP4OhdrAtom(); + void Read(); }; class MP4RtpAtom : public MP4Atom { @@ -314,21 +295,6 @@ void WriteHntiType(); }; -class MP4TimsAtom : public MP4Atom { -public: - MP4TimsAtom(); -}; - -class MP4TsroAtom : public MP4Atom { -public: - MP4TsroAtom(); -}; - -class MP4SnroAtom : public MP4Atom { -public: - MP4SnroAtom(); -}; - class MP4SdpAtom : public MP4Atom { public: MP4SdpAtom(); @@ -336,95 +302,60 @@ void Write(); }; -class MP4HinfAtom : public MP4Atom { -public: - MP4HinfAtom(); - void Generate(); -}; - -class MP4TrpyAtom : public MP4Atom { -public: - MP4TrpyAtom(); -}; - -class MP4NumpAtom : public MP4Atom { -public: - MP4NumpAtom(); -}; - -class MP4TpylAtom : public MP4Atom { -public: - MP4TpylAtom(); -}; - -class MP4MaxrAtom : public MP4Atom { -public: - MP4MaxrAtom(); -}; - -class MP4DmedAtom : public MP4Atom { -public: - MP4DmedAtom(); -}; - -class MP4DimmAtom : public MP4Atom { -public: - MP4DimmAtom(); -}; - -class MP4DrepAtom : public MP4Atom { -public: - MP4DrepAtom(); -}; - -class MP4TminAtom : public MP4Atom { -public: - MP4TminAtom(); -}; - -class MP4TmaxAtom : public MP4Atom { -public: - MP4TmaxAtom(); +class MP4SmiAtom : public MP4Atom { + public: + MP4SmiAtom(void); + void Read(); }; -class MP4PmaxAtom : public MP4Atom { +class MP4StblAtom : public MP4Atom { public: - MP4PmaxAtom(); + MP4StblAtom(); + void Generate(); }; -class MP4DmaxAtom : public MP4Atom { +class MP4StdpAtom : public MP4Atom { public: - MP4DmaxAtom(); + MP4StdpAtom(); + void Read(); }; -class MP4PaytAtom : public MP4Atom { +class MP4StscAtom : public MP4Atom { public: - MP4PaytAtom(); + MP4StscAtom(); + void Read(); }; -class MP4MvexAtom : public MP4Atom { +class MP4StsdAtom : public MP4Atom { public: - MP4MvexAtom(); + MP4StsdAtom(); + void Read(); }; -class MP4TrexAtom : public MP4Atom { +class MP4StszAtom : public MP4Atom { public: - MP4TrexAtom(); + MP4StszAtom(); + void Read(); + void Write(); }; -class MP4MoofAtom : public MP4Atom { +class MP4Stz2Atom : public MP4Atom { public: - MP4MoofAtom(); + MP4Stz2Atom(); + void Read(); }; -class MP4MfhdAtom : public MP4Atom { +class MP4TextAtom : public MP4Atom { public: - MP4MfhdAtom(); -}; + MP4TextAtom(); + void Generate(); + void Read(); +protected: + void AddPropertiesStsdType(); + void AddPropertiesGmhdType(); -class MP4TrafAtom : public MP4Atom { -public: - MP4TrafAtom(); + void GenerateStsdType(); + void GenerateGmhdType(); }; class MP4TfhdAtom : public MP4Atom { @@ -435,6 +366,14 @@ void AddProperties(u_int32_t flags); }; +class MP4TkhdAtom : public MP4Atom { +public: + MP4TkhdAtom(); + void Generate(); + void Read(); +protected: + void AddProperties(u_int8_t version); +}; class MP4TrunAtom : public MP4Atom { public: MP4TrunAtom(); @@ -443,193 +382,27 @@ void AddProperties(u_int32_t flags); }; -class MP4FreeAtom : public MP4Atom { +class MP4UdtaAtom : public MP4Atom { public: - MP4FreeAtom(); + MP4UdtaAtom(); void Read(); - void Write(); -}; - -class MP4EncaAtom : public MP4Atom { -public: - MP4EncaAtom(); - void Generate(); -}; - -class MP4EncvAtom : public MP4Atom { -public: - MP4EncvAtom(); - void Generate(); -}; - -class MP4FrmaAtom : public MP4Atom { -public: - MP4FrmaAtom(); -}; - -class MP4IKMSAtom : public MP4Atom { -public: - MP4IKMSAtom(); -}; - -class MP4ISFMAtom : public MP4Atom { -public: - MP4ISFMAtom(); -}; - -class MP4SchiAtom : public MP4Atom { -public: - MP4SchiAtom(); -}; - -class MP4SchmAtom : public MP4Atom { -public: - MP4SchmAtom(); }; -class MP4SinfAtom : public MP4Atom { -public: - MP4SinfAtom(); -}; - -/* iTunes META data atoms */ -class MP4MetaAtom : public MP4Atom { -public: - MP4MetaAtom(); -}; - -class MP4NameAtom : public MP4Atom { -public: - MP4NameAtom(); - void Read(); -}; - -class MP4MeanAtom : public MP4Atom { -public: - MP4MeanAtom(); - void Read(); -}; - -class MP4DataAtom : public MP4Atom { -public: - MP4DataAtom(); - void Read(); -}; - -class MP4IlstAtom : public MP4Atom { -public: - MP4IlstAtom(); -}; - -class MP4DashAtom : public MP4Atom { -public: - MP4DashAtom(); -}; - -class MP4NamAtom : public MP4Atom { -public: - MP4NamAtom(); -}; - -class MP4ArtAtom : public MP4Atom { -public: - MP4ArtAtom(); -}; - -class MP4WrtAtom : public MP4Atom { -public: - MP4WrtAtom(); -}; - -class MP4AlbAtom : public MP4Atom { -public: - MP4AlbAtom(); -}; - -class MP4TrknAtom : public MP4Atom { -public: - MP4TrknAtom(); -}; - -class MP4DayAtom : public MP4Atom { -public: - MP4DayAtom(); -}; - -class MP4GenAtom : public MP4Atom { -public: - MP4GenAtom(); -}; - -class MP4TooAtom : public MP4Atom { -public: - MP4TooAtom(); -}; - -class MP4GnreAtom : public MP4Atom { -public: - MP4GnreAtom(); -}; - -class MP4CpilAtom : public MP4Atom { -public: - MP4CpilAtom(); -}; - -class MP4TmpoAtom : public MP4Atom { -public: - MP4TmpoAtom(); -}; - -class MP4CmtAtom : public MP4Atom { +class MP4UrnAtom : public MP4Atom { public: - MP4CmtAtom(); -}; - -class MP4CovrAtom : public MP4Atom { - public: - MP4CovrAtom(); + MP4UrnAtom(); + void Read(); }; - -class MP4DiskAtom : public MP4Atom { +class MP4VmhdAtom : public MP4Atom { public: - MP4DiskAtom(); + MP4VmhdAtom(); + void Generate(); }; -class MP4BitrAtom : public MP4Atom { - public: - MP4BitrAtom(); -}; - -class MP4D263Atom : public MP4Atom { - public: - MP4D263Atom(); - void Generate(); - void Write(); -}; - -class MP4DamrAtom : public MP4Atom { - public: - MP4DamrAtom(); - void Generate(); -}; - -class MP4S263Atom : public MP4Atom { - public: - MP4S263Atom(); - void Generate(); -}; - -class MP4SamrAtom : public MP4Atom { - public: - MP4SamrAtom(); - void Generate(); -}; - -class MP4SawbAtom : public MP4Atom { +class MP4HrefAtom : public MP4Atom { public: - MP4SawbAtom(); - void Generate(); + MP4HrefAtom(); + void Generate(void); }; #endif /* __MP4_ATOMS_INCLUDED__ */ diff -Nru faac-1.26/common/mp4v2/atom_sinf.cpp faac-1.28/common/mp4v2/atom_sinf.cpp --- faac-1.26/common/mp4v2/atom_sinf.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_sinf.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - * Alix Marchandise-Franquet alix@cisco.com - * - * Add the ProtectionInfoBox for ISMACrypt - */ - -#include "mp4common.h" - -MP4SinfAtom::MP4SinfAtom() - : MP4Atom("sinf") -{ - ExpectChildAtom("frma", Required, OnlyOne); - ExpectChildAtom("schm", Required, OnlyOne); - ExpectChildAtom("schi", Required, OnlyOne); -} diff -Nru faac-1.26/common/mp4v2/atom_smhd.cpp faac-1.28/common/mp4v2/atom_smhd.cpp --- faac-1.26/common/mp4v2/atom_smhd.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_smhd.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4SmhdAtom::MP4SmhdAtom() - : MP4Atom("smhd") -{ - AddVersionAndFlags(); - AddReserved("reserved", 4); -} diff -Nru faac-1.26/common/mp4v2/atom_smi.cpp faac-1.28/common/mp4v2/atom_smi.cpp --- faac-1.26/common/mp4v2/atom_smi.cpp 1970-01-01 00:00:00.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_smi.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -0,0 +1,41 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2004. All Rights Reserved. + * + * Contributor(s): + * Bill May wmay@cisco.com + * + * Apple iTunes META data + */ + +#include "mp4common.h" + +MP4SmiAtom::MP4SmiAtom() + : MP4Atom("meta") +{ + + AddProperty( new MP4BytesProperty("metadata")); + +} + +void MP4SmiAtom::Read() +{ + // calculate size of the metadata from the atom size + ((MP4BytesProperty*)m_pProperties[0])->SetValueSize(m_size); + + MP4Atom::Read(); +} + diff -Nru faac-1.26/common/mp4v2/atom_snro.cpp faac-1.28/common/mp4v2/atom_snro.cpp --- faac-1.26/common/mp4v2/atom_snro.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_snro.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4SnroAtom::MP4SnroAtom() - : MP4Atom("snro") -{ - AddProperty( - new MP4Integer32Property("offset")); -} - diff -Nru faac-1.26/common/mp4v2/atom_sound.cpp faac-1.28/common/mp4v2/atom_sound.cpp --- faac-1.26/common/mp4v2/atom_sound.cpp 1970-01-01 00:00:00.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_sound.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -0,0 +1,125 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2004. All Rights Reserved. + * + * Contributor(s): + * Bill May wmay@cisco.com + */ + +#include "mp4common.h" + +MP4SoundAtom::MP4SoundAtom(const char *atomid) + : MP4Atom(atomid) +{ + AddReserved("reserved1", 6); /* 0 */ + + AddProperty( /* 1 */ + new MP4Integer16Property("dataReferenceIndex")); + AddProperty( /* 2 */ + new MP4Integer16Property("soundVersion")); + AddReserved( "reserved2", 6); /* 3 */ + + AddProperty( /* 4 */ + new MP4Integer16Property("channels")); + AddProperty( /* 5 */ + new MP4Integer16Property("sampleSize")); + AddProperty( /* 6 */ + new MP4Integer16Property("packetSize")); + AddProperty( /* 7 */ + new MP4Integer32Property("timeScale")); + + if (ATOMID(atomid) == ATOMID("mp4a")) { + AddReserved("reserved3", 2); /* 8 */ + ExpectChildAtom("esds", Required, OnlyOne); + ExpectChildAtom("wave", Optional, OnlyOne); + } else if (ATOMID(atomid) == ATOMID("alac")) { + AddReserved("reserved3", 2); /* 8 */ + ExpectChildAtom("alac", Optional, Optional); + //AddProperty( new MP4BytesProperty("alacInfo", 36)); + } +} + +void MP4SoundAtom::AddProperties (uint8_t version) +{ + if (version > 0) { + AddProperty( /* 8 */ + new MP4Integer32Property("samplesPerPacket")); + AddProperty( /* 9 */ + new MP4Integer32Property("bytesPerPacket")); + AddProperty( /* 10 */ + new MP4Integer32Property("bytesPerFrame")); + AddProperty( /* 11 */ + new MP4Integer32Property("bytesPerSample")); + } + if (version == 2) { + AddReserved("reserved4", 20); + } +} +void MP4SoundAtom::Generate() +{ + MP4Atom::Generate(); + + ((MP4Integer16Property*)m_pProperties[1])->SetValue(1); + + // property reserved2 has non-zero fixed values + ((MP4Integer16Property*)m_pProperties[2])->SetValue(0); + static const u_int8_t reserved2[6] = { + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, + }; + m_pProperties[3]->SetReadOnly(false); + ((MP4BytesProperty*)m_pProperties[3])-> + SetValue(reserved2, sizeof(reserved2)); + m_pProperties[3]->SetReadOnly(true); + ((MP4Integer16Property*)m_pProperties[4])->SetValue(2); + ((MP4Integer16Property*)m_pProperties[5])->SetValue(0x0010); + ((MP4Integer16Property*)m_pProperties[6])->SetValue(0); + +} + +void MP4SoundAtom::Read() +{ + MP4Atom *parent = GetParentAtom(); + if (ATOMID(parent->GetType()) != ATOMID("stsd")) { + // Quicktime has an interesting thing - they'll put an mp4a atom + // which is blank inside a wave atom, which is inside an mp4a atom + // we have a mp4a inside an wave inside an mp4a - delete all properties + m_pProperties.Delete(8); + m_pProperties.Delete(7); + m_pProperties.Delete(6); + m_pProperties.Delete(5); + m_pProperties.Delete(4); + m_pProperties.Delete(3); + m_pProperties.Delete(2); + m_pProperties.Delete(1); + m_pProperties.Delete(0); + if (ATOMID(GetType()) == ATOMID("alac")) { + AddProperty(new MP4BytesProperty("decoderConfig", m_size)); + ReadProperties(); + } + if (m_pChildAtomInfos.Size() > 0) { + ReadChildAtoms(); + } + } else { + ReadProperties(0, 3); // read first 3 properties + AddProperties(((MP4IntegerProperty *)m_pProperties[2])->GetValue()); + ReadProperties(3); // continue + if (m_pChildAtomInfos.Size() > 0) { + ReadChildAtoms(); + } + } + Skip(); +} diff -Nru faac-1.26/common/mp4v2/atom_standard.cpp faac-1.28/common/mp4v2/atom_standard.cpp --- faac-1.26/common/mp4v2/atom_standard.cpp 1970-01-01 00:00:00.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_standard.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -0,0 +1,463 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2004. All Rights Reserved. + * + * Contributor(s): + * Bill May (from others work). + */ + +#include "mp4common.h" +#include "atoms.h" + +static const char name[5]={0251,'n', 'a', 'm', '\0'}; +static const char art[5]={0251,'A', 'R', 'T', '\0'}; +static const char wrt[5]={0251,'w', 'r', 't', '\0'}; +static const char alb[5]={0251,'a', 'l', 'b', '\0'}; +static const char day[5]={0251,'d', 'a', 'y', '\0'}; +static const char too[5]={0251,'t', 'o', 'o', '\0'}; +static const char cmt[5]={0251,'c', 'm', 't', '\0'}; +static const char gen[5]={0251,'g', 'e', 'n', '\0'}; +static const char grp[5]={0251,'g', 'r', 'p', '\0'}; + +MP4StandardAtom::MP4StandardAtom (const char *type) : MP4Atom(type) +{ + /* + * This is a big if else loop. Make sure that you don't break it + * when adding new atoms, or you will set the unknown type flag + * + * Try to keep it in alphabetical order - it should only be called + * 1 time per atom, so it's not that urgent. + */ + if (ATOMID(type) == ATOMID("aART") || + ATOMID(type) == ATOMID("akID") || + ATOMID(type) == ATOMID("apID") || + ATOMID(type) == ATOMID("atID")) { + ExpectChildAtom("data", Required, OnlyOne); + /* + * b??? + */ + } else if (ATOMID(type) == ATOMID("bitr")) { + AddProperty( /* 0 */ + new MP4Integer32Property("avgBitrate")); + + AddProperty( /* 1 */ + new MP4Integer32Property("maxBitrate")); + + } else if (ATOMID(type) == ATOMID("btrt")) { + AddProperty( new MP4Integer32Property("bufferSizeDB")); /* 0 */ + AddProperty( new MP4Integer32Property("avgBitrate")); /* 1 */ + AddProperty( new MP4Integer32Property("maxBitrate")); /* 2 */ + } else if (ATOMID(type) == ATOMID("burl")) { + AddProperty( new MP4StringProperty("base_url")); + /* + * c??? + */ + } else if (ATOMID(type) == ATOMID("co64")) { + AddVersionAndFlags(); + + MP4Integer32Property* pCount = + new MP4Integer32Property("entryCount"); + AddProperty(pCount); + + MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); + AddProperty(pTable); + + pTable->AddProperty( + new MP4Integer64Property("chunkOffset")); + + } else if (ATOMID(type) == ATOMID("cpil")) { + ExpectChildAtom("data", Required, OnlyOne); + } else if (ATOMID(type) == ATOMID("covr")) { /* Apple iTunes */ + ExpectChildAtom("data", Required, Many); + } else if (ATOMID(type) == ATOMID("cprt") || + ATOMID(type) == ATOMID("cnID")) { +#if 0 + AddVersionAndFlags(); + AddProperty( + new MP4Integer16Property("language")); + AddProperty( + new MP4StringProperty("notice")); +#else + ExpectChildAtom("data", Required, OnlyOne); +#endif + + } else if (ATOMID(type) == ATOMID("ctts")) { + AddVersionAndFlags(); + + MP4Integer32Property* pCount = + new MP4Integer32Property("entryCount"); + AddProperty(pCount); + + MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); + AddProperty(pTable); + + pTable->AddProperty(new MP4Integer32Property("sampleCount")); + pTable->AddProperty(new MP4Integer32Property("sampleOffset")); + /* + * d??? + */ + } else if (ATOMID(type) == ATOMID("dinf")) { + ExpectChildAtom("dref", Required, OnlyOne); + + } else if (ATOMID(type) == ATOMID("dimm")) { + AddProperty( // bytes of immediate data + new MP4Integer64Property("bytes")); + + } else if (ATOMID(type) == ATOMID("disk")) { /* Apple iTunes */ + ExpectChildAtom("data", Required, OnlyOne); + + } else if (ATOMID(type) == ATOMID("dmax")) { + AddProperty( // max packet duration + new MP4Integer32Property("milliSecs")); + + } else if (ATOMID(type) == ATOMID("dmed")) { + AddProperty( // bytes sent from media data + new MP4Integer64Property("bytes")); + + } else if (ATOMID(type) == ATOMID("drep")) { + AddProperty( // bytes of repeated data + new MP4Integer64Property("bytes")); + /* + * e??? + */ + } else if (ATOMID(type) == ATOMID("edts")) { + ExpectChildAtom("elst", Required, OnlyOne); + + } else if (ATOMID(type) == ATOMID("esds")) { + AddVersionAndFlags(); + AddProperty( + new MP4DescriptorProperty(NULL, MP4ESDescrTag, 0, + Required, OnlyOne)); + /* + * f??? + */ + } else if (ATOMID(type) == ATOMID("frma")) { + AddProperty( /* 0 */ + new MP4Integer32Property("data-format")); + /* + * g??? + */ + } else if (ATOMID(type) == ATOMID("gmhd")) { + ExpectChildAtom("gmin", Required, OnlyOne); + ExpectChildAtom("tmcd", Optional, OnlyOne); + ExpectChildAtom("text", Optional, OnlyOne); + } else if (ATOMID(type) == ATOMID("gnre") || + ATOMID(type) == ATOMID("geID")) { // Apple iTunes + ExpectChildAtom("data", Optional, OnlyOne); + + /* + * h??? + */ + } else if (ATOMID(type) == ATOMID("hmhd")) { + AddVersionAndFlags(); + + AddProperty(new MP4Integer16Property("maxPduSize")); + AddProperty(new MP4Integer16Property("avgPduSize")); + AddProperty(new MP4Integer32Property("maxBitRate")); + AddProperty(new MP4Integer32Property("avgBitRate")); + AddProperty(new MP4Integer32Property("slidingAvgBitRate")); + /* + * i??? + */ + } else if (ATOMID(type) == ATOMID("iKMS")) { + AddVersionAndFlags(); /* 0, 1 */ + MP4StringProperty* pProp = new MP4StringProperty("kms_URI"); + AddProperty(pProp); /* 2 */ + + } else if (ATOMID(type) == ATOMID("iSFM")) { + AddVersionAndFlags(); /* 0, 1 */ + AddProperty( /* 2 */ + new MP4BitfieldProperty("selective-encryption", 1)); + AddProperty( /* 3 */ + new MP4BitfieldProperty("reserved", 7)); + AddProperty( /* 4 */ + new MP4Integer8Property("key-indicator-length")); + AddProperty( /* 5 */ + new MP4Integer8Property("IV-length")); + + } else if (ATOMID(type) == ATOMID("ilst")) { + ExpectChildAtom("\251nam", Optional, OnlyOne); /* name */ + ExpectChildAtom("\251ART", Optional, OnlyOne); /* artist */ + ExpectChildAtom("\251wrt", Optional, OnlyOne); /* writer */ + ExpectChildAtom("\251alb", Optional, OnlyOne); /* album */ + ExpectChildAtom("\251day", Optional, OnlyOne); /* date */ + ExpectChildAtom("\251too", Optional, OnlyOne); /* tool */ + ExpectChildAtom("\251cmt", Optional, OnlyOne); /* comment */ + ExpectChildAtom("\251gen", Optional, OnlyOne); /* custom genre */ + ExpectChildAtom("trkn", Optional, OnlyOne); /* tracknumber */ + ExpectChildAtom("disk", Optional, OnlyOne); /* disknumber */ + ExpectChildAtom("gnre", Optional, OnlyOne); /* genre (ID3v1 index + 1) */ + ExpectChildAtom("cpil", Optional, OnlyOne); /* compilation */ + ExpectChildAtom("tmpo", Optional, OnlyOne); /* BPM */ + ExpectChildAtom("covr", Optional, OnlyOne); /* cover art */ + ExpectChildAtom("aART", Optional, OnlyOne); /* album artist */ + ExpectChildAtom("----", Optional, Many); /* ---- free form */ + ExpectChildAtom("pgap", Optional, OnlyOne); /* part of gapless album */ + + } else if (ATOMID(type) == ATOMID("imif")) { + AddVersionAndFlags(); + AddProperty(new MP4DescriptorProperty("ipmp_desc", MP4IPMPDescrTag, + MP4IPMPDescrTag, Required, Many)); + } else if (ATOMID(type) == ATOMID("iods")) { + AddVersionAndFlags(); + AddProperty( + new MP4DescriptorProperty(NULL, MP4FileIODescrTag, + MP4FileODescrTag, + Required, OnlyOne)); + /* + * m??? + */ + } else if (ATOMID(type) == ATOMID("maxr")) { + AddProperty(new MP4Integer32Property("granularity")); + AddProperty(new MP4Integer32Property("bytes")); + + } else if (ATOMID(type) == ATOMID("mdia")) { + ExpectChildAtom("mdhd", Required, OnlyOne); + ExpectChildAtom("hdlr", Required, OnlyOne); + ExpectChildAtom("minf", Required, OnlyOne); + + } else if (ATOMID(type) == ATOMID("meta")) { // iTunes + AddVersionAndFlags(); /* 0, 1 */ + ExpectChildAtom("hdlr", Required, OnlyOne); + ExpectChildAtom("ilst", Required, OnlyOne); + + } else if (ATOMID(type) == ATOMID("mfhd")) { + AddVersionAndFlags(); /* 0, 1 */ + AddProperty( /* 2 */ + new MP4Integer32Property("sequenceNumber")); + + } else if (ATOMID(type) == ATOMID("minf")) { + ExpectChildAtom("vmhd", Optional, OnlyOne); + ExpectChildAtom("smhd", Optional, OnlyOne); + ExpectChildAtom("hmhd", Optional, OnlyOne); + ExpectChildAtom("nmhd", Optional, OnlyOne); + ExpectChildAtom("gmhd", Optional, OnlyOne); + ExpectChildAtom("dinf", Required, OnlyOne); + ExpectChildAtom("stbl", Required, OnlyOne); + + } else if (ATOMID(type) == ATOMID("moof")) { + ExpectChildAtom("mfhd", Required, OnlyOne); + ExpectChildAtom("traf", Optional, Many); + + } else if (ATOMID(type) == ATOMID("moov")) { + ExpectChildAtom("mvhd", Required, OnlyOne); + ExpectChildAtom("iods", Optional, OnlyOne); + ExpectChildAtom("trak", Required, Many); + ExpectChildAtom("udta", Optional, Many); + ExpectChildAtom("mvex", Optional, OnlyOne); + + } else if (ATOMID(type) == ATOMID("mvex")) { + ExpectChildAtom("trex", Required, Many); + + /* + * n??? + */ + } else if (ATOMID(type) == ATOMID("nmhd")) { + AddVersionAndFlags(); + + } else if (ATOMID(type) == ATOMID("nump")) { + AddProperty( // packets sent + new MP4Integer64Property("packets")); + /* + * o??? + */ + } else if (ATOMID(type) == ATOMID("odkm")) { + AddVersionAndFlags(); + ExpectChildAtom("ohdr", Required, OnlyOne); + /* + * p??? + */ + } else if (ATOMID(type) == ATOMID("payt")) { + AddProperty(new MP4Integer32Property("payloadNumber")); + AddProperty(new MP4StringProperty("rtpMap", Counted)); + + } else if (ATOMID(type) == ATOMID("pinf")) { + ExpectChildAtom("frma", Required, OnlyOne); + } else if (ATOMID(type) == ATOMID("pmax")) { + AddProperty( // max packet size + new MP4Integer32Property("bytes")); + } else if (ATOMID(type) == ATOMID("pgap") || + ATOMID(type) == ATOMID("plID") || + ATOMID(type) == ATOMID("purd") || + ATOMID(type) == ATOMID("rtng")) { + ExpectChildAtom("data", Required, OnlyOne); + /* + * s??? + */ + } else if (ATOMID(type) == ATOMID("schi")) { + // not sure if this is child atoms or table of boxes + // get clarification on spec 9.1.2.5 + ExpectChildAtom("odkm", Optional, OnlyOne); + ExpectChildAtom("iKMS", Optional, OnlyOne); + ExpectChildAtom("iSFM", Optional, OnlyOne); + + } else if (ATOMID(type) == ATOMID("schm")) { + AddVersionAndFlags(); /* 0, 1 */ + AddProperty( /* 2 */ + new MP4Integer32Property("scheme_type")); + AddProperty( /* 3 */ + new MP4Integer32Property("scheme_version")); + // browser URI if flags set, TODO + + } else if (ATOMID(type) == ATOMID("sinf")) { + ExpectChildAtom("frma", Required, OnlyOne); + ExpectChildAtom("imif", Optional, OnlyOne); + ExpectChildAtom("schm", Optional, OnlyOne); + ExpectChildAtom("schi", Optional, OnlyOne); + + } else if (ATOMID(type) == ATOMID("smhd")) { + AddVersionAndFlags(); + AddReserved("reserved", 4); + + } else if (ATOMID(type) == ATOMID("snro")) { + AddProperty(new MP4Integer32Property("offset")); + + } else if (ATOMID(type) == ATOMID("stco")) { + AddVersionAndFlags(); + + MP4Integer32Property* pCount = new MP4Integer32Property("entryCount"); + AddProperty(pCount); + + MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); + AddProperty(pTable); + + pTable->AddProperty(new MP4Integer32Property("chunkOffset")); + + } else if (ATOMID(type) == ATOMID("stsh")) { + AddVersionAndFlags(); + + MP4Integer32Property* pCount = new MP4Integer32Property("entryCount"); + AddProperty(pCount); + + MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); + AddProperty(pTable); + + pTable->AddProperty(new MP4Integer32Property("shadowedSampleNumber")); + pTable->AddProperty(new MP4Integer32Property("syncSampleNumber")); + + } else if (ATOMID(type) == ATOMID("stss")) { + AddVersionAndFlags(); + + MP4Integer32Property* pCount = new MP4Integer32Property("entryCount"); + AddProperty(pCount); + + MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); + AddProperty(pTable); + + pTable->AddProperty(new MP4Integer32Property("sampleNumber")); + + } else if (ATOMID(type) == ATOMID("stts")) { + AddVersionAndFlags(); + MP4Integer32Property* pCount = new MP4Integer32Property("entryCount"); + AddProperty(pCount); + + MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); + AddProperty(pTable); + + pTable->AddProperty(new MP4Integer32Property("sampleCount")); + pTable->AddProperty(new MP4Integer32Property("sampleDelta")); + } else if (ATOMID(type) == ATOMID("sfID") || + ATOMID(type) == ATOMID("stik")) { + ExpectChildAtom("data", Required, OnlyOne); + /* + * t??? + */ + } else if (ATOMID(type) == ATOMID("tims")) { + AddProperty( + new MP4Integer32Property("timeScale")); + + } else if (ATOMID(type) == ATOMID("tmin")) { + AddProperty( // min relative xmit time + new MP4Integer32Property("milliSecs")); + + } else if (ATOMID(type) == ATOMID("tmax")) { + AddProperty( // max relative xmit time + new MP4Integer32Property("milliSecs")); + + } else if (ATOMID(type) == ATOMID("tmpo")) { // iTunes + ExpectChildAtom("data", Required, OnlyOne); + + } else if (ATOMID(type) == ATOMID("traf")) { + ExpectChildAtom("tfhd", Required, OnlyOne); + ExpectChildAtom("trun", Optional, Many); + + } else if (ATOMID(type) == ATOMID("trak")) { + ExpectChildAtom("tkhd", Required, OnlyOne); + ExpectChildAtom("tref", Optional, OnlyOne); + ExpectChildAtom("edts", Optional, OnlyOne); + ExpectChildAtom("mdia", Required, OnlyOne); + ExpectChildAtom("udta", Optional, Many); + + } else if (ATOMID(type) == ATOMID("tref")) { + ExpectChildAtom("chap", Optional, OnlyOne); + ExpectChildAtom("dpnd", Optional, OnlyOne); + ExpectChildAtom("hint", Optional, OnlyOne); + ExpectChildAtom("ipir", Optional, OnlyOne); + ExpectChildAtom("mpod", Optional, OnlyOne); + ExpectChildAtom("sync", Optional, OnlyOne); + + } else if (ATOMID(type) == ATOMID("trex")) { + AddVersionAndFlags(); /* 0, 1 */ + AddProperty( /* 2 */ + new MP4Integer32Property("trackId")); + AddProperty( /* 3 */ + new MP4Integer32Property("defaultSampleDesriptionIndex")); + AddProperty( /* 4 */ + new MP4Integer32Property("defaultSampleDuration")); + AddProperty( /* 5 */ + new MP4Integer32Property("defaultSampleSize")); + AddProperty( /* 6 */ + new MP4Integer32Property("defaultSampleFlags")); + + } else if (ATOMID(type) == ATOMID("trkn")) { // iTunes + ExpectChildAtom("data", Required, OnlyOne); + + } else if (ATOMID(type) == ATOMID("trpy") || + ATOMID(type) == ATOMID("tpyl")) { + AddProperty( // bytes sent including RTP headers + new MP4Integer64Property("bytes")); + + } else if (ATOMID(type) == ATOMID("tsro")) { + AddProperty( + new MP4Integer32Property("offset")); + } else if (ATOMID(type) == ATOMID("wave")) { + ExpectChildAtom("esds", Required, OnlyOne); + /* + * copyright??? + */ + } else if (ATOMID(type) == ATOMID(art) || + ATOMID(type) == ATOMID(wrt) || + ATOMID(type) == ATOMID(alb) || + ATOMID(type) == ATOMID(day) || + ATOMID(type) == ATOMID(too) || + ATOMID(type) == ATOMID(gen) || + ATOMID(type) == ATOMID(grp)) { /* Apple iTunes */ + ExpectChildAtom("data", Required, OnlyOne); + /* + * ---- + */ + } else if (ATOMID(type) == ATOMID("----")) { /* Apple iTunes */ + ExpectChildAtom("mean", Required, OnlyOne); + ExpectChildAtom("name", Required, OnlyOne); + ExpectChildAtom("data", Required, OnlyOne); + } else { + /* + * default - unknown type + */ + SetUnknownType(true); + } + +} diff -Nru faac-1.26/common/mp4v2/atom_stbl.cpp faac-1.28/common/mp4v2/atom_stbl.cpp --- faac-1.26/common/mp4v2/atom_stbl.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_stbl.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -28,6 +28,7 @@ ExpectChildAtom("stts", Required, OnlyOne); ExpectChildAtom("ctts", Optional, OnlyOne); ExpectChildAtom("stsz", Required, OnlyOne); + ExpectChildAtom("stz2", Optional, OnlyOne); ExpectChildAtom("stsc", Required, OnlyOne); ExpectChildAtom("stco", Optional, OnlyOne); ExpectChildAtom("co64", Optional, OnlyOne); diff -Nru faac-1.26/common/mp4v2/atom_stco.cpp faac-1.28/common/mp4v2/atom_stco.cpp --- faac-1.26/common/mp4v2/atom_stco.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_stco.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4StcoAtom::MP4StcoAtom() - : MP4Atom("stco") -{ - AddVersionAndFlags(); - - MP4Integer32Property* pCount = - new MP4Integer32Property("entryCount"); - AddProperty(pCount); - - MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); - AddProperty(pTable); - - pTable->AddProperty( - new MP4Integer32Property("chunkOffset")); -} diff -Nru faac-1.26/common/mp4v2/atom_stsd.cpp faac-1.28/common/mp4v2/atom_stsd.cpp --- faac-1.26/common/mp4v2/atom_stsd.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_stsd.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -48,6 +48,9 @@ ExpectChildAtom("samr", Optional, Many); // For AMR-NB ExpectChildAtom("sawb", Optional, Many); // For AMR-WB ExpectChildAtom("s263", Optional, Many); // For H.263 + ExpectChildAtom("avc1", Optional, Many); + ExpectChildAtom("alac", Optional, Many); + ExpectChildAtom("text", Optional, Many); } void MP4StsdAtom::Read() diff -Nru faac-1.26/common/mp4v2/atom_stsh.cpp faac-1.28/common/mp4v2/atom_stsh.cpp --- faac-1.26/common/mp4v2/atom_stsh.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_stsh.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4StshAtom::MP4StshAtom() - : MP4Atom("stsh") -{ - AddVersionAndFlags(); - - MP4Integer32Property* pCount = - new MP4Integer32Property("entryCount"); - AddProperty(pCount); - - MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); - AddProperty(pTable); - - pTable->AddProperty( - new MP4Integer32Property("shadowedSampleNumber")); - pTable->AddProperty( - new MP4Integer32Property("syncSampleNumber")); -} diff -Nru faac-1.26/common/mp4v2/atom_stss.cpp faac-1.28/common/mp4v2/atom_stss.cpp --- faac-1.26/common/mp4v2/atom_stss.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_stss.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4StssAtom::MP4StssAtom() - : MP4Atom("stss") -{ - AddVersionAndFlags(); - - MP4Integer32Property* pCount = - new MP4Integer32Property("entryCount"); - AddProperty(pCount); - - MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); - AddProperty(pTable); - - pTable->AddProperty( - new MP4Integer32Property("sampleNumber")); -} diff -Nru faac-1.26/common/mp4v2/atom_stsz.cpp faac-1.28/common/mp4v2/atom_stsz.cpp --- faac-1.26/common/mp4v2/atom_stsz.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_stsz.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -37,7 +37,7 @@ AddProperty(pTable); /* 4 */ pTable->AddProperty( /* 4/0 */ - new MP4Integer32Property("sampleSize")); + new MP4Integer32Property("entrySize")); } void MP4StszAtom::Read() diff -Nru faac-1.26/common/mp4v2/atom_stts.cpp faac-1.28/common/mp4v2/atom_stts.cpp --- faac-1.26/common/mp4v2/atom_stts.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_stts.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4SttsAtom::MP4SttsAtom() - : MP4Atom("stts") -{ - AddVersionAndFlags(); - - MP4Integer32Property* pCount = - new MP4Integer32Property("entryCount"); - AddProperty(pCount); - - MP4TableProperty* pTable = new MP4TableProperty("entries", pCount); - AddProperty(pTable); - - pTable->AddProperty( - new MP4Integer32Property("sampleCount")); - pTable->AddProperty( - new MP4Integer32Property("sampleDelta")); -} diff -Nru faac-1.26/common/mp4v2/atom_stz2.cpp faac-1.28/common/mp4v2/atom_stz2.cpp --- faac-1.26/common/mp4v2/atom_stz2.cpp 1970-01-01 00:00:00.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_stz2.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -0,0 +1,95 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * + * Contributor(s): + * Dave Mackie dmackie@cisco.com + */ + +#include "mp4common.h" + +/* + * This is used for the 4 bit sample size below. We need the sampleCount + * to be correct for the number of samples, but the table size needs to + * be correct to read and write it. + */ + +class MP4HalfSizeTableProperty : public MP4TableProperty +{ +public: + MP4HalfSizeTableProperty(char *name, MP4IntegerProperty *pCountProperty) : + MP4TableProperty(name, pCountProperty) {}; + + // The count is half the actual size + u_int32_t GetCount() { + return (m_pCountProperty->GetValue() + 1)/ 2; + }; + void SetCount(u_int32_t count) { + m_pCountProperty->SetValue(count * 2); + }; +}; + + +MP4Stz2Atom::MP4Stz2Atom() + : MP4Atom("stz2") +{ + AddVersionAndFlags(); /* 0, 1 */ + + AddReserved("reserved", 3); /* 2 */ + + AddProperty( /* 3 */ + new MP4Integer8Property("fieldSize")); + + MP4Integer32Property* pCount = + new MP4Integer32Property("sampleCount"); + AddProperty(pCount); /* 4 */ + +} + +void MP4Stz2Atom::Read() +{ + ReadProperties(0, 4); + + uint8_t fieldSize = + ((MP4Integer8Property *)m_pProperties[3])->GetValue(); + // uint32_t sampleCount = 0; + + MP4Integer32Property* pCount = + (MP4Integer32Property *)m_pProperties[4]; + + MP4TableProperty *pTable; + if (fieldSize != 4) { + pTable = new MP4TableProperty("entries", pCount); + } else { + // 4 bit field size uses a special table. + pTable = new MP4HalfSizeTableProperty("entries", pCount); + } + + AddProperty(pTable); + + if (fieldSize == 16) { + pTable->AddProperty( /* 5/0 */ + new MP4Integer16Property("entrySize")); + } else { + pTable->AddProperty( /* 5/0 */ + new MP4Integer8Property("entrySize")); + } + + ReadProperties(4); + + Skip(); // to end of atom +} + diff -Nru faac-1.26/common/mp4v2/atom_text.cpp faac-1.28/common/mp4v2/atom_text.cpp --- faac-1.26/common/mp4v2/atom_text.cpp 1970-01-01 00:00:00.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_text.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -0,0 +1,138 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * Contributer has declined to give copyright information, and gives + * it freely to the world. + */ + +#include "mp4common.h" + +MP4TextAtom::MP4TextAtom() + : MP4Atom("text") +{ + // The atom type "text" is used in two complete unrelated ways + // i.e. it's real two atoms with the same name + // To handle that we need to postpone property creation until + // we know who our parent atom is (stsd or gmhd) which gives us + // the context info we need to know who we are +} + +void MP4TextAtom::AddPropertiesStsdType() +{ + + AddReserved("reserved1", 6); /* 0 */ + + AddProperty(new MP4Integer16Property("dataReferenceIndex"));/* 1 */ + + AddProperty(new MP4Integer32Property("displayFlags")); /* 2 */ + AddProperty(new MP4Integer32Property("textJustification")); /* 3 */ + + AddProperty(new MP4Integer16Property("bgColorRed")); /* 4 */ + AddProperty(new MP4Integer16Property("bgColorGreen")); /* 5 */ + AddProperty(new MP4Integer16Property("bgColorBlue")); /* 6 */ + + AddProperty(new MP4Integer16Property("defTextBoxTop")); /* 7 */ + AddProperty(new MP4Integer16Property("defTextBoxLeft")); /* 8 */ + AddProperty(new MP4Integer16Property("defTextBoxBottom")); /* 9 */ + AddProperty(new MP4Integer16Property("defTextBoxRight")); /* 10 */ + + AddReserved("reserved2", 8); /* 11 */ + + AddProperty(new MP4Integer16Property("fontNumber")); /* 12 */ + AddProperty(new MP4Integer16Property("fontFace")); /* 13 */ + + AddReserved("reserved3", 1); /* 14 */ + AddReserved("reserved4", 2); /* 15 */ + + AddProperty(new MP4Integer16Property("foreColorRed")); /* 16 */ + AddProperty(new MP4Integer16Property("foreColorGreen")); /* 17 */ + AddProperty(new MP4Integer16Property("foreColorBlue")); /* 18 */ + +} + +void MP4TextAtom::AddPropertiesGmhdType() +{ + + AddProperty(new MP4BytesProperty("textData", 36)); /* 0 */ + +} + + +void MP4TextAtom::Generate() +{ + + if (ATOMID(m_pParentAtom->GetType()) == ATOMID("stsd")) { + AddPropertiesStsdType(); + GenerateStsdType(); + } else if (ATOMID(m_pParentAtom->GetType()) == ATOMID("gmhd")) { + AddPropertiesGmhdType(); + GenerateGmhdType(); + } else { + VERBOSE_WARNING(m_pFile->GetVerbosity(), + printf("Warning: text atom in unexpected context, can not generate")); + } + +} + +void MP4TextAtom::GenerateStsdType() +{ + // generate children + MP4Atom::Generate(); + + ((MP4Integer16Property*)m_pProperties[1])->SetValue(1); + + ((MP4Integer32Property*)m_pProperties[2])->SetValue(1); + ((MP4Integer32Property*)m_pProperties[3])->SetValue(1); + +} + +void MP4TextAtom::GenerateGmhdType() +{ + MP4Atom::Generate(); + + // property 0 has non-zero fixed values + static u_int8_t textData[36] = { + 0x00, 0x01, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x01, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0x40, 0x00, + 0x00, 0x00, + }; + ((MP4BytesProperty*)m_pProperties[0])->SetValue(textData, sizeof(textData)); + +} + +void MP4TextAtom::Read () +{ + if (ATOMID(m_pParentAtom->GetType()) == ATOMID("stsd")) { + AddPropertiesStsdType(); + } else if (ATOMID(m_pParentAtom->GetType()) == ATOMID("gmhd")) { + AddPropertiesGmhdType(); + } + + MP4Atom::Read(); +} + diff -Nru faac-1.26/common/mp4v2/atom_tims.cpp faac-1.28/common/mp4v2/atom_tims.cpp --- faac-1.26/common/mp4v2/atom_tims.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_tims.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4TimsAtom::MP4TimsAtom() - : MP4Atom("tims") -{ - AddProperty( - new MP4Integer32Property("timeScale")); -} - diff -Nru faac-1.26/common/mp4v2/atom_tkhd.cpp faac-1.28/common/mp4v2/atom_tkhd.cpp --- faac-1.26/common/mp4v2/atom_tkhd.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_tkhd.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -61,15 +61,17 @@ pProp->SetFixed16Format(); AddProperty(pProp); /* 8 */ - AddReserved("reserved3", 38); /* 9 */ + AddReserved("reserved3", 2); /* 9 */ + + AddProperty(new MP4BytesProperty("matrix", 36)); /* 10 */ pProp = new MP4Float32Property("width"); pProp->SetFixed32Format(); - AddProperty(pProp); /* 10 */ + AddProperty(pProp); /* 11 */ pProp = new MP4Float32Property("height"); pProp->SetFixed32Format(); - AddProperty(pProp); /* 11 */ + AddProperty(pProp); /* 12 */ } void MP4TkhdAtom::Generate() @@ -90,9 +92,14 @@ ((MP4Integer32Property*)m_pProperties[3])->SetValue(now); } - // property reserved3 has non-zero fixed values - static u_int8_t reserved3[38] = { - 0x00, 0x00, + // property "matrix" has non-zero fixed values + // this default identity matrix indicates no transformation, i.e. + // 1, 0, 0 + // 0, 1, 0 + // 0, 0, 1 + // see http://developer.apple.com/documentation/QuickTime/QTFF/QTFFChap4/chapter_5_section_4.html + + static u_int8_t matrix[36] = { 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -103,10 +110,9 @@ 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, }; - m_pProperties[9]->SetReadOnly(false); - ((MP4BytesProperty*)m_pProperties[9])-> - SetValue(reserved3, sizeof(reserved3)); - m_pProperties[9]->SetReadOnly(true); + + ((MP4BytesProperty*)m_pProperties[10])-> + SetValue(matrix, sizeof(matrix)); } void MP4TkhdAtom::Read() diff -Nru faac-1.26/common/mp4v2/atom_tmax.cpp faac-1.28/common/mp4v2/atom_tmax.cpp --- faac-1.26/common/mp4v2/atom_tmax.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_tmax.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4TmaxAtom::MP4TmaxAtom() - : MP4Atom("tmax") -{ - AddProperty( // max relative xmit time - new MP4Integer32Property("milliSecs")); -} diff -Nru faac-1.26/common/mp4v2/atom_tmin.cpp faac-1.28/common/mp4v2/atom_tmin.cpp --- faac-1.26/common/mp4v2/atom_tmin.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_tmin.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4TminAtom::MP4TminAtom() - : MP4Atom("tmin") -{ - AddProperty( // min relative xmit time - new MP4Integer32Property("milliSecs")); -} diff -Nru faac-1.26/common/mp4v2/atom_tpyl.cpp faac-1.28/common/mp4v2/atom_tpyl.cpp --- faac-1.26/common/mp4v2/atom_tpyl.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_tpyl.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4TpylAtom::MP4TpylAtom() - : MP4Atom("tpyl") -{ - AddProperty( // bytes sent of RTP payload data - new MP4Integer64Property("bytes")); -} diff -Nru faac-1.26/common/mp4v2/atom_traf.cpp faac-1.28/common/mp4v2/atom_traf.cpp --- faac-1.26/common/mp4v2/atom_traf.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_traf.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4TrafAtom::MP4TrafAtom() - : MP4Atom("traf") -{ - ExpectChildAtom("tfhd", Required, OnlyOne); - ExpectChildAtom("trun", Optional, Many); -} - diff -Nru faac-1.26/common/mp4v2/atom_trak.cpp faac-1.28/common/mp4v2/atom_trak.cpp --- faac-1.26/common/mp4v2/atom_trak.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_trak.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4TrakAtom::MP4TrakAtom() - : MP4Atom("trak") -{ - ExpectChildAtom("tkhd", Required, OnlyOne); - ExpectChildAtom("tref", Optional, OnlyOne); - ExpectChildAtom("edts", Optional, OnlyOne); - ExpectChildAtom("mdia", Required, OnlyOne); - ExpectChildAtom("udta", Optional, Many); -} diff -Nru faac-1.26/common/mp4v2/atom_tref.cpp faac-1.28/common/mp4v2/atom_tref.cpp --- faac-1.26/common/mp4v2/atom_tref.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_tref.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4TrefAtom::MP4TrefAtom() - : MP4Atom("tref") -{ - ExpectChildAtom("dpnd", Optional, OnlyOne); - ExpectChildAtom("hint", Optional, OnlyOne); - ExpectChildAtom("ipir", Optional, OnlyOne); - ExpectChildAtom("mpod", Optional, OnlyOne); - ExpectChildAtom("sync", Optional, OnlyOne); -} diff -Nru faac-1.26/common/mp4v2/atom_trex.cpp faac-1.28/common/mp4v2/atom_trex.cpp --- faac-1.26/common/mp4v2/atom_trex.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_trex.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4TrexAtom::MP4TrexAtom() - : MP4Atom("trex") -{ - AddVersionAndFlags(); /* 0, 1 */ - AddProperty( /* 2 */ - new MP4Integer32Property("trackId")); - AddProperty( /* 3 */ - new MP4Integer32Property("defaultSampleDesriptionIndex")); - AddProperty( /* 4 */ - new MP4Integer32Property("defaultSampleDuration")); - AddProperty( /* 5 */ - new MP4Integer32Property("defaultSampleSize")); - AddProperty( /* 6 */ - new MP4Integer32Property("defaultSampleFlags")); -} - diff -Nru faac-1.26/common/mp4v2/atom_trpy.cpp faac-1.28/common/mp4v2/atom_trpy.cpp --- faac-1.26/common/mp4v2/atom_trpy.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_trpy.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4TrpyAtom::MP4TrpyAtom() - : MP4Atom("trpy") -{ - AddProperty( // bytes sent including RTP headers - new MP4Integer64Property("bytes")); -} diff -Nru faac-1.26/common/mp4v2/atom_trun.cpp faac-1.28/common/mp4v2/atom_trun.cpp --- faac-1.26/common/mp4v2/atom_trun.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_trun.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -42,7 +42,8 @@ } MP4TableProperty* pTable = - new MP4TableProperty("samples", m_pProperties[2]); + new MP4TableProperty("samples", + (MP4Integer32Property *)m_pProperties[2]); AddProperty(pTable); if (flags & 0x100) { diff -Nru faac-1.26/common/mp4v2/atom_tsro.cpp faac-1.28/common/mp4v2/atom_tsro.cpp --- faac-1.26/common/mp4v2/atom_tsro.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_tsro.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is MPEG4IP. - * - * The Initial Developer of the Original Code is Cisco Systems Inc. - * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. - * - * Contributor(s): - * Dave Mackie dmackie@cisco.com - */ - -#include "mp4common.h" - -MP4TsroAtom::MP4TsroAtom() - : MP4Atom("tsro") -{ - AddProperty( - new MP4Integer32Property("offset")); -} - diff -Nru faac-1.26/common/mp4v2/atom_udta.cpp faac-1.28/common/mp4v2/atom_udta.cpp --- faac-1.26/common/mp4v2/atom_udta.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_udta.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -27,6 +27,11 @@ ExpectChildAtom("cprt", Optional, Many); ExpectChildAtom("hnti", Optional, OnlyOne); ExpectChildAtom("meta", Optional, OnlyOne); + ExpectChildAtom("\251cpy", Optional, OnlyOne); + ExpectChildAtom("\251des", Optional, OnlyOne); + ExpectChildAtom("\251nam", Optional, OnlyOne); + ExpectChildAtom("\251cmt", Optional, OnlyOne); + ExpectChildAtom("\251prd", Optional, OnlyOne); } void MP4UdtaAtom::Read() diff -Nru faac-1.26/common/mp4v2/atom_url.cpp faac-1.28/common/mp4v2/atom_url.cpp --- faac-1.26/common/mp4v2/atom_url.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_url.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -21,8 +21,8 @@ #include "mp4common.h" -MP4UrlAtom::MP4UrlAtom() - : MP4Atom("url ") +MP4UrlAtom::MP4UrlAtom(const char *type) + : MP4Atom(type) { AddVersionAndFlags(); AddProperty(new MP4StringProperty("location")); diff -Nru faac-1.26/common/mp4v2/atom_video.cpp faac-1.28/common/mp4v2/atom_video.cpp --- faac-1.26/common/mp4v2/atom_video.cpp 1970-01-01 00:00:00.000000000 +0000 +++ faac-1.28/common/mp4v2/atom_video.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -0,0 +1,78 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2004. All Rights Reserved. + * + * Contributor(s): + * Bill May wmay@cisco.com + */ + +#include "mp4common.h" + +MP4VideoAtom::MP4VideoAtom (const char *type) + : MP4Atom(type) +{ + AddReserved("reserved1", 6); /* 0 */ + + AddProperty( /* 1 */ + new MP4Integer16Property("dataReferenceIndex")); + + AddReserved("reserved2", 16); /* 2 */ + + AddProperty( /* 3 */ + new MP4Integer16Property("width")); + AddProperty( /* 4 */ + new MP4Integer16Property("height")); + + AddReserved("reserved3", 14); /* 5 */ + + MP4StringProperty* pProp = + new MP4StringProperty("compressorName"); + pProp->SetFixedLength(32); + pProp->SetValue(""); + AddProperty(pProp); /* 6 */ + + AddProperty(/* 7 */ + new MP4Integer16Property("depth")); + AddProperty(/* 8 */ + new MP4Integer16Property("colorTableId")); + ExpectChildAtom("smi ", Optional, OnlyOne); +} + +void MP4VideoAtom::Generate() +{ + MP4Atom::Generate(); + + ((MP4Integer16Property*)m_pProperties[1])->SetValue(1); + + // property reserved3 has non-zero fixed values + static u_int8_t reserved3[14] = { + 0x00, 0x48, 0x00, 0x00, + 0x00, 0x48, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, + }; + m_pProperties[5]->SetReadOnly(false); + ((MP4BytesProperty*)m_pProperties[5])-> + SetValue(reserved3, sizeof(reserved3)); + m_pProperties[5]->SetReadOnly(true); + + // depth and color table id values - should be set later + // as far as depth - color table is most likely 0xff + ((MP4IntegerProperty *)m_pProperties[7])->SetValue(0x18); + ((MP4IntegerProperty *)m_pProperties[8])->SetValue(0xffff); + +} + diff -Nru faac-1.26/common/mp4v2/descriptors.cpp faac-1.28/common/mp4v2/descriptors.cpp --- faac-1.26/common/mp4v2/descriptors.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/descriptors.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -21,6 +21,105 @@ #include "mp4common.h" +MP4BaseDescriptor::MP4BaseDescriptor (u_int8_t tag) : MP4Descriptor(tag) +{ + switch (tag) { + case MP4ESIDIncDescrTag: + AddProperty( /* 0 */ + new MP4Integer32Property("id")); + break; + case MP4ESIDRefDescrTag: + AddProperty( /* 0 */ + new MP4Integer16Property("refIndex")); + break; + case MP4IPIPtrDescrTag: + AddProperty( /* 0 */ + new MP4Integer16Property("IPIESId")); + break; + case MP4SupplContentIdDescrTag: + AddProperty( /* 0 */ + new MP4BytesProperty("languageCode", 3)); + AddProperty( /* 1 */ + new MP4StringProperty("title", Counted)); + AddProperty( /* 2 */ + new MP4StringProperty("value", Counted)); + break; + case MP4IPMPPtrDescrTag: + AddProperty( /* 0 */ + new MP4Integer8Property("IPMPDescriptorId")); + break; + case MP4ExtProfileLevelDescrTag: + AddProperty( /* 0 */ + new MP4Integer8Property("profileLevelIndicationIndex")); + AddProperty( /* 1 */ + new MP4Integer8Property("ODProfileLevelIndication")); + AddProperty( /* 2 */ + new MP4Integer8Property("sceneProfileLevelIndication")); + AddProperty( /* 3 */ + new MP4Integer8Property("audioProfileLevelIndication")); + AddProperty( /* 4 */ + new MP4Integer8Property("visualProfileLevelIndication")); + AddProperty( /* 5 */ + new MP4Integer8Property("graphicsProfileLevelIndication")); + AddProperty( /* 6 */ + new MP4Integer8Property("MPEGJProfileLevelIndication")); + break; + default: + MP4Printf("error in base descriptor - tag %u", tag); + break; + + } +} + +MP4BytesDescriptor::MP4BytesDescriptor (u_int8_t tag) : MP4Descriptor(tag) +{ + m_size_offset = 0; + m_bytes_index = 0; + if (tag >= MP4ExtDescrTagsStart && tag <= MP4ExtDescrTagsEnd) { + AddProperty( /* 0 */ + new MP4BytesProperty("data")); + } else { + switch (tag) { + case MP4DecSpecificDescrTag: + AddProperty( /* 0 */ + new MP4BytesProperty("info")); + // no change to m_size + break; + case MP4IPMPDescrTag: + AddProperty( /* 0 */ + new MP4Integer8Property("IPMPDescriptorId")); + AddProperty( /* 1 */ + new MP4Integer16Property("IPMPSType")); + AddProperty( /* 2 */ + new MP4BytesProperty("IPMPData")); + /* note: if IPMPSType == 0, IPMPData is an URL */ + m_size_offset = 3; + m_bytes_index = 2; + break; + case MP4RegistrationDescrTag: + AddProperty( /* 0 */ + new MP4Integer32Property("formatIdentifier")); + AddProperty( /* 1 */ + new MP4BytesProperty("additionalIdentificationInfo")); + m_size_offset = 4; + m_bytes_index = 1; + break; + default: + MP4Printf("error in bytes descriptor - tag %u", tag); + break; + } + } +} + +void MP4BytesDescriptor::Read(MP4File *pFile) +{ + ReadHeader(pFile); + + /* byte properties need to know how long they are before reading */ + ((MP4BytesProperty*)m_pProperties[m_bytes_index])->SetValueSize(m_size - m_size_offset); + + ReadProperties(pFile); +} MP4IODescriptor::MP4IODescriptor() : MP4Descriptor(MP4FileIODescrTag) { @@ -123,20 +222,6 @@ } } -MP4ESIDIncDescriptor::MP4ESIDIncDescriptor() - : MP4Descriptor(MP4ESIDIncDescrTag) -{ - AddProperty( /* 0 */ - new MP4Integer32Property("id")); -} - -MP4ESIDRefDescriptor::MP4ESIDRefDescriptor() - : MP4Descriptor(MP4ESIDRefDescrTag) -{ - AddProperty( /* 0 */ - new MP4Integer16Property("refIndex")); -} - MP4ESDescriptor::MP4ESDescriptor() : MP4Descriptor(MP4ESDescrTag) { @@ -233,23 +318,6 @@ ((MP4BitfieldProperty*)m_pProperties[3])->SetValue(1); } -MP4DecSpecificDescriptor::MP4DecSpecificDescriptor() - : MP4Descriptor(MP4DecSpecificDescrTag) -{ - AddProperty( /* 0 */ - new MP4BytesProperty("info")); -} - -void MP4DecSpecificDescriptor::Read(MP4File* pFile) -{ - ReadHeader(pFile); - - /* byte properties need to know how long they are before reading */ - ((MP4BytesProperty*)m_pProperties[0])->SetValueSize(m_size); - - ReadProperties(pFile); -} - MP4SLConfigDescriptor::MP4SLConfigDescriptor() : MP4Descriptor(MP4SLConfigDescrTag) { @@ -401,13 +469,6 @@ } } -MP4IPIPtrDescriptor::MP4IPIPtrDescriptor() - : MP4Descriptor(MP4IPIPtrDescrTag) -{ - AddProperty( /* 0 */ - new MP4Integer16Property("IPIESId")); -} - MP4ContentIdDescriptor::MP4ContentIdDescriptor() : MP4Descriptor(MP4ContentIdDescrTag) { @@ -450,113 +511,39 @@ /* which allows us to reconfigure ourselves */ Mutate(); - /* read the remaining properties */ - ReadProperties(pFile, 5); -} - -void MP4ContentIdDescriptor::Mutate() -{ bool contentTypeFlag = ((MP4BitfieldProperty*)m_pProperties[1])->GetValue(); - m_pProperties[5]->SetImplicit(!contentTypeFlag); bool contentIdFlag = ((MP4BitfieldProperty*)m_pProperties[2])->GetValue(); - m_pProperties[6]->SetImplicit(!contentIdFlag); - m_pProperties[7]->SetImplicit(!contentIdFlag); -} - -MP4SupplContentIdDescriptor::MP4SupplContentIdDescriptor() - : MP4Descriptor(MP4SupplContentIdDescrTag) -{ - AddProperty( /* 0 */ - new MP4BytesProperty("languageCode", 3)); - AddProperty( /* 1 */ - new MP4StringProperty("title", Counted)); - AddProperty( /* 2 */ - new MP4StringProperty("value", Counted)); -} - -MP4IPMPPtrDescriptor::MP4IPMPPtrDescriptor() - : MP4Descriptor(MP4IPMPPtrDescrTag) -{ - AddProperty( /* 0 */ - new MP4Integer8Property("IPMPDescriptorId")); -} -MP4IPMPDescriptor::MP4IPMPDescriptor() - : MP4Descriptor(MP4IPMPDescrTag) -{ - AddProperty( /* 0 */ - new MP4Integer8Property("IPMPDescriptorId")); - AddProperty( /* 1 */ - new MP4Integer16Property("IPMPSType")); - AddProperty( /* 2 */ - new MP4BytesProperty("IPMPData")); - /* note: if IPMPSType == 0, IPMPData is an URL */ -} + if (contentIdFlag) { -void MP4IPMPDescriptor::Read(MP4File* pFile) -{ - ReadHeader(pFile); + u_int32_t cIdOffset = 2; - /* byte properties need to know how long they are before reading */ - ((MP4BytesProperty*)m_pProperties[2])->SetValueSize(m_size - 3); + if (contentTypeFlag) { - ReadProperties(pFile); -} + cIdOffset++; -MP4RegistrationDescriptor::MP4RegistrationDescriptor() - : MP4Descriptor(MP4RegistrationDescrTag) -{ - AddProperty( /* 0 */ - new MP4Integer32Property("formatIdentifier")); - AddProperty( /* 1 */ - new MP4BytesProperty("additionalIdentificationInfo")); -} + } -void MP4RegistrationDescriptor::Read(MP4File* pFile) -{ - ReadHeader(pFile); + ((MP4BytesProperty*)m_pProperties[7])->SetValueSize(m_size - cIdOffset); - /* byte properties need to know how long they are before reading */ - ((MP4BytesProperty*)m_pProperties[1])->SetValueSize(m_size - 4); + } - ReadProperties(pFile); -} -MP4ExtProfileLevelDescriptor::MP4ExtProfileLevelDescriptor() - : MP4Descriptor(MP4ExtProfileLevelDescrTag) -{ - AddProperty( /* 0 */ - new MP4Integer8Property("profileLevelIndicationIndex")); - AddProperty( /* 1 */ - new MP4Integer8Property("ODProfileLevelIndication")); - AddProperty( /* 2 */ - new MP4Integer8Property("sceneProfileLevelIndication")); - AddProperty( /* 3 */ - new MP4Integer8Property("audioProfileLevelIndication")); - AddProperty( /* 4 */ - new MP4Integer8Property("visualProfileLevelIndication")); - AddProperty( /* 5 */ - new MP4Integer8Property("graphicsProfileLevelIndication")); - AddProperty( /* 6 */ - new MP4Integer8Property("MPEGJProfileLevelIndication")); -} -MP4ExtensionDescriptor::MP4ExtensionDescriptor() - : MP4Descriptor() -{ - AddProperty( /* 0 */ - new MP4BytesProperty("data")); + /* read the remaining properties */ + ReadProperties(pFile, 5); } -void MP4ExtensionDescriptor::Read(MP4File* pFile) +void MP4ContentIdDescriptor::Mutate() { - ReadHeader(pFile); + bool contentTypeFlag = ((MP4BitfieldProperty*)m_pProperties[1])->GetValue(); + m_pProperties[5]->SetImplicit(!contentTypeFlag); - /* byte properties need to know how long they are before reading */ - ((MP4BytesProperty*)m_pProperties[0])->SetValueSize(m_size); + bool contentIdFlag = ((MP4BitfieldProperty*)m_pProperties[2])->GetValue(); + m_pProperties[6]->SetImplicit(!contentIdFlag); + m_pProperties[7]->SetImplicit(!contentIdFlag); - ReadProperties(pFile); } MP4Descriptor* MP4DescriptorProperty::CreateDescriptor(u_int8_t tag) @@ -571,7 +558,9 @@ pDescriptor = new MP4DecConfigDescriptor(); break; case MP4DecSpecificDescrTag: - pDescriptor = new MP4DecSpecificDescriptor(); + case MP4IPMPDescrTag: + case MP4RegistrationDescrTag: + pDescriptor = new MP4BytesDescriptor(tag); break; case MP4SLConfigDescrTag: pDescriptor = new MP4SLConfigDescriptor(); @@ -579,29 +568,16 @@ case MP4ContentIdDescrTag: pDescriptor = new MP4ContentIdDescriptor(); break; - case MP4SupplContentIdDescrTag: - pDescriptor = new MP4SupplContentIdDescriptor(); - break; + case MP4ESIDIncDescrTag: + case MP4ESIDRefDescrTag: case MP4IPIPtrDescrTag: - pDescriptor = new MP4IPIPtrDescriptor(); - break; + case MP4SupplContentIdDescrTag: case MP4IPMPPtrDescrTag: - pDescriptor = new MP4IPMPPtrDescriptor(); - break; - case MP4IPMPDescrTag: - pDescriptor = new MP4IPMPDescriptor(); + case MP4ExtProfileLevelDescrTag: + pDescriptor = new MP4BaseDescriptor(tag); break; case MP4QosDescrTag: - pDescriptor = new MP4QosDescriptor(); - break; - case MP4RegistrationDescrTag: - pDescriptor = new MP4RegistrationDescriptor(); - break; - case MP4ESIDIncDescrTag: - pDescriptor = new MP4ESIDIncDescriptor(); - break; - case MP4ESIDRefDescrTag: - pDescriptor = new MP4ESIDRefDescriptor(); + pDescriptor = new MP4QosDescriptorBase(MP4QosDescrTag); break; case MP4IODescrTag: case MP4FileIODescrTag: @@ -613,9 +589,6 @@ pDescriptor = new MP4ODescriptor(); pDescriptor->SetTag(tag); break; - case MP4ExtProfileLevelDescrTag: - pDescriptor = new MP4ExtProfileLevelDescriptor(); - break; } if (pDescriptor == NULL) { @@ -624,8 +597,7 @@ } if (tag >= MP4ExtDescrTagsStart && tag <= MP4ExtDescrTagsEnd) { - pDescriptor = new MP4ExtensionDescriptor(); - pDescriptor->SetTag(tag); + pDescriptor = new MP4BytesDescriptor(tag); } } diff -Nru faac-1.26/common/mp4v2/descriptors.h faac-1.28/common/mp4v2/descriptors.h --- faac-1.26/common/mp4v2/descriptors.h 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/descriptors.h 2009-01-25 01:14:34.000000000 +0000 @@ -42,6 +42,20 @@ const u_int8_t MP4ExtDescrTagsStart = 0x80; const u_int8_t MP4ExtDescrTagsEnd = 0xFE; +class MP4BaseDescriptor : public MP4Descriptor { + public: + MP4BaseDescriptor(u_int8_t tag); +}; + +class MP4BytesDescriptor : public MP4Descriptor { + public: + MP4BytesDescriptor(u_int8_t tag); + void Read(MP4File* pFile); + protected: + uint m_size_offset; // size to adjust the size for the bytes property + uint m_bytes_index; // index into properties for bytes property +}; + class MP4IODescriptor : public MP4Descriptor { public: MP4IODescriptor(); @@ -58,15 +72,6 @@ void Mutate(); }; -class MP4ESIDIncDescriptor : public MP4Descriptor { -public: - MP4ESIDIncDescriptor(); -}; - -class MP4ESIDRefDescriptor : public MP4Descriptor { -public: - MP4ESIDRefDescriptor(); -}; class MP4ESDescriptor : public MP4Descriptor { public: @@ -81,11 +86,6 @@ void Generate(); }; -class MP4DecSpecificDescriptor : public MP4Descriptor { -public: - MP4DecSpecificDescriptor(); - void Read(MP4File* pFile); -}; class MP4SLConfigDescriptor : public MP4Descriptor { public: @@ -109,39 +109,6 @@ void Mutate(); }; -class MP4SupplContentIdDescriptor : public MP4Descriptor { -public: - MP4SupplContentIdDescriptor(); -}; - -class MP4IPMPPtrDescriptor : public MP4Descriptor { -public: - MP4IPMPPtrDescriptor(); -}; - -class MP4IPMPDescriptor : public MP4Descriptor { -public: - MP4IPMPDescriptor(); - void Read(MP4File* pFile); -}; - -class MP4RegistrationDescriptor : public MP4Descriptor { -public: - MP4RegistrationDescriptor(); - void Read(MP4File* pFile); -}; - -class MP4ExtProfileLevelDescriptor : public MP4Descriptor { -public: - MP4ExtProfileLevelDescriptor(); -}; - -class MP4ExtensionDescriptor : public MP4Descriptor { -public: - MP4ExtensionDescriptor(); - void Read(MP4File* pFile); -}; - // associated values in descriptors // ES objectTypeId diff -Nru faac-1.26/common/mp4v2/INTERNALS faac-1.28/common/mp4v2/INTERNALS --- faac-1.26/common/mp4v2/INTERNALS 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/INTERNALS 2009-01-25 01:14:34.000000000 +0000 @@ -50,12 +50,17 @@ any combination of properties, other atoms, or descriptors. The mp4atom files contain the base class for all the atoms, and provide -generic functions that cover most cases. However, each atom has it's own -subclass contained in file atom_.cpp, where is the four -letter name of the atom defined in the MP4 specification. Typically this -atom file just specifies the properties of the atom or the possible child -atoms in the case of a container atom. In more specialized cases the atom -specific file provides routines to initialize, read, or write the atom. +generic functions that cover most cases. Most atoms are covered in +atom_standard.cpp. Atoms that have a special read, generation or +write needs are contained in their subclass contained in file atom_.cpp, + where is the four letter name of the atom defined in the MP4 +specification. + +Atoms that only specifies the properties of the atom or the possible child +atoms in the case of a container atom are located in atom_standard.cpp. + +In more specialized cases the atom specific file provides routines to +initialize, read, or write the atom. Properties are the atomic pieces of information. The basic types of properties are integers, floats, strings, and byte arrays. For integers @@ -103,6 +108,15 @@ Note that internally when performance matters the code looks up a property by name once, and then stores the returned pointer to the property class. +To add an atom, first you should see if an existing atom exists that +can be used. If not, you need to decide if special read/write or +generate properties need to be established; for example a property in the atom +changes other properties (adds, or subtracts). If there are no +special cases, add the atom properties to atom_standard.cpp. If there +are special properties, add a new file, add a new class to atoms.h, and +add the class to MP4Atom::CreateAtom in mp4atom.cpp. + + Generic Tracks ============== diff -Nru faac-1.26/common/mp4v2/isma.cpp faac-1.28/common/mp4v2/isma.cpp --- faac-1.26/common/mp4v2/isma.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/isma.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -29,7 +29,7 @@ #include "mp4common.h" -static u_int8_t BifsV2Config[3] = { +static const u_int8_t BifsV2Config[3] = { 0x00, 0x00, 0x60 // IsCommandStream = 1, PixelMetric = 1 }; @@ -59,20 +59,42 @@ catch (MP4Error* e) { delete e; } - // Check whether it's an AMR-NB or AMR-WB trak - if ((MP4HaveTrackIntegerProperty(this, audioTrackId, "mdia.minf.stbl.stsd.sawb.damr.vendor")) || - (MP4HaveTrackIntegerProperty(this, audioTrackId, "mdia.minf.stbl.stsd.samr.damr.vendor"))) { - throw new MP4Error("can't make ISMA compliant when file contains an AMR track", "MakeIsmaCompliant"); + if (audioTrackId == MP4_INVALID_TRACK_ID && + videoTrackId == MP4_INVALID_TRACK_ID) return; + + const char *audio_media_data_name, *video_media_data_name; + uint8_t videoProfile = 0xff; + if (audioTrackId != MP4_INVALID_TRACK_ID) { + audio_media_data_name = MP4GetTrackMediaDataName(this, audioTrackId); + if (!(ATOMID(audio_media_data_name) == ATOMID("mp4a") || + ATOMID(audio_media_data_name) == ATOMID("enca"))) { + VERBOSE_ERROR(m_verbosity, + printf("MakeIsmaCompliant:can't make ISMA compliant when file contains an %s track\n", audio_media_data_name); + ); + return; + } } // - // Check whether it's an H.263 file - if (MP4HaveTrackIntegerProperty(this, videoTrackId, "mdia.minf.stbl.stsd.s263.d263.vendor")) { - throw new MP4Error("can't make ISMA compliant when file contains an H.263 track", "MakeIsmaCompliant"); + // Note - might have to check for avc1 here... + if (videoTrackId != MP4_INVALID_TRACK_ID) { + video_media_data_name = MP4GetTrackMediaDataName(this, videoTrackId); + if (!(ATOMID(video_media_data_name) == ATOMID("mp4v") || + ATOMID(video_media_data_name) == ATOMID("encv"))) { + VERBOSE_ERROR(m_verbosity, + printf("MakeIsmaCompliant:can't make ISMA compliant when file contains an %s track\n", video_media_data_name); + ); + return; + } + uint32_t verb = GetVerbosity(); + SetVerbosity(verb & ~MP4_DETAILS_ERROR); + videoProfile = MP4GetVideoProfileLevel(this, videoTrackId); + SetVerbosity(verb); } m_useIsma = true; - u_int64_t fileMsDuration = + u_int64_t fileMsDuration = 0; + fileMsDuration = ConvertFromMovieDuration(GetDuration(), MP4_MSECS_TIME_SCALE); // delete any existing OD track @@ -80,15 +102,19 @@ DeleteTrack(m_odTrackId); } - AddODTrack(); + if (m_pRootAtom->FindAtom("moov.iods") == NULL) { + (void)AddChildAtom("moov", "iods"); + } + (void)AddODTrack(); SetODProfileLevel(0xFF); if (audioTrackId != MP4_INVALID_TRACK_ID) { AddTrackToOd(audioTrackId); + MP4SetAudioProfileLevel(this, 0xf); } - if (videoTrackId != MP4_INVALID_TRACK_ID) { AddTrackToOd(videoTrackId); + MP4SetVideoProfileLevel(this, videoProfile); } // delete any existing scene track @@ -153,13 +179,17 @@ char* iodBase64 = MP4ToBase64(pBytes, numBytes); - char* sdpBuf = (char*)MP4Calloc(strlen(iodBase64) + 256); + uint sdpBufLen = strlen(iodBase64) + 256; + uint used; + char* sdpBuf = (char*)MP4Calloc(sdpBufLen); if (addIsmaComplianceSdp) { - strcpy(sdpBuf, "a=isma-compliance:1,1.0,1\015\012"); + strncpy(sdpBuf, "a=isma-compliance:1,1.0,1\015\012", sdpBufLen); } - sprintf(&sdpBuf[strlen(sdpBuf)], + used = strlen(sdpBuf); + sdpBufLen -= used; + snprintf(&sdpBuf[used], sdpBufLen, "a=mpeg4-iod: \042data:application/mpeg4-iod;base64,%s\042\015\012", iodBase64); @@ -184,9 +214,8 @@ MP4IntegerProperty* pGetProperty; MP4IntegerProperty* pSetProperty; - pSrc->FindProperty(name, (MP4Property**)&pGetProperty); - pDest->FindProperty(name, (MP4Property**)&pSetProperty); - + if (!pSrc->FindProperty(name, (MP4Property**)&pGetProperty)) return; + if (!pDest->FindProperty(name, (MP4Property**)&pSetProperty)) return; pSetProperty->SetValue(pGetProperty->GetValue()); } @@ -216,7 +245,7 @@ // mutate esIds from MP4ESIDIncDescrTag to MP4ESDescrTag MP4DescriptorProperty* pEsProperty; - pIod->FindProperty("esIds", (MP4Property**)&pEsProperty); + if (!pIod->FindProperty("esIds", (MP4Property**)&pEsProperty)) return; pEsProperty->SetTags(MP4ESDescrTag); MP4IntegerProperty* pSetProperty; @@ -228,15 +257,14 @@ pEsProperty->AddDescriptor(MP4ESDescrTag); pOdEsd->Generate(); - pOdEsd->FindProperty("ESID", - (MP4Property**)&pOdESID); + if (!pOdEsd->FindProperty("ESID", (MP4Property**)&pOdESID)) return; // we set the OD ESID to a non-zero unique value pOdESID->SetValue(m_odTrackId); - pOdEsd->FindProperty("URLFlag", - (MP4Property**)&pSetProperty); - pSetProperty->SetValue(1); + if (pOdEsd->FindProperty("URLFlag", + (MP4Property**)&pSetProperty)) + pSetProperty->SetValue(1); u_int8_t* pBytes; u_int64_t numBytes; @@ -252,16 +280,17 @@ char* odCmdBase64 = MP4ToBase64(pBytes, numBytes); - char* urlBuf = (char*)MP4Malloc(strlen(odCmdBase64) + 64); + uint urlBufLen = strlen(odCmdBase64) + 64; + char* urlBuf = (char*)MP4Malloc(urlBufLen); - sprintf(urlBuf, + snprintf(urlBuf, urlBufLen, "data:application/mpeg4-od-au;base64,%s", odCmdBase64); MP4StringProperty* pUrlProperty; - pOdEsd->FindProperty("URL", - (MP4Property**)&pUrlProperty); - pUrlProperty->SetValue(urlBuf); + if (pOdEsd->FindProperty("URL", + (MP4Property**)&pUrlProperty)) + pUrlProperty->SetValue(urlBuf); VERBOSE_ISMA(GetVerbosity(), printf("OD data URL = \042%s\042\n", urlBuf)); @@ -276,7 +305,7 @@ MP4DescriptorProperty* pSrcDcd = NULL; // HACK temporarily point to scene decoder config - FindProperty(MakeTrackName(odTrackId, + (void)FindProperty(MakeTrackName(odTrackId, "mdia.minf.stbl.stsd.mp4s.esds.decConfigDescr"), (MP4Property**)&pSrcDcd); ASSERT(pSrcDcd); @@ -286,15 +315,16 @@ // bufferSizeDB needs to be set appropriately MP4BitfieldProperty* pBufferSizeProperty = NULL; - pOdEsd->FindProperty("decConfigDescr.bufferSizeDB", - (MP4Property**)&pBufferSizeProperty); - ASSERT(pBufferSizeProperty); - pBufferSizeProperty->SetValue(numBytes); + if (pOdEsd->FindProperty("decConfigDescr.bufferSizeDB", + (MP4Property**)&pBufferSizeProperty)) { + ASSERT(pBufferSizeProperty); + pBufferSizeProperty->SetValue(numBytes); + } // SL config needs to change from 2 (file) to 1 (null) - pOdEsd->FindProperty("slConfigDescr.predefined", - (MP4Property**)&pSetProperty); - pSetProperty->SetValue(1); + if (pOdEsd->FindProperty("slConfigDescr.predefined", + (MP4Property**)&pSetProperty)) + pSetProperty->SetValue(1); // Scene @@ -302,14 +332,15 @@ pEsProperty->AddDescriptor(MP4ESDescrTag); pSceneEsd->Generate(); - pSceneEsd->FindProperty("ESID", - (MP4Property**)&pSceneESID); - // we set the Scene ESID to a non-zero unique value - pSceneESID->SetValue(sceneTrackId); + if (pSceneEsd->FindProperty("ESID", + (MP4Property**)&pSceneESID)) { + // we set the Scene ESID to a non-zero unique value + pSceneESID->SetValue(sceneTrackId); + } - pSceneEsd->FindProperty("URLFlag", - (MP4Property**)&pSetProperty); - pSetProperty->SetValue(1); + if (pSceneEsd->FindProperty("URLFlag", + (MP4Property**)&pSetProperty)) + pSetProperty->SetValue(1); CreateIsmaSceneCommand( MP4_IS_VALID_TRACK_ID(audioTrackId), @@ -323,12 +354,12 @@ char *sceneCmdBase64 = MP4ToBase64(pBytes, numBytes); urlBuf = (char*)MP4Malloc(strlen(sceneCmdBase64) + 64); - sprintf(urlBuf, - "data:application/mpeg4-bifs-au;base64,%s", - sceneCmdBase64); + snprintf(urlBuf, strlen(sceneCmdBase64) + 64, + "data:application/mpeg4-bifs-au;base64,%s", + sceneCmdBase64); - pSceneEsd->FindProperty("URL", - (MP4Property**)&pUrlProperty); + if (pSceneEsd->FindProperty("URL", + (MP4Property**)&pUrlProperty)) pUrlProperty->SetValue(urlBuf); VERBOSE_ISMA(GetVerbosity(), @@ -342,9 +373,9 @@ pBytes = NULL; // HACK temporarily point to scene decoder config - FindProperty(MakeTrackName(sceneTrackId, + ASSERT(FindProperty(MakeTrackName(sceneTrackId, "mdia.minf.stbl.stsd.mp4s.esds.decConfigDescr"), - (MP4Property**)&pSrcDcd); + (MP4Property**)&pSrcDcd)); ASSERT(pSrcDcd); MP4Property* pOrgSceneEsdProperty = pSceneEsd->GetProperty(8); @@ -352,14 +383,15 @@ // bufferSizeDB needs to be set pBufferSizeProperty = NULL; - pSceneEsd->FindProperty("decConfigDescr.bufferSizeDB", - (MP4Property**)&pBufferSizeProperty); + if (pSceneEsd->FindProperty("decConfigDescr.bufferSizeDB", + (MP4Property**)&pBufferSizeProperty)) { ASSERT(pBufferSizeProperty); pBufferSizeProperty->SetValue(numBytes); + } // SL config needs to change from 2 (file) to 1 (null) - pSceneEsd->FindProperty("slConfigDescr.predefined", - (MP4Property**)&pSetProperty); + if (pSceneEsd->FindProperty("slConfigDescr.predefined", + (MP4Property**)&pSetProperty)) pSetProperty->SetValue(1); @@ -401,17 +433,17 @@ pIod->Generate(); // Set audio and video profileLevels - pIod->FindProperty("audioProfileLevelId", - (MP4Property**)&pInt); + if (pIod->FindProperty("audioProfileLevelId", + (MP4Property**)&pInt)) pInt->SetValue(audioProfile); - pIod->FindProperty("visualProfileLevelId", - (MP4Property**)&pInt); - pInt->SetValue(videoProfile); + if (pIod->FindProperty("visualProfileLevelId", + (MP4Property**)&pInt)) + pInt->SetValue(videoProfile); // Mutate esIds from MP4ESIDIncDescrTag to MP4ESDescrTag MP4DescriptorProperty* pEsProperty; - pIod->FindProperty("esIds", (MP4Property**)&pEsProperty); + if (!pIod->FindProperty("esIds", (MP4Property**)&pEsProperty)) return; pEsProperty->SetTags(MP4ESDescrTag); // Add ES Descriptors @@ -430,29 +462,29 @@ char* urlBuf = (char*)MP4Malloc(strlen(sceneCmdBase64) + 64); - sprintf(urlBuf, - "data:application/mpeg4-bifs-au;base64,%s", - sceneCmdBase64); - - VERBOSE_ISMA(GetVerbosity(), - printf("Scene data URL = \042%s\042\n", urlBuf)); - - /* MP4Descriptor* pSceneEsd = */ - CreateESD( - pEsProperty, - 201, // esid - MP4SystemsV2ObjectType, + snprintf(urlBuf, strlen(sceneCmdBase64) + 64, + "data:application/mpeg4-bifs-au;base64,%s", + sceneCmdBase64); + + VERBOSE_ISMA(GetVerbosity(), + printf("Scene data URL = \042%s\042\n", urlBuf)); + + /* MP4Descriptor* pSceneEsd = */ + CreateESD( + pEsProperty, + 201, // esid + MP4SystemsV2ObjectType, MP4SceneDescriptionStreamType, - numBytes, // bufferSize - numBytes * 8, // bitrate - BifsV2Config, - sizeof(BifsV2Config), - urlBuf); + numBytes, // bufferSize + numBytes * 8, // bitrate + BifsV2Config, + sizeof(BifsV2Config), + urlBuf); + MP4Free(urlBuf); + urlBuf = NULL; MP4Free(sceneCmdBase64); sceneCmdBase64 = NULL; - MP4Free(urlBuf); - urlBuf = NULL; MP4Free(pBytes); pBytes = NULL; @@ -508,10 +540,10 @@ char* odCmdBase64 = MP4ToBase64(pBytes, numBytes); urlBuf = (char*)MP4Malloc(strlen(odCmdBase64) + 64); - - sprintf(urlBuf, - "data:application/mpeg4-od-au;base64,%s", - odCmdBase64); + if (urlBuf != NULL) { + snprintf(urlBuf, strlen(odCmdBase64) + 64, + "data:application/mpeg4-od-au;base64,%s", + odCmdBase64); VERBOSE_ISMA(GetVerbosity(), printf("OD data URL = \042%s\042\n", urlBuf)); @@ -528,12 +560,13 @@ 0, // configLength urlBuf); + MP4Free(urlBuf); + urlBuf = NULL; + } MP4Free(odCmdBase64); odCmdBase64 = NULL; MP4Free(pBytes); pBytes = NULL; - MP4Free(urlBuf); - urlBuf = NULL; // finally get the whole thing written to a memory pIod->WriteToMemory(this, ppIodBytes, pIodNumBytes); @@ -544,14 +577,14 @@ printf("IOD data =\n"); MP4HexDump(*ppIodBytes, *pIodNumBytes)); } -MP4Descriptor* MP4File::CreateESD( +void MP4File::CreateESD( MP4DescriptorProperty* pEsProperty, u_int32_t esid, u_int8_t objectType, u_int8_t streamType, u_int32_t bufferSize, u_int32_t bitrate, - u_int8_t* pConfig, + const u_int8_t* pConfig, u_int32_t configLength, char* url) { @@ -564,62 +597,63 @@ pEsProperty->AddDescriptor(MP4ESDescrTag); pEsd->Generate(); - pEsd->FindProperty("ESID", - (MP4Property**)&pInt); - pInt->SetValue(esid); - - pEsd->FindProperty("decConfigDescr.objectTypeId", - (MP4Property**)&pInt); - pInt->SetValue(objectType); - - pEsd->FindProperty("decConfigDescr.streamType", - (MP4Property**)&pInt); - pInt->SetValue(streamType); - - pEsd->FindProperty("decConfigDescr.bufferSizeDB", - (MP4Property**)&pInt); - pInt->SetValue(bufferSize); - - pEsd->FindProperty("decConfigDescr.maxBitrate", - (MP4Property**)&pInt); - pInt->SetValue(bitrate); - - pEsd->FindProperty("decConfigDescr.avgBitrate", - (MP4Property**)&pInt); - pInt->SetValue(bitrate); + if (pEsd->FindProperty("ESID", + (MP4Property**)&pInt)) + pInt->SetValue(esid); + + if (pEsd->FindProperty("decConfigDescr.objectTypeId", + (MP4Property**)&pInt)) + pInt->SetValue(objectType); + + if (pEsd->FindProperty("decConfigDescr.streamType", + (MP4Property**)&pInt)) + pInt->SetValue(streamType); + + if (pEsd->FindProperty("decConfigDescr.bufferSizeDB", + (MP4Property**)&pInt)) + pInt->SetValue(bufferSize); + + if (pEsd->FindProperty("decConfigDescr.maxBitrate", + (MP4Property**)&pInt)) + pInt->SetValue(bitrate); + + if (pEsd->FindProperty("decConfigDescr.avgBitrate", + (MP4Property**)&pInt)) + pInt->SetValue(bitrate); MP4DescriptorProperty* pConfigDescrProperty; - pEsd->FindProperty("decConfigDescr.decSpecificInfo", - (MP4Property**)&pConfigDescrProperty); + if (pEsd->FindProperty("decConfigDescr.decSpecificInfo", + (MP4Property**)&pConfigDescrProperty)) { MP4Descriptor* pConfigDescr = pConfigDescrProperty->AddDescriptor(MP4DecSpecificDescrTag); pConfigDescr->Generate(); - pConfigDescrProperty->FindProperty("decSpecificInfo[0].info", - (MP4Property**)&pBytes); - pBytes->SetValue(pConfig, configLength); - - pEsd->FindProperty("slConfigDescr.predefined", - (MP4Property**)&pInt); - // changed 12/5/02 from plugfest to value 0 - pInt->SetValue(0); - - pEsd->FindProperty("slConfig.useAccessUnitEndFlag", - (MP4Property **)&pBits); - pBits->SetValue(1); + if (pConfigDescrProperty->FindProperty("decSpecificInfo[0].info", + (MP4Property**)&pBytes)) + pBytes->SetValue(pConfig, configLength); + } + + if (pEsd->FindProperty("slConfigDescr.predefined", + (MP4Property**)&pInt)) + // changed 12/5/02 from plugfest to value 0 + pInt->SetValue(0); + + if (pEsd->FindProperty("slConfig.useAccessUnitEndFlag", + (MP4Property **)&pBits)) + pBits->SetValue(1); if (url) { - pEsd->FindProperty("URLFlag", - (MP4Property**)&pInt); - pInt->SetValue(1); + if (pEsd->FindProperty("URLFlag", + (MP4Property**)&pInt)) + pInt->SetValue(1); - pEsd->FindProperty("URL", - (MP4Property**)&pString); - pString->SetValue(url); + if (pEsd->FindProperty("URL", + (MP4Property**)&pString)) + pString->SetValue(url); } - return pEsd; + //return pEsd; } void MP4File::CreateIsmaODUpdateCommandFromFileForFile( @@ -659,13 +693,13 @@ pOd->Generate(); MP4BitfieldProperty* pOdIdProperty = NULL; - pOd->FindProperty("objectDescriptorId", - (MP4Property**)&pOdIdProperty); - pOdIdProperty->SetValue(odId); + if (pOd->FindProperty("objectDescriptorId", + (MP4Property**)&pOdIdProperty)) + pOdIdProperty->SetValue(odId); MP4DescriptorProperty* pEsIdsDescriptorProperty = NULL; - pOd->FindProperty("esIds", - (MP4Property**)&pEsIdsDescriptorProperty); + ASSERT(pOd->FindProperty("esIds", + (MP4Property**)&pEsIdsDescriptorProperty)); ASSERT(pEsIdsDescriptorProperty); pEsIdsDescriptorProperty->SetTags(MP4ESIDRefDescrTag); @@ -675,8 +709,8 @@ pRefDescriptor->Generate(); MP4Integer16Property* pRefIndexProperty = NULL; - pRefDescriptor->FindProperty("refIndex", - (MP4Property**)&pRefIndexProperty); + ASSERT(pRefDescriptor->FindProperty("refIndex", + (MP4Property**)&pRefIndexProperty)); ASSERT(pRefIndexProperty); u_int32_t mpodIndex = FindTrackReference( @@ -717,23 +751,25 @@ pAudioEsd = (MP4DescriptorProperty*)(pEsdsAtom->GetProperty(2)); // ESID is 0 for file, stream needs to be non-ze - pAudioEsd->FindProperty("ESID", - (MP4Property**)&pAudioEsdId); + ASSERT(pAudioEsd->FindProperty("ESID", + (MP4Property**)&pAudioEsdId)); ASSERT(pAudioEsdId); pAudioEsdId->SetValue(audioTrackId); // SL config needs to change from 2 (file) to 1 (null) - pAudioEsd->FindProperty("slConfigDescr.predefined", - (MP4Property**)&pAudioSLConfigPredef); - ASSERT(pAudioSLConfigPredef); - pAudioSLConfigPredef->SetValue(0); - - pAudioEsd->FindProperty("slConfigDescr.useAccessUnitEndFlag", - (MP4Property **)&pAudioAccessUnitEndFlag); - oldAudioUnitEndFlagValue = - pAudioAccessUnitEndFlag->GetValue(); - pAudioAccessUnitEndFlag->SetValue(1); + if (pAudioEsd->FindProperty("slConfigDescr.predefined", + (MP4Property**)&pAudioSLConfigPredef)) { + ASSERT(pAudioSLConfigPredef); + pAudioSLConfigPredef->SetValue(0); + } + + if (pAudioEsd->FindProperty("slConfigDescr.useAccessUnitEndFlag", + (MP4Property **)&pAudioAccessUnitEndFlag)) { + oldAudioUnitEndFlagValue = + pAudioAccessUnitEndFlag->GetValue(); + pAudioAccessUnitEndFlag->SetValue(1); + } } if (videoTrackId != MP4_INVALID_TRACK_ID) { @@ -744,23 +780,24 @@ ASSERT(pEsdsAtom); pVideoEsd = (MP4DescriptorProperty*)(pEsdsAtom->GetProperty(2)); - pVideoEsd->FindProperty("ESID", - (MP4Property**)&pVideoEsdId); + ASSERT(pVideoEsd->FindProperty("ESID", + (MP4Property**)&pVideoEsdId)); ASSERT(pVideoEsdId); pVideoEsdId->SetValue(videoTrackId); // SL config needs to change from 2 (file) to 1 (null) - pVideoEsd->FindProperty("slConfigDescr.predefined", - (MP4Property**)&pVideoSLConfigPredef); + ASSERT(pVideoEsd->FindProperty("slConfigDescr.predefined", + (MP4Property **)&pVideoSLConfigPredef)); ASSERT(pVideoSLConfigPredef); pVideoSLConfigPredef->SetValue(0); - pVideoEsd->FindProperty("slConfigDescr.useAccessUnitEndFlag", - (MP4Property **)&pVideoAccessUnitEndFlag); - oldVideoUnitEndFlagValue = - pVideoAccessUnitEndFlag->GetValue(); - pVideoAccessUnitEndFlag->SetValue(1); + if (pVideoEsd->FindProperty("slConfigDescr.useAccessUnitEndFlag", + (MP4Property **)&pVideoAccessUnitEndFlag)) { + oldVideoUnitEndFlagValue = + pVideoAccessUnitEndFlag->GetValue(); + pVideoAccessUnitEndFlag->SetValue(1); + } } CreateIsmaODUpdateCommandForStream( @@ -834,9 +871,10 @@ } MP4BitfieldProperty* pOdIdProperty = NULL; - pOd->FindProperty("objectDescriptorId", - (MP4Property**)&pOdIdProperty); - pOdIdProperty->SetValue(odId); + if (pOd->FindProperty("objectDescriptorId", + (MP4Property**)&pOdIdProperty)) { + pOdIdProperty->SetValue(odId); + } delete (MP4DescriptorProperty*)pOd->GetProperty(4); pOd->SetProperty(4, pEsdProperty); @@ -864,18 +902,18 @@ u_int64_t* pNumBytes) { // from ISMA 1.0 Tech Spec Appendix E - static u_int8_t bifsAudioOnly[] = { + static const u_int8_t bifsAudioOnly[] = { 0xC0, 0x10, 0x12, 0x81, 0x30, 0x2A, 0x05, 0x6D, 0xC0 }; - static u_int8_t bifsVideoOnly[] = { + static const u_int8_t bifsVideoOnly[] = { 0xC0, 0x10, 0x12, 0x61, 0x04, 0x1F, 0xC0, 0x00, 0x00, 0x1F, 0xC0, 0x00, 0x00, 0x44, 0x28, 0x22, 0x82, 0x9F, 0x80 }; - static u_int8_t bifsAudioVideo[] = { + static const u_int8_t bifsAudioVideo[] = { 0xC0, 0x10, 0x12, 0x81, 0x30, 0x2A, 0x05, 0x6D, 0x26, 0x10, 0x41, 0xFC, 0x00, 0x00, 0x01, 0xFC, 0x00, 0x00, diff -Nru faac-1.26/common/mp4v2/libmp4v260.dsp faac-1.28/common/mp4v2/libmp4v260.dsp --- faac-1.26/common/mp4v2/libmp4v260.dsp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/libmp4v260.dsp 1970-01-01 00:00:00.000000000 +0000 @@ -1,561 +0,0 @@ -# Microsoft Developer Studio Project File - Name="libmp4v2" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=libmp4v2 - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "libmp4v260.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "libmp4v260.mak" CFG="libmp4v2 - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libmp4v2 - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "libmp4v2 - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "libmp4v2 - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# SUBTRACT CPP /Fr -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "libmp4v2 - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR /YX /FD /c -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "libmp4v2 - Win32 Release" -# Name "libmp4v2 - Win32 Debug" -# Begin Group "source" - -# PROP Default_Filter ".c, .cpp" -# Begin Source File - -SOURCE=.\3gp.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_bitr.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_co64.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_cprt.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_ctts.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_d263.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_damr.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_dimm.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_dinf.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_dmax.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_dmed.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_dref.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_drep.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_edts.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_elst.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_enca.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_encv.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_esds.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_free.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_frma.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_ftyp.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_hdlr.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_hinf.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_hmhd.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_hnti.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_iKMS.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_iods.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_iSFM.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_maxr.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_mdat.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_mdhd.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_mdia.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_meta.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_mfhd.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_minf.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_moof.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_moov.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_mp4a.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_mp4s.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_mp4v.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_mvex.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_mvhd.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_nmhd.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_nump.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_payt.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_pmax.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_root.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_rtp.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_s263.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_samr.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_sawb.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_schi.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_schm.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_sdp.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_sinf.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_smhd.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_snro.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_stbl.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_stco.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_stdp.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_stsc.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_stsd.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_stsh.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_stss.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_stsz.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_stts.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_tfhd.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_tims.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_tkhd.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_tmax.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_tmin.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_tpyl.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_traf.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_trak.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_tref.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_treftype.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_trex.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_trpy.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_trun.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_tsro.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_udta.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_url.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_urn.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_vmhd.cpp -# End Source File -# Begin Source File - -SOURCE=.\descriptors.cpp -# End Source File -# Begin Source File - -SOURCE=.\isma.cpp -# End Source File -# Begin Source File - -SOURCE=.\mp4.cpp -# End Source File -# Begin Source File - -SOURCE=.\mp4atom.cpp -# End Source File -# Begin Source File - -SOURCE=.\mp4container.cpp -# End Source File -# Begin Source File - -SOURCE=.\mp4descriptor.cpp -# End Source File -# Begin Source File - -SOURCE=.\mp4file.cpp -# End Source File -# Begin Source File - -SOURCE=.\mp4file_io.cpp -# End Source File -# Begin Source File - -SOURCE=.\mp4info.cpp -# End Source File -# Begin Source File - -SOURCE=.\mp4meta.cpp -# End Source File -# Begin Source File - -SOURCE=.\mp4property.cpp -# End Source File -# Begin Source File - -SOURCE=.\mp4track.cpp -# End Source File -# Begin Source File - -SOURCE=.\mp4util.cpp -# End Source File -# Begin Source File - -SOURCE=.\ocidescriptors.cpp -# End Source File -# Begin Source File - -SOURCE=.\odcommands.cpp -# End Source File -# Begin Source File - -SOURCE=.\qosqualifiers.cpp -# End Source File -# Begin Source File - -SOURCE=.\rtphint.cpp -# End Source File -# End Group -# Begin Group "include" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=.\atoms.h -# End Source File -# Begin Source File - -SOURCE=.\descriptors.h -# End Source File -# Begin Source File - -SOURCE=.\mp4.h -# End Source File -# Begin Source File - -SOURCE=.\mp4array.h -# End Source File -# Begin Source File - -SOURCE=.\mp4atom.h -# End Source File -# Begin Source File - -SOURCE=.\mp4common.h -# End Source File -# Begin Source File - -SOURCE=.\mp4container.h -# End Source File -# Begin Source File - -SOURCE=.\mp4descriptor.h -# End Source File -# Begin Source File - -SOURCE=.\mp4file.h -# End Source File -# Begin Source File - -SOURCE=.\mp4property.h -# End Source File -# Begin Source File - -SOURCE=.\mp4track.h -# End Source File -# Begin Source File - -SOURCE=.\mp4util.h -# End Source File -# Begin Source File - -SOURCE=.\ocidescriptors.h -# End Source File -# Begin Source File - -SOURCE=.\odcommands.h -# End Source File -# Begin Source File - -SOURCE=.\qosqualifiers.h -# End Source File -# Begin Source File - -SOURCE=.\rtphint.h -# End Source File -# End Group -# End Target -# End Project diff -Nru faac-1.26/common/mp4v2/libmp4v2_st60.dsp faac-1.28/common/mp4v2/libmp4v2_st60.dsp --- faac-1.26/common/mp4v2/libmp4v2_st60.dsp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/libmp4v2_st60.dsp 1970-01-01 00:00:00.000000000 +0000 @@ -1,568 +0,0 @@ -# Microsoft Developer Studio Project File - Name="libmp4v2_st" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=libmp4v2_st - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "libmp4v2_st60.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "libmp4v2_st60.mak" CFG="libmp4v2_st - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libmp4v2_st - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "libmp4v2_st - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=xicl6.exe -RSC=rc.exe - -!IF "$(CFG)" == "libmp4v2_st - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ST_Release" -# PROP Intermediate_Dir "ST_Release" -# PROP Target_Dir "" -MTL=midl.exe -F90=df.exe -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "libmp4v2_st - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "ST_Debug" -# PROP Intermediate_Dir "ST_Debug" -# PROP Target_Dir "" -MTL=midl.exe -F90=df.exe -# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /Z7 /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "libmp4v2_st - Win32 Release" -# Name "libmp4v2_st - Win32 Debug" -# Begin Group "source" - -# PROP Default_Filter ".c, .cpp" -# Begin Source File - -SOURCE=.\3gp.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_bitr.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_co64.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_cprt.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_ctts.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_d263.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_damr.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_dimm.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_dinf.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_dmax.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_dmed.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_dref.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_drep.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_edts.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_elst.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_esds.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_free.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_ftyp.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_hdlr.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_hinf.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_hmhd.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_hnti.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_iods.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_maxr.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_mdat.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_mdhd.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_mdia.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_meta.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_mfhd.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_minf.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_moof.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_moov.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_mp4a.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_mp4s.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_mp4v.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_mvex.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_mvhd.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_nmhd.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_nump.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_payt.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_pmax.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_root.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_rtp.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_s263.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_samr.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_sawb.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_sdp.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_smhd.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_snro.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_stbl.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_stco.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_stdp.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_stsc.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_stsd.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_stsh.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_stss.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_stsz.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_stts.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_tfhd.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_tims.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_tkhd.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_tmax.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_tmin.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_tpyl.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_traf.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_trak.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_tref.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_treftype.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_trex.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_trpy.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_trun.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_tsro.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_udta.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_url.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_urn.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_vmhd.cpp -# End Source File -# Begin Source File - -SOURCE=.\descriptors.cpp -# End Source File -# Begin Source File - -SOURCE=.\isma.cpp -# End Source File -# Begin Source File - -SOURCE=.\mp4.cpp -# End Source File -# Begin Source File - -SOURCE=.\mp4atom.cpp -# End Source File -# Begin Source File - -SOURCE=.\mp4container.cpp -# End Source File -# Begin Source File - -SOURCE=.\mp4descriptor.cpp -# End Source File -# Begin Source File - -SOURCE=.\mp4file.cpp -# End Source File -# Begin Source File - -SOURCE=.\mp4file_io.cpp -# End Source File -# Begin Source File - -SOURCE=.\mp4meta.cpp -# End Source File -# Begin Source File - -SOURCE=.\mp4property.cpp -# End Source File -# Begin Source File - -SOURCE=.\mp4track.cpp -# End Source File -# Begin Source File - -SOURCE=.\mp4util.cpp -# End Source File -# Begin Source File - -SOURCE=.\need_for_win32.c -# End Source File -# Begin Source File - -SOURCE=.\ocidescriptors.cpp -# End Source File -# Begin Source File - -SOURCE=.\odcommands.cpp -# End Source File -# Begin Source File - -SOURCE=.\qosqualifiers.cpp -# End Source File -# Begin Source File - -SOURCE=.\rtphint.cpp -# End Source File -# End Group -# Begin Group "include" - -# PROP Default_Filter ".h" -# Begin Source File - -SOURCE=.\atoms.h -# End Source File -# Begin Source File - -SOURCE=.\descriptors.h -# End Source File -# Begin Source File - -SOURCE=.\mp4.h -# End Source File -# Begin Source File - -SOURCE=.\mp4array.h -# End Source File -# Begin Source File - -SOURCE=.\mp4atom.h -# End Source File -# Begin Source File - -SOURCE=.\mp4common.h -# End Source File -# Begin Source File - -SOURCE=.\mp4container.h -# End Source File -# Begin Source File - -SOURCE=.\mp4descriptor.h -# End Source File -# Begin Source File - -SOURCE=.\mp4file.h -# End Source File -# Begin Source File - -SOURCE=.\mp4property.h -# End Source File -# Begin Source File - -SOURCE=.\mp4track.h -# End Source File -# Begin Source File - -SOURCE=.\mp4util.h -# End Source File -# Begin Source File - -SOURCE=.\ocidescriptors.h -# End Source File -# Begin Source File - -SOURCE=.\odcommands.h -# End Source File -# Begin Source File - -SOURCE=.\qosqualifiers.h -# End Source File -# Begin Source File - -SOURCE=.\rtphint.h -# End Source File -# End Group -# Begin Source File - -SOURCE=.\atom_enca.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_encv.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_frma.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_iKMS.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_iSFM.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_schi.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_schm.cpp -# End Source File -# Begin Source File - -SOURCE=.\atom_sinf.cpp -# End Source File -# Begin Source File - -SOURCE=.\mp4info.cpp -# End Source File -# End Target -# End Project diff -Nru faac-1.26/common/mp4v2/libmp4v2_st60.vcproj faac-1.28/common/mp4v2/libmp4v2_st60.vcproj --- faac-1.26/common/mp4v2/libmp4v2_st60.vcproj 1970-01-01 00:00:00.000000000 +0000 +++ faac-1.28/common/mp4v2/libmp4v2_st60.vcproj 2009-01-25 01:14:34.000000000 +0000 @@ -0,0 +1,1475 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru faac-1.26/common/mp4v2/Makefile.am faac-1.28/common/mp4v2/Makefile.am --- faac-1.26/common/mp4v2/Makefile.am 2004-08-02 20:40:30.000000000 +0000 +++ faac-1.28/common/mp4v2/Makefile.am 2009-01-25 01:14:34.000000000 +0000 @@ -2,95 +2,58 @@ AM_CXXFLAGS = -Wall -lib_LTLIBRARIES = libmp4v2.la +noinst_LIBRARIES = libmp4v2.a -include_HEADERS = mp4.h mpeg4ip.h mpeg4ip_version.h mpeg4ip_config.h +noinst_HEADERS = mp4.h mpeg4ip.h mpeg4ip_version.h mpeg4ip_config.h -libmp4v2_la_SOURCES = \ +libmp4v2_a_SOURCES = \ 3gp.cpp \ - atom_bitr.cpp \ - atom_co64.cpp \ - atom_cprt.cpp \ - atom_ctts.cpp \ + atom_amr.cpp \ + atom_avc1.cpp \ + atom_avcC.cpp \ atom_d263.cpp \ atom_damr.cpp \ - atom_dimm.cpp \ - atom_dinf.cpp \ - atom_dmax.cpp \ - atom_dmed.cpp \ atom_dref.cpp \ - atom_drep.cpp \ - atom_edts.cpp \ atom_elst.cpp \ atom_enca.cpp \ atom_encv.cpp \ - atom_esds.cpp \ atom_free.cpp \ - atom_frma.cpp \ atom_ftyp.cpp \ + atom_gmin.cpp \ atom_hdlr.cpp \ atom_hinf.cpp \ - atom_hmhd.cpp \ atom_hnti.cpp \ - atom_iods.cpp \ - atom_iKMS.cpp \ - atom_iSFM.cpp \ - atom_maxr.cpp \ + atom_href.cpp \ atom_mdat.cpp \ atom_mdhd.cpp \ - atom_mdia.cpp \ atom_meta.cpp \ - atom_mfhd.cpp \ - atom_minf.cpp \ - atom_moof.cpp \ - atom_moov.cpp \ - atom_mp4a.cpp \ atom_mp4s.cpp \ atom_mp4v.cpp \ - atom_mvex.cpp \ atom_mvhd.cpp \ - atom_nmhd.cpp \ - atom_nump.cpp \ - atom_payt.cpp \ - atom_pmax.cpp \ + atom_ohdr.cpp \ atom_root.cpp \ atom_rtp.cpp \ atom_s263.cpp \ - atom_samr.cpp \ - atom_sawb.cpp \ - atom_schi.cpp \ - atom_schm.cpp \ atom_sdp.cpp \ atoms.h \ - atom_sinf.cpp \ - atom_smhd.cpp \ - atom_snro.cpp \ + atom_smi.cpp \ + atom_sound.cpp \ + atom_standard.cpp \ atom_stbl.cpp \ - atom_stco.cpp \ atom_stdp.cpp \ atom_stsc.cpp \ atom_stsd.cpp \ - atom_stsh.cpp \ - atom_stss.cpp \ atom_stsz.cpp \ - atom_stts.cpp \ + atom_stz2.cpp \ + atom_text.cpp \ atom_tfhd.cpp \ - atom_tims.cpp \ atom_tkhd.cpp \ - atom_tmax.cpp \ - atom_tmin.cpp \ - atom_tpyl.cpp \ - atom_traf.cpp \ - atom_trak.cpp \ - atom_tref.cpp \ atom_treftype.cpp \ - atom_trex.cpp \ - atom_trpy.cpp \ atom_trun.cpp \ - atom_tsro.cpp \ atom_udta.cpp \ atom_url.cpp \ atom_urn.cpp \ + atom_video.cpp \ atom_vmhd.cpp \ descriptors.cpp \ descriptors.h \ @@ -122,7 +85,9 @@ qosqualifiers.cpp \ qosqualifiers.h \ rtphint.cpp \ - rtphint.h + rtphint.h \ + virtual_io.cpp \ + virtual_io.h EXTRA_DIST = API_CHANGES \ INTERNALS \ diff -Nru faac-1.26/common/mp4v2/Makefile.in faac-1.28/common/mp4v2/Makefile.in --- faac-1.26/common/mp4v2/Makefile.in 2007-10-15 08:13:09.000000000 +0000 +++ faac-1.28/common/mp4v2/Makefile.in 2009-02-10 08:37:00.000000000 +0000 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005 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. @@ -15,11 +15,15 @@ @SET_MAKE@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -34,7 +38,7 @@ build_triplet = @build@ host_triplet = @host@ subdir = common/mp4v2 -DIST_COMMON = README $(include_HEADERS) $(srcdir)/Makefile.am \ +DIST_COMMON = README $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in TODO ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in @@ -43,71 +47,62 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = mpeg4ip_config.h -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" -libLTLIBRARIES_INSTALL = $(INSTALL) -LTLIBRARIES = $(lib_LTLIBRARIES) -libmp4v2_la_LIBADD = -am_libmp4v2_la_OBJECTS = 3gp.lo atom_bitr.lo atom_co64.lo atom_cprt.lo \ - atom_ctts.lo atom_d263.lo atom_damr.lo atom_dimm.lo \ - atom_dinf.lo atom_dmax.lo atom_dmed.lo atom_dref.lo \ - atom_drep.lo atom_edts.lo atom_elst.lo atom_enca.lo \ - atom_encv.lo atom_esds.lo atom_free.lo atom_frma.lo \ - atom_ftyp.lo atom_hdlr.lo atom_hinf.lo atom_hmhd.lo \ - atom_hnti.lo atom_iods.lo atom_iKMS.lo atom_iSFM.lo \ - atom_maxr.lo atom_mdat.lo atom_mdhd.lo atom_mdia.lo \ - atom_meta.lo atom_mfhd.lo atom_minf.lo atom_moof.lo \ - atom_moov.lo atom_mp4a.lo atom_mp4s.lo atom_mp4v.lo \ - atom_mvex.lo atom_mvhd.lo atom_nmhd.lo atom_nump.lo \ - atom_payt.lo atom_pmax.lo atom_root.lo atom_rtp.lo \ - atom_s263.lo atom_samr.lo atom_sawb.lo atom_schi.lo \ - atom_schm.lo atom_sdp.lo atom_sinf.lo atom_smhd.lo \ - atom_snro.lo atom_stbl.lo atom_stco.lo atom_stdp.lo \ - atom_stsc.lo atom_stsd.lo atom_stsh.lo atom_stss.lo \ - atom_stsz.lo atom_stts.lo atom_tfhd.lo atom_tims.lo \ - atom_tkhd.lo atom_tmax.lo atom_tmin.lo atom_tpyl.lo \ - atom_traf.lo atom_trak.lo atom_tref.lo atom_treftype.lo \ - atom_trex.lo atom_trpy.lo atom_trun.lo atom_tsro.lo \ - atom_udta.lo atom_url.lo atom_urn.lo atom_vmhd.lo \ - descriptors.lo isma.lo mp4atom.lo mp4container.lo mp4.lo \ - mp4descriptor.lo mp4file.lo mp4file_io.lo mp4info.lo \ - mp4meta.lo mp4property.lo mp4track.lo mp4util.lo \ - ocidescriptors.lo odcommands.lo qosqualifiers.lo rtphint.lo -libmp4v2_la_OBJECTS = $(am_libmp4v2_la_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +LIBRARIES = $(noinst_LIBRARIES) +ARFLAGS = cru +libmp4v2_a_AR = $(AR) $(ARFLAGS) +libmp4v2_a_LIBADD = +am_libmp4v2_a_OBJECTS = 3gp.$(OBJEXT) atom_amr.$(OBJEXT) \ + atom_avc1.$(OBJEXT) atom_avcC.$(OBJEXT) atom_d263.$(OBJEXT) \ + atom_damr.$(OBJEXT) atom_dref.$(OBJEXT) atom_elst.$(OBJEXT) \ + atom_enca.$(OBJEXT) atom_encv.$(OBJEXT) atom_free.$(OBJEXT) \ + atom_ftyp.$(OBJEXT) atom_gmin.$(OBJEXT) atom_hdlr.$(OBJEXT) \ + atom_hinf.$(OBJEXT) atom_hnti.$(OBJEXT) atom_href.$(OBJEXT) \ + atom_mdat.$(OBJEXT) atom_mdhd.$(OBJEXT) atom_meta.$(OBJEXT) \ + atom_mp4s.$(OBJEXT) atom_mp4v.$(OBJEXT) atom_mvhd.$(OBJEXT) \ + atom_ohdr.$(OBJEXT) atom_root.$(OBJEXT) atom_rtp.$(OBJEXT) \ + atom_s263.$(OBJEXT) atom_sdp.$(OBJEXT) atom_smi.$(OBJEXT) \ + atom_sound.$(OBJEXT) atom_standard.$(OBJEXT) \ + atom_stbl.$(OBJEXT) atom_stdp.$(OBJEXT) atom_stsc.$(OBJEXT) \ + atom_stsd.$(OBJEXT) atom_stsz.$(OBJEXT) atom_stz2.$(OBJEXT) \ + atom_text.$(OBJEXT) atom_tfhd.$(OBJEXT) atom_tkhd.$(OBJEXT) \ + atom_treftype.$(OBJEXT) atom_trun.$(OBJEXT) \ + atom_udta.$(OBJEXT) atom_url.$(OBJEXT) atom_urn.$(OBJEXT) \ + atom_video.$(OBJEXT) atom_vmhd.$(OBJEXT) descriptors.$(OBJEXT) \ + isma.$(OBJEXT) mp4atom.$(OBJEXT) mp4container.$(OBJEXT) \ + mp4.$(OBJEXT) mp4descriptor.$(OBJEXT) mp4file.$(OBJEXT) \ + mp4file_io.$(OBJEXT) mp4info.$(OBJEXT) mp4meta.$(OBJEXT) \ + mp4property.$(OBJEXT) mp4track.$(OBJEXT) mp4util.$(OBJEXT) \ + ocidescriptors.$(OBJEXT) odcommands.$(OBJEXT) \ + qosqualifiers.$(OBJEXT) rtphint.$(OBJEXT) virtual_io.$(OBJEXT) +libmp4v2_a_OBJECTS = $(am_libmp4v2_a_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -SOURCES = $(libmp4v2_la_SOURCES) -DIST_SOURCES = $(libmp4v2_la_SOURCES) -includeHEADERS_INSTALL = $(INSTALL_HEADER) -HEADERS = $(include_HEADERS) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libmp4v2_a_SOURCES) +DIST_SOURCES = $(libmp4v2_a_SOURCES) +HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ @@ -135,7 +130,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ -INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -147,7 +141,6 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -157,18 +150,21 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ -SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +USE_DRM_FALSE = @USE_DRM_FALSE@ +USE_DRM_TRUE = @USE_DRM_TRUE@ VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ +WITH_MP4V2_FALSE = @WITH_MP4V2_FALSE@ +WITH_MP4V2_TRUE = @WITH_MP4V2_TRUE@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -180,7 +176,6 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ -builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ @@ -208,100 +203,60 @@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ INCLUDES = -I$(top_srcdir)/include AM_CXXFLAGS = -Wall -lib_LTLIBRARIES = libmp4v2.la -include_HEADERS = mp4.h mpeg4ip.h mpeg4ip_version.h mpeg4ip_config.h -libmp4v2_la_SOURCES = \ +noinst_LIBRARIES = libmp4v2.a +noinst_HEADERS = mp4.h mpeg4ip.h mpeg4ip_version.h mpeg4ip_config.h +libmp4v2_a_SOURCES = \ 3gp.cpp \ - atom_bitr.cpp \ - atom_co64.cpp \ - atom_cprt.cpp \ - atom_ctts.cpp \ + atom_amr.cpp \ + atom_avc1.cpp \ + atom_avcC.cpp \ atom_d263.cpp \ atom_damr.cpp \ - atom_dimm.cpp \ - atom_dinf.cpp \ - atom_dmax.cpp \ - atom_dmed.cpp \ atom_dref.cpp \ - atom_drep.cpp \ - atom_edts.cpp \ atom_elst.cpp \ atom_enca.cpp \ atom_encv.cpp \ - atom_esds.cpp \ atom_free.cpp \ - atom_frma.cpp \ atom_ftyp.cpp \ + atom_gmin.cpp \ atom_hdlr.cpp \ atom_hinf.cpp \ - atom_hmhd.cpp \ atom_hnti.cpp \ - atom_iods.cpp \ - atom_iKMS.cpp \ - atom_iSFM.cpp \ - atom_maxr.cpp \ + atom_href.cpp \ atom_mdat.cpp \ atom_mdhd.cpp \ - atom_mdia.cpp \ atom_meta.cpp \ - atom_mfhd.cpp \ - atom_minf.cpp \ - atom_moof.cpp \ - atom_moov.cpp \ - atom_mp4a.cpp \ atom_mp4s.cpp \ atom_mp4v.cpp \ - atom_mvex.cpp \ atom_mvhd.cpp \ - atom_nmhd.cpp \ - atom_nump.cpp \ - atom_payt.cpp \ - atom_pmax.cpp \ + atom_ohdr.cpp \ atom_root.cpp \ atom_rtp.cpp \ atom_s263.cpp \ - atom_samr.cpp \ - atom_sawb.cpp \ - atom_schi.cpp \ - atom_schm.cpp \ atom_sdp.cpp \ atoms.h \ - atom_sinf.cpp \ - atom_smhd.cpp \ - atom_snro.cpp \ + atom_smi.cpp \ + atom_sound.cpp \ + atom_standard.cpp \ atom_stbl.cpp \ - atom_stco.cpp \ atom_stdp.cpp \ atom_stsc.cpp \ atom_stsd.cpp \ - atom_stsh.cpp \ - atom_stss.cpp \ atom_stsz.cpp \ - atom_stts.cpp \ + atom_stz2.cpp \ + atom_text.cpp \ atom_tfhd.cpp \ - atom_tims.cpp \ atom_tkhd.cpp \ - atom_tmax.cpp \ - atom_tmin.cpp \ - atom_tpyl.cpp \ - atom_traf.cpp \ - atom_trak.cpp \ - atom_tref.cpp \ atom_treftype.cpp \ - atom_trex.cpp \ - atom_trpy.cpp \ atom_trun.cpp \ - atom_tsro.cpp \ atom_udta.cpp \ atom_url.cpp \ atom_urn.cpp \ + atom_video.cpp \ atom_vmhd.cpp \ descriptors.cpp \ descriptors.h \ @@ -333,7 +288,9 @@ qosqualifiers.cpp \ qosqualifiers.h \ rtphint.cpp \ - rtphint.h + rtphint.h \ + virtual_io.cpp \ + virtual_io.h EXTRA_DIST = API_CHANGES \ INTERNALS \ @@ -374,35 +331,13 @@ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - if test -f $$p; then \ - f=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ - else :; fi; \ - done -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - p=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ - $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libmp4v2.la: $(libmp4v2_la_OBJECTS) $(libmp4v2_la_DEPENDENCIES) - $(CXXLINK) -rpath $(libdir) $(libmp4v2_la_OBJECTS) $(libmp4v2_la_LIBADD) $(LIBS) +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libmp4v2.a: $(libmp4v2_a_OBJECTS) $(libmp4v2_a_DEPENDENCIES) + -rm -f libmp4v2.a + $(libmp4v2_a_AR) libmp4v2.a $(libmp4v2_a_OBJECTS) $(libmp4v2_a_LIBADD) + $(RANLIB) libmp4v2.a mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -410,125 +345,89 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/3gp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_bitr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_co64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_cprt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_ctts.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_d263.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_damr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_dimm.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_dinf.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_dmax.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_dmed.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_dref.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_drep.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_edts.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_elst.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_enca.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_encv.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_esds.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_free.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_frma.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_ftyp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_hdlr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_hinf.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_hmhd.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_hnti.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_iKMS.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_iSFM.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_iods.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_maxr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_mdat.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_mdhd.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_mdia.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_meta.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_mfhd.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_minf.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_moof.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_moov.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_mp4a.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_mp4s.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_mp4v.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_mvex.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_mvhd.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_nmhd.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_nump.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_payt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_pmax.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_root.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_rtp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_s263.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_samr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_sawb.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_schi.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_schm.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_sdp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_sinf.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_smhd.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_snro.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stbl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stco.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stdp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stsc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stsd.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stsh.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stss.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stsz.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stts.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_tfhd.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_tims.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_tkhd.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_tmax.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_tmin.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_tpyl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_traf.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_trak.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_tref.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_treftype.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_trex.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_trpy.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_trun.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_tsro.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_udta.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_url.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_urn.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_vmhd.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/descriptors.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isma.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4atom.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4container.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4descriptor.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4file.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4file_io.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4info.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4meta.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4property.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4track.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4util.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ocidescriptors.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/odcommands.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qosqualifiers.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtphint.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/3gp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_amr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_avc1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_avcC.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_d263.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_damr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_dref.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_elst.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_enca.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_encv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_free.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_ftyp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_gmin.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_hdlr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_hinf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_hnti.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_href.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_mdat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_mdhd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_meta.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_mp4s.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_mp4v.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_mvhd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_ohdr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_root.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_rtp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_s263.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_sdp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_smi.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_sound.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_standard.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stbl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stdp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stsc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stsd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stsz.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_stz2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_text.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_tfhd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_tkhd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_treftype.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_trun.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_udta.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_url.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_urn.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_video.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atom_vmhd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/descriptors.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isma.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4atom.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4container.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4descriptor.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4file.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4file_io.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4info.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4meta.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4property.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4track.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ocidescriptors.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/odcommands.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qosqualifiers.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtphint.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virtual_io.Po@am__quote@ .cpp.o: -@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: -@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: -@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< @@ -538,23 +437,10 @@ clean-libtool: -rm -rf .libs _libs -install-includeHEADERS: $(include_HEADERS) - @$(NORMAL_INSTALL) - test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" - @list='$(include_HEADERS)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ - $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ - done -uninstall-includeHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(include_HEADERS)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ - rm -f "$(DESTDIR)$(includedir)/$$f"; \ - done +distclean-libtool: + -rm -f libtool +uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -605,21 +491,22 @@ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(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 \ + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ @@ -632,11 +519,8 @@ done check-am: all-am check: check-am -all-am: Makefile $(LTLIBRARIES) $(HEADERS) +all-am: Makefile $(LIBRARIES) $(HEADERS) installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -663,14 +547,14 @@ @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ +clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags + distclean-libtool distclean-tags dvi: dvi-am @@ -682,22 +566,14 @@ info-am: -install-data-am: install-includeHEADERS +install-data-am: -install-dvi: install-dvi-am - -install-exec-am: install-libLTLIBRARIES - -install-html: install-html-am +install-exec-am: install-info: install-info-am install-man: -install-pdf: install-pdf-am - -install-ps: install-ps-am - installcheck-am: maintainer-clean: maintainer-clean-am @@ -718,24 +594,19 @@ ps-am: -uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES - -.MAKE: install-am install-strip +uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libtool ctags distclean \ + clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ 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-includeHEADERS install-info \ - install-info-am install-libLTLIBRARIES 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 mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-includeHEADERS \ - uninstall-libLTLIBRARIES + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-info-am # 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. diff -Nru faac-1.26/common/mp4v2/mp4array.h faac-1.28/common/mp4v2/mp4array.h --- faac-1.26/common/mp4v2/mp4array.h 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/mp4array.h 2009-01-25 01:14:34.000000000 +0000 @@ -89,9 +89,11 @@ if (!ValidIndex(index)) { \ throw new MP4Error(ERANGE, "MP4Array::Delete"); \ } \ - memmove(&m_elements[index], &m_elements[index + 1], \ - (m_numElements - index) * sizeof(type)); \ m_numElements--; \ + if (index < m_numElements) { \ + memmove(&m_elements[index], &m_elements[index + 1], \ + (m_numElements - index) * sizeof(type)); \ + } \ } \ void Resize(MP4ArrayIndex newSize) { \ m_numElements = newSize; \ @@ -102,7 +104,7 @@ \ type& operator[](MP4ArrayIndex index) { \ if (!ValidIndex(index)) { \ - throw new MP4Error(ERANGE, "MP4Array::[]"); \ + throw new MP4Error(ERANGE, "index %u of %u", "MP4Array::[]", index, m_numElements); \ } \ return m_elements[index]; \ } \ diff -Nru faac-1.26/common/mp4v2/mp4atom.cpp faac-1.28/common/mp4v2/mp4atom.cpp --- faac-1.26/common/mp4v2/mp4atom.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/mp4atom.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -21,10 +21,14 @@ * Portions created by Ximpo Group Ltd. are * Copyright (C) Ximpo Group Ltd. 2003, 2004. All Rights Reserved. * + * Portions created by Adnecto d.o.o. are + * Copyright (C) Adnecto d.o.o. 2005. All Rights Reserved + * * Contributor(s): * Dave Mackie dmackie@cisco.com * Alix Marchandise-Franquet alix@cisco.com * Ximpo Group Ltd. mp4v2@ximpo.com + * Danijel Kopcinovic danijel.kopcinovic@adnecto.net */ #include "mp4common.h" @@ -73,55 +77,39 @@ pAtom = new MP4RootAtom(); } else { switch((uint8_t)type[0]) { - case 'b': - if (ATOMID(type) == ATOMID("bitr")) { - pAtom = new MP4BitrAtom(); + case 'a': + if (ATOMID(type) == ATOMID("avc1")) { + pAtom = new MP4Avc1Atom(); + } else if (ATOMID(type) == ATOMID("avcC")) { + pAtom = new MP4AvcCAtom(); + } else if (ATOMID(type) == ATOMID("alis")) { + pAtom = new MP4UrlAtom("alis"); + } else if (ATOMID(type) == ATOMID("alaw")) { + pAtom = new MP4SoundAtom(type); + } else if (ATOMID(type) == ATOMID("alac")) { + pAtom = new MP4SoundAtom(type); } break; case 'c': - if (ATOMID(type) == ATOMID("ctts")) { - pAtom = new MP4CttsAtom(); - } else if (ATOMID(type) == ATOMID("co64")) { - pAtom = new MP4Co64Atom(); - } else if (ATOMID(type) == ATOMID("cprt")) { - pAtom = new MP4CprtAtom(); - } else if (ATOMID(type) == ATOMID("cpil")) { /* Apple iTunes */ - pAtom = new MP4CpilAtom(); - } else if (ATOMID(type) == ATOMID("covr")) { /* Apple iTunes */ - pAtom = new MP4CovrAtom(); - } - break; + if (ATOMID(type) == ATOMID("chap")) { + pAtom = new MP4TrefTypeAtom(type); + } + break; case 'd': if (ATOMID(type) == ATOMID("d263")) { pAtom = new MP4D263Atom(); } else if (ATOMID(type) == ATOMID("damr")) { pAtom = new MP4DamrAtom(); - } else if (ATOMID(type) == ATOMID("dinf")) { - pAtom = new MP4DinfAtom(); } else if (ATOMID(type) == ATOMID("dref")) { pAtom = new MP4DrefAtom(); } else if (ATOMID(type) == ATOMID("dpnd")) { pAtom = new MP4TrefTypeAtom(type); - } else if (ATOMID(type) == ATOMID("dmed")) { - pAtom = new MP4DmedAtom(); - } else if (ATOMID(type) == ATOMID("dimm")) { - pAtom = new MP4DimmAtom(); - } else if (ATOMID(type) == ATOMID("drep")) { - pAtom = new MP4DrepAtom(); - } else if (ATOMID(type) == ATOMID("dmax")) { - pAtom = new MP4DmaxAtom(); } else if (ATOMID(type) == ATOMID("data")) { /* Apple iTunes */ pAtom = new MP4DataAtom(); - } else if (ATOMID(type) == ATOMID("disk")) { /* Apple iTunes */ - pAtom = new MP4DiskAtom(); } break; case 'e': - if (ATOMID(type) == ATOMID("esds")) { - pAtom = new MP4EsdsAtom(); - } else if (ATOMID(type) == ATOMID("edts")) { - pAtom = new MP4EdtsAtom(); - } else if (ATOMID(type) == ATOMID("elst")) { + if (ATOMID(type) == ATOMID("elst")) { pAtom = new MP4ElstAtom(); } else if (ATOMID(type) == ATOMID("enca")) { pAtom = new MP4EncaAtom(); @@ -132,174 +120,119 @@ case 'f': if (ATOMID(type) == ATOMID("free")) { pAtom = new MP4FreeAtom(); - } else if (ATOMID(type) == ATOMID("frma")) { - pAtom = new MP4FrmaAtom(); } else if (ATOMID(type) == ATOMID("ftyp")) { pAtom = new MP4FtypAtom(); } break; case 'g': - if (ATOMID(type) == ATOMID("gnre")) { // Apple iTunes - pAtom = new MP4GnreAtom(); + if (ATOMID(type) == ATOMID("gmin")) { + pAtom = new MP4GminAtom(); } break; case 'h': if (ATOMID(type) == ATOMID("hdlr")) { pAtom = new MP4HdlrAtom(); - } else if (ATOMID(type) == ATOMID("hmhd")) { - pAtom = new MP4HmhdAtom(); } else if (ATOMID(type) == ATOMID("hint")) { pAtom = new MP4TrefTypeAtom(type); } else if (ATOMID(type) == ATOMID("hnti")) { pAtom = new MP4HntiAtom(); } else if (ATOMID(type) == ATOMID("hinf")) { pAtom = new MP4HinfAtom(); + } else if (ATOMID(type) == ATOMID("h263")) { + pAtom = new MP4VideoAtom("h263"); + } else if (ATOMID(type) == ATOMID("href")) { + pAtom = new MP4HrefAtom(); } break; case 'i': - if (ATOMID(type) == ATOMID("iKMS")) { - pAtom = new MP4IKMSAtom(); - } else if (ATOMID(type) == ATOMID("iSFM")) { - pAtom = new MP4ISFMAtom(); - } else if (ATOMID(type) == ATOMID("iods")) { - pAtom = new MP4IodsAtom(); - } else if (ATOMID(type) == ATOMID("ipir")) { + if (ATOMID(type) == ATOMID("ipir")) { pAtom = new MP4TrefTypeAtom(type); - } else if (ATOMID(type) == ATOMID("ilst")) { - pAtom = new MP4IlstAtom(); + } else if (ATOMID(type) == ATOMID("ima4")) { + pAtom = new MP4SoundAtom("ima4"); + } + break; + case 'j': + if (ATOMID(type) == ATOMID("jpeg")) { + pAtom = new MP4VideoAtom("jpeg"); } break; case 'm': - if (ATOMID(type) == ATOMID("mdia")) { - pAtom = new MP4MdiaAtom(); - } else if (ATOMID(type) == ATOMID("minf")) { - pAtom = new MP4MinfAtom(); - } else if (ATOMID(type) == ATOMID("mdhd")) { + if (ATOMID(type) == ATOMID("mdhd")) { pAtom = new MP4MdhdAtom(); - } else if (ATOMID(type) == ATOMID("mdat")) { - pAtom = new MP4MdatAtom(); - } else if (ATOMID(type) == ATOMID("moov")) { - pAtom = new MP4MoovAtom(); } else if (ATOMID(type) == ATOMID("mvhd")) { pAtom = new MP4MvhdAtom(); + } else if (ATOMID(type) == ATOMID("mdat")) { + pAtom = new MP4MdatAtom(); } else if (ATOMID(type) == ATOMID("mpod")) { pAtom = new MP4TrefTypeAtom(type); } else if (ATOMID(type) == ATOMID("mp4a")) { - pAtom = new MP4Mp4aAtom(); + pAtom = new MP4SoundAtom("mp4a"); } else if (ATOMID(type) == ATOMID("mp4s")) { pAtom = new MP4Mp4sAtom(); } else if (ATOMID(type) == ATOMID("mp4v")) { pAtom = new MP4Mp4vAtom(); - } else if (ATOMID(type) == ATOMID("moof")) { - pAtom = new MP4MoofAtom(); - } else if (ATOMID(type) == ATOMID("mfhd")) { - pAtom = new MP4MfhdAtom(); - } else if (ATOMID(type) == ATOMID("mvex")) { - pAtom = new MP4MvexAtom(); - } else if (ATOMID(type) == ATOMID("maxr")) { - pAtom = new MP4MaxrAtom(); - } else if (ATOMID(type) == ATOMID("meta")) { // iTunes - pAtom = new MP4MetaAtom(); } else if (ATOMID(type) == ATOMID("mean")) { // iTunes - pAtom = new MP4MeanAtom(); + pAtom = new MP4Meta1Atom(type); } break; case 'n': - if (ATOMID(type) == ATOMID("nmhd")) { - pAtom = new MP4NmhdAtom(); - } else if (ATOMID(type) == ATOMID("nump")) { - pAtom = new MP4NumpAtom(); - } else if (ATOMID(type) == ATOMID("name")) { // iTunes - pAtom = new MP4NameAtom(); + if (ATOMID(type) == ATOMID("name")) { // iTunes + pAtom = new MP4Meta1Atom(type); } break; - case 'p': - if (ATOMID(type) == ATOMID("pmax")) { - pAtom = new MP4PmaxAtom(); - } else if (ATOMID(type) == ATOMID("payt")) { - pAtom = new MP4PaytAtom(); + case 'o': + if (ATOMID(type) == ATOMID("ohdr")) { + pAtom = new MP4OhdrAtom(); } break; case 'r': if (ATOMID(type) == ATOMID("rtp ")) { pAtom = new MP4RtpAtom(); + } else if (ATOMID(type) == ATOMID("raw ")) { + pAtom = new MP4VideoAtom("raw "); } break; case 's': if (ATOMID(type) == ATOMID("s263")) { pAtom = new MP4S263Atom(); } else if (ATOMID(type) == ATOMID("samr")) { - pAtom = new MP4SamrAtom(); + pAtom = new MP4AmrAtom("samr"); } else if (ATOMID(type) == ATOMID("sawb")) { - pAtom = new MP4SawbAtom(); - } else if (ATOMID(type) == ATOMID("schi")) { - pAtom = new MP4SchiAtom(); - } else if (ATOMID(type) == ATOMID("schm")) { - pAtom = new MP4SchmAtom(); - } else if (ATOMID(type) == ATOMID("sinf")) { - pAtom = new MP4SinfAtom(); + pAtom = new MP4AmrAtom("sawb"); } else if (ATOMID(type) == ATOMID("stbl")) { pAtom = new MP4StblAtom(); } else if (ATOMID(type) == ATOMID("stsd")) { pAtom = new MP4StsdAtom(); - } else if (ATOMID(type) == ATOMID("stts")) { - pAtom = new MP4SttsAtom(); } else if (ATOMID(type) == ATOMID("stsz")) { pAtom = new MP4StszAtom(); } else if (ATOMID(type) == ATOMID("stsc")) { pAtom = new MP4StscAtom(); - } else if (ATOMID(type) == ATOMID("stco")) { - pAtom = new MP4StcoAtom(); - } else if (ATOMID(type) == ATOMID("stss")) { - pAtom = new MP4StssAtom(); - } else if (ATOMID(type) == ATOMID("stsh")) { - pAtom = new MP4StshAtom(); + } else if (ATOMID(type) == ATOMID("stz2")) { + pAtom = new MP4Stz2Atom(); } else if (ATOMID(type) == ATOMID("stdp")) { pAtom = new MP4StdpAtom(); - } else if (ATOMID(type) == ATOMID("smhd")) { - pAtom = new MP4SmhdAtom(); } else if (ATOMID(type) == ATOMID("sdp ")) { pAtom = new MP4SdpAtom(); - } else if (ATOMID(type) == ATOMID("snro")) { - pAtom = new MP4SnroAtom(); } else if (ATOMID(type) == ATOMID("sync")) { pAtom = new MP4TrefTypeAtom(type); } else if (ATOMID(type) == ATOMID("skip")) { pAtom = new MP4FreeAtom(); pAtom->SetType("skip"); + } else if (ATOMID(type) == ATOMID("sowt")) { + pAtom = new MP4SoundAtom("sowt"); } break; case 't': - if (ATOMID(type) == ATOMID("trak")) { - pAtom = new MP4TrakAtom(); + if (ATOMID(type) == ATOMID("text")) { + pAtom = new MP4TextAtom(); } else if (ATOMID(type) == ATOMID("tkhd")) { pAtom = new MP4TkhdAtom(); - } else if (ATOMID(type) == ATOMID("tref")) { - pAtom = new MP4TrefAtom(); - } else if (ATOMID(type) == ATOMID("traf")) { - pAtom = new MP4TrafAtom(); } else if (ATOMID(type) == ATOMID("tfhd")) { pAtom = new MP4TfhdAtom(); - } else if (ATOMID(type) == ATOMID("trex")) { - pAtom = new MP4TrexAtom(); } else if (ATOMID(type) == ATOMID("trun")) { pAtom = new MP4TrunAtom(); - } else if (ATOMID(type) == ATOMID("tmin")) { - pAtom = new MP4TminAtom(); - } else if (ATOMID(type) == ATOMID("tmax")) { - pAtom = new MP4TmaxAtom(); - } else if (ATOMID(type) == ATOMID("trpy")) { - pAtom = new MP4TrpyAtom(); - } else if (ATOMID(type) == ATOMID("tpyl")) { - pAtom = new MP4TpylAtom(); - } else if (ATOMID(type) == ATOMID("tims")) { - pAtom = new MP4TimsAtom(); - } else if (ATOMID(type) == ATOMID("tsro")) { - pAtom = new MP4TsroAtom(); - } else if (ATOMID(type) == ATOMID("trkn")) { // iTunes - pAtom = new MP4TrknAtom(); - } else if (ATOMID(type) == ATOMID("tmpo")) { // iTunes - pAtom = new MP4TmpoAtom(); + } else if (ATOMID(type) == ATOMID("twos")) { + pAtom = new MP4SoundAtom("twos"); } break; case 'u': @@ -309,6 +242,8 @@ pAtom = new MP4UrlAtom(); } else if (ATOMID(type) == ATOMID("urn ")) { pAtom = new MP4UrnAtom(); + } else if (ATOMID(type) == ATOMID("ulaw")) { + pAtom = new MP4SoundAtom("ulaw"); } break; case 'v': @@ -316,41 +251,38 @@ pAtom = new MP4VmhdAtom(); } break; - case 0251: { // copyright symbol -static const char name[5]={0251,'n', 'a', 'm', '\0'}; -static const char art[5]={0251,'A', 'R', 'T', '\0'}; -static const char wrt[5]={0251,'w', 'r', 't', '\0'}; -static const char alb[5]={0251,'a', 'l', 'b', '\0'}; -static const char day[5]={0251,'d', 'a', 'y', '\0'}; -static const char too[5]={0251,'t', 'o', 'o', '\0'}; -static const char cmt[5]={0251,'c', 'm', 't', '\0'}; - if (ATOMID(type) == ATOMID(name)) { - pAtom = new MP4NamAtom(); - } else if (ATOMID(type) == ATOMID(art)) { /* Apple iTunes */ - pAtom = new MP4ArtAtom(); - } else if (ATOMID(type) == ATOMID(wrt)) { /* Apple iTunes */ - pAtom = new MP4WrtAtom(); - } else if (ATOMID(type) == ATOMID(alb)) { /* Apple iTunes */ - pAtom = new MP4AlbAtom(); - } else if (ATOMID(type) == ATOMID(day)) { /* Apple iTunes */ - pAtom = new MP4DayAtom(); - } else if (ATOMID(type) == ATOMID(too)) { /* Apple iTunes */ - pAtom = new MP4TooAtom(); - } else if (ATOMID(type) == ATOMID(cmt)) { /* Apple iTunes */ - pAtom = new MP4CmtAtom(); + case 'y': + if (ATOMID(type) == ATOMID("yuv2")) { + pAtom = new MP4VideoAtom("yuv2"); + } + break; + case 'S': + if (ATOMID(type) == ATOMID("SVQ3")) { + pAtom = new MP4VideoAtom("SVQ3"); + } else if (ATOMID(type) == ATOMID("SMI ")) { + pAtom = new MP4SmiAtom(); + } + break; + case 0251: + static const char name[5]={0251,'n', 'a', 'm', '\0'}; + static const char cmt[5]={0251,'c', 'm', 't', '\0'}; + static const char cpy[5]={0251,'c', 'p', 'y', '\0'}; + static const char des[5]={0251,'d', 'e', 's','\0'}; + static const char prd[5]={0251, 'p', 'r', 'd', '\0'}; + if (ATOMID(type) == ATOMID(name) || + ATOMID(type) == ATOMID(cmt) || + ATOMID(type) == ATOMID(cpy) || + ATOMID(type) == ATOMID(prd) || + ATOMID(type) == ATOMID(des)) { + pAtom = new MP4Meta2Atom(type); } break; } - case '-': - if (ATOMID(type) == ATOMID("----")) { /* Apple iTunes */ - pAtom = new MP4DashAtom(); - } - } } if (pAtom == NULL) { - pAtom = new MP4Atom(type); - pAtom->SetUnknownType(true); + pAtom = new MP4StandardAtom(type); + // unknown type is set by StandardAtom type } ASSERT(pAtom); @@ -406,6 +338,7 @@ if (dataSize == 1) { dataSize = pFile->ReadUInt64(); hdrSize += 8; + pFile->Check64BitStatus(type); } // extended type @@ -422,13 +355,29 @@ dataSize -= hdrSize; VERBOSE_READ(pFile->GetVerbosity(), - printf("ReadAtom: type = %s data-size = "U64" (0x"X64")\n", - type, dataSize, dataSize)); + printf("ReadAtom: type = \"%s\" data-size = "U64" (0x"X64") hdr %u\n", + type, dataSize, dataSize, hdrSize)); if (pos + hdrSize + dataSize > pParentAtom->GetEnd()) { - VERBOSE_READ(pFile->GetVerbosity(), - printf("ReadAtom: invalid atom size, extends outside parent atom\n")); + VERBOSE_ERROR(pFile->GetVerbosity(), + printf("ReadAtom: invalid atom size, extends outside parent atom - skipping to end of \"%s\" \"%s\" "U64" vs "U64"\n", + pParentAtom->GetType(), type, + pos + hdrSize + dataSize, + pParentAtom->GetEnd())); + VERBOSE_READ(pFile->GetVerbosity(), + printf("parent %s ("U64") pos "U64" hdr %d data "U64" sum "U64"\n", + pParentAtom->GetType(), + pParentAtom->GetEnd(), + pos, + hdrSize, + dataSize, + pos + hdrSize + dataSize)); +#if 0 throw new MP4Error("invalid atom size", "ReadAtom"); +#else + // skip to end of atom + dataSize = pParentAtom->GetEnd() - pos - hdrSize; +#endif } @@ -574,7 +523,7 @@ u_int32_t atomIndex = 0; // get the index if we have one, e.g. moov.trak[2].mdia... - MP4NameFirstIndex(name, &atomIndex); + (void)MP4NameFirstIndex(name, &atomIndex); // need to get to the index'th child atom of the right type for (u_int32_t i = 0; i < m_pChildAtoms.Size(); i++) { @@ -608,7 +557,7 @@ // check if we have an index, e.g. trak[2].mdia... u_int32_t atomIndex = 0; - MP4NameFirstIndex(name, &atomIndex); + (void)MP4NameFirstIndex(name, &atomIndex); // need to get to the index'th child atom of the right type for (i = 0; i < m_pChildAtoms.Size(); i++) { @@ -656,11 +605,36 @@ void MP4Atom::ReadChildAtoms() { + bool this_is_udta = ATOMID(m_type) == ATOMID("udta"); + VERBOSE_READ(GetVerbosity(), printf("ReadChildAtoms: of %s\n", m_type[0] ? m_type : "root")); - - // read any child atoms - while (m_pFile->GetPosition() < m_end) { + for (u_int64_t position = m_pFile->GetPosition(); + position < m_end; + position = m_pFile->GetPosition()) { + // make sure that we have enough to read at least 8 bytes + // size and type. + if (m_end - position < 2 * sizeof(uint32_t)) { + // if we're reading udta, it's okay to have 4 bytes of 0 + if (this_is_udta && + m_end - position == sizeof(uint32_t)) { + u_int32_t mbz = m_pFile->ReadUInt32(); + if (mbz != 0) { + VERBOSE_WARNING(GetVerbosity(), + printf("Error: In udta atom, end value is not zero %x\n", + mbz)); + } + continue; + } + // otherwise, output a warning, but don't care + VERBOSE_WARNING(GetVerbosity(), + printf("Error: In %s atom, extra "D64" bytes at end of atom\n", + m_type, (m_end - position))); + for (uint64_t ix = 0; ix < m_end - position; ix++) { + (void)m_pFile->ReadUInt8(); + } + continue; + } MP4Atom* pChildAtom = MP4Atom::ReadAtom(m_pFile, this); AddChildAtom(pChildAtom); @@ -686,6 +660,7 @@ GetType(), pChildAtom->GetType())); } } + } // if mandatory child atom doesn't exist, print warning @@ -765,6 +740,10 @@ { m_end = m_pFile->GetPosition(); m_size = (m_end - m_start); + VERBOSE_WRITE(GetVerbosity(), + printf("end: type %s "U64" "U64" size "U64"\n", m_type, + m_start, m_end, + m_size)); //use64 = m_pFile->Use64Bits(); if (use64) { m_pFile->SetPosition(m_start + 8); @@ -876,6 +855,7 @@ if (m_type[0] != '\0') { Indent(pFile, indent); fprintf(pFile, "type %s\n", m_type); + fflush(pFile); } u_int32_t i; diff -Nru faac-1.26/common/mp4v2/mp4atom.h faac-1.28/common/mp4v2/mp4atom.h --- faac-1.26/common/mp4v2/mp4atom.h 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/mp4atom.h 2009-01-25 01:14:34.000000000 +0000 @@ -96,7 +96,7 @@ }; void SetType(const char* type) { if (type && *type != '\0') { - ASSERT(strlen(type) == 4); + // not needed ASSERT(strlen(type) == 4); memcpy(m_type, type, 4); m_type[4] = '\0'; } else { @@ -162,6 +162,21 @@ return m_pProperties[index]; } + u_int32_t GetCount() { + return m_pProperties.Size(); + } + +#if 0 + void SetProperty(u_int32_t index, MP4Property *property) { + u_int64_t t; + if (index > m_pProperties.Size()) + return; + + t = property->Get(index); + m_pProperties[index]->Set(t, index); + } +#endif + MP4Atom* FindAtom(const char* name); MP4Atom* FindChildAtom(const char* name); @@ -236,4 +251,9 @@ return STRTOINT32(type); } +// inverse ATOMID - 32 bit id to string +inline void IDATOM(u_int32_t type, char *s) { + INT32TOSTR(type, s); +} + #endif /* __MP4_ATOM_INCLUDED__ */ diff -Nru faac-1.26/common/mp4v2/mp4common.h faac-1.28/common/mp4v2/mp4common.h --- faac-1.26/common/mp4v2/mp4common.h 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/mp4common.h 2009-01-25 01:14:34.000000000 +0000 @@ -46,5 +46,5 @@ #include "odcommands.h" #include "rtphint.h" - +#include "virtual_io.h" #endif /* __MP4_COMMON_INCLUDED__ */ diff -Nru faac-1.26/common/mp4v2/mp4.cpp faac-1.28/common/mp4v2/mp4.cpp --- faac-1.26/common/mp4v2/mp4.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/mp4.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -13,7 +13,7 @@ * * The Initial Developer of the Original Code is Cisco Systems Inc. * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001 - 2004. All Rights Reserved. + * Copyright (C) Cisco Systems Inc. 2001 - 2005. All Rights Reserved. * * 3GPP features implementation is based on 3GPP's TS26.234-v5.60, * and was contributed by Ximpo Group Ltd. @@ -25,6 +25,7 @@ * Dave Mackie dmackie@cisco.com * Alix Marchandise-Franquet alix@cisco.com * Ximpo Group Ltd. mp4v2@ximpo.com + * Bill May wmay@cisco.com */ /* @@ -41,6 +42,25 @@ VERBOSE_ERROR(((MP4File*)hFile)->GetVerbosity(), e->Print()); /* file operations */ +// benski> + extern "C" MP4FileHandle MP4ReadEx (const char* fileName, + void *user, + struct Virtual_IO *virtual_IO, + u_int32_t verbosity) +{ + MP4File* pFile = NULL; + try { + pFile = new MP4File(verbosity); + + pFile->ReadEx(fileName, user, virtual_IO); + return (MP4FileHandle)pFile; + } catch (MP4Error* e) { + VERBOSE_ERROR(verbosity, e->Print()); + delete e; + delete pFile; + return MP4_INVALID_FILE_HANDLE; + } +} extern "C" MP4FileHandle MP4Read(const char* fileName, u_int32_t verbosity) { @@ -58,20 +78,30 @@ } } -extern "C" MP4FileHandle MP4CreateEx(const char* fileName, - u_int32_t verbosity, u_int32_t flags, - char* majorBrand, u_int32_t minorVersion, - char** supportedBrands, u_int32_t supportedBrandsCount) +extern "C" MP4FileHandle MP4Create (const char* fileName, + u_int32_t verbosity, + u_int32_t flags) +{ + return MP4CreateEx(fileName, verbosity, flags); +} + +extern "C" MP4FileHandle MP4CreateEx (const char* fileName, + u_int32_t verbosity, + u_int32_t flags, + int add_ftyp, + int add_iods, + char* majorBrand, + u_int32_t minorVersion, + char** supportedBrands, + u_int32_t supportedBrandsCount) { MP4File* pFile = NULL; try { pFile = new MP4File(verbosity); // LATER useExtensibleFormat, moov first, then mvex's - if (!majorBrand) { - pFile->Create(fileName, flags); - } else { - pFile->CreateEx(fileName, flags, majorBrand, minorVersion, supportedBrands, supportedBrandsCount); - } + pFile->Create(fileName, flags, add_ftyp, add_iods, + majorBrand, minorVersion, + supportedBrands, supportedBrandsCount); return (MP4FileHandle)pFile; } catch (MP4Error* e) { @@ -82,13 +112,6 @@ } } -extern "C" MP4FileHandle MP4Create(const char* fileName, - u_int32_t verbosity, - u_int32_t flags) -{ - return MP4CreateEx(fileName, verbosity, flags, NULL, 0, NULL, 0 ); -} - extern "C" MP4FileHandle MP4Modify(const char* fileName, u_int32_t verbosity, u_int32_t flags) { @@ -96,15 +119,16 @@ try { pFile = new MP4File(verbosity); // LATER useExtensibleFormat, moov first, then mvex's - pFile->Modify(fileName); + if (pFile->Modify(fileName)) return (MP4FileHandle)pFile; } catch (MP4Error* e) { VERBOSE_ERROR(verbosity, e->Print()); delete e; - delete pFile; - return MP4_INVALID_FILE_HANDLE; } + + if (pFile) delete pFile; + return MP4_INVALID_FILE_HANDLE; } extern "C" bool MP4Optimize(const char* existingFileName, @@ -124,20 +148,20 @@ return false; } -extern "C" bool MP4Close(MP4FileHandle hFile) +extern "C" void MP4Close(MP4FileHandle hFile) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { ((MP4File*)hFile)->Close(); delete (MP4File*)hFile; - return true; + return; } catch (MP4Error* e) { PRINT_ERROR(e); delete e; } } - return false; + return ; } extern "C" bool MP4Dump( @@ -175,19 +199,19 @@ return 0; } -extern "C" bool MP4SetVerbosity(MP4FileHandle hFile, u_int32_t verbosity) +extern "C" void MP4SetVerbosity(MP4FileHandle hFile, u_int32_t verbosity) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { ((MP4File*)hFile)->SetVerbosity(verbosity); - return true; + return; } catch (MP4Error* e) { PRINT_ERROR(e); delete e; } } - return false; + return; } extern "C" MP4Duration MP4GetDuration(MP4FileHandle hFile) @@ -291,7 +315,8 @@ return false; } -extern "C" u_int8_t MP4GetVideoProfileLevel(MP4FileHandle hFile) +extern "C" u_int8_t MP4GetVideoProfileLevel(MP4FileHandle hFile, + MP4TrackId trackId) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { @@ -301,23 +326,50 @@ PRINT_ERROR(e); delete e; } + if (MP4_IS_VALID_TRACK_ID(trackId)) { + uint8_t *foo; + uint32_t bufsize; + uint8_t type; + // for mpeg4 video tracks, try to look for the VOSH header, + // which has this info. + type = MP4GetTrackEsdsObjectTypeId(hFile, trackId); + if (type == MP4_MPEG4_VIDEO_TYPE) { + if (MP4GetTrackESConfiguration(hFile, + trackId, + &foo, + &bufsize)) { + uint8_t *ptr = foo; + while (bufsize > 0) { + if (htonl(*(uint32_t *)ptr) == 0x1b0) { + uint8_t ret = ptr[4]; + free(foo); + return ret; + } + ptr++; + bufsize--; + } + free(foo); + } + } + } + } return 0; } -extern "C" bool MP4SetVideoProfileLevel(MP4FileHandle hFile, u_int8_t value) +extern "C" void MP4SetVideoProfileLevel(MP4FileHandle hFile, u_int8_t value) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { ((MP4File*)hFile)->SetVideoProfileLevel(value); - return true; + return ; } catch (MP4Error* e) { PRINT_ERROR(e); delete e; } } - return false; + return ; } extern "C" u_int8_t MP4GetAudioProfileLevel(MP4FileHandle hFile) @@ -334,19 +386,17 @@ return 0; } -extern "C" bool MP4SetAudioProfileLevel(MP4FileHandle hFile, u_int8_t value) +extern "C" void MP4SetAudioProfileLevel(MP4FileHandle hFile, u_int8_t value) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { ((MP4File*)hFile)->SetAudioProfileLevel(value); - return true; } catch (MP4Error* e) { PRINT_ERROR(e); delete e; } } - return false; } extern "C" u_int8_t MP4GetGraphicsProfileLevel(MP4FileHandle hFile) @@ -380,59 +430,76 @@ /* generic file properties */ -extern "C" u_int64_t MP4GetIntegerProperty( - MP4FileHandle hFile, const char* propName) +extern "C" bool MP4HaveAtom (MP4FileHandle hFile, const char *atomName) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File *)hFile)->FindAtom(atomName) != NULL; + } catch (MP4Error *e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4GetIntegerProperty( + MP4FileHandle hFile, const char* propName, u_int64_t *retvalue) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->GetIntegerProperty(propName); + *retvalue = ((MP4File*)hFile)->GetIntegerProperty(propName); + return true; } catch (MP4Error* e) { PRINT_ERROR(e); delete e; } } - return (u_int64_t)-1; + return false; } -extern "C" float MP4GetFloatProperty( - MP4FileHandle hFile, const char* propName) +extern "C" bool MP4GetFloatProperty( + MP4FileHandle hFile, const char* propName, float *retvalue) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->GetFloatProperty(propName); + *retvalue = ((MP4File*)hFile)->GetFloatProperty(propName); + return true; } catch (MP4Error* e) { PRINT_ERROR(e); delete e; } } - return NAN; + return false; } -extern "C" const char* MP4GetStringProperty( - MP4FileHandle hFile, const char* propName) +extern "C" bool MP4GetStringProperty( + MP4FileHandle hFile, const char* propName, + const char **retvalue) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->GetStringProperty(propName); + *retvalue = ((MP4File*)hFile)->GetStringProperty(propName); + return true; } catch (MP4Error* e) { PRINT_ERROR(e); delete e; } } - return NULL; + return false; } -extern "C" void MP4GetBytesProperty( +extern "C" bool MP4GetBytesProperty( MP4FileHandle hFile, const char* propName, u_int8_t** ppValue, u_int32_t* pValueSize) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { ((MP4File*)hFile)->GetBytesProperty(propName, ppValue, pValueSize); - return; + return true; } catch (MP4Error* e) { PRINT_ERROR(e); @@ -441,7 +508,7 @@ } *ppValue = NULL; *pValueSize = 0; - return; + return false; } extern "C" bool MP4SetIntegerProperty( @@ -588,22 +655,50 @@ return MP4_INVALID_TRACK_ID; } +// +// API to initialize ismacryp properties to sensible defaults. +// if the input pointer is null then an ismacryp params is malloc'd. +// caller must see to it that it is properly disposed of. +// +extern "C" mp4v2_ismacrypParams *MP4DefaultISMACrypParams(mp4v2_ismacrypParams *ptr) +{ + try + { + if (ptr == NULL) { + ptr = (mp4v2_ismacrypParams *)MP4Malloc(sizeof(mp4v2_ismacrypParams)); + } + memset(ptr, 0, sizeof(*ptr)); + return ptr; + } + + catch (...) { + return MP4_INVALID_TRACK_ID; + } +} + + extern "C" MP4TrackId MP4AddEncAudioTrack(MP4FileHandle hFile, u_int32_t timeScale, MP4Duration sampleDuration, mp4v2_ismacrypParams *icPp, - u_int8_t audioType - ) + u_int8_t audioType) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)-> - AddEncAudioTrack(timeScale, sampleDuration, audioType, - icPp->scheme_type, icPp->scheme_version, - icPp->key_ind_len, icPp->iv_len, - icPp->selective_enc, icPp->kms_uri); - } - catch (MP4Error* e) { + if (icPp == NULL) { + return ((MP4File*)hFile)-> + AddEncAudioTrack(timeScale, sampleDuration, audioType, + 0, 0, + 0, 0, + false, NULL, false); + } else { + return ((MP4File*)hFile)-> + AddEncAudioTrack(timeScale, sampleDuration, audioType, + icPp->scheme_type, icPp->scheme_version, + icPp->key_ind_len, icPp->iv_len, + icPp->selective_enc, icPp->kms_uri, true); + } + } catch (MP4Error* e) { PRINT_ERROR(e); delete e; } @@ -682,26 +777,84 @@ } } - -extern "C" MP4TrackId MP4AddVideoTrack( - MP4FileHandle hFile, - u_int32_t timeScale, - MP4Duration sampleDuration, - u_int16_t width, - u_int16_t height, - u_int8_t videoType) +extern "C" uint16_t MP4GetAmrModeSet( + MP4FileHandle hFile, + MP4TrackId trackId) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->AddVideoTrack( - timeScale, sampleDuration, width, height, videoType); + return ((MP4File*)hFile)-> + GetAmrModeSet(trackId); } catch (MP4Error* e) { PRINT_ERROR(e); delete e; } } - return MP4_INVALID_TRACK_ID; + return 0; +} + +extern "C" MP4TrackId MP4AddHrefTrack (MP4FileHandle hFile, + uint32_t timeScale, + MP4Duration sampleDuration, + const char *base_url) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + MP4File *pFile = (MP4File *)hFile; + + return pFile->AddHrefTrack(timeScale, + sampleDuration, + base_url); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_TRACK_ID; +} + +extern "C" const char *MP4GetHrefTrackBaseUrl (MP4FileHandle hFile, + MP4TrackId trackId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetTrackStringProperty(trackId, + "mdia.minf.stbl.stsd.href.burl.base_url"); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return NULL; +} + +extern "C" MP4TrackId MP4AddVideoTrack( + MP4FileHandle hFile, + u_int32_t timeScale, + MP4Duration sampleDuration, + u_int16_t width, + u_int16_t height, + u_int8_t videoType) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + MP4File *pFile = (MP4File *)hFile; + + return pFile->AddMP4VideoTrack(timeScale, + sampleDuration, + width, + height, + videoType); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_TRACK_ID; } extern "C" MP4TrackId MP4AddEncVideoTrack(MP4FileHandle hFile, @@ -710,15 +863,97 @@ u_int16_t width, u_int16_t height, mp4v2_ismacrypParams *icPp, - u_int8_t videoType ) + u_int8_t videoType, + const char *oFormat) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + + // test for valid ismacrypt session descriptor + if (icPp == NULL) { + return MP4_INVALID_TRACK_ID; + } + MP4File *pFile = (MP4File *)hFile; + + return pFile->AddEncVideoTrack(timeScale, + sampleDuration, + width, + height, + videoType, + icPp, + oFormat); + + } catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_TRACK_ID; +} + + +extern "C" MP4TrackId MP4AddH264VideoTrack(MP4FileHandle hFile, + u_int32_t timeScale, + MP4Duration sampleDuration, + u_int16_t width, + u_int16_t height, + uint8_t AVCProfileIndication, + uint8_t profile_compat, + uint8_t AVCLevelIndication, + uint8_t sampleLenFieldSizeMinusOne) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + MP4File *pFile = (MP4File *)hFile; + + return pFile->AddH264VideoTrack(timeScale, + sampleDuration, + width, + height, + AVCProfileIndication, + profile_compat, + AVCLevelIndication, + sampleLenFieldSizeMinusOne); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return MP4_INVALID_TRACK_ID; +} + +extern "C" MP4TrackId MP4AddEncH264VideoTrack( + MP4FileHandle hFile, + u_int32_t timeScale, + MP4Duration sampleDuration, + u_int16_t width, + u_int16_t height, + MP4FileHandle srcFile, + MP4TrackId srcTrackId, + mp4v2_ismacrypParams *icPp +) + { + MP4Atom *srcAtom; + MP4File *pFile; + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->AddEncVideoTrack(timeScale, sampleDuration, - width, height, videoType, - icPp->scheme_type, icPp->scheme_version, - icPp->key_ind_len, icPp->iv_len, - icPp->selective_enc, icPp->kms_uri); + + pFile = (MP4File *)srcFile; + srcAtom = pFile->FindTrackAtom(srcTrackId, "mdia.minf.stbl.stsd.avc1.avcC"); + if (srcAtom == NULL) + return MP4_INVALID_TRACK_ID; + + pFile = (MP4File *)hFile; + + return pFile->AddEncH264VideoTrack(timeScale, + sampleDuration, + width, + height, + srcAtom, + icPp); } catch (MP4Error* e) { PRINT_ERROR(e); @@ -727,6 +962,50 @@ } return MP4_INVALID_TRACK_ID; } + +extern "C" void MP4AddH264SequenceParameterSet (MP4FileHandle hFile, + MP4TrackId trackId, + const uint8_t *pSequence, + uint16_t sequenceLen) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + MP4File *pFile = (MP4File *)hFile; + + pFile->AddH264SequenceParameterSet(trackId, + pSequence, + sequenceLen); + return; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return; +} +extern "C" void MP4AddH264PictureParameterSet (MP4FileHandle hFile, + MP4TrackId trackId, + const uint8_t *pPict, + uint16_t pictLen) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + MP4File *pFile = (MP4File *)hFile; + + pFile->AddH264PictureParameterSet(trackId, + pPict, + pictLen); + return; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return; +} + extern "C" MP4TrackId MP4AddH263VideoTrack( MP4FileHandle hFile, u_int32_t timeScale, @@ -821,139 +1100,41 @@ return MP4_INVALID_TRACK_ID; } -extern "C" MP4TrackId MP4CloneTrack( - MP4FileHandle srcFile, - MP4TrackId srcTrackId, - MP4FileHandle dstFile, - MP4TrackId dstHintTrackReferenceTrack) +extern "C" MP4TrackId MP4AddTextTrack( + MP4FileHandle hFile, MP4TrackId refTrackId) { - MP4TrackId dstTrackId = MP4_INVALID_TRACK_ID; - - if (dstFile == NULL) { - dstFile = srcFile; - } - - const char* trackType = - MP4GetTrackType(srcFile, srcTrackId); - - if (!trackType) { - return dstTrackId; - } - - if (MP4_IS_VIDEO_TRACK_TYPE(trackType)) { - MP4SetVideoProfileLevel(dstFile, - MP4GetVideoProfileLevel(srcFile)); - dstTrackId = MP4AddVideoTrack( - dstFile, - MP4GetTrackTimeScale(srcFile, srcTrackId), - MP4GetTrackFixedSampleDuration(srcFile, srcTrackId), - MP4GetTrackVideoWidth(srcFile, srcTrackId), - MP4GetTrackVideoHeight(srcFile, srcTrackId), - MP4GetTrackEsdsObjectTypeId(srcFile, srcTrackId)); - - } else if (MP4_IS_AUDIO_TRACK_TYPE(trackType)) { - MP4SetAudioProfileLevel(dstFile, - MP4GetAudioProfileLevel(srcFile)); - dstTrackId = MP4AddAudioTrack( - dstFile, - MP4GetTrackTimeScale(srcFile, srcTrackId), - MP4GetTrackFixedSampleDuration(srcFile, srcTrackId), - MP4GetTrackEsdsObjectTypeId(srcFile, srcTrackId)); - - } else if (MP4_IS_OD_TRACK_TYPE(trackType)) { - dstTrackId = MP4AddODTrack(dstFile); - - } else if (MP4_IS_SCENE_TRACK_TYPE(trackType)) { - dstTrackId = MP4AddSceneTrack(dstFile); - - } else if (MP4_IS_HINT_TRACK_TYPE(trackType)) { - if (dstHintTrackReferenceTrack == MP4_INVALID_TRACK_ID) { - dstTrackId = MP4_INVALID_TRACK_ID; - } else { - dstTrackId = MP4AddHintTrack( - dstFile, - dstHintTrackReferenceTrack); - } - - } else if (MP4_IS_SYSTEMS_TRACK_TYPE(trackType)) { - dstTrackId = MP4AddSystemsTrack(dstFile, trackType); - - } else { - dstTrackId = MP4AddTrack(dstFile, trackType); - } - - if (dstTrackId == MP4_INVALID_TRACK_ID) { - return dstTrackId; - } - - MP4SetTrackTimeScale( - dstFile, - dstTrackId, - MP4GetTrackTimeScale(srcFile, srcTrackId)); - - if (MP4_IS_AUDIO_TRACK_TYPE(trackType) - || MP4_IS_VIDEO_TRACK_TYPE(trackType)) { - // copy track ES configuration - u_int8_t* pConfig = NULL; - u_int32_t configSize = 0; - - MP4GetTrackESConfiguration( - srcFile, - srcTrackId, - &pConfig, - &configSize); - - MP4SetTrackESConfiguration( - dstFile, - dstTrackId, - pConfig, - configSize); - - free(pConfig); + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->AddTextTrack(refTrackId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } } + return MP4_INVALID_TRACK_ID; +} - if (MP4_IS_HINT_TRACK_TYPE(trackType)) { - // probably not exactly what is wanted - // but caller can adjust later to fit their desires - - char* payloadName = NULL; - char *encodingParms = NULL; - u_int8_t payloadNumber; - u_int16_t maxPayloadSize; - - MP4GetHintTrackRtpPayload( - srcFile, - srcTrackId, - &payloadName, - &payloadNumber, - &maxPayloadSize, - &encodingParms); - - MP4SetHintTrackRtpPayload( - dstFile, - dstTrackId, - payloadName, - &payloadNumber, - maxPayloadSize, - encodingParms); -#if 0 - MP4SetHintTrackSdp( - dstFile, - dstTrackId, - MP4GetHintTrackSdp(srcFile, srcTrackId)); -#endif +extern "C" MP4TrackId MP4AddChapterTextTrack( + MP4FileHandle hFile, MP4TrackId refTrackId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->AddChapterTextTrack(refTrackId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } } - - return dstTrackId; + return MP4_INVALID_TRACK_ID; } -// Given a track, make an encrypted clone of it in the dest. file -extern "C" MP4TrackId MP4EncAndCloneTrack(MP4FileHandle srcFile, - MP4TrackId srcTrackId, - mp4v2_ismacrypParams *icPp, - MP4FileHandle dstFile, - MP4TrackId dstHintTrackReferenceTrack - ) + +extern "C" MP4TrackId MP4CloneTrack (MP4FileHandle srcFile, + MP4TrackId srcTrackId, + MP4FileHandle dstFile, + MP4TrackId dstHintTrackReferenceTrack) { MP4TrackId dstTrackId = MP4_INVALID_TRACK_ID; @@ -968,29 +1149,253 @@ return dstTrackId; } - if (MP4_IS_VIDEO_TRACK_TYPE(trackType)) { - MP4SetVideoProfileLevel(dstFile, MP4GetVideoProfileLevel(srcFile)); - dstTrackId = MP4AddEncVideoTrack(dstFile, - MP4GetTrackTimeScale(srcFile, srcTrackId), - MP4GetTrackFixedSampleDuration(srcFile, - srcTrackId), - MP4GetTrackVideoWidth(srcFile, srcTrackId), - MP4GetTrackVideoHeight(srcFile, srcTrackId), - icPp, - MP4GetTrackEsdsObjectTypeId(srcFile, - srcTrackId) - ); + const char *media_data_name = + MP4GetTrackMediaDataName(srcFile, srcTrackId); + if (media_data_name == NULL) return dstTrackId; + if (MP4_IS_VIDEO_TRACK_TYPE(trackType)) { + if (ATOMID(media_data_name) == ATOMID("mp4v")) { + MP4SetVideoProfileLevel(dstFile, + MP4GetVideoProfileLevel(srcFile)); + dstTrackId = MP4AddVideoTrack( + dstFile, + MP4GetTrackTimeScale(srcFile, + srcTrackId), + MP4GetTrackFixedSampleDuration(srcFile, + srcTrackId), + MP4GetTrackVideoWidth(srcFile, + srcTrackId), + MP4GetTrackVideoHeight(srcFile, + srcTrackId), + MP4GetTrackEsdsObjectTypeId(srcFile, + srcTrackId)); + } else if (ATOMID(media_data_name) == ATOMID("avc1")) { + uint8_t AVCProfileIndication; + uint8_t profile_compat; + uint8_t AVCLevelIndication; + uint32_t sampleLenFieldSizeMinusOne; + uint64_t temp; + + if (MP4GetTrackH264ProfileLevel(srcFile, srcTrackId, + &AVCProfileIndication, + &AVCLevelIndication) == false) { + return dstTrackId; + } + if (MP4GetTrackH264LengthSize(srcFile, srcTrackId, + &sampleLenFieldSizeMinusOne) == false) { + return dstTrackId; + } + sampleLenFieldSizeMinusOne--; + if (MP4GetTrackIntegerProperty(srcFile, srcTrackId, + "mdia.minf.stbl.stsd.*[0].avcC.profile_compatibility", + &temp) == false) return dstTrackId; + profile_compat = temp & 0xff; + + dstTrackId = MP4AddH264VideoTrack(dstFile, + MP4GetTrackTimeScale(srcFile, + srcTrackId), + MP4GetTrackFixedSampleDuration(srcFile, + srcTrackId), + MP4GetTrackVideoWidth(srcFile, + srcTrackId), + MP4GetTrackVideoHeight(srcFile, + srcTrackId), + AVCProfileIndication, + profile_compat, + AVCLevelIndication, + sampleLenFieldSizeMinusOne); + uint8_t **seqheader, **pictheader; + uint32_t *pictheadersize, *seqheadersize; + uint32_t ix; + MP4GetTrackH264SeqPictHeaders(srcFile, srcTrackId, + &seqheader, &seqheadersize, + &pictheader, &pictheadersize); + for (ix = 0; seqheadersize[ix] != 0; ix++) { + MP4AddH264SequenceParameterSet(dstFile, dstTrackId, + seqheader[ix], seqheadersize[ix]); + free(seqheader[ix]); + } + free(seqheader); + free(seqheadersize); + for (ix = 0; pictheadersize[ix] != 0; ix++) { + MP4AddH264PictureParameterSet(dstFile, dstTrackId, + pictheader[ix], pictheadersize[ix]); + free(pictheader[ix]); + } + free(pictheader); + free(pictheadersize); + } else + return dstTrackId; } else if (MP4_IS_AUDIO_TRACK_TYPE(trackType)) { - MP4SetAudioProfileLevel(dstFile, MP4GetAudioProfileLevel(srcFile)); - dstTrackId = MP4AddEncAudioTrack(dstFile, - MP4GetTrackTimeScale(srcFile, srcTrackId), - MP4GetTrackFixedSampleDuration(srcFile, - srcTrackId), - icPp, - MP4GetTrackEsdsObjectTypeId(srcFile, - srcTrackId) - ); + if (ATOMID(media_data_name) != ATOMID("mp4a")) return dstTrackId; + MP4SetAudioProfileLevel(dstFile, + MP4GetAudioProfileLevel(srcFile)); + dstTrackId = MP4AddAudioTrack( + dstFile, + MP4GetTrackTimeScale(srcFile, srcTrackId), + MP4GetTrackFixedSampleDuration(srcFile, srcTrackId), + MP4GetTrackEsdsObjectTypeId(srcFile, srcTrackId)); + + } else if (MP4_IS_OD_TRACK_TYPE(trackType)) { + dstTrackId = MP4AddODTrack(dstFile); + + } else if (MP4_IS_SCENE_TRACK_TYPE(trackType)) { + dstTrackId = MP4AddSceneTrack(dstFile); + + } else if (MP4_IS_HINT_TRACK_TYPE(trackType)) { + if (dstHintTrackReferenceTrack == MP4_INVALID_TRACK_ID) { + dstTrackId = MP4_INVALID_TRACK_ID; + } else { + dstTrackId = MP4AddHintTrack( + dstFile, + dstHintTrackReferenceTrack); + } + + } else if (MP4_IS_SYSTEMS_TRACK_TYPE(trackType)) { + dstTrackId = MP4AddSystemsTrack(dstFile, trackType); + + } else { + dstTrackId = MP4AddTrack(dstFile, trackType); + } + + if (dstTrackId == MP4_INVALID_TRACK_ID) { + return dstTrackId; + } + + MP4SetTrackTimeScale( + dstFile, + dstTrackId, + MP4GetTrackTimeScale(srcFile, srcTrackId)); + + if (MP4_IS_AUDIO_TRACK_TYPE(trackType) + || MP4_IS_VIDEO_TRACK_TYPE(trackType)) { + // copy track ES configuration + u_int8_t* pConfig = NULL; + u_int32_t configSize = 0; + uint32_t verb = MP4GetVerbosity(srcFile); + MP4SetVerbosity(srcFile, verb & ~(MP4_DETAILS_ERROR)); + bool haveEs = MP4GetTrackESConfiguration(srcFile, + srcTrackId, + &pConfig, + &configSize); + MP4SetVerbosity(srcFile, verb); + if (haveEs && + pConfig != NULL && configSize != 0) { + if (!MP4SetTrackESConfiguration( + dstFile, + dstTrackId, + pConfig, + configSize)) { + free(pConfig); + MP4DeleteTrack(dstFile, dstTrackId); + return MP4_INVALID_TRACK_ID; + } + + free(pConfig); + } + } + + if (MP4_IS_HINT_TRACK_TYPE(trackType)) { + // probably not exactly what is wanted + // but caller can adjust later to fit their desires + + char* payloadName = NULL; + char *encodingParms = NULL; + u_int8_t payloadNumber; + u_int16_t maxPayloadSize; + + if (MP4GetHintTrackRtpPayload( + srcFile, + srcTrackId, + &payloadName, + &payloadNumber, + &maxPayloadSize, + &encodingParms)) { + + if (MP4SetHintTrackRtpPayload( + dstFile, + dstTrackId, + payloadName, + &payloadNumber, + maxPayloadSize, + encodingParms) == false) { + MP4DeleteTrack(dstFile, dstTrackId); + return MP4_INVALID_TRACK_ID; + } + } +#if 0 + MP4SetHintTrackSdp( + dstFile, + dstTrackId, + MP4GetHintTrackSdp(srcFile, srcTrackId)); +#endif + } + + return dstTrackId; +} + +// Given a track, make an encrypted clone of it in the dest. file +extern "C" MP4TrackId MP4EncAndCloneTrack(MP4FileHandle srcFile, + MP4TrackId srcTrackId, + mp4v2_ismacrypParams *icPp, + MP4FileHandle dstFile, + MP4TrackId dstHintTrackReferenceTrack + ) +{ + const char *oFormat; + + MP4TrackId dstTrackId = MP4_INVALID_TRACK_ID; + + if (dstFile == NULL) { + dstFile = srcFile; + } + + const char* trackType = MP4GetTrackType(srcFile, srcTrackId); + + if (!trackType) { + return dstTrackId; + } + + if (MP4_IS_VIDEO_TRACK_TYPE(trackType)) { + + // test source file format for avc1 + oFormat = MP4GetTrackMediaDataName(srcFile, srcTrackId); + if (!strcasecmp(oFormat, "avc1")) + { + dstTrackId = MP4AddEncH264VideoTrack(dstFile, + MP4GetTrackTimeScale(srcFile, srcTrackId), + MP4GetTrackFixedSampleDuration(srcFile, srcTrackId), + MP4GetTrackVideoWidth(srcFile, srcTrackId), + MP4GetTrackVideoHeight(srcFile, srcTrackId), + srcFile, + srcTrackId, + icPp + ); + } + else + { + MP4SetVideoProfileLevel(dstFile, MP4GetVideoProfileLevel(srcFile)); + dstTrackId = MP4AddEncVideoTrack(dstFile, + MP4GetTrackTimeScale(srcFile, srcTrackId), + MP4GetTrackFixedSampleDuration(srcFile, srcTrackId), + MP4GetTrackVideoWidth(srcFile, srcTrackId), + MP4GetTrackVideoHeight(srcFile, srcTrackId), + icPp, + MP4GetTrackEsdsObjectTypeId(srcFile, srcTrackId), + oFormat + ); + } + + } else if (MP4_IS_AUDIO_TRACK_TYPE(trackType)) { + MP4SetAudioProfileLevel(dstFile, MP4GetAudioProfileLevel(srcFile)); + dstTrackId = MP4AddEncAudioTrack(dstFile, + MP4GetTrackTimeScale(srcFile, srcTrackId), + MP4GetTrackFixedSampleDuration(srcFile, + srcTrackId), + icPp, + MP4GetTrackEsdsObjectTypeId(srcFile, + srcTrackId) + ); } else if (MP4_IS_OD_TRACK_TYPE(trackType)) { dstTrackId = MP4AddODTrack(dstFile); @@ -1048,21 +1453,22 @@ u_int8_t payloadNumber; u_int16_t maxPayloadSize; - MP4GetHintTrackRtpPayload( - srcFile, - srcTrackId, - &payloadName, - &payloadNumber, - &maxPayloadSize, - &encodingParms); + if (MP4GetHintTrackRtpPayload( + srcFile, + srcTrackId, + &payloadName, + &payloadNumber, + &maxPayloadSize, + &encodingParms)) { - MP4SetHintTrackRtpPayload( + (void)MP4SetHintTrackRtpPayload( dstFile, dstTrackId, payloadName, &payloadNumber, maxPayloadSize, encodingParms); + } #if 0 MP4SetHintTrackSdp( dstFile, @@ -1073,6 +1479,7 @@ return dstTrackId; } + extern "C" MP4TrackId MP4CopyTrack(MP4FileHandle srcFile, MP4TrackId srcTrackId, MP4FileHandle dstFile, @@ -1252,21 +1659,21 @@ return dstTrackId; } -extern "C" bool MP4DeleteTrack( +extern "C" void MP4DeleteTrack( MP4FileHandle hFile, MP4TrackId trackId) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { ((MP4File*)hFile)->DeleteTrack(trackId); - return true; + return ; } catch (MP4Error* e) { PRINT_ERROR(e); delete e; } } - return false; + return; } extern "C" u_int32_t MP4GetNumberOfTracks( @@ -1335,105 +1742,102 @@ } return NULL; } - -extern "C" MP4Duration MP4GetTrackDuration( +extern "C" const char* MP4GetTrackMediaDataName( MP4FileHandle hFile, MP4TrackId trackId) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->GetTrackDuration(trackId); + return ((MP4File*)hFile)->GetTrackMediaDataName(trackId); } catch (MP4Error* e) { PRINT_ERROR(e); delete e; } } - return MP4_INVALID_DURATION; + return NULL; } -extern "C" u_int32_t MP4GetTrackTimeScale( - MP4FileHandle hFile, MP4TrackId trackId) +extern "C" bool MP4GetTrackMediaDataOriginalFormat( + MP4FileHandle hFile, MP4TrackId trackId, char *originalFormat, + u_int32_t buflen) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->GetTrackTimeScale(trackId); + + return ((MP4File*)hFile)->GetTrackMediaDataOriginalFormat(trackId, + originalFormat, buflen); } catch (MP4Error* e) { PRINT_ERROR(e); delete e; } } - return 0; + return false; } -extern "C" bool MP4SetTrackTimeScale( - MP4FileHandle hFile, MP4TrackId trackId, u_int32_t value) +extern "C" MP4Duration MP4GetTrackDuration( + MP4FileHandle hFile, MP4TrackId trackId) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - ((MP4File*)hFile)->SetTrackTimeScale(trackId, value); - return true; + return ((MP4File*)hFile)->GetTrackDuration(trackId); } catch (MP4Error* e) { PRINT_ERROR(e); delete e; } } - return false; + return MP4_INVALID_DURATION; } - -// This function should not be used anymore -// use MP4GetTrackEsdsObjectTypeId instead -extern "C" u_int8_t MP4GetTrackAudioType( - MP4FileHandle hFile, MP4TrackId trackId) +extern "C" u_int32_t MP4GetTrackTimeScale( + MP4FileHandle hFile, MP4TrackId trackId) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - - return ((MP4File*)hFile)->GetTrackAudioType(trackId); + return ((MP4File*)hFile)->GetTrackTimeScale(trackId); } catch (MP4Error* e) { PRINT_ERROR(e); delete e; } } - return MP4_INVALID_AUDIO_TYPE; + return 0; } -extern "C" u_int8_t MP4GetTrackAudioMpeg4Type( - MP4FileHandle hFile, MP4TrackId trackId) +extern "C" void MP4SetTrackTimeScale( + MP4FileHandle hFile, MP4TrackId trackId, u_int32_t value) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->GetTrackAudioMpeg4Type(trackId); + ((MP4File*)hFile)->SetTrackTimeScale(trackId, value); + return; } catch (MP4Error* e) { PRINT_ERROR(e); delete e; } } - return MP4_MPEG4_INVALID_AUDIO_TYPE; + return; } - -// This function should not be used anymore -// use MP4GetTrackEsdsObjectTypeId instead -extern "C" u_int8_t MP4GetTrackVideoType( +extern "C" u_int8_t MP4GetTrackAudioMpeg4Type( MP4FileHandle hFile, MP4TrackId trackId) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->GetTrackVideoType(trackId); + return ((MP4File*)hFile)->GetTrackAudioMpeg4Type(trackId); } catch (MP4Error* e) { PRINT_ERROR(e); delete e; } } - return MP4_INVALID_VIDEO_TYPE; + return MP4_MPEG4_INVALID_AUDIO_TYPE; } + + // Replacement to MP4GetTrackVideoType and MP4GetTrackAudioType // Basically does the same thing but with a more self-explanatory name extern "C" u_int8_t MP4GetTrackEsdsObjectTypeId( @@ -1471,14 +1875,36 @@ MP4FileHandle hFile, MP4TrackId trackId) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + MP4File *pFile = (MP4File *)hFile; try { - return ((MP4File*)hFile)->GetTrackIntegerProperty(trackId, + return pFile->GetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.*.esds.decConfigDescr.avgBitrate"); } catch (MP4Error* e) { - PRINT_ERROR(e); + //PRINT_ERROR(e); we don't really need to print this. + delete e; + } + // if we're here, we can't get the bitrate from above - + // lets calculate it + try { + MP4Duration trackDur; + trackDur = MP4GetTrackDuration(hFile, trackId); + uint64_t msDuration = + pFile->ConvertFromTrackDuration(trackId, trackDur, + MP4_MSECS_TIME_SCALE); + if (msDuration == 0) return 0; + + MP4Track *pTrack = pFile->GetTrack(trackId); + uint64_t bytes = pTrack->GetTotalOfSampleSizes(); + bytes *= TO_U64(8 * 1000); + bytes /= msDuration; + return (uint32_t)bytes; + } + catch (MP4Error* e) { + PRINT_ERROR(e); // print this one. delete e; } + } return 0; } @@ -1502,6 +1928,25 @@ *pConfigSize = 0; return false; } +extern "C" bool MP4GetTrackVideoMetadata( + MP4FileHandle hFile, MP4TrackId trackId, + u_int8_t** ppConfig, u_int32_t* pConfigSize) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->GetTrackVideoMetadata( + trackId, ppConfig, pConfigSize); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + *ppConfig = NULL; + *pConfigSize = 0; + return false; +} extern "C" bool MP4SetTrackESConfiguration( MP4FileHandle hFile, MP4TrackId trackId, @@ -1521,6 +1966,71 @@ return false; } +extern "C" bool MP4GetTrackH264ProfileLevel (MP4FileHandle hFile, + MP4TrackId trackId, + uint8_t *pProfile, + uint8_t *pLevel) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + *pProfile = + ((MP4File *)hFile)->GetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.*[0].avcC.AVCProfileIndication"); + *pLevel = + ((MP4File *)hFile)->GetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.*[0].avcC.AVCLevelIndication"); + + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} +extern "C" void MP4GetTrackH264SeqPictHeaders (MP4FileHandle hFile, + MP4TrackId trackId, + uint8_t ***pSeqHeader, + uint32_t **pSeqHeaderSize, + uint8_t ***pPictHeader, + uint32_t **pPictHeaderSize) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + ((MP4File*)hFile)->GetTrackH264SeqPictHeaders(trackId, + pSeqHeader, + pSeqHeaderSize, + pPictHeader, + pPictHeaderSize); + return; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return; +} +extern "C" bool MP4GetTrackH264LengthSize (MP4FileHandle hFile, + MP4TrackId trackId, + uint32_t *pLength) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + *pLength = 1 + + ((MP4File*) hFile)->GetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.*[0].avcC.lengthSizeMinusOne"); + return true; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + extern "C" MP4SampleId MP4GetTrackNumberOfSamples( MP4FileHandle hFile, MP4TrackId trackId) { @@ -1568,7 +2078,7 @@ return 0; } -extern "C" float MP4GetTrackVideoFrameRate( +extern "C" double MP4GetTrackVideoFrameRate( MP4FileHandle hFile, MP4TrackId trackId) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { @@ -1583,92 +2093,117 @@ return 0.0; } +extern "C" int MP4GetTrackAudioChannels (MP4FileHandle hFile, + MP4TrackId trackId) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetTrackAudioChannels(trackId); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return -1; +} + // returns true if the track is a media track encrypted according to ismacryp extern "C" bool MP4IsIsmaCrypMediaTrack( MP4FileHandle hFile, MP4TrackId trackId) { + bool retval = false; + uint32_t verb = MP4GetVerbosity(hFile); + MP4SetVerbosity(hFile, verb & ~(MP4_DETAILS_ERROR)); + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->IsIsmaCrypMediaTrack(trackId); + retval = ((MP4File*)hFile)->IsIsmaCrypMediaTrack(trackId); } catch (MP4Error* e) { PRINT_ERROR(e); delete e; } } - return false; + MP4SetVerbosity(hFile, verb); + return retval; } /* generic track properties */ -extern "C" u_int64_t MP4GetTrackIntegerProperty ( +extern "C" bool MP4HaveTrackAtom (MP4FileHandle hFile, + MP4TrackId trackId, + const char *atomName) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->FindTrackAtom(trackId, atomName) != NULL; + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4GetTrackIntegerProperty ( MP4FileHandle hFile, MP4TrackId trackId, - const char* propName) + const char* propName, + u_int64_t *retvalue) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->GetTrackIntegerProperty(trackId, + *retvalue = ((MP4File*)hFile)->GetTrackIntegerProperty(trackId, propName); + return true; } catch (MP4Error* e) { PRINT_ERROR(e); delete e; } } - return (u_int64_t)-1; -} -extern "C" bool MP4HaveTrackIntegerProperty( - MP4FileHandle hFile, MP4TrackId trackId, - const char* propName) -{ - // The same as MP4GetTrackIntegerProperty but with no error reporting - if (MP4_IS_VALID_FILE_HANDLE(hFile)) { - try { - return ((MP4File*)hFile)->GetTrackIntegerProperty(trackId, - propName) != (u_int64_t)-1; - } - catch (MP4Error* e) { - // No error reporting - delete e; - } - } return false; } -extern "C" float MP4GetTrackFloatProperty( +extern "C" bool MP4GetTrackFloatProperty( MP4FileHandle hFile, MP4TrackId trackId, - const char* propName) + const char* propName, + float *retvalue) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->GetTrackFloatProperty(trackId, propName); + *retvalue = ((MP4File*)hFile)->GetTrackFloatProperty(trackId, propName); + return true; } catch (MP4Error* e) { PRINT_ERROR(e); delete e; } } - return NAN; + return false; } -extern "C" const char* MP4GetTrackStringProperty( +extern "C" bool MP4GetTrackStringProperty( MP4FileHandle hFile, MP4TrackId trackId, - const char* propName) + const char* propName, + const char **retvalue) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->GetTrackStringProperty(trackId, propName); + *retvalue = ((MP4File*)hFile)->GetTrackStringProperty(trackId, propName); + return true; } catch (MP4Error* e) { PRINT_ERROR(e); delete e; } } - return NULL; + return false; } -extern "C" void MP4GetTrackBytesProperty( +extern "C" bool MP4GetTrackBytesProperty( MP4FileHandle hFile, MP4TrackId trackId, const char* propName, u_int8_t** ppValue, u_int32_t* pValueSize) { @@ -1676,7 +2211,7 @@ try { ((MP4File*)hFile)->GetTrackBytesProperty( trackId, propName, ppValue, pValueSize); - return; + return true; } catch (MP4Error* e) { PRINT_ERROR(e); @@ -1685,7 +2220,7 @@ } *ppValue = NULL; *pValueSize = 0; - return; + return false; } extern "C" bool MP4SetTrackIntegerProperty( @@ -2684,11 +3219,14 @@ u_int32_t supportedBrandsCount, bool deleteIodsAtom) { - MP4File* pFile = NULL; + MP4File* pFile; + pFile = NULL; try { pFile = new MP4File(verbosity); + pFile->Modify(fileName); pFile->Make3GPCompliant(fileName, majorBrand, minorVersion, supportedBrands, supportedBrandsCount, deleteIodsAtom); + pFile->Close(); delete pFile; return true; } @@ -2707,7 +3245,8 @@ u_int32_t verbosity, bool addIsmaComplianceSdp) { - MP4File* pFile = NULL; + MP4File* pFile; + pFile = NULL; try { pFile = new MP4File(verbosity); @@ -2762,7 +3301,7 @@ char* sdpIod = (char*)MP4Malloc(strlen(iodBase64) + 64); - sprintf(sdpIod, + snprintf(sdpIod, strlen(iodBase64) + 64, "a=mpeg4-iod: \042data:application/mpeg4-iod;base64,%s\042", iodBase64); MP4Free(iodBase64); @@ -2775,7 +3314,6 @@ VERBOSE_ERROR(verbosity, e->Print()); delete e; } - delete pFile; return NULL; } @@ -2840,7 +3378,7 @@ return ((MP4File*)hFile)->GetTrackNumberOfEdits(trackId); } catch (MP4Error* e) { - PRINT_ERROR(e); + //PRINT_ERROR(e); delete e; } } @@ -3062,7 +3600,7 @@ /* iTunes meta data handling */ extern "C" bool MP4GetMetadataByIndex(MP4FileHandle hFile, u_int32_t index, - const char** ppName, + char** ppName, u_int8_t** ppValue, u_int32_t* pValueSize) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { @@ -3097,7 +3635,7 @@ { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->SetMetadataName(value); + return ((MP4File*)hFile)->SetMetadataString("\251nam", value); } catch (MP4Error* e) { PRINT_ERROR(e); @@ -3112,7 +3650,7 @@ { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->GetMetadataName(value); + return ((MP4File*)hFile)->GetMetadataString("\251nam", value); } catch (MP4Error* e) { PRINT_ERROR(e); @@ -3122,12 +3660,26 @@ return false; } -extern "C" bool MP4SetMetadataWriter(MP4FileHandle hFile, +extern "C" bool MP4DeleteMetadataName(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->DeleteMetadataAtom("\251nam"); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4SetMetadataWriter(MP4FileHandle hFile, const char* value) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->SetMetadataWriter(value); + return ((MP4File*)hFile)->SetMetadataString("\251wrt", value); } catch (MP4Error* e) { PRINT_ERROR(e); @@ -3142,7 +3694,21 @@ { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->GetMetadataWriter(value); + return ((MP4File*)hFile)->GetMetadataString("\251wrt", value); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4DeleteMetadataWriter(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->DeleteMetadataAtom("\251wrt"); } catch (MP4Error* e) { PRINT_ERROR(e); @@ -3157,7 +3723,7 @@ { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->SetMetadataAlbum(value); + return ((MP4File*)hFile)->SetMetadataString("\251alb", value); } catch (MP4Error* e) { PRINT_ERROR(e); @@ -3172,7 +3738,7 @@ { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->GetMetadataAlbum(value); + return ((MP4File*)hFile)->GetMetadataString("\251alb", value); } catch (MP4Error* e) { PRINT_ERROR(e); @@ -3181,13 +3747,27 @@ } return false; } - + +extern "C" bool MP4DeleteMetadataAlbum(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->DeleteMetadataAtom("\251alb"); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + extern "C" bool MP4SetMetadataArtist(MP4FileHandle hFile, const char* value) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->SetMetadataArtist(value); + return ((MP4File*)hFile)->SetMetadataString("\251ART", value); } catch (MP4Error* e) { PRINT_ERROR(e); @@ -3202,7 +3782,7 @@ { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->GetMetadataArtist(value); + return ((MP4File*)hFile)->GetMetadataString("\251ART", value); } catch (MP4Error* e) { PRINT_ERROR(e); @@ -3212,12 +3792,26 @@ return false; } +extern "C" bool MP4DeleteMetadataArtist(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->DeleteMetadataAtom("\251ART"); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + extern "C" bool MP4SetMetadataTool(MP4FileHandle hFile, const char* value) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->SetMetadataTool(value); + return ((MP4File*)hFile)->SetMetadataString("\251too", value); } catch (MP4Error* e) { PRINT_ERROR(e); @@ -3232,7 +3826,7 @@ { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->GetMetadataTool(value); + return ((MP4File*)hFile)->GetMetadataString("\251too", value); } catch (MP4Error* e) { PRINT_ERROR(e); @@ -3242,12 +3836,26 @@ return false; } +extern "C" bool MP4DeleteMetadataTool(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->DeleteMetadataAtom("\251too"); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + extern "C" bool MP4SetMetadataComment(MP4FileHandle hFile, const char* value) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->SetMetadataComment(value); + return ((MP4File*)hFile)->SetMetadataString("\251cmt", value); } catch (MP4Error* e) { PRINT_ERROR(e); @@ -3262,7 +3870,7 @@ { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->GetMetadataComment(value); + return ((MP4File*)hFile)->GetMetadataString("\251cmt", value); } catch (MP4Error* e) { PRINT_ERROR(e); @@ -3272,12 +3880,26 @@ return false; } +extern "C" bool MP4DeleteMetadataComment(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->DeleteMetadataAtom("\251cmt"); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + extern "C" bool MP4SetMetadataYear(MP4FileHandle hFile, const char* value) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->SetMetadataYear(value); + return ((MP4File*)hFile)->SetMetadataString("\251day", value); } catch (MP4Error* e) { PRINT_ERROR(e); @@ -3292,7 +3914,7 @@ { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->GetMetadataYear(value); + return ((MP4File*)hFile)->GetMetadataString("\251day", value); } catch (MP4Error* e) { PRINT_ERROR(e); @@ -3302,6 +3924,20 @@ return false; } +extern "C" bool MP4DeleteMetadataYear(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->DeleteMetadataAtom("\251day"); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + extern "C" bool MP4SetMetadataTrack(MP4FileHandle hFile, u_int16_t track, u_int16_t totalTracks) { @@ -3332,6 +3968,20 @@ return false; } +extern "C" bool MP4DeleteMetadataTrack(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->DeleteMetadataAtom("trkn"); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + extern "C" bool MP4SetMetadataDisk(MP4FileHandle hFile, u_int16_t disk, u_int16_t totalDisks) { @@ -3362,6 +4012,20 @@ return false; } +extern "C" bool MP4DeleteMetadataDisk(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->DeleteMetadataAtom("disk"); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + extern "C" bool MP4SetMetadataGenre(MP4FileHandle hFile, const char *genre) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { @@ -3390,6 +4054,62 @@ return false; } +extern "C" bool MP4DeleteMetadataGenre(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->DeleteMetadataGenre(); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4SetMetadataGrouping(MP4FileHandle hFile, const char *grouping) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->SetMetadataString("\251grp", grouping); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4GetMetadataGrouping(MP4FileHandle hFile, char **grouping) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetMetadataString("\251grp", grouping); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4DeleteMetadataGrouping(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->DeleteMetadataAtom("\251grp"); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + extern "C" bool MP4SetMetadataTempo(MP4FileHandle hFile, u_int16_t tempo) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { @@ -3418,11 +4138,25 @@ return false; } +extern "C" bool MP4DeleteMetadataTempo(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->DeleteMetadataAtom("tmpo"); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + extern "C" bool MP4SetMetadataCompilation(MP4FileHandle hFile, u_int8_t cpl) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->SetMetadataCompilation(cpl); + return ((MP4File*)hFile)->SetMetadataUint8("cpil", cpl & 0x1); } catch (MP4Error* e) { PRINT_ERROR(e); @@ -3436,7 +4170,51 @@ { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->GetMetadataCompilation(cpl); + return ((MP4File*)hFile)->GetMetadataUint8("cpil", cpl); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4DeleteMetadataCompilation(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->DeleteMetadataAtom("cpil"); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4SetMetadataPartOfGaplessAlbum (MP4FileHandle hFile, + u_int8_t pgap) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->SetMetadataUint8("pgap", pgap & 0x1); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4GetMetadataPartOfGaplessAlbum (MP4FileHandle hFile, + u_int8_t* pgap) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetMetadataUint8("pgap", pgap); } catch (MP4Error* e) { PRINT_ERROR(e); @@ -3446,6 +4224,20 @@ return false; } +extern "C" bool MP4DeleteMetadataPartOfGaplessAlbum (MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->DeleteMetadataAtom("pgap"); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + extern "C" bool MP4SetMetadataCoverArt(MP4FileHandle hFile, u_int8_t *coverArt, u_int32_t size) { @@ -3462,11 +4254,12 @@ } extern "C" bool MP4GetMetadataCoverArt(MP4FileHandle hFile, - u_int8_t **coverArt, u_int32_t* size) + u_int8_t **coverArt, u_int32_t* size, + uint32_t index) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->GetMetadataCoverArt(coverArt, size); + return ((MP4File*)hFile)->GetMetadataCoverArt(coverArt, size, index); } catch (MP4Error* e) { PRINT_ERROR(e); @@ -3475,13 +4268,87 @@ } return false; } - -extern "C" bool MP4SetMetadataFreeForm(MP4FileHandle hFile, char *name, - u_int8_t* pValue, u_int32_t valueSize) + +extern "C" u_int32_t MP4GetMetadataCoverArtCount(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetMetadataCoverArtCount(); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4DeleteMetadataCoverArt(MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->DeleteMetadataAtom("covr"); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} +extern "C" bool MP4SetMetadataAlbumArtist (MP4FileHandle hFile, + const char* value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->SetMetadataString("aART", value); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4GetMetadataAlbumArtist (MP4FileHandle hFile, + char** value) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->GetMetadataString("aART", value); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4DeleteMetadataAlbumArtist (MP4FileHandle hFile) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->DeleteMetadataAtom("aART"); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + +extern "C" bool MP4SetMetadataFreeForm(MP4FileHandle hFile, + const char *name, + const u_int8_t* pValue, + u_int32_t valueSize, + const char *owner) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->SetMetadataFreeForm(name, pValue, valueSize); + return ((MP4File*)hFile)->SetMetadataFreeForm(name, pValue, valueSize, owner); } catch (MP4Error* e) { PRINT_ERROR(e); @@ -3491,12 +4358,12 @@ return false; } -extern "C" bool MP4GetMetadataFreeForm(MP4FileHandle hFile, char *name, - u_int8_t** pValue, u_int32_t* valueSize) +extern "C" bool MP4GetMetadataFreeForm(MP4FileHandle hFile, const char *name, + u_int8_t** pValue, u_int32_t* valueSize, const char *owner) { if (MP4_IS_VALID_FILE_HANDLE(hFile)) { try { - return ((MP4File*)hFile)->GetMetadataFreeForm(name, pValue, valueSize); + return ((MP4File*)hFile)->GetMetadataFreeForm(name, pValue, valueSize, owner); } catch (MP4Error* e) { PRINT_ERROR(e); @@ -3505,3 +4372,24 @@ } return false; } + +extern "C" bool MP4DeleteMetadataFreeForm(MP4FileHandle hFile, const char *name, const char *owner) +{ + if (MP4_IS_VALID_FILE_HANDLE(hFile)) { + try { + return ((MP4File*)hFile)->DeleteMetadataFreeForm(name, owner); + } + catch (MP4Error* e) { + PRINT_ERROR(e); + delete e; + } + } + return false; +} + + +extern "C" void MP4Free (void *p) +{ + if (p != NULL) + free(p); +} diff -Nru faac-1.26/common/mp4v2/mp4file.cpp faac-1.28/common/mp4v2/mp4file.cpp --- faac-1.26/common/mp4v2/mp4file.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/mp4file.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -13,7 +13,7 @@ * * The Initial Developer of the Original Code is Cisco Systems Inc. * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001 - 2004. All Rights Reserved. + * Copyright (C) Cisco Systems Inc. 2001 - 2005. All Rights Reserved. * * 3GPP features implementation is based on 3GPP's TS26.234-v5.60, * and was contributed by Ximpo Group Ltd. @@ -25,6 +25,7 @@ * Dave Mackie dmackie@cisco.com * Alix Marchandise-Franquet alix@cisco.com * Ximpo Group Ltd. mp4v2@ximpo.com + * Bill May wmay@cisco.com */ #include "mp4common.h" @@ -32,7 +33,11 @@ MP4File::MP4File(u_int32_t verbosity) { m_fileName = NULL; + #ifdef _WIN32 + m_fileName_w = NULL; + #endif m_pFile = NULL; + m_virtual_IO = NULL; m_orgFileSize = 0; m_fileSize = 0; m_pRootAtom = NULL; @@ -55,16 +60,31 @@ m_bufReadBits = 0; m_numWriteBits = 0; m_bufWriteBits = 0; + m_editName = NULL; +#ifndef _WIN32 + m_tempFileName[0] = '\0'; +#endif + m_trakName[0] = '\0'; } MP4File::~MP4File() { MP4Free(m_fileName); + #ifdef _WIN32 + MP4Free(m_fileName_w); + #endif + if (m_pFile != NULL) { + // not closed ? + m_virtual_IO->Close(m_pFile); + m_pFile = NULL; + } delete m_pRootAtom; for (u_int32_t i = 0; i < m_pTracks.Size(); i++) { delete m_pTracks[i]; } MP4Free(m_memoryBuffer); // just in case + CHECK_AND_FREE(m_editName); + } void MP4File::Read(const char* fileName) @@ -79,14 +99,44 @@ CacheProperties(); } -void MP4File::Create(const char* fileName, u_int32_t flags) +#ifdef _WIN32 +void MP4File::Read(const wchar_t* fileName) { - CreateEx( fileName, flags, NULL, 0, NULL, 0 ); + m_fileName_w = MP4Stralloc(fileName); + m_mode = 'r'; + + Open(L"rb"); + + ReadFromFile(); + + CacheProperties(); } +#endif -void MP4File::CreateEx(const char* fileName, u_int32_t flags, - char* majorBrand, u_int32_t minorVersion, - char** supportedBrands, u_int32_t supportedBrandsCount) +// benski> +void MP4File::ReadEx(const char *fileName, void *user, Virtual_IO *virtual_IO) +{ + m_fileName = MP4Stralloc(fileName); + m_mode = 'r'; + + m_pFile = user; + m_virtual_IO = virtual_IO; + + ASSERT(m_pFile); + ASSERT(m_virtual_IO) + + m_orgFileSize = m_fileSize = m_virtual_IO->GetFileLength(m_pFile); + + ReadFromFile(); + + CacheProperties(); +} + + +void MP4File::Create(const char* fileName, u_int32_t flags, + int add_ftyp, int add_iods, + char* majorBrand, u_int32_t minorVersion, + char** supportedBrands, u_int32_t supportedBrandsCount) { m_fileName = MP4Stralloc(fileName); m_mode = 'w'; @@ -99,36 +149,53 @@ m_pRootAtom->SetFile(this); m_pRootAtom->Generate(); - if ((majorBrand != NULL) || (minorVersion != 0)) { - MakeFtypAtom(majorBrand, minorVersion, - supportedBrands, supportedBrandsCount); + if (add_ftyp != 0) { + MakeFtypAtom(majorBrand, minorVersion, + supportedBrands, supportedBrandsCount); } CacheProperties(); // create mdat, and insert it after ftyp, and before moov - InsertChildAtom(m_pRootAtom, "mdat", 1); + (void)InsertChildAtom(m_pRootAtom, "mdat", + add_ftyp != 0 ? 1 : 0); // start writing m_pRootAtom->BeginWrite(); + if (add_iods != 0) { + (void)AddChildAtom("moov", "iods"); + } } bool MP4File::Use64Bits (const char *atomName) { - if (!strcmp(atomName, "mdat") || !strcmp(atomName, "stbl")) { + uint32_t atomid = ATOMID(atomName); + if (atomid == ATOMID("mdat") || atomid == ATOMID("stbl")) { return (m_createFlags & MP4_CREATE_64BIT_DATA) == MP4_CREATE_64BIT_DATA; - } - - if (!strcmp(atomName, "mvhd") || - !strcmp(atomName, "tkhd") || - !strcmp(atomName, "mdhd")) { + } + if (atomid == ATOMID("mvhd") || + atomid == ATOMID("tkhd") || + atomid == ATOMID("mdhd")) { return (m_createFlags & MP4_CREATE_64BIT_TIME) == MP4_CREATE_64BIT_TIME; } return false; } +void MP4File::Check64BitStatus (const char *atomName) +{ + uint32_t atomid = ATOMID(atomName); + + if (atomid == ATOMID("mdat") || atomid == ATOMID("stbl")) { + m_createFlags |= MP4_CREATE_64BIT_DATA; + } else if (atomid == ATOMID("mvhd") || + atomid == ATOMID("tkhd") || + atomid == ATOMID("mdhd")) { + m_createFlags |= MP4_CREATE_64BIT_TIME; + } +} + -void MP4File::Modify(const char* fileName) +bool MP4File::Modify(const char* fileName) { m_fileName = MP4Stralloc(fileName); m_mode = 'r'; @@ -144,7 +211,8 @@ if (pMoovAtom == NULL) { // there isn't one, odd but we can still proceed - pMoovAtom = AddChildAtom(m_pRootAtom, "moov"); + return false; + //pMoovAtom = AddChildAtom(m_pRootAtom, "moov"); } else { numAtoms = m_pRootAtom->GetNumberOfChildAtoms(); @@ -217,7 +285,8 @@ MP4Atom* pMdatAtom = InsertChildAtom(m_pRootAtom, "mdat", numAtoms - 1); // start writing new mdat - pMdatAtom->BeginWrite(); + pMdatAtom->BeginWrite(Use64Bits("mdat")); + return true; } void MP4File::Optimize(const char* orgFileName, const char* newFileName) @@ -233,6 +302,9 @@ // now switch over to writing the new file MP4Free(m_fileName); + #ifdef _WIN32 + MP4Free(m_fileName_w); + #endif // create a temporary file if necessary if (newFileName == NULL) { @@ -241,7 +313,8 @@ m_fileName = MP4Stralloc(newFileName); } - FILE* pReadFile = m_pFile; + void* pReadFile = m_pFile; + Virtual_IO *pReadIO = m_virtual_IO; m_pFile = NULL; m_mode = 'w'; @@ -254,15 +327,15 @@ ((MP4RootAtom*)m_pRootAtom)->BeginOptimalWrite(); // write data in optimal order - RewriteMdat(pReadFile, m_pFile); + RewriteMdat(pReadFile, m_pFile, pReadIO, m_virtual_IO); // finish writing ((MP4RootAtom*)m_pRootAtom)->FinishOptimalWrite(); // cleanup - fclose(m_pFile); + m_virtual_IO->Close(m_pFile); m_pFile = NULL; - fclose(pReadFile); + pReadIO->Close(pReadFile); // move temporary file into place if (newFileName == NULL) { @@ -270,7 +343,8 @@ } } -void MP4File::RewriteMdat(FILE* pReadFile, FILE* pWriteFile) +void MP4File::RewriteMdat(void* pReadFile, void* pWriteFile, + Virtual_IO *readIO, Virtual_IO *writeIO) { u_int32_t numTracks = m_pTracks.Size(); @@ -323,6 +397,7 @@ // point into original mp4 file for read chunk call m_pFile = pReadFile; + m_virtual_IO = readIO; m_mode = 'r'; u_int8_t* pChunk; @@ -333,6 +408,7 @@ // point back at the new mp4 file for write chunk m_pFile = pWriteFile; + m_virtual_IO = writeIO; m_mode = 'w'; m_pTracks[nextTrackIndex]-> @@ -352,6 +428,7 @@ void MP4File::Open(const char* fmode) { ASSERT(m_pFile == NULL); + FILE *openFile = NULL; #ifdef O_LARGEFILE // UGH! fopen doesn't open a file in 64-bit mode, period. @@ -374,25 +451,70 @@ fd = open(m_fileName, flags, 0666); if (fd >= 0) { - m_pFile = fdopen(fd, fmode); + openFile = fdopen(fd, fmode); } #else - m_pFile = fopen(m_fileName, fmode); + openFile = fopen(m_fileName, fmode); #endif + m_pFile = openFile; + if (m_pFile == NULL) { throw new MP4Error(errno, "failed", "MP4Open"); } - + + m_virtual_IO = &FILE_virtual_IO; if (m_mode == 'r') { - struct stat s; - if (fstat(fileno(m_pFile), &s) < 0) { - throw new MP4Error(errno, "stat failed", "MP4Open"); + m_orgFileSize = m_fileSize = m_virtual_IO->GetFileLength(m_pFile); // benski + } else { + m_orgFileSize = m_fileSize = 0; + } +} + +#ifdef _WIN32 +void MP4File::Open(const wchar_t* fmode) +{ + ASSERT(m_pFile == NULL); + FILE *openFile = NULL; +#ifdef O_LARGEFILE + // UGH! fopen doesn't open a file in 64-bit mode, period. + // So we need to use open() and then fdopen() + int fd; + int flags = O_LARGEFILE; + + if (strchr(fmode, '+')) { + flags |= O_CREAT | O_RDWR; + if (fmode[0] == 'w') { + flags |= O_TRUNC; } - m_orgFileSize = m_fileSize = s.st_size; + } else { + if (fmode[0] == 'w') { + flags |= O_CREAT | O_TRUNC | O_WRONLY; + } else { + flags |= O_RDONLY; + } + } + fd = _wopen(m_fileName_w, flags, 0666); + + if (fd >= 0) { + openFile = _wfdopen(fd, fmode); + } +#else + openFile = _wfopen(m_fileName_w, fmode); +#endif + m_pFile = openFile; + + if (m_pFile == NULL) { + throw new MP4Error(errno, "failed", "MP4Open"); + } + + m_virtual_IO = &FILE_virtual_IO; + if (m_mode == 'r') { + m_orgFileSize = m_fileSize = m_virtual_IO->GetFileLength(m_pFile); // benski } else { m_orgFileSize = m_fileSize = 0; } } +#endif void MP4File::ReadFromFile() { @@ -434,13 +556,13 @@ // find track id property MP4Integer32Property* pTrackIdProperty = NULL; - pTrakAtom->FindProperty( + (void)pTrakAtom->FindProperty( "trak.tkhd.trackId", (MP4Property**)&pTrackIdProperty); // find track type property MP4StringProperty* pTypeProperty = NULL; - pTrakAtom->FindProperty( + (void)pTrakAtom->FindProperty( "trak.mdia.hdlr.handlerType", (MP4Property**)&pTypeProperty); @@ -504,7 +626,6 @@ ASSERT(m_pTracks[i]); m_pTracks[i]->FinishWrite(); } - // ask root atom to write m_pRootAtom->FinishWrite(); @@ -523,14 +644,12 @@ } } -MP4Duration MP4File::UpdateDuration(MP4Duration duration) +void MP4File::UpdateDuration(MP4Duration duration) { MP4Duration currentDuration = GetDuration(); if (duration > currentDuration) { SetDuration(duration); - return duration; } - return currentDuration; } void MP4File::Dump(FILE* pDumpFile, bool dumpImplicits) @@ -552,7 +671,7 @@ FinishWrite(); } - fclose(m_pFile); + m_virtual_IO->Close(m_pFile); m_pFile = NULL; } @@ -561,11 +680,11 @@ // there are so many attempts in libc to get this right // that for portablity reasons, it's best just to roll our own #ifndef _WIN32 - static char tempFileName[64]; u_int32_t i; for (i = getpid(); i < 0xFFFFFFFF; i++) { - sprintf(tempFileName, "./tmp%u.mp4", i); - if (access(tempFileName, F_OK) != 0) { + snprintf(m_tempFileName, sizeof(m_tempFileName), + "./tmp%u.mp4", i); + if (access(m_tempFileName, F_OK) != 0) { break; } } @@ -573,14 +692,13 @@ throw new MP4Error("can't create temporary file", "TempFileName"); } #else - static char tempFileName[MAX_PATH + 3]; - GetTempFileName(".", // dir. for temp. files - "mp4", // temp. filename prefix - 0, // create unique name - tempFileName); // buffer for name + GetTempFileNameA(".", // dir. for temp. files + "mp4", // temp. filename prefix + 0, // create unique name + m_tempFileName); // buffer for name #endif - return tempFileName; + return (char *)m_tempFileName; } void MP4File::Rename(const char* oldFileName, const char* newFileName) @@ -872,13 +990,13 @@ // set track id MP4Integer32Property* pInteger32Property = NULL; - pTrakAtom->FindProperty( - "trak.tkhd.trackId", (MP4Property**)&pInteger32Property); + (void)pTrakAtom->FindProperty("trak.tkhd.trackId", + (MP4Property**)&pInteger32Property); ASSERT(pInteger32Property); pInteger32Property->SetValue(trackId); // set track type - const char* normType = MP4Track::NormalizeTrackType(type); + const char* normType = MP4NormalizeTrackType(type, m_verbosity); // sanity check for user defined types if (strlen(normType) > 4) { @@ -888,15 +1006,15 @@ } MP4StringProperty* pStringProperty = NULL; - pTrakAtom->FindProperty( - "trak.mdia.hdlr.handlerType", (MP4Property**)&pStringProperty); + (void)pTrakAtom->FindProperty("trak.mdia.hdlr.handlerType", + (MP4Property**)&pStringProperty); ASSERT(pStringProperty); pStringProperty->SetValue(normType); // set track time scale pInteger32Property = NULL; - pTrakAtom->FindProperty( - "trak.mdia.mdhd.timeScale", (MP4Property**)&pInteger32Property); + (void)pTrakAtom->FindProperty("trak.mdia.mdhd.timeScale", + (MP4Property**)&pInteger32Property); ASSERT(pInteger32Property); pInteger32Property->SetValue(timeScale ? timeScale : 1000); @@ -924,8 +1042,8 @@ void MP4File::AddTrackToIod(MP4TrackId trackId) { MP4DescriptorProperty* pDescriptorProperty = NULL; - m_pRootAtom->FindProperty("moov.iods.esIds", - (MP4Property**)&pDescriptorProperty); + (void)m_pRootAtom->FindProperty("moov.iods.esIds", + (MP4Property**)&pDescriptorProperty); ASSERT(pDescriptorProperty); MP4Descriptor* pDescriptor = @@ -933,8 +1051,8 @@ ASSERT(pDescriptor); MP4Integer32Property* pIdProperty = NULL; - pDescriptor->FindProperty("id", - (MP4Property**)&pIdProperty); + (void)pDescriptor->FindProperty("id", + (MP4Property**)&pIdProperty); ASSERT(pIdProperty); pIdProperty->SetValue(trackId); @@ -943,9 +1061,11 @@ void MP4File::RemoveTrackFromIod(MP4TrackId trackId, bool shallHaveIods) { MP4DescriptorProperty* pDescriptorProperty = NULL; - m_pRootAtom->FindProperty("moov.iods.esIds", - (MP4Property**)&pDescriptorProperty); - + if (!m_pRootAtom->FindProperty("moov.iods.esIds", + (MP4Property**)&pDescriptorProperty)) + return; +#if 0 + // we may not have iods if (shallHaveIods) { ASSERT(pDescriptorProperty); } else { @@ -953,17 +1073,23 @@ return; } } +#else + if (pDescriptorProperty == NULL) { + return; + } +#endif for (u_int32_t i = 0; i < pDescriptorProperty->GetCount(); i++) { - static char name[32]; + /* static */char name[32]; snprintf(name, sizeof(name), "esIds[%u].id", i); MP4Integer32Property* pIdProperty = NULL; - pDescriptorProperty->FindProperty(name, + (void)pDescriptorProperty->FindProperty(name, (MP4Property**)&pIdProperty); - ASSERT(pIdProperty); + // wmay ASSERT(pIdProperty); - if (pIdProperty->GetValue() == trackId) { + if (pIdProperty != NULL && + pIdProperty->GetValue() == trackId) { pDescriptorProperty->DeleteDescriptor(i); break; } @@ -994,11 +1120,11 @@ char propName[1024]; snprintf(propName, sizeof(propName), "%s.%s", trefName, "entryCount"); - m_pRootAtom->FindProperty(propName, ppCountProperty); + (void)m_pRootAtom->FindProperty(propName, ppCountProperty); ASSERT(*ppCountProperty); snprintf(propName, sizeof(propName), "%s.%s", trefName, "entries.trackId"); - m_pRootAtom->FindProperty(propName, ppTrackIdProperty); + (void)m_pRootAtom->FindProperty(propName, ppTrackIdProperty); ASSERT(*ppTrackIdProperty); } @@ -1057,8 +1183,8 @@ ASSERT(pDrefAtom); MP4Integer32Property* pCountProperty = NULL; - pDrefAtom->FindProperty("dref.entryCount", - (MP4Property**)&pCountProperty); + (void)pDrefAtom->FindProperty("dref.entryCount", + (MP4Property**)&pCountProperty); ASSERT(pCountProperty); pCountProperty->IncrementValue(); @@ -1068,8 +1194,8 @@ pUrlAtom->SetFlags(pUrlAtom->GetFlags() & 0xFFFFFE); MP4StringProperty* pUrlProperty = NULL; - pUrlAtom->FindProperty("url .location", - (MP4Property**)&pUrlProperty); + (void)pUrlAtom->FindProperty("url .location", + (MP4Property**)&pUrlProperty); ASSERT(pUrlProperty); pUrlProperty->SetValue(url); } else { @@ -1079,15 +1205,15 @@ MP4TrackId MP4File::AddSystemsTrack(const char* type) { - const char* normType = MP4Track::NormalizeTrackType(type); + const char* normType = MP4NormalizeTrackType(type, m_verbosity); // TBD if user type, fix name to four chars, and warn MP4TrackId trackId = AddTrack(type, MP4_MSECS_TIME_SCALE); - InsertChildAtom(MakeTrackName(trackId, "mdia.minf"), "nmhd", 0); + (void)InsertChildAtom(MakeTrackName(trackId, "mdia.minf"), "nmhd", 0); - AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd"), "mp4s"); + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd"), "mp4s"); // stsd is a unique beast in that it has a count of the number // of child atoms that needs to be incremented after we add the mp4s atom @@ -1132,7 +1258,7 @@ AddTrackToIod(m_odTrackId); - AddDescendantAtoms(MakeTrackName(m_odTrackId, NULL), "tref.mpod"); + (void)AddDescendantAtoms(MakeTrackName(m_odTrackId, NULL), "tref.mpod"); return m_odTrackId; } @@ -1147,22 +1273,6 @@ return trackId; } -MP4Atom* MP4File::GetTrakDamrAtom(MP4TrackId trackId) -{ - MP4Atom* amrAtom; - u_int16_t trackIndex = FindTrackIndex(trackId); - MP4Track* pTrack = m_pTracks[trackIndex]; - ASSERT(pTrack); - MP4Atom* pTrakAtom = pTrack->GetTrakAtom(); - ASSERT(pTrakAtom); - if ((amrAtom = pTrakAtom->FindAtom("trak.mdia.minf.stbl.stsd.sawb.damr"))) { - return amrAtom; - } - else if ((amrAtom = pTrakAtom->FindAtom("trak.mdia.minf.stbl.stsd.samr.damr"))) { - return amrAtom; - } - return NULL; -} // NULL terminated list of brands which require the IODS atom char *brandsWithIods[] = { "mp42", "isom", @@ -1174,12 +1284,12 @@ MP4StringProperty *pMajorBrandProperty; MP4Atom* ftypAtom = m_pRootAtom->FindAtom("ftyp"); - ASSERT(ftypAtom); + if (ftypAtom == NULL) return false; // Check the major brand - ftypAtom->FindProperty( - "ftyp.majorBrand", - (MP4Property**)&pMajorBrandProperty); + (void)ftypAtom->FindProperty( + "ftyp.majorBrand", + (MP4Property**)&pMajorBrandProperty); ASSERT(pMajorBrandProperty); for(u_int32_t j = 0 ; brandsWithIods[j] != NULL ; j++) { if (!strcasecmp( ((MP4StringProperty*)pMajorBrandProperty)->GetValue(), @@ -1189,7 +1299,7 @@ // Check the compatible brands MP4Integer32Property* pCompatibleBrandsCountProperty; - ftypAtom->FindProperty( + (void)ftypAtom->FindProperty( "ftyp.compatibleBrandsCount", (MP4Property**)&pCompatibleBrandsCountProperty); ASSERT(pCompatibleBrandsCountProperty); @@ -1197,7 +1307,7 @@ compatibleBrandsCount = pCompatibleBrandsCountProperty->GetValue(); MP4TableProperty* pCompatibleBrandsProperty; - ftypAtom->FindProperty( + (void)ftypAtom->FindProperty( "ftyp.compatibleBrands", (MP4Property**)&pCompatibleBrandsProperty); @@ -1218,66 +1328,33 @@ MP4TrackId trackId, u_int32_t vendor) { - - MP4Atom* damrAtom = GetTrakDamrAtom(trackId); - - if (damrAtom == NULL) - return; - - MP4Integer32Property* pVendorProperty = NULL; - - damrAtom->FindProperty("damr.vendor", - (MP4Property**)&pVendorProperty, - NULL); - ASSERT(pVendorProperty); - - pVendorProperty->SetValue(vendor); - - damrAtom->Rewrite(); - + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.*.damr.vendor", + vendor); } void MP4File::SetAmrDecoderVersion( MP4TrackId trackId, u_int8_t decoderVersion) { - MP4Atom* damrAtom = GetTrakDamrAtom(trackId); - - if (damrAtom == NULL) - return; - - MP4Integer8Property* pDecoderVersionProperty; - - damrAtom->FindProperty("damr.decoderVersion", - (MP4Property**)&pDecoderVersionProperty, - NULL); - ASSERT(pDecoderVersionProperty); - - pDecoderVersionProperty->SetValue(decoderVersion); - - damrAtom->Rewrite(); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.*.damr.decoderVersion", + decoderVersion); } void MP4File::SetAmrModeSet( MP4TrackId trackId, u_int16_t modeSet) { - MP4Atom* damrAtom = GetTrakDamrAtom(trackId); - - if (damrAtom == NULL) - return; - - MP4Integer16Property* pModeSetProperty; - - damrAtom->FindProperty("damr.modeSet", - (MP4Property**)&pModeSetProperty, - NULL); - ASSERT(pModeSetProperty); - - pModeSetProperty->SetValue(modeSet); - - damrAtom->Rewrite(); - + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.*.damr.modeSet", + modeSet); +} +uint16_t MP4File::GetAmrModeSet(MP4TrackId trackId) +{ + return GetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.*.damr.modeSet"); } MP4TrackId MP4File::AddAmrAudioTrack( @@ -1296,9 +1373,9 @@ SetTrackFloatProperty(trackId, "tkhd.volume", 1.0); - InsertChildAtom(MakeTrackName(trackId, "mdia.minf"), "smhd", 0); + (void)InsertChildAtom(MakeTrackName(trackId, "mdia.minf"), "smhd", 0); - AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd"), isAmrWB ? "sawb" : "samr"); + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd"), isAmrWB ? "sawb" : "samr"); // stsd is a unique beast in that it has a count of the number // of child atoms that needs to be incremented after we add the mp4a atom @@ -1308,35 +1385,22 @@ (MP4Property**)&pStsdCountProperty); pStsdCountProperty->IncrementValue(); - if (isAmrWB) { - SetTrackIntegerProperty(trackId, - "mdia.minf.stbl.stsd.sawb.timeScale", timeScale); - SetTrackIntegerProperty(trackId, - "mdia.minf.stbl.stsd.sawb.damr.modeSet", modeSet); + "mdia.minf.stbl.stsd.*.timeScale", + timeScale); SetTrackIntegerProperty(trackId, - "mdia.minf.stbl.stsd.sawb.damr.modeChangePeriod", modeChangePeriod); + "mdia.minf.stbl.stsd.*.damr.modeSet", + modeSet); SetTrackIntegerProperty(trackId, - "mdia.minf.stbl.stsd.sawb.damr.framesPerSample", framesPerSample); + "mdia.minf.stbl.stsd.*.damr.modeChangePeriod", + modeChangePeriod); - m_pTracks[FindTrackIndex(trackId)]-> - SetFixedSampleDuration(fixedSampleDuration); + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.*.damr.framesPerSample", + framesPerSample); - } else { - SetTrackIntegerProperty(trackId, - "mdia.minf.stbl.stsd.samr.timeScale", timeScale); - - SetTrackIntegerProperty(trackId, - "mdia.minf.stbl.stsd.samr.damr.modeSet", modeSet); - - SetTrackIntegerProperty(trackId, - "mdia.minf.stbl.stsd.samr.damr.modeChangePeriod", modeChangePeriod); - - SetTrackIntegerProperty(trackId, - "mdia.minf.stbl.stsd.samr.damr.framesPerSample", framesPerSample); - } m_pTracks[FindTrackIndex(trackId)]-> SetFixedSampleDuration(fixedSampleDuration); @@ -1355,9 +1419,9 @@ SetTrackFloatProperty(trackId, "tkhd.volume", 1.0); - InsertChildAtom(MakeTrackName(trackId, "mdia.minf"), "smhd", 0); + (void)InsertChildAtom(MakeTrackName(trackId, "mdia.minf"), "smhd", 0); - AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd"), "mp4a"); + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd"), "mp4a"); // stsd is a unique beast in that it has a count of the number // of child atoms that needs to be incremented after we add the mp4a atom @@ -1403,7 +1467,8 @@ u_int8_t key_ind_len, u_int8_t iv_len, bool selective_enc, - char *kms_uri + const char *kms_uri, + bool use_ismacryp ) { u_int32_t original_fmt = 0; @@ -1414,9 +1479,9 @@ SetTrackFloatProperty(trackId, "tkhd.volume", 1.0); - InsertChildAtom(MakeTrackName(trackId, "mdia.minf"), "smhd", 0); + (void)InsertChildAtom(MakeTrackName(trackId, "mdia.minf"), "smhd", 0); - AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd"), "enca"); + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd"), "enca"); // stsd is a unique beast in that it has a count of the number // of child atoms that needs to be incremented after we add the enca atom @@ -1428,38 +1493,50 @@ /* set all the ismacryp-specific values */ // original format is mp4a - original_fmt = ('m'<<24 | 'p'<<16 | '4'<<8 | 'a'); - SetTrackIntegerProperty(trackId, - "mdia.minf.stbl.stsd.enca.sinf.frma.data-format", - original_fmt); - - SetTrackIntegerProperty(trackId, - "mdia.minf.stbl.stsd.enca.sinf.schm.scheme_type", - scheme_type); - - SetTrackIntegerProperty(trackId, - "mdia.minf.stbl.stsd.enca.sinf.schm.scheme_version", - scheme_version); + if (use_ismacryp) { + original_fmt = ATOMID("mp4a"); + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.enca.sinf.frma.data-format", + original_fmt); + + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd.enca.sinf"), + "schm"); + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd.enca.sinf"), + "schi"); + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd.enca.sinf.schi"), + "iKMS"); + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd.enca.sinf.schi"), + "iSFM"); + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.enca.sinf.schm.scheme_type", + scheme_type); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.enca.sinf.schm.scheme_version", + scheme_version); - SetTrackStringProperty(trackId, - "mdia.minf.stbl.stsd.enca.sinf.schi.iKMS.kms_URI", - kms_uri); - if (kms_uri != NULL) { - free(kms_uri); - } - - SetTrackIntegerProperty(trackId, - "mdia.minf.stbl.stsd.enca.sinf.schi.iSFM.selective-encryption", - selective_enc); - - SetTrackIntegerProperty(trackId, - "mdia.minf.stbl.stsd.enca.sinf.schi.iSFM.key-indicator-length", - key_ind_len); - - SetTrackIntegerProperty(trackId, - "mdia.minf.stbl.stsd.enca.sinf.schi.iSFM.IV-length", - iv_len); - /* end ismacryp */ + SetTrackStringProperty(trackId, + "mdia.minf.stbl.stsd.enca.sinf.schi.iKMS.kms_URI", + kms_uri); + #if 0 + if (kms_uri != NULL) { + free((void *)kms_uri); + } + #endif + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.enca.sinf.schi.iSFM.selective-encryption", + selective_enc); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.enca.sinf.schi.iSFM.key-indicator-length", + key_ind_len); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.enca.sinf.schi.iSFM.IV-length", + iv_len); + /* end ismacryp */ + } SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.enca.timeScale", timeScale); @@ -1489,12 +1566,54 @@ return trackId; } -MP4TrackId MP4File::AddVideoTrack( +MP4TrackId MP4File::AddCntlTrackDefault (uint32_t timeScale, + MP4Duration sampleDuration, + const char *type) +{ + MP4TrackId trackId = AddTrack(MP4_CNTL_TRACK_TYPE, timeScale); + + (void)InsertChildAtom(MakeTrackName(trackId, "mdia.minf"), "nmhd", 0); + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd"), type); + + // stsd is a unique beast in that it has a count of the number + // of child atoms that needs to be incremented after we add the mp4v atom + MP4Integer32Property* pStsdCountProperty; + FindIntegerProperty( + MakeTrackName(trackId, "mdia.minf.stbl.stsd.entryCount"), + (MP4Property**)&pStsdCountProperty); + pStsdCountProperty->IncrementValue(); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsz.sampleSize", sampleDuration); + + m_pTracks[FindTrackIndex(trackId)]-> + SetFixedSampleDuration(sampleDuration); + + return trackId; +} + +MP4TrackId MP4File::AddHrefTrack (uint32_t timeScale, + MP4Duration sampleDuration, + const char *base_url) +{ + MP4TrackId trackId = AddCntlTrackDefault(timeScale, sampleDuration, "href"); + + if (base_url != NULL) { + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd.href"), + "burl"); + SetTrackStringProperty(trackId, "mdia.minf.stbl.stsd.href.burl.base_url", + base_url); + } + + return trackId; +} + +MP4TrackId MP4File::AddVideoTrackDefault( u_int32_t timeScale, MP4Duration sampleDuration, u_int16_t width, u_int16_t height, - u_int8_t videoType) + const char *videoType) { MP4TrackId trackId = AddTrack(MP4_VIDEO_TRACK_TYPE, timeScale); @@ -1503,9 +1622,9 @@ SetTrackFloatProperty(trackId, "tkhd.width", width); SetTrackFloatProperty(trackId, "tkhd.height", height); - InsertChildAtom(MakeTrackName(trackId, "mdia.minf"), "vmhd", 0); + (void)InsertChildAtom(MakeTrackName(trackId, "mdia.minf"), "vmhd", 0); - AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd"), "mp4v"); + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd"), videoType); // stsd is a unique beast in that it has a count of the number // of child atoms that needs to be incremented after we add the mp4v atom @@ -1516,6 +1635,27 @@ pStsdCountProperty->IncrementValue(); SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsz.sampleSize", sampleDuration); + + m_pTracks[FindTrackIndex(trackId)]-> + SetFixedSampleDuration(sampleDuration); + + return trackId; +} +MP4TrackId MP4File::AddMP4VideoTrack( + u_int32_t timeScale, + MP4Duration sampleDuration, + u_int16_t width, + u_int16_t height, + u_int8_t videoType) +{ + MP4TrackId trackId = AddVideoTrackDefault(timeScale, + sampleDuration, + width, + height, + "mp4v"); + + SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.mp4v.width", width); SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.mp4v.height", height); @@ -1539,48 +1679,26 @@ "mdia.minf.stbl.stsd.mp4v.esds.decConfigDescr.streamType", MP4VisualStreamType); - SetTrackIntegerProperty(trackId, - "mdia.minf.stbl.stsz.sampleSize", sampleDuration); - - m_pTracks[FindTrackIndex(trackId)]-> - SetFixedSampleDuration(sampleDuration); - return trackId; } +// ismacrypted MP4TrackId MP4File::AddEncVideoTrack(u_int32_t timeScale, MP4Duration sampleDuration, u_int16_t width, u_int16_t height, u_int8_t videoType, - u_int32_t scheme_type, - u_int16_t scheme_version, - u_int8_t key_ind_len, - u_int8_t iv_len, - bool selective_enc, - char *kms_uri + mp4v2_ismacrypParams *icPp, + const char *oFormat ) { u_int32_t original_fmt = 0; - MP4TrackId trackId = AddTrack(MP4_VIDEO_TRACK_TYPE, timeScale); - - AddTrackToOd(trackId); - - SetTrackFloatProperty(trackId, "tkhd.width", width); - SetTrackFloatProperty(trackId, "tkhd.height", height); - - InsertChildAtom(MakeTrackName(trackId, "mdia.minf"), "vmhd", 0); - - AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd"), "encv"); - - // stsd is a unique beast in that it has a count of the number - // of child atoms that needs to be incremented after we add the encv atom - MP4Integer32Property* pStsdCountProperty; - FindIntegerProperty( - MakeTrackName(trackId, "mdia.minf.stbl.stsd.entryCount"), - (MP4Property**)&pStsdCountProperty); - pStsdCountProperty->IncrementValue(); + MP4TrackId trackId = AddVideoTrackDefault(timeScale, + sampleDuration, + width, + height, + "encv"); SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.encv.width", width); @@ -1588,40 +1706,51 @@ "mdia.minf.stbl.stsd.encv.height", height); /* set all the ismacryp-specific values */ - // original format is mp4v - original_fmt = ('m'<<24 | 'p'<<16 | '4'<<8 | 'v'); - SetTrackIntegerProperty(trackId, - "mdia.minf.stbl.stsd.encv.sinf.frma.data-format", - original_fmt); - - SetTrackIntegerProperty(trackId, - "mdia.minf.stbl.stsd.encv.sinf.schm.scheme_type", - scheme_type); - - SetTrackIntegerProperty(trackId, - "mdia.minf.stbl.stsd.encv.sinf.schm.scheme_version", - scheme_version); + + original_fmt = ATOMID(oFormat); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.encv.sinf.frma.data-format", + original_fmt); + + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd.encv.sinf"), + "schm"); + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd.encv.sinf"), + "schi"); + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd.encv.sinf.schi"), + "iKMS"); + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd.encv.sinf.schi"), + "iSFM"); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.encv.sinf.schm.scheme_type", + icPp->scheme_type); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.encv.sinf.schm.scheme_version", + icPp->scheme_version); - SetTrackStringProperty(trackId, - "mdia.minf.stbl.stsd.encv.sinf.schi.iKMS.kms_URI", - kms_uri); - if (kms_uri != NULL) { - free(kms_uri); + SetTrackStringProperty(trackId, + "mdia.minf.stbl.stsd.encv.sinf.schi.iKMS.kms_URI", + icPp->kms_uri); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.encv.sinf.schi.iSFM.selective-encryption", + icPp->selective_enc); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.encv.sinf.schi.iSFM.key-indicator-length", + icPp->key_ind_len); + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.encv.sinf.schi.iSFM.IV-length", + icPp->iv_len); + + #if 0 + if (icPp->kms_uri != NULL) { + free(icPp->kms_uri); } - - SetTrackIntegerProperty(trackId, - "mdia.minf.stbl.stsd.encv.sinf.schi.iSFM.selective-encryption", - selective_enc); - - SetTrackIntegerProperty(trackId, - "mdia.minf.stbl.stsd.encv.sinf.schi.iSFM.key-indicator-length", - key_ind_len); - - SetTrackIntegerProperty(trackId, - "mdia.minf.stbl.stsd.encv.sinf.schi.iSFM.IV-length", - iv_len); - /* end ismacryp */ - + #endif SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.encv.esds.ESID", @@ -1642,47 +1771,238 @@ "mdia.minf.stbl.stsd.encv.esds.decConfigDescr.streamType", MP4VisualStreamType); - SetTrackIntegerProperty(trackId, - "mdia.minf.stbl.stsz.sampleSize", sampleDuration); + return trackId; +} - m_pTracks[FindTrackIndex(trackId)]-> - SetFixedSampleDuration(sampleDuration); +MP4TrackId MP4File::AddH264VideoTrack( + u_int32_t timeScale, + MP4Duration sampleDuration, + u_int16_t width, + u_int16_t height, + uint8_t AVCProfileIndication, + uint8_t profile_compat, + uint8_t AVCLevelIndication, + uint8_t sampleLenFieldSizeMinusOne) +{ + MP4TrackId trackId = AddVideoTrackDefault(timeScale, + sampleDuration, + width, + height, + "avc1"); - return trackId; + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.avc1.width", width); + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.avc1.height", height); + + //FIXME - check this + // shouldn't need this + #if 0 + AddChildAtom(MakeTrackName(trackId, + "mdia.minf.stbl.stsd.avc1"), + "avcC"); + #endif + + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.avc1.avcC.AVCProfileIndication", + AVCProfileIndication); + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.avc1.avcC.profile_compatibility", + profile_compat); + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.avc1.avcC.AVCLevelIndication", + AVCLevelIndication); + SetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.avc1.avcC.lengthSizeMinusOne", + sampleLenFieldSizeMinusOne); + + + return trackId; +} + +MP4TrackId MP4File::AddEncH264VideoTrack( + u_int32_t timeScale, + MP4Duration sampleDuration, + u_int16_t width, + u_int16_t height, + MP4Atom *srcAtom, + mp4v2_ismacrypParams *icPp) + +{ + + u_int32_t original_fmt = 0; + MP4Atom *avcCAtom; + + MP4TrackId trackId = AddVideoTrackDefault(timeScale, + sampleDuration, + width, + height, + "encv"); + + SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.encv.width", width); + SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.encv.height", height); + + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd.encv"), "avcC"); + + // create default values + avcCAtom = FindAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd.encv.avcC")); + + // export source atom + ((MP4AvcCAtom *) srcAtom)->Clone((MP4AvcCAtom *)avcCAtom); + + /* set all the ismacryp-specific values */ + + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd.encv.sinf"), "schm"); + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd.encv.sinf"), "schi"); + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd.encv.sinf.schi"), "iKMS"); + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd.encv.sinf.schi"), "iSFM"); + + // per ismacrypt E&A V1.1 section 9.1.2.1 'avc1' is renamed '264b' + // avc1 must not appear as a sample entry name or original format name + original_fmt = ATOMID("264b"); + SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.encv.sinf.frma.data-format", + original_fmt); + + SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.encv.sinf.schm.scheme_type", + icPp->scheme_type); + + SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.encv.sinf.schm.scheme_version", + icPp->scheme_version); + + SetTrackStringProperty(trackId, "mdia.minf.stbl.stsd.encv.sinf.schi.iKMS.kms_URI", + icPp->kms_uri); + + SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.encv.sinf.schi.iSFM.selective-encryption", + icPp->selective_enc); + + SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.encv.sinf.schi.iSFM.key-indicator-length", + icPp->key_ind_len); + + SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.encv.sinf.schi.iSFM.IV-length", + icPp->iv_len); + + + return trackId; +} + + +void MP4File::AddH264SequenceParameterSet (MP4TrackId trackId, + const uint8_t *pSequence, + uint16_t sequenceLen) +{ + const char *format; + MP4Atom *avcCAtom; + + // get 4cc media format - can be avc1 or encv for ismacrypted track + format = GetTrackMediaDataName(trackId); + + if (!strcasecmp(format, "avc1")) + avcCAtom = FindAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd.avc1.avcC")); + else if (!strcasecmp(format, "encv")) + avcCAtom = FindAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd.encv.avcC")); + else + // huh? unknown track format + return; + + + MP4BitfieldProperty *pCount; + MP4Integer16Property *pLength; + MP4BytesProperty *pUnit; + if ((avcCAtom->FindProperty("avcC.numOfSequenceParameterSets", + (MP4Property **)&pCount) == false) || + (avcCAtom->FindProperty("avcC.sequenceEntries.sequenceParameterSetLength", + (MP4Property **)&pLength) == false) || + (avcCAtom->FindProperty("avcC.sequenceEntries.sequenceParameterSetNALUnit", + (MP4Property **)&pUnit) == false)) { + VERBOSE_ERROR(m_verbosity, WARNING("Could not find avcC properties")); + return; + } + uint32_t count = pCount->GetValue(); + + if (count > 0) { + // see if we already exist + for (uint32_t index = 0; index < count; index++) { + if (pLength->GetValue(index) == sequenceLen) { + uint8_t *seq; + uint32_t seqlen; + pUnit->GetValue(&seq, &seqlen, index); + if (memcmp(seq, pSequence, sequenceLen) == 0) { + free(seq); + return; + } + free(seq); + } + } + } + pLength->AddValue(sequenceLen); + pUnit->AddValue(pSequence, sequenceLen); + pCount->IncrementValue(); + + return; +} +void MP4File::AddH264PictureParameterSet (MP4TrackId trackId, + const uint8_t *pPict, + uint16_t pictLen) +{ + MP4Atom *avcCAtom = + FindAtom(MakeTrackName(trackId, + "mdia.minf.stbl.stsd.avc1.avcC")); + MP4Integer8Property *pCount; + MP4Integer16Property *pLength; + MP4BytesProperty *pUnit; + if ((avcCAtom->FindProperty("avcC.numOfPictureParameterSets", + (MP4Property **)&pCount) == false) || + (avcCAtom->FindProperty("avcC.pictureEntries.pictureParameterSetLength", + (MP4Property **)&pLength) == false) || + (avcCAtom->FindProperty("avcC.pictureEntries.pictureParameterSetNALUnit", + (MP4Property **)&pUnit) == false)) { + VERBOSE_ERROR(m_verbosity, + WARNING("Could not find avcC picture table properties")); + return; + } + uint32_t count = pCount->GetValue(); + + if (count > 0) { + // see if we already exist + for (uint32_t index = 0; index < count; index++) { + if (pLength->GetValue(index) == pictLen) { + uint8_t *seq; + uint32_t seqlen; + pUnit->GetValue(&seq, &seqlen, index); + if (memcmp(seq, pPict, pictLen) == 0) { + VERBOSE_WRITE(m_verbosity, + fprintf(stderr, "picture matches %d\n", index)); + free(seq); + return; + } + free(seq); + } + } + } + pLength->AddValue(pictLen); + pUnit->AddValue(pPict, pictLen); + pCount->IncrementValue(); + VERBOSE_WRITE(m_verbosity, + fprintf(stderr, "new picture added %d\n", pCount->GetValue())); + + return; } void MP4File::SetH263Vendor( MP4TrackId trackId, u_int32_t vendor) { - - MP4Atom* d263Atom = FindAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd.s263.d263")); - - if (d263Atom == NULL) - return; - SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.s263.d263.vendor", vendor); - - d263Atom->Rewrite(); - } void MP4File::SetH263DecoderVersion( MP4TrackId trackId, u_int8_t decoderVersion) { - MP4Atom* d263Atom = FindAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd.s263.d263")); - - if (d263Atom == NULL) { - return; - } - SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.s263.d263.decoderVersion", decoderVersion); - - d263Atom->Rewrite(); } void MP4File::SetH263Bitrates( @@ -1690,13 +2010,6 @@ u_int32_t avgBitrate, u_int32_t maxBitrate) { - MP4Atom* bitrAtom = FindAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd.s263.d263.bitr")); - - if (bitrAtom == NULL) { - VERBOSE_ERROR(m_verbosity, WARNING("Could not find bitr atom!")); - return; - } - SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.s263.d263.bitr.avgBitrate", avgBitrate); @@ -1705,8 +2018,6 @@ "mdia.minf.stbl.stsd.s263.d263.bitr.maxBitrate", maxBitrate); - bitrAtom->Rewrite(); - } MP4TrackId MP4File::AddH263VideoTrack( @@ -1720,24 +2031,11 @@ u_int32_t maxBitrate) { - MP4TrackId trackId = AddTrack(MP4_VIDEO_TRACK_TYPE, timeScale); - - AddTrackToOd(trackId); - - SetTrackFloatProperty(trackId, "tkhd.width", width); - SetTrackFloatProperty(trackId, "tkhd.height", height); - - InsertChildAtom(MakeTrackName(trackId, "mdia.minf"), "vmhd", 0); - - AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd"), "s263"); - - // stsd is a unique beast in that it has a count of the number - // of child atoms that needs to be incremented after we add the mp4v atom - MP4Integer32Property* pStsdCountProperty; - FindIntegerProperty( - MakeTrackName(trackId, "mdia.minf.stbl.stsd.entryCount"), - (MP4Property**)&pStsdCountProperty); - pStsdCountProperty->IncrementValue(); + MP4TrackId trackId = AddVideoTrackDefault(timeScale, + sampleDuration, + width, + height, + "s263"); SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.s263.width", width); @@ -1751,7 +2049,7 @@ "mdia.minf.stbl.stsd.s263.d263.h263Profile", h263Profile); // Add the bitr atom - AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd.s263.d263"), + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd.s263.d263"), "bitr"); SetTrackIntegerProperty(trackId, @@ -1764,9 +2062,6 @@ SetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsz.sampleSize", sampleDuration); - m_pTracks[FindTrackIndex(trackId)]-> - SetFixedSampleDuration(sampleDuration); - return trackId; } @@ -1774,14 +2069,14 @@ MP4TrackId MP4File::AddHintTrack(MP4TrackId refTrackId) { // validate reference track id - FindTrackIndex(refTrackId); + (void)FindTrackIndex(refTrackId); MP4TrackId trackId = AddTrack(MP4_HINT_TRACK_TYPE, GetTrackTimeScale(refTrackId)); - InsertChildAtom(MakeTrackName(trackId, "mdia.minf"), "hmhd", 0); + (void)InsertChildAtom(MakeTrackName(trackId, "mdia.minf"), "hmhd", 0); - AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd"), "rtp "); + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd"), "rtp "); // stsd is a unique beast in that it has a count of the number // of child atoms that needs to be incremented after we add the rtp atom @@ -1795,13 +2090,80 @@ "mdia.minf.stbl.stsd.rtp .tims.timeScale", GetTrackTimeScale(trackId)); - AddDescendantAtoms(MakeTrackName(trackId, NULL), "tref.hint"); + (void)AddDescendantAtoms(MakeTrackName(trackId, NULL), "tref.hint"); AddTrackReference(MakeTrackName(trackId, "tref.hint"), refTrackId); - AddDescendantAtoms(MakeTrackName(trackId, NULL), "udta.hnti.sdp "); + (void)AddDescendantAtoms(MakeTrackName(trackId, NULL), "udta.hnti.sdp "); - AddDescendantAtoms(MakeTrackName(trackId, NULL), "udta.hinf"); + (void)AddDescendantAtoms(MakeTrackName(trackId, NULL), "udta.hinf"); + + return trackId; +} + +MP4TrackId MP4File::AddTextTrack(MP4TrackId refTrackId) +{ + // validate reference track id + (void)FindTrackIndex(refTrackId); + + MP4TrackId trackId = + AddTrack(MP4_TEXT_TRACK_TYPE, GetTrackTimeScale(refTrackId)); + + (void)InsertChildAtom(MakeTrackName(trackId, "mdia.minf"), "gmhd", 0); + + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd"), "text"); + + // stsd is a unique beast in that it has a count of the number + // of child atoms that needs to be incremented after we add the text atom + MP4Integer32Property* pStsdCountProperty; + FindIntegerProperty( + MakeTrackName(trackId, "mdia.minf.stbl.stsd.entryCount"), + (MP4Property**)&pStsdCountProperty); + pStsdCountProperty->IncrementValue(); + + return trackId; +} + +MP4TrackId MP4File::AddChapterTextTrack(MP4TrackId refTrackId) +{ + // validate reference track id + (void)FindTrackIndex(refTrackId); + + MP4TrackId trackId = + AddTrack(MP4_TEXT_TRACK_TYPE, GetTrackTimeScale(refTrackId)); + + (void)InsertChildAtom(MakeTrackName(trackId, "mdia.minf"), "gmhd", 0); + + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd"), "text"); + + // stsd is a unique beast in that it has a count of the number + // of child atoms that needs to be incremented after we add the text atom + MP4Integer32Property* pStsdCountProperty; + FindIntegerProperty( + MakeTrackName(trackId, "mdia.minf.stbl.stsd.entryCount"), + (MP4Property**)&pStsdCountProperty); + pStsdCountProperty->IncrementValue(); + + // add a "text" atom to the generic media header + // this is different to the stsd "text" atom added above + // truth be told, it's not clear what this second "text" atom does, + // but all iTunes Store movies (with chapter markers) have it, + // as do all movies with chapter tracks made by hand in QuickTime Pro + (void)AddChildAtom(MakeTrackName(trackId, "mdia.minf.gmhd"), "text"); + + // disable the chapter text track + // it won't display anyway, as it has zero display size, + // but nonetheless it's good to disable it + // the track still operates as a chapter track when disabled + MP4Atom *pTkhdAtom = FindAtom(MakeTrackName(trackId, "tkhd")); + if (pTkhdAtom) { + pTkhdAtom->SetFlags(0xE); + } + + // add a "chapter" track reference to our reference track, + // pointing to this new chapter track + (void)AddDescendantAtoms(MakeTrackName(refTrackId, NULL), "tref.chap"); + AddTrackReference(MakeTrackName(refTrackId, "tref.chap"), trackId); return trackId; } @@ -1844,7 +2206,7 @@ } u_int32_t typeSeen = 0; - const char* normType = MP4Track::NormalizeTrackType(type); + const char* normType = MP4NormalizeTrackType(type, m_verbosity); for (u_int32_t i = 0; i < m_pTracks.Size(); i++) { if (!strcmp(normType, m_pTracks[i]->GetType())) { @@ -1874,7 +2236,7 @@ if (trackId <= 0xFFFF) { // check that nextTrackid is correct try { - FindTrackIndex(trackId); + (void)FindTrackIndex(trackId); // ERROR, this trackId is in use } catch (MP4Error* e) { @@ -1888,7 +2250,7 @@ // we need to search for a track id for (trackId = 1; trackId <= 0xFFFF; trackId++) { try { - FindTrackIndex(trackId); + (void)FindTrackIndex(trackId); // KEEP LOOKING, this trackId is in use } catch (MP4Error* e) { @@ -1911,7 +2273,7 @@ } u_int32_t typeSeen = 0; - const char* normType = MP4Track::NormalizeTrackType(type); + const char* normType = MP4NormalizeTrackType(type, m_verbosity); for (u_int32_t i = 0; i < m_pTracks.Size(); i++) { if (!strcmp(normType, m_pTracks[i]->GetType())) { @@ -2053,15 +2415,19 @@ { u_int16_t trakIndex = FindTrakAtomIndex(trackId); - static char trakName[1024]; if (name == NULL || name[0] == '\0') { - snprintf(trakName, sizeof(trakName), + snprintf(m_trakName, sizeof(m_trakName), "moov.trak[%u]", trakIndex); } else { - snprintf(trakName, sizeof(trakName), + snprintf(m_trakName, sizeof(m_trakName), "moov.trak[%u].%s", trakIndex, name); } - return trakName; + return m_trakName; +} + +MP4Atom *MP4File::FindTrackAtom (MP4TrackId trackId, const char *name) +{ + return FindAtom(MakeTrackName(trackId, name)); } u_int64_t MP4File::GetTrackIntegerProperty(MP4TrackId trackId, const char* name) @@ -2192,7 +2558,7 @@ void MP4File::SetSessionSdp(const char* sdpString) { - AddDescendantAtoms("moov", "udta.hnti.rtp "); + (void)AddDescendantAtoms("moov", "udta.hnti.rtp "); SetStringProperty("moov.udta.hnti.rtp .sdpText", sdpString); } @@ -2217,6 +2583,41 @@ MP4Free(newSdpString); } +// +// ismacrypt API - retrieve OriginalFormatBox +// +// parameters are assumed to have been sanity tested in mp4.cpp +// don't call this unless media data name is 'encv', +// results may otherwise be unpredictable. +// +// input: +// trackID - valid encv track ID for this file +// buflen - length of oFormat, minimum is 5 (4cc plus null terminator) +// +// output: +// oFormat - buffer to return null terminated string containing +// track original format +// return: +// 0 - original format returned OK +// 1 - buffer length error or problem retrieving track property +// +// +bool MP4File::GetTrackMediaDataOriginalFormat(MP4TrackId trackId, + char *originalFormat, u_int32_t buflen) +{ + u_int32_t format; + + if (buflen < 5) + return false; + + format = GetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.*.sinf.frma.data-format"); + + IDATOM(format, originalFormat); + return true; + +} + // track level convenience functions @@ -2230,6 +2631,22 @@ return m_pTracks[FindTrackIndex(trackId)]->GetType(); } +const char *MP4File::GetTrackMediaDataName (MP4TrackId trackId) +{ + MP4Atom *pChild; + MP4Atom *pAtom = + FindAtom(MakeTrackName(trackId, + "mdia.minf.stbl.stsd")); + if (pAtom->GetNumberOfChildAtoms() != 1) { + VERBOSE_ERROR(m_verbosity, + fprintf(stderr, "track %d has more than 1 child atoms in stsd\n", trackId)); + return NULL; + } + pChild = pAtom->GetChildAtom(0); + return pChild->GetType(); +} + + u_int32_t MP4File::GetTrackTimeScale(MP4TrackId trackId) { return m_pTracks[FindTrackIndex(trackId)]->GetTimeScale(); @@ -2248,18 +2665,17 @@ return GetTrackIntegerProperty(trackId, "mdia.mdhd.duration"); } -// now GetTrackEsdsObjectTypeId -u_int8_t MP4File::GetTrackAudioType(MP4TrackId trackId) -{ - return GetTrackIntegerProperty(trackId, - "mdia.minf.stbl.stsd.mp4a.esds.decConfigDescr.objectTypeId"); -} - u_int8_t MP4File::GetTrackEsdsObjectTypeId(MP4TrackId trackId) { // changed mp4a to * to handle enca case + try { return GetTrackIntegerProperty(trackId, "mdia.minf.stbl.stsd.*.esds.decConfigDescr.objectTypeId"); + } catch (MP4Error *e) { + delete e; + return GetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.*.*.esds.decConfigDescr.objectTypeId"); + } } u_int8_t MP4File::GetTrackAudioMpeg4Type(MP4TrackId trackId) @@ -2278,29 +2694,33 @@ GetTrackESConfiguration(trackId, &pEsConfig, &esConfigSize); if (esConfigSize < 1) { + free(pEsConfig); return MP4_MPEG4_INVALID_AUDIO_TYPE; } - u_int8_t mpeg4Type = (pEsConfig[0] >> 3); + u_int8_t mpeg4Type = ((pEsConfig[0] >> 3) & 0x1f); + // TTTT TXXX XXX potentially 6 bits of extension. + if (mpeg4Type == 0x1f) { + if (esConfigSize < 2) { + free(pEsConfig); + return MP4_MPEG4_INVALID_AUDIO_TYPE; + } + mpeg4Type = 32 + + (((pEsConfig[0] & 0x7) << 3) | ((pEsConfig[1] >> 5) & 0x7)); + } free(pEsConfig); return mpeg4Type; } -// replaced with GetTrackEsdsObjectTypeId -u_int8_t MP4File::GetTrackVideoType(MP4TrackId trackId) -{ - return GetTrackIntegerProperty(trackId, - "mdia.minf.stbl.stsd.mp4v.esds.decConfigDescr.objectTypeId"); -} MP4Duration MP4File::GetTrackFixedSampleDuration(MP4TrackId trackId) { return m_pTracks[FindTrackIndex(trackId)]->GetFixedSampleDuration(); } -float MP4File::GetTrackVideoFrameRate(MP4TrackId trackId) +double MP4File::GetTrackVideoFrameRate(MP4TrackId trackId) { MP4SampleId numSamples = GetTrackNumberOfSamples(trackId); @@ -2316,6 +2736,12 @@ return ((double)numSamples / UINT64_TO_DOUBLE(msDuration)) * MP4_MSECS_TIME_SCALE; } +int MP4File::GetTrackAudioChannels (MP4TrackId trackId) +{ + return GetTrackIntegerProperty(trackId, + "mdia.minf.stbl.stsd.*[0].channels"); +} + // true if media track encrypted according to ismacryp bool MP4File::IsIsmaCrypMediaTrack(MP4TrackId trackId) { @@ -2331,9 +2757,24 @@ void MP4File::GetTrackESConfiguration(MP4TrackId trackId, u_int8_t** ppConfig, u_int32_t* pConfigSize) { + try { GetTrackBytesProperty(trackId, "mdia.minf.stbl.stsd.*[0].esds.decConfigDescr.decSpecificInfo[0].info", ppConfig, pConfigSize); + } catch (MP4Error *e) { + delete e; + GetTrackBytesProperty(trackId, + "mdia.minf.stbl.stsd.*[0].*.esds.decConfigDescr.decSpecificInfo[0].info", + ppConfig, pConfigSize); + } +} + +void MP4File::GetTrackVideoMetadata(MP4TrackId trackId, + u_int8_t** ppConfig, u_int32_t* pConfigSize) +{ + GetTrackBytesProperty(trackId, + "mdia.minf.stbl.stsd.*[0].*.metadata", + ppConfig, pConfigSize); } void MP4File::SetTrackESConfiguration(MP4TrackId trackId, @@ -2341,19 +2782,18 @@ { // get a handle on the track decoder config descriptor MP4DescriptorProperty* pConfigDescrProperty = NULL; - FindProperty(MakeTrackName(trackId, - "mdia.minf.stbl.stsd.*[0].esds.decConfigDescr.decSpecificInfo"), - (MP4Property**)&pConfigDescrProperty); - - if (pConfigDescrProperty == NULL) { + if (FindProperty(MakeTrackName(trackId, + "mdia.minf.stbl.stsd.*[0].esds.decConfigDescr.decSpecificInfo"), + (MP4Property**)&pConfigDescrProperty) == false || + pConfigDescrProperty == NULL) { // probably trackId refers to a hint track throw new MP4Error("no such property", "MP4SetTrackESConfiguration"); } // lookup the property to store the configuration MP4BytesProperty* pInfoProperty = NULL; - pConfigDescrProperty->FindProperty("decSpecificInfo[0].info", - (MP4Property**)&pInfoProperty); + (void)pConfigDescrProperty->FindProperty("decSpecificInfo[0].info", + (MP4Property**)&pInfoProperty); // configuration being set for the first time if (pInfoProperty == NULL) { @@ -2362,7 +2802,7 @@ pConfigDescrProperty->AddDescriptor(MP4DecSpecificDescrTag); pConfigDescr->Generate(); - pConfigDescrProperty->FindProperty( + (void)pConfigDescrProperty->FindProperty( "decSpecificInfo[0].info", (MP4Property**)&pInfoProperty); ASSERT(pInfoProperty); @@ -2372,6 +2812,96 @@ pInfoProperty->SetValue(pConfig, configSize); } + +void MP4File::GetTrackH264SeqPictHeaders (MP4TrackId trackId, + uint8_t ***pppSeqHeader, + uint32_t **ppSeqHeaderSize, + uint8_t ***pppPictHeader, + uint32_t **ppPictHeaderSize) +{ + uint32_t count; + const char *format; + MP4Atom *avcCAtom; + + *pppSeqHeader = NULL; *pppPictHeader = NULL; + *ppSeqHeaderSize = NULL; *ppPictHeaderSize = NULL; + + // get 4cc media format - can be avc1 or encv for ismacrypted track + format = GetTrackMediaDataName (trackId); + + if (!strcasecmp(format, "avc1")) + avcCAtom = FindAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd.avc1.avcC")); + else if (!strcasecmp(format, "encv")) + avcCAtom = FindAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd.encv.avcC")); + else + // huh? unknown track format + return; + + MP4BitfieldProperty *pSeqCount; + MP4IntegerProperty *pSeqLen, *pPictCount, *pPictLen; + MP4BytesProperty *pSeqVal, *pPictVal; + + if ((avcCAtom->FindProperty("avcC.numOfSequenceParameterSets", + (MP4Property **)&pSeqCount) == false) || + (avcCAtom->FindProperty("avcC.sequenceEntries.sequenceParameterSetLength", + (MP4Property **)&pSeqLen) == false) || + (avcCAtom->FindProperty("avcC.sequenceEntries.sequenceParameterSetNALUnit", + (MP4Property **)&pSeqVal) == false)) { + VERBOSE_ERROR(m_verbosity, WARNING("Could not find avcC properties")); + return ; + } + uint8_t **ppSeqHeader = + (uint8_t **)malloc((pSeqCount->GetValue() + 1) * sizeof(uint8_t *)); + if (ppSeqHeader == NULL) return; + *pppSeqHeader = ppSeqHeader; + + uint32_t *pSeqHeaderSize = + (uint32_t *)malloc((pSeqCount->GetValue() + 1) * sizeof(uint32_t *)); + + if (pSeqHeaderSize == NULL) return; + + *ppSeqHeaderSize = pSeqHeaderSize; + for (count = 0; count < pSeqCount->GetValue(); count++) { + pSeqVal->GetValue(&(ppSeqHeader[count]), &(pSeqHeaderSize[count]), + count); + } + ppSeqHeader[count] = NULL; + pSeqHeaderSize[count] = 0; + + if ((avcCAtom->FindProperty("avcC.numOfPictureParameterSets", + (MP4Property **)&pPictCount) == false) || + (avcCAtom->FindProperty("avcC.pictureEntries.pictureParameterSetLength", + (MP4Property **)&pPictLen) == false) || + (avcCAtom->FindProperty("avcC.pictureEntries.pictureParameterSetNALUnit", + (MP4Property **)&pPictVal) == false)) { + VERBOSE_ERROR(m_verbosity, + WARNING("Could not find avcC picture table properties")); + return ; + } + uint8_t + **ppPictHeader = + (uint8_t **)malloc((pPictCount->GetValue() + 1) * sizeof(uint8_t *)); + if (ppPictHeader == NULL) return; + uint32_t *pPictHeaderSize = + (uint32_t *)malloc((pPictCount->GetValue() + 1)* sizeof(uint32_t *)); + if (pPictHeaderSize == NULL) { + free(ppPictHeader); + return; + } + *pppPictHeader = ppPictHeader; + *ppPictHeaderSize = pPictHeaderSize; + + for (count = 0; count < pPictCount->GetValue(); count++) { + pPictVal->GetValue(&(ppPictHeader[count]), &(pPictHeaderSize[count]), + count); + } + ppPictHeader[count] = NULL; + pPictHeaderSize[count] = 0; + return ; +} + + + const char* MP4File::GetHintTrackSdp(MP4TrackId hintTrackId) { return GetTrackStringProperty(hintTrackId, "udta.hnti.sdp .sdpText"); @@ -2386,7 +2916,7 @@ "MP4SetHintTrackSdp"); } - AddDescendantAtoms( + (void)AddDescendantAtoms( MakeTrackName(hintTrackId, NULL), "udta.hnti.sdp "); SetTrackStringProperty(hintTrackId, "udta.hnti.sdp .sdpText", sdpString); @@ -2469,10 +2999,9 @@ MP4Atom* pTrakAtom = m_pTracks[i]->GetTrakAtom(); MP4Integer32Property* pPayloadProperty = NULL; - pTrakAtom->FindProperty("trak.udta.hinf.payt.payloadNumber", - (MP4Property**)&pPayloadProperty); - - if (pPayloadProperty) { + if (pTrakAtom->FindProperty("trak.udta.hinf.payt.payloadNumber", + (MP4Property**)&pPayloadProperty) && + pPayloadProperty) { usedPayloads.Add(pPayloadProperty->GetValue()); } } @@ -2772,11 +3301,14 @@ { char* trakName = MakeTrackName(trackId, NULL); - static char editName[1024]; - snprintf(editName, sizeof(editName), + if (m_editName == NULL) { + m_editName = (char *)malloc(1024); + if (m_editName == NULL) return NULL; + } + snprintf(m_editName, 1024, "%s.edts.elst.entries[%u].%s", trakName, editId - 1, name); - return editName; + return m_editName; } MP4EditId MP4File::AddTrackEdit( diff -Nru faac-1.26/common/mp4v2/mp4file.h faac-1.28/common/mp4v2/mp4file.h --- faac-1.26/common/mp4v2/mp4file.h 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/mp4file.h 2009-01-25 01:14:34.000000000 +0000 @@ -13,7 +13,7 @@ * * The Initial Developer of the Original Code is Cisco Systems Inc. * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001 - 2004. All Rights Reserved. + * Copyright (C) Cisco Systems Inc. 2001 - 2005. All Rights Reserved. * * 3GPP features implementation is based on 3GPP's TS26.234-v5.60, * and was contributed by Ximpo Group Ltd. @@ -38,6 +38,7 @@ class MP4BytesProperty; class MP4Descriptor; class MP4DescriptorProperty; +struct Virtual_IO; class MP4File { public: /* equivalent to MP4 library API */ @@ -46,11 +47,16 @@ /* file operations */ void Read(const char* fileName); - void Create(const char* fileName, u_int32_t flags); - void CreateEx(const char* fileName, u_int32_t flags, char* majorBrand, - u_int32_t minorVersion, char** supportedBrands, - u_int32_t supportedBrandsCount); - void Modify(const char* fileName); + #ifdef _WIN32 + void Read(const wchar_t* fileName); + #endif + void ReadEx(const char *fileName, void *user, Virtual_IO *virtual_IO); //benski> + void Create(const char* fileName, u_int32_t flags, + int add_ftyp = 1, int add_iods = 1, + char* majorBrand = NULL, + u_int32_t minorVersion = 0, char** supportedBrands = NULL, + u_int32_t supportedBrandsCount = 0); + bool Modify(const char* fileName); void Optimize(const char* orgFileName, const char* newFileName = NULL); void Dump(FILE* pDumpFile = NULL, bool dumpImplicits = false); @@ -66,7 +72,7 @@ } bool Use64Bits(const char *atomName); - + void Check64BitStatus(const char *atomName); /* file properties */ u_int64_t GetIntegerProperty(const char* name); @@ -122,7 +128,7 @@ u_int16_t FindTrakAtomIndex(MP4TrackId trackId); /* track properties */ - + MP4Atom *FindTrackAtom(MP4TrackId trackId, const char *name); u_int64_t GetTrackIntegerProperty( MP4TrackId trackId, const char* name); float GetTrackFloatProperty( @@ -211,7 +217,8 @@ u_int8_t key_ind_len, u_int8_t iv_len, bool selective_enc, - char *kms_uri); + const char *kms_uri, + bool use_ismacryp); void SetAmrVendor( MP4TrackId trackId, @@ -224,6 +231,7 @@ void SetAmrModeSet( MP4TrackId trackId, u_int16_t modeSet); + uint16_t GetAmrModeSet(MP4TrackId trackId); MP4TrackId AddAmrAudioTrack( u_int32_t timeScale, @@ -232,7 +240,11 @@ u_int8_t framesPerSample, bool isAmrWB); - MP4TrackId AddVideoTrack( + MP4TrackId AddHrefTrack(uint32_t timeScale, + MP4Duration sampleDuration, + const char *base_url); + + MP4TrackId AddMP4VideoTrack( u_int32_t timeScale, MP4Duration sampleDuration, u_int16_t width, @@ -245,12 +257,8 @@ u_int16_t width, u_int16_t height, u_int8_t videoType, - u_int32_t scheme_type, - u_int16_t scheme_version, - u_int8_t key_ind_len, - u_int8_t iv_len, - bool selective_enc, - char *kms_uri); + mp4v2_ismacrypParams *icPp, + const char *oFormat); void SetH263Vendor( MP4TrackId trackId, @@ -275,12 +283,42 @@ u_int32_t avgBitrate, u_int32_t maxBitrate); + MP4TrackId AddH264VideoTrack( + u_int32_t timeScale, + MP4Duration sampleDuration, + u_int16_t width, + u_int16_t height, + uint8_t AVCProfileIndication, + uint8_t profile_compat, + uint8_t AVCLevelIndication, + uint8_t sampleLenFieldSizeMinusOne); + + MP4TrackId AddEncH264VideoTrack( + u_int32_t timeScale, + MP4Duration sampleDuration, + u_int16_t width, + u_int16_t height, + MP4Atom *srcAtom, + mp4v2_ismacrypParams *icPp); + + void AddH264SequenceParameterSet(MP4TrackId trackId, + const uint8_t *pSequence, + uint16_t sequenceLen); + void AddH264PictureParameterSet(MP4TrackId trackId, + const uint8_t *pPicture, + uint16_t pictureLen); MP4TrackId AddHintTrack(MP4TrackId refTrackId); + MP4TrackId AddTextTrack(MP4TrackId refTrackId); + MP4TrackId AddChapterTextTrack(MP4TrackId refTrackId); + MP4SampleId GetTrackNumberOfSamples(MP4TrackId trackId); const char* GetTrackType(MP4TrackId trackId); + const char *GetTrackMediaDataName(MP4TrackId trackId); + bool GetTrackMediaDataOriginalFormat(MP4TrackId trackId, + char *originalFormat, u_int32_t buflen); MP4Duration GetTrackDuration(MP4TrackId trackId); u_int32_t GetTrackTimeScale(MP4TrackId trackId); @@ -289,19 +327,25 @@ // replacement to GetTrackAudioType and GetTrackVideoType u_int8_t GetTrackEsdsObjectTypeId(MP4TrackId trackId); - u_int8_t GetTrackAudioType(MP4TrackId trackId); u_int8_t GetTrackAudioMpeg4Type(MP4TrackId trackId); - u_int8_t GetTrackVideoType(MP4TrackId trackId); MP4Duration GetTrackFixedSampleDuration(MP4TrackId trackId); - float GetTrackVideoFrameRate(MP4TrackId trackId); - + double GetTrackVideoFrameRate(MP4TrackId trackId); + + int GetTrackAudioChannels(MP4TrackId trackId); void GetTrackESConfiguration(MP4TrackId trackId, u_int8_t** ppConfig, u_int32_t* pConfigSize); void SetTrackESConfiguration(MP4TrackId trackId, const u_int8_t* pConfig, u_int32_t configSize); + void GetTrackVideoMetadata(MP4TrackId trackId, + u_int8_t** ppConfig, u_int32_t* pConfigSize); + void GetTrackH264SeqPictHeaders(MP4TrackId trackId, + uint8_t ***pSeqHeader, + uint32_t **pSeqHeaderSize, + uint8_t ***pPictHeader, + uint32_t **pPictHeaderSize); const char* GetHintTrackSdp(MP4TrackId hintTrackId); void SetHintTrackSdp(MP4TrackId hintTrackId, const char* sdpString); void AppendHintTrackSdp(MP4TrackId hintTrackId, const char* sdpString); @@ -507,48 +551,50 @@ MP4Duration* pDuration = NULL); /* iTunes metadata handling */ + protected: bool CreateMetadataAtom(const char* name); + public: + // these are public to remove a lot of unnecessary routines + bool DeleteMetadataAtom(const char* name, bool try_udta = false); + bool GetMetadataString(const char *atom, char **value, bool try_udta = false); + bool SetMetadataString(const char *atom, const char *value); bool MetadataDelete(void); + + bool SetMetadataUint8(const char *atom, u_int8_t compilation); + bool GetMetadataUint8(const char *atom, u_int8_t* compilation); /* set metadata */ - bool SetMetadataName(const char* value); - bool SetMetadataWriter(const char* value); - bool SetMetadataAlbum(const char* value); - bool SetMetadataArtist(const char* value); - bool SetMetadataTool(const char* value); - bool SetMetadataComment(const char* value); - bool SetMetadataYear(const char* value); bool SetMetadataTrack(u_int16_t track, u_int16_t totalTracks); bool SetMetadataDisk(u_int16_t disk, u_int16_t totalDisks); bool SetMetadataGenre(const char *value); bool SetMetadataTempo(u_int16_t tempo); - bool SetMetadataCompilation(u_int8_t compilation); bool SetMetadataCoverArt(u_int8_t *coverArt, u_int32_t size); - bool SetMetadataFreeForm(char *name, - u_int8_t* pValue, - u_int32_t valueSize); + bool SetMetadataFreeForm(const char *name, + const u_int8_t* pValue, + u_int32_t valueSize, + const char *owner = NULL); /* get metadata */ bool GetMetadataByIndex(u_int32_t index, - const char** ppName, - u_int8_t** ppValue, + char** ppName, // free memory when done + u_int8_t** ppValue, // free memory when done u_int32_t* pValueSize); - bool GetMetadataName(char** value); - bool GetMetadataWriter(char** value); - bool GetMetadataAlbum(char** value); - bool GetMetadataArtist(char** value); - bool GetMetadataTool(char** value); - bool GetMetadataComment(char** value); - bool GetMetadataYear(char** value); bool GetMetadataTrack(u_int16_t* track, u_int16_t* totalTracks); bool GetMetadataDisk(u_int16_t* disk, u_int16_t* totalDisks); bool GetMetadataGenre(char **value); bool GetMetadataTempo(u_int16_t* tempo); - bool GetMetadataCompilation(u_int8_t* compilation); - bool GetMetadataCoverArt(u_int8_t **coverArt, u_int32_t* size); - bool GetMetadataFreeForm(char *name, + bool GetMetadataCoverArt(u_int8_t **coverArt, u_int32_t* size, + uint32_t index = 0); + u_int32_t GetMetadataCoverArtCount(void); + bool GetMetadataFreeForm(const char *name, u_int8_t** pValue, - u_int32_t* valueSize); + u_int32_t* valueSize, + const char *owner = NULL); + + /* delete metadata */ + bool DeleteMetadataGenre(); + bool DeleteMetadataFreeForm(const char *name, const char *owner = NULL); + /* end of MP4 API */ /* "protected" interface to be used only by friends in library */ @@ -558,7 +604,7 @@ u_int64_t GetSize(); - u_int32_t ReadBytes( + void ReadBytes( u_int8_t* pBytes, u_int32_t numBytes, FILE* pFile = NULL); u_int64_t ReadUInt(u_int8_t size); u_int8_t ReadUInt8(); @@ -576,11 +622,10 @@ void FlushReadBits(); u_int32_t ReadMpegLength(); - u_int32_t PeekBytes( + void PeekBytes( u_int8_t* pBytes, u_int32_t numBytes, FILE* pFile = NULL); void WriteBytes(u_int8_t* pBytes, u_int32_t numBytes, FILE* pFile = NULL); - void WriteUInt(u_int64_t value, u_int8_t size); void WriteUInt8(u_int8_t value); void WriteUInt16(u_int16_t value); void WriteUInt24(u_int32_t value); @@ -608,7 +653,7 @@ MP4Track* GetTrack(MP4TrackId trackId); - MP4Duration UpdateDuration(MP4Duration duration); + void UpdateDuration(MP4Duration duration); MP4Atom* FindAtom(const char* name); @@ -640,13 +685,16 @@ protected: void Open(const char* fmode); + #ifdef _WIN32 + void Open(const wchar_t* fmode); + #endif void ReadFromFile(); void GenerateTracks(); void BeginWrite(); void FinishWrite(); void CacheProperties(); - void RewriteMdat(FILE* pReadFile, FILE* pWriteFile); - MP4Atom* GetTrakDamrAtom(MP4TrackId trackId); + void RewriteMdat(void* pReadFile, void* pWriteFile, + Virtual_IO *readIO, Virtual_IO *writeIO); bool ShallHaveIods(); const char* TempFileName(); @@ -666,6 +714,16 @@ bool FindProperty(const char* name, MP4Property** ppProperty, u_int32_t* pIndex = NULL); + MP4TrackId AddVideoTrackDefault( + u_int32_t timeScale, + MP4Duration sampleDuration, + u_int16_t width, + u_int16_t height, + const char *videoType); + MP4TrackId AddCntlTrackDefault( + u_int32_t timeScale, + MP4Duration sampleDuration, + const char *videoType); void AddTrackToIod(MP4TrackId trackId); void RemoveTrackFromIod(MP4TrackId trackId, bool shallHaveIods = true); @@ -697,14 +755,14 @@ u_int8_t** ppBytes, u_int64_t* pNumBytes); - MP4Descriptor* CreateESD( + void CreateESD( MP4DescriptorProperty* pEsProperty, u_int32_t esid, u_int8_t objectType, u_int8_t streamType, u_int32_t bufferSize, u_int32_t bitrate, - u_int8_t* pConfig, + const u_int8_t* pConfig, u_int32_t configLength, char* url); @@ -735,7 +793,11 @@ protected: char* m_fileName; - FILE* m_pFile; + #ifdef _WIN32 + wchar_t* m_fileName_w; + #endif + void* m_pFile; + Virtual_IO *m_virtual_IO; u_int64_t m_orgFileSize; u_int64_t m_fileSize; MP4Atom* m_pRootAtom; @@ -762,6 +824,14 @@ u_int8_t m_bufReadBits; u_int8_t m_numWriteBits; u_int8_t m_bufWriteBits; + +#ifndef _WIN32 + char m_tempFileName[64]; +#else + char m_tempFileName[MAX_PATH + 3]; +#endif + char m_trakName[1024]; + char *m_editName; }; #endif /* __MP4_FILE_INCLUDED__ */ diff -Nru faac-1.26/common/mp4v2/mp4file_io.cpp faac-1.28/common/mp4v2/mp4file_io.cpp --- faac-1.26/common/mp4v2/mp4file_io.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/mp4file_io.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -28,16 +28,20 @@ if (m_memoryBuffer == NULL) { if (pFile == NULL) { ASSERT(m_pFile); - pFile = m_pFile; - } - - fpos_t fpos; - if (fgetpos(pFile, &fpos) < 0) { - throw new MP4Error(errno, "MP4GetPosition"); + u_int64_t fpos; + if (m_virtual_IO->GetPosition(m_pFile, &fpos) != 0) { + throw new MP4Error("getting position via Virtual I/O", "MP4GetPosition"); + } + return fpos; + } else { + fpos_t fpos; + if (fgetpos(pFile, &fpos) < 0) { + throw new MP4Error(errno, "MP4GetPosition"); + } + uint64_t ret; + FPOS_TO_VAR(fpos, uint64_t, ret); + return ret; } - uint64_t ret; - FPOS_TO_VAR(fpos, uint64_t, ret); - return ret; } else { return m_memoryBufferPosition; } @@ -48,13 +52,15 @@ if (m_memoryBuffer == NULL) { if (pFile == NULL) { ASSERT(m_pFile); - pFile = m_pFile; - } - - fpos_t fpos; - VAR_TO_FPOS(fpos, pos); - if (fsetpos(pFile, &fpos) < 0) { - throw new MP4Error(errno, "MP4SetPosition"); + if (m_virtual_IO->SetPosition(m_pFile, pos) != 0) { + throw new MP4Error("setting position via Virtual I/O", "MP4SetPosition"); + } + } else { + fpos_t fpos; + VAR_TO_FPOS(fpos, pos); + if (fsetpos(pFile, &fpos) < 0) { + throw new MP4Error(errno, "MP4SetPosition"); + } } } else { if (pos >= m_memoryBufferSize) { @@ -78,29 +84,31 @@ return m_fileSize; } -u_int32_t MP4File::ReadBytes(u_int8_t* pBytes, u_int32_t numBytes, FILE* pFile) +void MP4File::ReadBytes(u_int8_t* pBytes, u_int32_t numBytes, FILE* pFile) { // handle degenerate cases if (numBytes == 0) { - return 0; + return; } ASSERT(pBytes); WARNING(m_numReadBits > 0); - if (pFile == NULL) { - pFile = m_pFile; - } - ASSERT(pFile); - if (m_memoryBuffer == NULL) { - if (fread(pBytes, 1, numBytes, pFile) != numBytes) { - if (feof(pFile)) { - throw new MP4Error( - "not enough bytes, reached end-of-file", - "MP4ReadBytes"); - } else { - throw new MP4Error(errno, "MP4ReadBytes"); + if (pFile == NULL) { + ASSERT(m_pFile); + if (m_virtual_IO->Read(m_pFile, pBytes, numBytes) != numBytes) { + throw new MP4Error("not enough bytes, reached end-of-file", "MP4ReadBytes"); + } + } else { + if (fread(pBytes, 1, numBytes, pFile) != numBytes) { + if (feof(pFile)) { + throw new MP4Error( + "not enough bytes, reached end-of-file", + "MP4ReadBytes"); + } else { + throw new MP4Error(errno, "MP4ReadBytes"); + } } } } else { @@ -112,15 +120,14 @@ memcpy(pBytes, &m_memoryBuffer[m_memoryBufferPosition], numBytes); m_memoryBufferPosition += numBytes; } - return numBytes; + return; } -u_int32_t MP4File::PeekBytes(u_int8_t* pBytes, u_int32_t numBytes, FILE* pFile) +void MP4File::PeekBytes(u_int8_t* pBytes, u_int32_t numBytes, FILE* pFile) { u_int64_t pos = GetPosition(pFile); ReadBytes(pBytes, numBytes, pFile); SetPosition(pos, pFile); - return numBytes; } void MP4File::EnableMemoryBuffer(u_int8_t* pBytes, u_int64_t numBytes) @@ -168,12 +175,14 @@ if (m_memoryBuffer == NULL) { if (pFile == NULL) { ASSERT(m_pFile); - pFile = m_pFile; - } - - u_int32_t rc = fwrite(pBytes, 1, numBytes, pFile); - if (rc != numBytes) { - throw new MP4Error(errno, "MP4WriteBytes"); + if (m_virtual_IO->Write(m_pFile, pBytes, numBytes) != numBytes) { + throw new MP4Error("error writing bytes via virtual I/O", "MP4WriteBytes"); + } + } else { + u_int32_t rc = fwrite(pBytes, 1, numBytes, pFile); + if (rc != numBytes) { + throw new MP4Error(errno, "MP4WriteBytes"); + } } } else { if (m_memoryBufferPosition + numBytes > m_memoryBufferSize) { @@ -205,6 +214,7 @@ } } +#if 0 void MP4File::WriteUInt(u_int64_t value, u_int8_t size) { switch (size) { @@ -222,6 +232,7 @@ ASSERT(false); } } +#endif u_int8_t MP4File::ReadUInt8() { @@ -382,6 +393,8 @@ do { if (length == alloced) { data = (char*)MP4Realloc(data, alloced * 2); + if (data == NULL) return NULL; + alloced *= 2; } ReadBytes((u_int8_t*)&data[length], 1); length++; @@ -394,7 +407,7 @@ void MP4File::WriteString(char* string) { if (string == NULL) { - static u_int8_t zero = 0; + u_int8_t zero = 0; WriteBytes(&zero, 1); } else { WriteBytes((u_int8_t*)string, strlen(string) + 1); @@ -406,10 +419,15 @@ u_int32_t charLength; if (allowExpandedCount) { u_int8_t b; + uint ix = 0; charLength = 0; do { b = ReadUInt8(); charLength += b; + ix++; + if (ix > 25) + throw new MP4Error(ERANGE, + "Counted string too long 25 * 255"); } while (b == 255); } else { charLength = ReadUInt8(); diff -Nru faac-1.26/common/mp4v2/mp4.h faac-1.28/common/mp4v2/mp4.h --- faac-1.26/common/mp4v2/mp4.h 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/mp4.h 2009-01-25 01:14:34.000000000 +0000 @@ -13,7 +13,7 @@ * * The Initial Developer of the Original Code is Cisco Systems Inc. * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001 - 2004. All Rights Reserved. + * Copyright (C) Cisco Systems Inc. 2001 - 2005. All Rights Reserved. * * 3GPP features implementation is based on 3GPP's TS26.234-v5.60, * and was contributed by Ximpo Group Ltd. @@ -25,6 +25,7 @@ * Dave Mackie dmackie@cisco.com * Alix Marchandise-Franquet alix@cisco.com * Ximpo Group Ltd. mp4v2@ximpo.com + * Bill May wmay@cisco.com */ #ifndef __MP4_INCLUDED__ @@ -32,18 +33,19 @@ /* include system and project specific headers */ #include "mpeg4ip.h" - #include /* to define float HUGE_VAL and/or NAN */ #ifndef NAN #define NAN HUGE_VAL #endif +#ifndef DEFAULT #ifdef __cplusplus /* exploit C++ ability of default values for function parameters */ #define DEFAULT(x) =x #else #define DEFAULT(x) #endif +#endif /* MP4 API types */ typedef void* MP4FileHandle; @@ -53,6 +55,26 @@ typedef u_int64_t MP4Duration; typedef u_int32_t MP4EditId; +typedef u_int64_t (*VIRTUALIO_GETFILELENGTH)(void *user); // return file length in bytes +typedef int (*VIRTUALIO_SETPOSITION)(void *user, u_int64_t position); // return 0 on success +typedef int (*VIRTUALIO_GETPOSITION)(void *user, u_int64_t *position); // fill position, return 0 on success +typedef size_t (*VIRTUALIO_READ)(void *user, void *buffer, size_t size); // return number of bytes actually read +typedef size_t (*VIRTUALIO_WRITE)(void *user, void *buffer, size_t size); // return number of bytes actually written +typedef int (*VIRTUALIO_ENDOFFILE)(void *user); // return 1 if file hit EOF +typedef int (*VIRTUALIO_CLOSE)(void *user); // return 0 on success + +typedef struct Virtual_IO +{ + VIRTUALIO_GETFILELENGTH GetFileLength; + VIRTUALIO_SETPOSITION SetPosition; + VIRTUALIO_GETPOSITION GetPosition; + VIRTUALIO_READ Read; + VIRTUALIO_WRITE Write; + VIRTUALIO_ENDOFFILE EndOfFile; + VIRTUALIO_CLOSE Close; +} Virtual_IO_t; + + /* Invalid values for API types */ #define MP4_INVALID_FILE_HANDLE ((MP4FileHandle)NULL) #define MP4_INVALID_TRACK_ID ((MP4TrackId)0) @@ -98,6 +120,8 @@ #define MP4_AUDIO_TRACK_TYPE "soun" #define MP4_VIDEO_TRACK_TYPE "vide" #define MP4_HINT_TRACK_TYPE "hint" +#define MP4_CNTL_TRACK_TYPE "cntl" +#define MP4_TEXT_TRACK_TYPE "text" /* * This second set of track types should be created * via MP4AddSystemsTrack(type) @@ -114,6 +138,9 @@ #define MP4_IS_AUDIO_TRACK_TYPE(type) \ (!strcasecmp(type, MP4_AUDIO_TRACK_TYPE)) +#define MP4_IS_CNTL_TRACK_TYPE(type) \ + (!strcasecmp(type, MP4_CNTL_TRACK_TYPE)) + #define MP4_IS_OD_TRACK_TYPE(type) \ (!strcasecmp(type, MP4_OD_TRACK_TYPE)) @@ -155,6 +182,7 @@ #define MP4_MPEG4_AAC_LC_AUDIO_TYPE 2 #define MP4_MPEG4_AAC_SSR_AUDIO_TYPE 3 #define MP4_MPEG4_AAC_LTP_AUDIO_TYPE 4 +#define MP4_MPEG4_AAC_HE_AUDIO_TYPE 5 #define MP4_MPEG4_AAC_SCALABLE_AUDIO_TYPE 6 #define MP4_MPEG4_CELP_AUDIO_TYPE 8 #define MP4_MPEG4_HVXC_AUDIO_TYPE 9 @@ -163,6 +191,11 @@ #define MP4_MPEG4_WAVETABLE_AUDIO_TYPE 14 #define MP4_MPEG4_MIDI_AUDIO_TYPE 15 #define MP4_MPEG4_ALGORITHMIC_FX_AUDIO_TYPE 16 +#define MP4_MPEG4_ALS_AUDIO_TYPE 31 +#define MP4_MPEG4_LAYER1_AUDIO_TYPE 32 +#define MP4_MPEG4_LAYER2_AUDIO_TYPE 33 +#define MP4_MPEG4_LAYER3_AUDIO_TYPE 34 +#define MP4_MPEG4_SLS_AUDIO_TYPE 35 /* MP4 Audio type utilities following common usage */ #define MP4_IS_MP3_AUDIO_TYPE(type) \ @@ -174,7 +207,7 @@ #define MP4_IS_MPEG4_AAC_AUDIO_TYPE(mpeg4Type) \ (((mpeg4Type) >= MP4_MPEG4_AAC_MAIN_AUDIO_TYPE \ - && (mpeg4Type) <= MP4_MPEG4_AAC_LTP_AUDIO_TYPE) \ + && (mpeg4Type) <= MP4_MPEG4_AAC_HE_AUDIO_TYPE) \ || (mpeg4Type) == MP4_MPEG4_AAC_SCALABLE_AUDIO_TYPE \ || (mpeg4Type) == 17) @@ -196,7 +229,6 @@ #define MP4_JPEG_VIDEO_TYPE 0x6C #define MP4_PRIVATE_VIDEO_TYPE 0xD0 #define MP4_YUV12_VIDEO_TYPE 0xF0 /* a private definition */ -#define MP4_H264_VIDEO_TYPE 0xF1 /* a private definition */ #define MP4_H263_VIDEO_TYPE 0xF2 /* a private definition */ #define MP4_H261_VIDEO_TYPE 0xF3 /* a private definition */ @@ -288,15 +320,16 @@ const char* fileName, u_int32_t verbosity DEFAULT(0), u_int32_t flags DEFAULT(0)); - MP4FileHandle MP4CreateEx( - const char* fileName, - u_int32_t verbosity DEFAULT(0), - u_int32_t flags DEFAULT(0), - char* majorBrand DEFAULT(0), - u_int32_t minorVersion DEFAULT(0), - char** supportedBrands DEFAULT(0), - u_int32_t supportedBrandsCount DEFAULT(0)); + const char *fileName, + u_int32_t verbosity DEFAULT(0), + u_int32_t flags DEFAULT(0), + int add_ftyp DEFAULT(1), + int add_iods DEFAULT(1), + char* majorBrand DEFAULT(0), + u_int32_t minorVersion DEFAULT(0), + char** supportedBrands DEFAULT(0), + u_int32_t supportedBrandsCount DEFAULT(0)); MP4FileHandle MP4Modify( const char* fileName, @@ -307,7 +340,13 @@ const char* fileName, u_int32_t verbosity DEFAULT(0)); -bool MP4Close( +// benski> +MP4FileHandle MP4ReadEx(const char* fileName, + void *user, + Virtual_IO_t *virtual_IO, + u_int32_t verbosity DEFAULT(0)); + +void MP4Close( MP4FileHandle hFile); bool MP4Optimize( @@ -334,7 +373,7 @@ u_int32_t MP4GetVerbosity(MP4FileHandle hFile); -bool MP4SetVerbosity(MP4FileHandle hFile, u_int32_t verbosity); +void MP4SetVerbosity(MP4FileHandle hFile, u_int32_t verbosity); MP4Duration MP4GetDuration(MP4FileHandle hFile); @@ -350,37 +389,40 @@ bool MP4SetSceneProfileLevel(MP4FileHandle hFile, u_int8_t value); -u_int8_t MP4GetVideoProfileLevel(MP4FileHandle hFile); +u_int8_t MP4GetVideoProfileLevel(MP4FileHandle hFile, + MP4TrackId trackId DEFAULT(MP4_INVALID_TRACK_ID)); -bool MP4SetVideoProfileLevel(MP4FileHandle hFile, u_int8_t value); +void MP4SetVideoProfileLevel(MP4FileHandle hFile, u_int8_t value); u_int8_t MP4GetAudioProfileLevel(MP4FileHandle hFile); -bool MP4SetAudioProfileLevel(MP4FileHandle hFile, u_int8_t value); +void MP4SetAudioProfileLevel(MP4FileHandle hFile, u_int8_t value); u_int8_t MP4GetGraphicsProfileLevel(MP4FileHandle hFile); bool MP4SetGraphicsProfileLevel(MP4FileHandle hFile, u_int8_t value); /* generic file properties */ +bool MP4HaveAtom(MP4FileHandle hFile, + const char *atomName); -u_int64_t MP4GetIntegerProperty( +bool MP4GetIntegerProperty( MP4FileHandle hFile, - const char* propName); + const char* propName, + u_int64_t *retval ); -bool MP4HaveTrackIntegerProperty( - MP4FileHandle hFile, MP4TrackId trackId, - const char* propName); -float MP4GetFloatProperty( +bool MP4GetFloatProperty( MP4FileHandle hFile, - const char* propName); + const char* propName, + float *retvalue); -const char* MP4GetStringProperty( +bool MP4GetStringProperty( MP4FileHandle hFile, - const char* propName); + const char* propName, + const char **retvalue); -void MP4GetBytesProperty( +bool MP4GetBytesProperty( MP4FileHandle hFile, const char* propName, u_int8_t** ppValue, @@ -431,9 +473,12 @@ u_int8_t key_ind_len; u_int8_t iv_len; u_int8_t selective_enc; - char *kms_uri; + const char *kms_uri; } mp4v2_ismacrypParams; +// API to initialize ismacryp properties to sensible defaults +// if input param is null then mallocs a params struct +mp4v2_ismacrypParams *MP4DefaultISMACrypParams(mp4v2_ismacrypParams *ptr); MP4TrackId MP4AddEncAudioTrack( MP4FileHandle hFile, @@ -441,6 +486,7 @@ MP4Duration sampleDuration, mp4v2_ismacrypParams *icPp, u_int8_t audioType DEFAULT(MP4_MPEG4_AUDIO_TYPE)); + MP4TrackId MP4AddAmrAudioTrack( MP4FileHandle hFile, u_int32_t timeScale, @@ -459,11 +505,16 @@ MP4TrackId trackId, u_int8_t decoderVersion); -void MP4SetAmrModeSet( - MP4FileHandle hFile, - MP4TrackId trackId, - u_int16_t modeSet); +void MP4SetAmrModeSet(MP4FileHandle hFile, MP4TrackId trakId, uint16_t modeSet); +uint16_t MP4GetAmrModeSet(MP4FileHandle hFile, MP4TrackId trackId); + +MP4TrackId MP4AddHrefTrack(MP4FileHandle hFile, + uint32_t timeScale, + MP4Duration sampleDuration, + const char *base_url DEFAULT(NULL)); +const char *MP4GetHrefTrackBaseUrl(MP4FileHandle hFile, + MP4TrackId trackId); MP4TrackId MP4AddVideoTrack( MP4FileHandle hFile, u_int32_t timeScale, @@ -479,8 +530,38 @@ u_int16_t width, u_int16_t height, mp4v2_ismacrypParams *icPp, - u_int8_t videoType DEFAULT(MP4_MPEG4_VIDEO_TYPE)); + u_int8_t videoType DEFAULT(MP4_MPEG4_VIDEO_TYPE), + const char *oFormat DEFAULT(NULL)); +MP4TrackId MP4AddH264VideoTrack( + MP4FileHandle hFile, + u_int32_t timeScale, + MP4Duration sampleDuration, + u_int16_t width, + u_int16_t height, + uint8_t AVCProfileIndication, + uint8_t profile_compat, + uint8_t AVCLevelIndication, + uint8_t sampleLenFieldSizeMinusOne); + +MP4TrackId MP4AddEncH264VideoTrack( + MP4FileHandle dstFile, + u_int32_t timeScale, + MP4Duration sampleDuration, + u_int16_t width, + u_int16_t height, + MP4FileHandle srcFile, + MP4TrackId srcTrackId, + mp4v2_ismacrypParams *icPp); + +void MP4AddH264SequenceParameterSet(MP4FileHandle hFile, + MP4TrackId trackId, + const uint8_t *pSequence, + uint16_t sequenceLen); +void MP4AddH264PictureParameterSet(MP4FileHandle hFile, + MP4TrackId trackId, + const uint8_t *pPict, + uint16_t pictLen); void MP4SetH263Vendor( MP4FileHandle hFile, MP4TrackId trackId, @@ -512,6 +593,14 @@ MP4FileHandle hFile, MP4TrackId refTrackId); +MP4TrackId MP4AddTextTrack( + MP4FileHandle hFile, + MP4TrackId refTrackId); + +MP4TrackId MP4AddChapterTextTrack( + MP4FileHandle hFile, + MP4TrackId refTrackId); + MP4TrackId MP4CloneTrack( MP4FileHandle srcFile, MP4TrackId srcTrackId, @@ -544,7 +633,7 @@ bool applyEdits DEFAULT(false), MP4TrackId dstHintTrackReferenceTrack DEFAULT(MP4_INVALID_TRACK_ID)); -bool MP4DeleteTrack( +void MP4DeleteTrack( MP4FileHandle hFile, MP4TrackId trackId); @@ -567,10 +656,22 @@ /* specific track properties */ +bool MP4HaveTrackAtom(MP4FileHandle hFile, + MP4TrackId trackId, + const char *atomname); + const char* MP4GetTrackType( MP4FileHandle hFile, MP4TrackId trackId); +const char *MP4GetTrackMediaDataName(MP4FileHandle hFile, + MP4TrackId trackId); + +// MP4GetTrackMediaDataOriginalFormat is to be used to get the original +// MediaDataName if a track has been encrypted. +bool MP4GetTrackMediaDataOriginalFormat(MP4FileHandle hFile, + MP4TrackId trackId, char *originalFormat, u_int32_t buflen); + MP4Duration MP4GetTrackDuration( MP4FileHandle hFile, MP4TrackId trackId); @@ -579,25 +680,15 @@ MP4FileHandle hFile, MP4TrackId trackId); -bool MP4SetTrackTimeScale( +void MP4SetTrackTimeScale( MP4FileHandle hFile, MP4TrackId trackId, u_int32_t value); -// Should not be used, replace with MP4GetTrackEsdsObjectTypeId -u_int8_t MP4GetTrackAudioType( - MP4FileHandle hFile, - MP4TrackId trackId); - u_int8_t MP4GetTrackAudioMpeg4Type( MP4FileHandle hFile, MP4TrackId trackId); -// Should not be used, replace with MP4GetTrackEsdsObjectTypeId -u_int8_t MP4GetTrackVideoType( - MP4FileHandle hFile, - MP4TrackId trackId); - u_int8_t MP4GetTrackEsdsObjectTypeId( MP4FileHandle hFile, MP4TrackId trackId); @@ -611,6 +702,11 @@ MP4FileHandle hFile, MP4TrackId trackId); +bool MP4GetTrackVideoMetadata(MP4FileHandle hFile, + MP4TrackId trackId, + uint8_t **ppConfig, + uint32_t *pConfigSize); + bool MP4GetTrackESConfiguration( MP4FileHandle hFile, MP4TrackId trackId, @@ -623,6 +719,20 @@ const u_int8_t* pConfig, u_int32_t configSize); +/* h264 information routines */ +bool MP4GetTrackH264ProfileLevel(MP4FileHandle hFile, + MP4TrackId trackId, + uint8_t *pProfile, + uint8_t *pLevel); +void MP4GetTrackH264SeqPictHeaders(MP4FileHandle hFile, + MP4TrackId trackId, + uint8_t ***pSeqHeaders, + uint32_t **pSeqHeaderSize, + uint8_t ***pPictHeader, + uint32_t **pPictHeaderSize); +bool MP4GetTrackH264LengthSize(MP4FileHandle hFile, + MP4TrackId trackId, + uint32_t *pLength); MP4SampleId MP4GetTrackNumberOfSamples( MP4FileHandle hFile, MP4TrackId trackId); @@ -635,32 +745,42 @@ MP4FileHandle hFile, MP4TrackId trackId); -float MP4GetTrackVideoFrameRate( +double MP4GetTrackVideoFrameRate( MP4FileHandle hFile, MP4TrackId trackId); +int MP4GetTrackAudioChannels(MP4FileHandle hFile, + MP4TrackId trackId); + bool MP4IsIsmaCrypMediaTrack( MP4FileHandle hFile, MP4TrackId trackId); /* generic track properties */ -u_int64_t MP4GetTrackIntegerProperty( +bool MP4HaveTrackAtom(MP4FileHandle hFile, + MP4TrackId trackId, + const char *atomName); + +bool MP4GetTrackIntegerProperty( MP4FileHandle hFile, MP4TrackId trackId, - const char* propName); + const char* propName, + u_int64_t *retvalue); -float MP4GetTrackFloatProperty( +bool MP4GetTrackFloatProperty( MP4FileHandle hFile, MP4TrackId trackId, - const char* propName); + const char* propName, + float *ret_value); -const char* MP4GetTrackStringProperty( +bool MP4GetTrackStringProperty( MP4FileHandle hFile, MP4TrackId trackId, - const char* propName); + const char* propName, + const char **retvalue); -void MP4GetTrackBytesProperty( +bool MP4GetTrackBytesProperty( MP4FileHandle hFile, MP4TrackId trackId, const char* propName, @@ -1046,45 +1166,72 @@ /* iTunes metadata handling */ bool MP4MetadataDelete(MP4FileHandle hFile); bool MP4GetMetadataByIndex(MP4FileHandle hFile, u_int32_t index, - const char** ppName, - u_int8_t** ppValue, u_int32_t* pValueSize); + char** ppName, // need to free memory + u_int8_t** ppValue, // need to free + u_int32_t* pValueSize); bool MP4SetMetadataName(MP4FileHandle hFile, const char* value); bool MP4GetMetadataName(MP4FileHandle hFile, char** value); +bool MP4DeleteMetadataName(MP4FileHandle hFile); bool MP4SetMetadataArtist(MP4FileHandle hFile, const char* value); bool MP4GetMetadataArtist(MP4FileHandle hFile, char** value); +bool MP4DeleteMetadataArtist(MP4FileHandle hFile); bool MP4SetMetadataWriter(MP4FileHandle hFile, const char* value); bool MP4GetMetadataWriter(MP4FileHandle hFile, char** value); +bool MP4DeleteMetadataWriter(MP4FileHandle hFile); bool MP4SetMetadataComment(MP4FileHandle hFile, const char* value); bool MP4GetMetadataComment(MP4FileHandle hFile, char** value); +bool MP4DeleteMetadataComment(MP4FileHandle hFile); bool MP4SetMetadataTool(MP4FileHandle hFile, const char* value); bool MP4GetMetadataTool(MP4FileHandle hFile, char** value); +bool MP4DeleteMetadataTool(MP4FileHandle hFile); bool MP4SetMetadataYear(MP4FileHandle hFile, const char* value); bool MP4GetMetadataYear(MP4FileHandle hFile, char** value); +bool MP4DeleteMetadataYear(MP4FileHandle hFile); bool MP4SetMetadataAlbum(MP4FileHandle hFile, const char* value); bool MP4GetMetadataAlbum(MP4FileHandle hFile, char** value); +bool MP4DeleteMetadataAlbum(MP4FileHandle hFile); bool MP4SetMetadataTrack(MP4FileHandle hFile, u_int16_t track, u_int16_t totalTracks); bool MP4GetMetadataTrack(MP4FileHandle hFile, u_int16_t* track, u_int16_t* totalTracks); +bool MP4DeleteMetadataTrack(MP4FileHandle hFile); bool MP4SetMetadataDisk(MP4FileHandle hFile, u_int16_t disk, u_int16_t totalDisks); bool MP4GetMetadataDisk(MP4FileHandle hFile, u_int16_t* disk, u_int16_t* totalDisks); +bool MP4DeleteMetadataDisk(MP4FileHandle hFile); bool MP4SetMetadataGenre(MP4FileHandle hFile, const char *genre); bool MP4GetMetadataGenre(MP4FileHandle hFile, char **genre); +bool MP4DeleteMetadataGenre(MP4FileHandle hFile); +bool MP4SetMetadataGrouping(MP4FileHandle hFile, const char *grouping); +bool MP4GetMetadataGrouping(MP4FileHandle hFile, char **grouping); +bool MP4DeleteMetadataGrouping(MP4FileHandle hFile); bool MP4SetMetadataTempo(MP4FileHandle hFile, u_int16_t tempo); bool MP4GetMetadataTempo(MP4FileHandle hFile, u_int16_t* tempo); +bool MP4DeleteMetadataTempo(MP4FileHandle hFile); bool MP4SetMetadataCompilation(MP4FileHandle hFile, u_int8_t cpl); bool MP4GetMetadataCompilation(MP4FileHandle hFile, u_int8_t* cpl); +bool MP4DeleteMetadataCompilation(MP4FileHandle hFile); +bool MP4SetMetadataPartOfGaplessAlbum(MP4FileHandle hFile, uint8_t pgap); +bool MP4GetMetadataPartOfGaplessAlbum(MP4FileHandle hFile, uint8_t *pgap); +bool MP4DeleteMetadataPartOfGaplessAlbum(MP4FileHandle hFile); bool MP4SetMetadataCoverArt(MP4FileHandle hFile, u_int8_t *coverArt, u_int32_t size); bool MP4GetMetadataCoverArt(MP4FileHandle hFile, - u_int8_t **coverArt, u_int32_t* size); -bool MP4SetMetadataFreeForm(MP4FileHandle hFile, char *name, - u_int8_t* pValue, u_int32_t valueSize); -bool MP4GetMetadataFreeForm(MP4FileHandle hFile, char *name, - u_int8_t** pValue, u_int32_t* valueSize); - + u_int8_t **coverArt, u_int32_t* size, + uint32_t index DEFAULT(0)); +u_int32_t MP4GetMetadataCoverArtCount(MP4FileHandle hFile); +bool MP4DeleteMetadataCoverArt(MP4FileHandle hFile); +bool MP4SetMetadataAlbumArtist(MP4FileHandle hFile, const char* value); +bool MP4GetMetadataAlbumArtist(MP4FileHandle hFile, char** value); +bool MP4DeleteMetadataAlbumArtist(MP4FileHandle hFile); + + +bool MP4SetMetadataFreeForm(MP4FileHandle hFile, const char *name, + const u_int8_t* pValue, u_int32_t valueSize, const char *owner DEFAULT(NULL)); +bool MP4GetMetadataFreeForm(MP4FileHandle hFile, const char *name, + u_int8_t** pValue, u_int32_t* valueSize, const char *owner DEFAULT(NULL)); +bool MP4DeleteMetadataFreeForm(MP4FileHandle hFile, const char *name, const char *owner DEFAULT(NULL)); /* time conversion utilties */ @@ -1136,6 +1283,13 @@ const u_int8_t* pData, u_int32_t dataSize); +uint8_t *Base64ToBinary(const char *pData, + uint32_t decodeSize, + uint32_t *pDataSize); +void MP4Free(void *p); + + void MP4SetLibFunc(lib_message_func_t libfunc); + #ifdef __cplusplus } #endif diff -Nru faac-1.26/common/mp4v2/mp4info.cpp faac-1.28/common/mp4v2/mp4info.cpp --- faac-1.26/common/mp4v2/mp4info.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/mp4info.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -36,7 +36,7 @@ "MPEG-4 AAC LC", "MPEG-4 AAC SSR", "MPEG-4 AAC LTP", - NULL, + "MPEG-4 AAC HE", "MPEG-4 AAC Scalable", "MPEG-4 TwinVQ", "MPEG-4 CELP", @@ -58,9 +58,20 @@ "MPEG-4 ER HVXC", "MPEG-4 ER HILN", "MPEG-4 ER Parametric", + "MPEG-4 SSC", + "MPEG-4 PS", + "MPEG-4 MPEG Surround", + NULL, + "MPEG-4 Layer-1", + "MPEG-4 Layer-2", + "MPEG-4 Layer-3", + "MPEG-4 DST", + "MPEG-4 Audio Lossless", + "MPEG-4 SLS", + "MPEG-4 SLS non-core", }; - static u_int8_t mpegAudioTypes[] = { + static const u_int8_t mpegAudioTypes[] = { MP4_MPEG2_AAC_MAIN_AUDIO_TYPE, // 0x66 MP4_MPEG2_AAC_LC_AUDIO_TYPE, // 0x67 MP4_MPEG2_AAC_SSR_AUDIO_TYPE, // 0x68 @@ -88,61 +99,58 @@ "G.723.1", "PCM16 (big endian)", }; - static u_int8_t numMpegAudioTypes = + u_int8_t numMpegAudioTypes = sizeof(mpegAudioTypes) / sizeof(u_int8_t); const char* typeName = "Unknown"; bool foundType = false; - u_int8_t type = MP4GetTrackEsdsObjectTypeId(mp4File, trackId); + u_int8_t type = 0; + const char *media_data_name; - switch (type) { - case MP4_MPEG4_AUDIO_TYPE: { - u_int8_t* pAacConfig = NULL; - u_int32_t aacConfigLength; - - MP4GetTrackESConfiguration(mp4File, - trackId, - &pAacConfig, - &aacConfigLength); - - if (pAacConfig != NULL && aacConfigLength >= 2) { - type = (pAacConfig[0] >> 3) & 0x1f; - if (type == 0 || type == 5 || type == 10 || type == 11 || - type == 18 || type >= 28) { - typeName = "MPEG-4 Unknown Profile"; - } else { - typeName = mpeg4AudioNames[type - 1]; - foundType = true; - } - free(pAacConfig); - } else { - typeName = "MPEG-4 (no GAConfig)"; - foundType = true; - } - break; - } - case MP4_INVALID_AUDIO_TYPE: - // type not found - // try with 3gpp codecs - if (MP4HaveTrackIntegerProperty(mp4File, trackId, - "mdia.minf.stbl.stsd.samr.damr.vendor")) { + media_data_name = MP4GetTrackMediaDataName(mp4File, trackId); + + if (media_data_name == NULL) { + typeName = "Unknown - no media data name"; + } else if (strcasecmp(media_data_name, "samr") == 0) { typeName = "AMR"; foundType = true; - } else if (MP4HaveTrackIntegerProperty(mp4File, trackId, - "mdia.minf.stbl.stsd.sawb.damr.vendor")) { + } else if (strcasecmp(media_data_name, "sawb") == 0) { typeName = "AMR-WB"; foundType = true; - } - break; - // fall through - default: - for (u_int8_t i = 0; i < numMpegAudioTypes; i++) { - if (type == mpegAudioTypes[i]) { - typeName = mpegAudioNames[i]; + } else if (strcasecmp(media_data_name, "mp4a") == 0) { + + type = MP4GetTrackEsdsObjectTypeId(mp4File, trackId); + switch (type) { + case MP4_INVALID_AUDIO_TYPE: + typeName = "AAC from .mov"; + foundType = true; + break; + case MP4_MPEG4_AUDIO_TYPE: { + + type = MP4GetTrackAudioMpeg4Type(mp4File, trackId); + if (type == MP4_MPEG4_INVALID_AUDIO_TYPE || + type > NUM_ELEMENTS_IN_ARRAY(mpeg4AudioNames) || + mpeg4AudioNames[type - 1] == NULL) { + typeName = "MPEG-4 Unknown Profile"; + } else { + typeName = mpeg4AudioNames[type - 1]; foundType = true; - break; + } + break; + } + // fall through + default: + for (u_int8_t i = 0; i < numMpegAudioTypes; i++) { + if (type == mpegAudioTypes[i]) { + typeName = mpegAudioNames[i]; + foundType = true; + break; + } } } + } else { + typeName = media_data_name; + foundType = true; } u_int32_t timeScale = @@ -162,7 +170,7 @@ // type duration avgBitrate samplingFrequency if (foundType) - sprintf(sInfo, + snprintf(sInfo, 256, "%u\taudio\t%s%s, %.3f secs, %u kbps, %u Hz\n", trackId, MP4IsIsmaCrypMediaTrack(mp4File, trackId) ? "enca - " : "", @@ -171,7 +179,7 @@ (avgBitRate + 500) / 1000, timeScale); else - sprintf(sInfo, + snprintf(sInfo, 256, "%u\taudio\t%s%s(%u), %.3f secs, %u kbps, %u Hz\n", trackId, MP4IsIsmaCrypMediaTrack(mp4File, trackId) ? "enca - " : "", @@ -183,7 +191,7 @@ return sInfo; } -static struct { +static const struct { uint8_t profile; const char *name; } VisualProfileToName[] = { @@ -263,7 +271,7 @@ MP4TrackId trackId) { - static u_int8_t mpegVideoTypes[] = { + static const u_int8_t mpegVideoTypes[] = { MP4_MPEG2_SIMPLE_VIDEO_TYPE, // 0x60 MP4_MPEG2_MAIN_VIDEO_TYPE, // 0x61 MP4_MPEG2_SNR_VIDEO_TYPE, // 0x62 @@ -273,7 +281,6 @@ MP4_MPEG1_VIDEO_TYPE, // 0x6A MP4_JPEG_VIDEO_TYPE, // 0x6C MP4_YUV12_VIDEO_TYPE, - MP4_H264_VIDEO_TYPE, MP4_H263_VIDEO_TYPE, MP4_H261_VIDEO_TYPE, }; @@ -287,41 +294,112 @@ "MPEG-1", "JPEG", "YUV12", - "H.264", "H.263", "H.261", }; - static u_int8_t numMpegVideoTypes = + u_int8_t numMpegVideoTypes = sizeof(mpegVideoTypes) / sizeof(u_int8_t); bool foundTypeName = false; const char* typeName = "Unknown"; - u_int8_t type = MP4GetTrackEsdsObjectTypeId(mp4File, trackId); - - if ( type == MP4_INVALID_VIDEO_TYPE ) { - // type not found - // try with 3gpp codecs - if (MP4HaveTrackIntegerProperty(mp4File, trackId, "mdia.minf.stbl.stsd.s263.d263.vendor")) { - type = MP4_H263_VIDEO_TYPE; - } - } - - if (type == MP4_MPEG4_VIDEO_TYPE) { - type = MP4GetVideoProfileLevel(mp4File); - typeName = Mpeg4VisualProfileName(type); - if (typeName == NULL) { - typeName = "MPEG-4 Unknown Profile"; - } else { - foundTypeName = true; - } - } else { - for (u_int8_t i = 0; i < numMpegVideoTypes; i++) { - if (type == mpegVideoTypes[i]) { - typeName = mpegVideoNames[i]; - foundTypeName = true; + const char *media_data_name; + char originalFormat[8]; + char oformatbuffer[32]; + originalFormat[0] = 0; + *oformatbuffer = 0; + uint8_t type = 0; + + media_data_name = MP4GetTrackMediaDataName(mp4File, trackId); + // encv 264b + if (strcasecmp(media_data_name, "encv") == 0) { + if (MP4GetTrackMediaDataOriginalFormat(mp4File, + trackId, + originalFormat, + sizeof(originalFormat)) == false) + media_data_name = NULL; + + } + + char typebuffer[80]; + if (media_data_name == NULL) { + typeName = "Unknown - no media data name"; + foundTypeName = true; + } else if ((strcasecmp(media_data_name, "avc1") == 0) || + (strcasecmp(originalFormat, "264b") == 0)) { + // avc + uint8_t profile, level; + char profileb[20], levelb[20]; + if (MP4GetTrackH264ProfileLevel(mp4File, trackId, + &profile, &level)) { + if (profile == 66) { + strcpy(profileb, "Baseline"); + } else if (profile == 77) { + strcpy(profileb, "Main"); + } else if (profile == 88) { + strcpy(profileb, "Extended"); + } else if (profile == 100) { + strcpy(profileb, "High"); + } else if (profile == 110) { + strcpy(profileb, "High 10"); + } else if (profile == 122) { + strcpy(profileb, "High 4:2:2"); + } else if (profile == 144) { + strcpy(profileb, "High 4:4:4"); + } else { + snprintf(profileb, 20, "Unknown Profile %x", profile); + } + switch (level) { + case 10: case 20: case 30: case 40: case 50: + snprintf(levelb, 20, "%u", level / 10); + break; + case 11: case 12: case 13: + case 21: case 22: + case 31: case 32: + case 41: case 42: + case 51: + snprintf(levelb, 20, "%u.%u", level / 10, level % 10); + break; + default: + snprintf(levelb, 20, "unknown level %x", level); break; } + if (originalFormat != NULL && originalFormat[0] != '\0') + snprintf(oformatbuffer, 32, "(%s) ", originalFormat); + snprintf(typebuffer, sizeof(typebuffer), "H264 %s%s@%s", + oformatbuffer, profileb, levelb); + typeName = typebuffer; + } else { + typeName = "H.264 - profile/level error"; } + foundTypeName = true; + } else if (strcasecmp(media_data_name, "s263") == 0) { + // 3gp h.263 + typeName = "H.263"; + foundTypeName = true; + } else if ((strcasecmp(media_data_name, "mp4v") == 0) || + (strcasecmp(media_data_name, "encv") == 0)) { + // note encv might needs it's own field eventually. + type = MP4GetTrackEsdsObjectTypeId(mp4File, trackId); + if (type == MP4_MPEG4_VIDEO_TYPE) { + type = MP4GetVideoProfileLevel(mp4File, trackId); + typeName = Mpeg4VisualProfileName(type); + if (typeName == NULL) { + typeName = "MPEG-4 Unknown Profile"; + } else { + foundTypeName = true; + } + } else { + for (u_int8_t i = 0; i < numMpegVideoTypes; i++) { + if (type == mpegVideoTypes[i]) { + typeName = mpegVideoNames[i]; + foundTypeName = true; + break; + } + } + } + } else { + typeName = media_data_name; + foundTypeName = true; // we don't have a type value to display } MP4Duration trackDuration = @@ -340,14 +418,14 @@ u_int16_t height = MP4GetTrackVideoHeight(mp4File, trackId); - float fps = MP4GetTrackVideoFrameRate(mp4File, trackId); + double fps = MP4GetTrackVideoFrameRate(mp4File, trackId); char *sInfo = (char*)MP4Malloc(256); // type duration avgBitrate frameSize frameRate if (foundTypeName) { sprintf(sInfo, - "%u\tvideo\t%s%s, %.3f secs, %u kbps, %ux%u @ %.2f fps\n", + "%u\tvideo\t%s%s, %.3f secs, %u kbps, %ux%u @ %f fps\n", trackId, MP4IsIsmaCrypMediaTrack(mp4File, trackId) ? "encv - " : "", typeName, @@ -359,7 +437,7 @@ ); } else { sprintf(sInfo, - "%u\tvideo\t%s(%u), %.3f secs, %u kbps, %ux%u @ %.2f fps\n", + "%u\tvideo\t%s(%u), %.3f secs, %u kbps, %ux%u @ %f fps\n", trackId, typeName, type, @@ -373,7 +451,38 @@ return sInfo; } +static char* PrintCntlInfo( + MP4FileHandle mp4File, + MP4TrackId trackId) +{ + const char *media_data_name = MP4GetTrackMediaDataName(mp4File, trackId); + const char *typeName = "Unknown"; + + if (media_data_name == NULL) { + typeName = "Unknown - no media data name"; + } else if (strcasecmp(media_data_name, "href") == 0) { + typeName = "ISMA Href"; + } else { + typeName = media_data_name; + } + + MP4Duration trackDuration = + MP4GetTrackDuration(mp4File, trackId); + + double msDuration = + UINT64_TO_DOUBLE(MP4ConvertFromTrackDuration(mp4File, trackId, + trackDuration, MP4_MSECS_TIME_SCALE)); + char *sInfo = (char *)MP4Malloc(256); + + snprintf(sInfo, 256, + "%u\tcontrol\t%s, %.3f secs\n", + trackId, + typeName, + msDuration / 1000.0); + return sInfo; +} + static char* PrintHintInfo( MP4FileHandle mp4File, MP4TrackId trackId) @@ -382,11 +491,12 @@ MP4GetHintTrackReferenceTrackId(mp4File, trackId); char* payloadName = NULL; - MP4GetHintTrackRtpPayload(mp4File, trackId, &payloadName); + if (!MP4GetHintTrackRtpPayload(mp4File, trackId, &payloadName)) + return NULL; char *sInfo = (char*)MP4Malloc(256); - sprintf(sInfo, + snprintf(sInfo, 256, "%u\thint\tPayload %s for track %u\n", trackId, payloadName, @@ -405,6 +515,7 @@ const char* trackType = MP4GetTrackType(mp4File, trackId); + if (trackType == NULL) return NULL; if (!strcmp(trackType, MP4_AUDIO_TRACK_TYPE)) { trackInfo = PrintAudioInfo(mp4File, trackId); @@ -412,18 +523,20 @@ trackInfo = PrintVideoInfo(mp4File, trackId); } else if (!strcmp(trackType, MP4_HINT_TRACK_TYPE)) { trackInfo = PrintHintInfo(mp4File, trackId); + } else if (strcmp(trackType, MP4_CNTL_TRACK_TYPE) == 0) { + trackInfo = PrintCntlInfo(mp4File, trackId); } else { trackInfo = (char*)MP4Malloc(256); if (!strcmp(trackType, MP4_OD_TRACK_TYPE)) { - sprintf(trackInfo, + snprintf(trackInfo, 256, "%u\tod\tObject Descriptors\n", trackId); } else if (!strcmp(trackType, MP4_SCENE_TRACK_TYPE)) { - sprintf(trackInfo, + snprintf(trackInfo, 256, "%u\tscene\tBIFS\n", trackId); } else { - sprintf(trackInfo, + snprintf(trackInfo, 256, "%u\t%s\n", trackId, trackType); } @@ -441,16 +554,21 @@ if (MP4_IS_VALID_FILE_HANDLE(mp4File)) { try { if (trackId == MP4_INVALID_TRACK_ID) { - info = (char*)MP4Calloc(4*1024); + uint buflen = 4 * 1024; + info = (char*)MP4Calloc(buflen); - sprintf(info, "Track\tType\tInfo\n"); + buflen -= snprintf(info, buflen, + "Track\tType\tInfo\n"); u_int32_t numTracks = MP4GetNumberOfTracks(mp4File); for (u_int32_t i = 0; i < numTracks; i++) { trackId = MP4FindTrackId(mp4File, i); char* trackInfo = PrintTrackInfo(mp4File, trackId); - strcat(info, trackInfo); + strncat(info, trackInfo, buflen); + uint newlen = strlen(trackInfo); + if (newlen > buflen) buflen = 0; + else buflen -= newlen; MP4Free(trackInfo); } } else { diff -Nru faac-1.26/common/mp4v2/mp4meta.cpp faac-1.28/common/mp4v2/mp4meta.cpp --- faac-1.26/common/mp4v2/mp4meta.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/mp4meta.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -23,965 +23,958 @@ /** - The iTunes tagging seems to support any tag field name - but there are some predefined fields, also known from the QuickTime format + The iTunes tagging seems to support any tag field name + but there are some predefined fields, also known from the QuickTime format - predefined fields (the ones I know of until now): - - ©nam : Name of the song/movie (string) - - ©ART : Name of the artist/performer (string) - - ©wrt : Name of the writer (string) - - ©alb : Name of the album (string) - - ©day : Year (4 bytes, e.g. "2003") (string) - - ©too : Tool(s) used to create the file (string) - - ©cmt : Comment (string) - - ©gen : Custom genre (string) - - trkn : Tracknumber (8 byte string) - 16 bit: empty - 16 bit: tracknumber - 16 bit: total tracks on album - 16 bit: empty - - disk : Disknumber (8 byte string) - 16 bit: empty - 16 bit: disknumber - 16 bit: total number of disks - 16 bit: empty - - gnre : Genre (16 bit genre) (ID3v1 index + 1) - - cpil : Part of a compilation (1 byte, 1 or 0) - - tmpo : Tempo in BPM (16 bit) - - covr : Cover art (xx bytes binary data) - - ---- : Free form metadata, can have any name and any data + predefined fields (the ones I know of until now): + - ©nam : Name of the song/movie (string) + - ©ART : Name of the artist/performer (string) + - aART : Album artist + - ©wrt : Name of the writer (string) + - ©alb : Name of the album (string) + - ©day : Year (4 bytes, e.g. "2003") (string) + - ©too : Tool(s) used to create the file (string) + - ©cmt : Comment (string) + - ©gen : Custom genre (string) + - ©grp : Grouping (string) + - trkn : Tracknumber (8 byte string) + 16 bit: empty + 16 bit: tracknumber + 16 bit: total tracks on album + 16 bit: empty + - disk : Disknumber (8 byte string) + 16 bit: empty + 16 bit: disknumber + 16 bit: total number of disks + 16 bit: empty + - gnre : Genre (16 bit genre) (ID3v1 index + 1) + - cpil : Part of a compilation (1 byte, 1 or 0) + - tmpo : Tempo in BPM (16 bit) + - covr : Cover art (xx bytes binary data) + - ---- : Free form metadata, can have any name and any data + - pgap : gapless - 8 bit boolean + + - apID : purchaser name. + - cprt : copyright + - purd : purchase date. **/ #include "mp4common.h" bool MP4File::GetMetadataByIndex(u_int32_t index, - const char** ppName, + char** ppName, u_int8_t** ppValue, u_int32_t* pValueSize) { - char s[256]; + char s[256]; - sprintf(s, "moov.udta.meta.ilst.*[%u].data.metadata", index); - GetBytesProperty(s, ppValue, pValueSize); + snprintf(s, 256, "moov.udta.meta.ilst.*[%u].data.metadata", index); + GetBytesProperty(s, ppValue, pValueSize); - sprintf(s, "moov.udta.meta.ilst.*[%u]", index); - MP4Atom* pParent = m_pRootAtom->FindAtom(s); - *ppName = pParent->GetType(); - - /* check for free form tagfield */ - if (memcmp(*ppName, "----", 4) == 0) - { - u_int8_t* pV; - u_int32_t VSize = 0; - char *pN; - - sprintf(s, "moov.udta.meta.ilst.*[%u].name.metadata", index); - GetBytesProperty(s, &pV, &VSize); - - pN = (char*)malloc((VSize+1)*sizeof(char)); - memset(pN, 0, (VSize+1)*sizeof(char)); - memcpy(pN, pV, VSize*sizeof(char)); - - *ppName = pN; - } + snprintf(s, 256, "moov.udta.meta.ilst.*[%u]", index); + MP4Atom* pParent = m_pRootAtom->FindAtom(s); + if (pParent == NULL) return false; + + /* check for free form tagfield */ + if (memcmp(*ppName, "----", 4) == 0) + { + u_int8_t* pV; + u_int32_t VSize = 0; + char *pN; + + snprintf(s, 256, "moov.udta.meta.ilst.*[%u].name.metadata", index); + GetBytesProperty(s, &pV, &VSize); + + pN = (char*)malloc((VSize+1)*sizeof(char)); + if (pN != NULL) { + memset(pN, 0, (VSize+1)*sizeof(char)); + memcpy(pN, pV, VSize*sizeof(char)); + } + free(pV); + *ppName = pN; + } else { + *ppName = strdup(pParent->GetType()); + } - return true; + return true; } bool MP4File::CreateMetadataAtom(const char* name) { - char s[256]; - char t[256]; + char s[256]; + char t[256]; - sprintf(t, "udta.meta.ilst.%s.data", name); - sprintf(s, "moov.udta.meta.ilst.%s.data", name); - AddDescendantAtoms("moov", t); - MP4Atom *pMetaAtom = m_pRootAtom->FindAtom(s); + snprintf(t, 256, "udta.meta.ilst.%s.data", name); + snprintf(s, 256, "moov.udta.meta.ilst.%s.data", name); + (void)AddDescendantAtoms("moov", t); + MP4Atom *pMetaAtom = m_pRootAtom->FindAtom(s); - if (!pMetaAtom) - return false; + if (!pMetaAtom) + return false; - /* some fields need special flags set */ - if ((uint8_t)name[0] == 0251) + /* some fields need special flags set */ + if ((uint8_t)name[0] == 0251 || ATOMID(name) == ATOMID("aART")) { - pMetaAtom->SetFlags(0x1); + pMetaAtom->SetFlags(0x1); } else if ((memcmp(name, "cpil", 4) == 0) || (memcmp(name, "tmpo", 4) == 0)) { - pMetaAtom->SetFlags(0x15); - } + pMetaAtom->SetFlags(0x15); + } - MP4Atom *pHdlrAtom = m_pRootAtom->FindAtom("moov.udta.meta.hdlr"); - MP4StringProperty *pStringProperty = NULL; - MP4BytesProperty *pBytesProperty = NULL; - ASSERT(pHdlrAtom); - - pHdlrAtom->FindProperty( - "hdlr.handlerType", (MP4Property**)&pStringProperty); - ASSERT(pStringProperty); - pStringProperty->SetValue("mdir"); - - u_int8_t val[12]; - memset(val, 0, 12*sizeof(u_int8_t)); - val[0] = 0x61; - val[1] = 0x70; - val[2] = 0x70; - val[3] = 0x6c; - pHdlrAtom->FindProperty( - "hdlr.reserved2", (MP4Property**)&pBytesProperty); - ASSERT(pBytesProperty); - pBytesProperty->SetReadOnly(false); - pBytesProperty->SetValue(val, 12); - pBytesProperty->SetReadOnly(true); + MP4Atom *pHdlrAtom = m_pRootAtom->FindAtom("moov.udta.meta.hdlr"); + MP4StringProperty *pStringProperty = NULL; + MP4BytesProperty *pBytesProperty = NULL; + ASSERT(pHdlrAtom); - return true; -} + ASSERT(pHdlrAtom->FindProperty("hdlr.handlerType", + (MP4Property**)&pStringProperty)); + ASSERT(pStringProperty); + pStringProperty->SetValue("mdir"); -bool MP4File::SetMetadataName(const char* value) -{ - const char *s = "moov.udta.meta.ilst.\251nam.data"; - MP4BytesProperty *pMetadataProperty = NULL; - MP4Atom *pMetaAtom = NULL; - - pMetaAtom = m_pRootAtom->FindAtom(s); + u_int8_t val[12]; + memset(val, 0, 12*sizeof(u_int8_t)); + val[0] = 0x61; + val[1] = 0x70; + val[2] = 0x70; + val[3] = 0x6c; + ASSERT(pHdlrAtom->FindProperty("hdlr.reserved2", + (MP4Property**)&pBytesProperty)); + ASSERT(pBytesProperty); + pBytesProperty->SetReadOnly(false); + pBytesProperty->SetValue(val, 12); + pBytesProperty->SetReadOnly(true); - if (!pMetaAtom) - { - if (!CreateMetadataAtom("\251nam")) - return false; - - pMetaAtom = m_pRootAtom->FindAtom(s); - } - - pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); - ASSERT(pMetadataProperty); - - pMetadataProperty->SetValue((u_int8_t*)value, strlen(value)); - - return true; + return true; } -bool MP4File::GetMetadataName(char** value) +bool MP4File::DeleteMetadataAtom(const char* name, bool try_udta) { - unsigned char *val = NULL; - u_int32_t valSize = 0; - const char *s = "moov.udta.meta.ilst.\251nam.data.metadata"; - GetBytesProperty(s, (u_int8_t**)&val, &valSize); + MP4Atom *pMetaAtom = NULL; + char s[256]; - if (valSize > 0) - { - *value = (char*)malloc((valSize+1)*sizeof(unsigned char)); - memset(*value, 0, (valSize+1)*sizeof(unsigned char)); - memcpy(*value, val, valSize*sizeof(unsigned char)); - return true; - } else { - *value = NULL; - return false; - } -} + snprintf(s, 256, "moov.udta.meta.ilst.%s", name); + pMetaAtom = m_pRootAtom->FindAtom(s); -bool MP4File::SetMetadataWriter(const char* value) -{ - const char *s = "moov.udta.meta.ilst.\251wrt.data"; - MP4BytesProperty *pMetadataProperty = NULL; - MP4Atom *pMetaAtom = NULL; - + if (pMetaAtom == NULL && try_udta) { + snprintf(s, 256, "moov.udta.%s", name); pMetaAtom = m_pRootAtom->FindAtom(s); - - if (!pMetaAtom) + } + /* if it exists, delete it */ + if (pMetaAtom) { - if (!CreateMetadataAtom("\251wrt")) - return false; - - pMetaAtom = m_pRootAtom->FindAtom(s); - } - - pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); - ASSERT(pMetadataProperty); + MP4Atom *pParent = pMetaAtom->GetParentAtom(); - pMetadataProperty->SetValue((u_int8_t*)value, strlen(value)); - - return true; -} + pParent->DeleteChildAtom(pMetaAtom); -bool MP4File::GetMetadataWriter(char** value) -{ - unsigned char *val = NULL; - u_int32_t valSize = 0; - const char *s = "moov.udta.meta.ilst.\251wrt.data.metadata"; - GetBytesProperty(s, (u_int8_t**)&val, &valSize); + delete pMetaAtom; - if (valSize > 0) - { - *value = (char*)malloc((valSize+1)*sizeof(unsigned char)); - memset(*value, 0, (valSize+1)*sizeof(unsigned char)); - memcpy(*value, val, valSize*sizeof(unsigned char)); - return true; - } else { - *value = NULL; - return false; + return true; } -} - -bool MP4File::SetMetadataAlbum(const char* value) -{ - const char *s = "moov.udta.meta.ilst.\251alb.data"; - MP4BytesProperty *pMetadataProperty = NULL; - MP4Atom *pMetaAtom = NULL; - - pMetaAtom = m_pRootAtom->FindAtom(s); - - if (!pMetaAtom) - { - if (!CreateMetadataAtom("\251alb")) - return false; - pMetaAtom = m_pRootAtom->FindAtom(s); - } - - pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); - ASSERT(pMetadataProperty); - - pMetadataProperty->SetValue((u_int8_t*)value, strlen(value)); - - return true; + return false; } -bool MP4File::GetMetadataAlbum(char** value) +bool MP4File::SetMetadataString (const char *atom, const char *value) { - unsigned char *val = NULL; - u_int32_t valSize = 0; - const char *s = "moov.udta.meta.ilst.\251alb.data.metadata"; - GetBytesProperty(s, (u_int8_t**)&val, &valSize); + char atomstring[40]; + MP4Atom *pMetaAtom; + MP4BytesProperty *pMetadataProperty = NULL; + snprintf(atomstring, 40, "moov.udta.meta.ilst.%s.data", atom); - if (valSize > 0) - { - *value = (char*)malloc((valSize+1)*sizeof(unsigned char)); - memset(*value, 0, (valSize+1)*sizeof(unsigned char)); - memcpy(*value, val, valSize*sizeof(unsigned char)); - return true; - } else { - *value = NULL; - return false; - } -} - -bool MP4File::SetMetadataArtist(const char* value) -{ - const char *s = "moov.udta.meta.ilst.\251ART.data"; - MP4BytesProperty *pMetadataProperty = NULL; - MP4Atom *pMetaAtom = NULL; - - pMetaAtom = m_pRootAtom->FindAtom(s); - - if (!pMetaAtom) + pMetaAtom = m_pRootAtom->FindAtom(atomstring); + + if (!pMetaAtom) { - if (!CreateMetadataAtom("\251ART")) - return false; - - pMetaAtom = m_pRootAtom->FindAtom(s); + if (!CreateMetadataAtom(atom)) + return false; + + pMetaAtom = m_pRootAtom->FindAtom(atomstring); + if (pMetaAtom == NULL) return false; } - pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); - ASSERT(pMetadataProperty); - - pMetadataProperty->SetValue((u_int8_t*)value, strlen(value)); - - return true; + ASSERT(pMetaAtom->FindProperty("data.metadata", + (MP4Property**)&pMetadataProperty)); + ASSERT(pMetadataProperty); + + pMetadataProperty->SetValue((u_int8_t*)value, strlen(value)); + + return true; } -bool MP4File::GetMetadataArtist(char** value) +bool MP4File::GetMetadataString (const char *atom, char **value, bool try_udta) { - unsigned char *val = NULL; - u_int32_t valSize = 0; - const char *s = "moov.udta.meta.ilst.\251ART.data.metadata"; - GetBytesProperty(s, (u_int8_t**)&val, &valSize); + unsigned char *val = NULL; + u_int32_t valSize = 0; + char atomstring[60]; + snprintf(atomstring, 60, "moov.udta.meta.ilst.%s.data.metadata", atom); - if (valSize > 0) - { - *value = (char*)malloc((valSize+1)*sizeof(unsigned char)); - memset(*value, 0, (valSize+1)*sizeof(unsigned char)); - memcpy(*value, val, valSize*sizeof(unsigned char)); - return true; - } else { - *value = NULL; - return false; + *value = NULL; + if (try_udta == false) { + GetBytesProperty(atomstring, (u_int8_t**)&val, &valSize); + } else { + bool got_it = false; + try { + GetBytesProperty(atomstring, (u_int8_t**)&val, &valSize); + got_it = true; } -} - -bool MP4File::SetMetadataTool(const char* value) -{ - const char *s = "moov.udta.meta.ilst.\251too.data"; - MP4BytesProperty *pMetadataProperty = NULL; - MP4Atom *pMetaAtom = NULL; - - pMetaAtom = m_pRootAtom->FindAtom(s); - - if (!pMetaAtom) - { - if (!CreateMetadataAtom("\251too")) - return false; - - pMetaAtom = m_pRootAtom->FindAtom(s); + catch (MP4Error* e) { + delete e; } - - pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); - ASSERT(pMetadataProperty); - - pMetadataProperty->SetValue((u_int8_t*)value, strlen(value)); - - return true; -} - -bool MP4File::GetMetadataTool(char** value) -{ - unsigned char *val = NULL; - u_int32_t valSize = 0; - const char *s = "moov.udta.meta.ilst.\251too.data.metadata"; - GetBytesProperty(s, (u_int8_t**)&val, &valSize); - - if (valSize > 0) - { - *value = (char*)malloc((valSize+1)*sizeof(unsigned char)); - memset(*value, 0, (valSize+1)*sizeof(unsigned char)); - memcpy(*value, val, valSize*sizeof(unsigned char)); - return true; - } else { - *value = NULL; - return false; + if (got_it == false) { + snprintf(atomstring, 60, "moov.udta.%s.metadata", atom); + GetBytesProperty(atomstring, (u_int8_t**)&val, &valSize); } -} - -bool MP4File::SetMetadataComment(const char* value) -{ - const char *s = "moov.udta.meta.ilst.\251cmt.data"; - MP4BytesProperty *pMetadataProperty = NULL; - MP4Atom *pMetaAtom = NULL; - - pMetaAtom = m_pRootAtom->FindAtom(s); - - if (!pMetaAtom) + } + if (valSize > 0) { - if (!CreateMetadataAtom("\251cmt")) - return false; - - pMetaAtom = m_pRootAtom->FindAtom(s); - } - - pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); - ASSERT(pMetadataProperty); - - pMetadataProperty->SetValue((u_int8_t*)value, strlen(value)); - - return true; -} - -bool MP4File::GetMetadataComment(char** value) -{ - unsigned char *val = NULL; - u_int32_t valSize = 0; - const char *s = "moov.udta.meta.ilst.\251cmt.data.metadata"; - GetBytesProperty(s, (u_int8_t**)&val, &valSize); - - if (valSize > 0) - { - *value = (char*)malloc((valSize+1)*sizeof(unsigned char)); - memset(*value, 0, (valSize+1)*sizeof(unsigned char)); - memcpy(*value, val, valSize*sizeof(unsigned char)); - return true; - } else { - *value = NULL; - return false; - } -} - -bool MP4File::SetMetadataYear(const char* value) -{ - const char *s = "moov.udta.meta.ilst.\251day.data"; - MP4BytesProperty *pMetadataProperty = NULL; - MP4Atom *pMetaAtom = NULL; - - pMetaAtom = m_pRootAtom->FindAtom(s); - - if (!pMetaAtom) - { - if (!CreateMetadataAtom("\251day")) - return false; - - pMetaAtom = m_pRootAtom->FindAtom(s); - } - - pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); - ASSERT(pMetadataProperty); - - if (strlen(value) < 4) - return false; - - pMetadataProperty->SetValue((u_int8_t*)value, 4); - - return true; -} - -bool MP4File::GetMetadataYear(char** value) -{ - unsigned char *val = NULL; - u_int32_t valSize = 0; - const char *s = "moov.udta.meta.ilst.\251day.data.metadata"; - GetBytesProperty(s, (u_int8_t**)&val, &valSize); - - if (valSize > 0) - { - *value = (char*)malloc((valSize+1)*sizeof(unsigned char)); - memset(*value, 0, (valSize+1)*sizeof(unsigned char)); - memcpy(*value, val, valSize*sizeof(unsigned char)); - return true; - } else { - *value = NULL; - return false; - } + *value = (char*)malloc((valSize+1)*sizeof(char)); + if (*value == NULL) { + free(val); + return false; + } + memcpy(*value, val, valSize*sizeof(unsigned char)); + free(val); + (*value)[valSize] = '\0'; + return true; + } + return false; } bool MP4File::SetMetadataTrack(u_int16_t track, u_int16_t totalTracks) { - unsigned char t[9]; - const char *s = "moov.udta.meta.ilst.trkn.data"; - MP4BytesProperty *pMetadataProperty = NULL; - MP4Atom *pMetaAtom = NULL; + unsigned char t[9]; + const char *s = "moov.udta.meta.ilst.trkn.data"; + MP4BytesProperty *pMetadataProperty = NULL; + MP4Atom *pMetaAtom = NULL; - pMetaAtom = m_pRootAtom->FindAtom(s); + pMetaAtom = m_pRootAtom->FindAtom(s); - if (!pMetaAtom) + if (!pMetaAtom) { - if (!CreateMetadataAtom("trkn")) - return false; + if (!CreateMetadataAtom("trkn")) + return false; - pMetaAtom = m_pRootAtom->FindAtom(s); + pMetaAtom = m_pRootAtom->FindAtom(s); + if (pMetaAtom == NULL) return false; } - memset(t, 0, 9*sizeof(unsigned char)); - t[2] = (unsigned char)(track>>8)&0xFF; - t[3] = (unsigned char)(track)&0xFF; - t[4] = (unsigned char)(totalTracks>>8)&0xFF; - t[5] = (unsigned char)(totalTracks)&0xFF; + memset(t, 0, 9*sizeof(unsigned char)); + t[2] = (unsigned char)(track>>8)&0xFF; + t[3] = (unsigned char)(track)&0xFF; + t[4] = (unsigned char)(totalTracks>>8)&0xFF; + t[5] = (unsigned char)(totalTracks)&0xFF; - pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); - ASSERT(pMetadataProperty); + ASSERT(pMetaAtom->FindProperty("data.metadata", + (MP4Property**)&pMetadataProperty)); + ASSERT(pMetadataProperty); - pMetadataProperty->SetValue((u_int8_t*)t, 8); + pMetadataProperty->SetValue((u_int8_t*)t, 8); - return true; + return true; } bool MP4File::GetMetadataTrack(u_int16_t* track, u_int16_t* totalTracks) { - unsigned char *val = NULL; - u_int32_t valSize = 0; - const char *s = "moov.udta.meta.ilst.trkn.data.metadata"; - GetBytesProperty(s, (u_int8_t**)&val, &valSize); + unsigned char *val = NULL; + u_int32_t valSize = 0; + const char *s = "moov.udta.meta.ilst.trkn.data.metadata"; - *track = 0; - *totalTracks = 0; + *track = 0; + *totalTracks = 0; - if (valSize != 8) - return false; + GetBytesProperty(s, (u_int8_t**)&val, &valSize); + if (valSize == 8) { *track = (u_int16_t)(val[3]); *track += (u_int16_t)(val[2]<<8); *totalTracks = (u_int16_t)(val[5]); *totalTracks += (u_int16_t)(val[4]<<8); - + CHECK_AND_FREE(val); return true; + } + CHECK_AND_FREE(val); + return false; } bool MP4File::SetMetadataDisk(u_int16_t disk, u_int16_t totalDisks) { - unsigned char t[9]; - const char *s = "moov.udta.meta.ilst.disk.data"; - MP4BytesProperty *pMetadataProperty = NULL; - MP4Atom *pMetaAtom = NULL; + unsigned char t[7]; + const char *s = "moov.udta.meta.ilst.disk.data"; + MP4BytesProperty *pMetadataProperty = NULL; + MP4Atom *pMetaAtom = NULL; - pMetaAtom = m_pRootAtom->FindAtom(s); + pMetaAtom = m_pRootAtom->FindAtom(s); - if (!pMetaAtom) + if (!pMetaAtom) { - if (!CreateMetadataAtom("disk")) - return false; + if (!CreateMetadataAtom("disk")) + return false; - pMetaAtom = m_pRootAtom->FindAtom(s); + pMetaAtom = m_pRootAtom->FindAtom(s); + if (pMetaAtom == NULL) return false; } - memset(t, 0, 9*sizeof(unsigned char)); - t[2] = (unsigned char)(disk>>8)&0xFF; - t[3] = (unsigned char)(disk)&0xFF; - t[4] = (unsigned char)(totalDisks>>8)&0xFF; - t[5] = (unsigned char)(totalDisks)&0xFF; + memset(t, 0, 7*sizeof(unsigned char)); + t[2] = (unsigned char)(disk>>8)&0xFF; + t[3] = (unsigned char)(disk)&0xFF; + t[4] = (unsigned char)(totalDisks>>8)&0xFF; + t[5] = (unsigned char)(totalDisks)&0xFF; - pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); - ASSERT(pMetadataProperty); + ASSERT(pMetaAtom->FindProperty("data.metadata", + (MP4Property**)&pMetadataProperty)); + ASSERT(pMetadataProperty); - pMetadataProperty->SetValue((u_int8_t*)t, 8); + pMetadataProperty->SetValue((u_int8_t*)t, 6); - return true; + return true; } bool MP4File::GetMetadataDisk(u_int16_t* disk, u_int16_t* totalDisks) { - unsigned char *val = NULL; - u_int32_t valSize = 0; - const char *s = "moov.udta.meta.ilst.disk.data.metadata"; - GetBytesProperty(s, (u_int8_t**)&val, &valSize); + unsigned char *val = NULL; + u_int32_t valSize = 0; + const char *s = "moov.udta.meta.ilst.disk.data.metadata"; - *disk = 0; - *totalDisks = 0; + *disk = 0; + *totalDisks = 0; - if (valSize != 8) - return false; + GetBytesProperty(s, (u_int8_t**)&val, &valSize); + if (valSize == 6 || valSize == 8) { *disk = (u_int16_t)(val[3]); *disk += (u_int16_t)(val[2]<<8); *totalDisks = (u_int16_t)(val[5]); *totalDisks += (u_int16_t)(val[4]<<8); - + free(val); return true; + } + CHECK_AND_FREE(val); + return true; } static const char* ID3v1GenreList[] = { - "Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk", - "Grunge", "Hip-Hop", "Jazz", "Metal", "New Age", "Oldies", - "Other", "Pop", "R&B", "Rap", "Reggae", "Rock", - "Techno", "Industrial", "Alternative", "Ska", "Death Metal", "Pranks", - "Soundtrack", "Euro-Techno", "Ambient", "Trip-Hop", "Vocal", "Jazz+Funk", - "Fusion", "Trance", "Classical", "Instrumental", "Acid", "House", - "Game", "Sound Clip", "Gospel", "Noise", "AlternRock", "Bass", - "Soul", "Punk", "Space", "Meditative", "Instrumental Pop", "Instrumental Rock", - "Ethnic", "Gothic", "Darkwave", "Techno-Industrial", "Electronic", "Pop-Folk", - "Eurodance", "Dream", "Southern Rock", "Comedy", "Cult", "Gangsta", - "Top 40", "Christian Rap", "Pop/Funk", "Jungle", "Native American", "Cabaret", - "New Wave", "Psychadelic", "Rave", "Showtunes", "Trailer", "Lo-Fi", - "Tribal", "Acid Punk", "Acid Jazz", "Polka", "Retro", "Musical", - "Rock & Roll", "Hard Rock", "Folk", "Folk/Rock", "National Folk", "Swing", - "Fast-Fusion", "Bebob", "Latin", "Revival", "Celtic", "Bluegrass", "Avantgarde", - "Gothic Rock", "Progressive Rock", "Psychedelic Rock", "Symphonic Rock", "Slow Rock", "Big Band", - "Chorus", "Easy Listening", "Acoustic", "Humour", "Speech", "Chanson", - "Opera", "Chamber Music", "Sonata", "Symphony", "Booty Bass", "Primus", - "Porn Groove", "Satire", "Slow Jam", "Club", "Tango", "Samba", - "Folklore", "Ballad", "Power Ballad", "Rhythmic Soul", "Freestyle", "Duet", - "Punk Rock", "Drum Solo", "A capella", "Euro-House", "Dance Hall", - "Goa", "Drum & Bass", "Club House", "Hardcore", "Terror", - "Indie", "BritPop", "NegerPunk", "Polsk Punk", "Beat", - "Christian Gangsta", "Heavy Metal", "Black Metal", "Crossover", "Contemporary C", - "Christian Rock", "Merengue", "Salsa", "Thrash Metal", "Anime", "JPop", - "SynthPop", + "Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk", + "Grunge", "Hip-Hop", "Jazz", "Metal", "New Age", "Oldies", + "Other", "Pop", "R&B", "Rap", "Reggae", "Rock", + "Techno", "Industrial", "Alternative", "Ska", "Death Metal", "Pranks", + "Soundtrack", "Euro-Techno", "Ambient", "Trip-Hop", "Vocal", "Jazz+Funk", + "Fusion", "Trance", "Classical", "Instrumental", "Acid", "House", + "Game", "Sound Clip", "Gospel", "Noise", "AlternRock", "Bass", + "Soul", "Punk", "Space", "Meditative", "Instrumental Pop", "Instrumental Rock", + "Ethnic", "Gothic", "Darkwave", "Techno-Industrial", "Electronic", "Pop-Folk", + "Eurodance", "Dream", "Southern Rock", "Comedy", "Cult", "Gangsta", + "Top 40", "Christian Rap", "Pop/Funk", "Jungle", "Native American", "Cabaret", + "New Wave", "Psychadelic", "Rave", "Showtunes", "Trailer", "Lo-Fi", + "Tribal", "Acid Punk", "Acid Jazz", "Polka", "Retro", "Musical", + "Rock & Roll", "Hard Rock", "Folk", "Folk/Rock", "National Folk", "Swing", + "Fast-Fusion", "Bebob", "Latin", "Revival", "Celtic", "Bluegrass", "Avantgarde", + "Gothic Rock", "Progressive Rock", "Psychedelic Rock", "Symphonic Rock", "Slow Rock", "Big Band", + "Chorus", "Easy Listening", "Acoustic", "Humour", "Speech", "Chanson", + "Opera", "Chamber Music", "Sonata", "Symphony", "Booty Bass", "Primus", + "Porn Groove", "Satire", "Slow Jam", "Club", "Tango", "Samba", + "Folklore", "Ballad", "Power Ballad", "Rhythmic Soul", "Freestyle", "Duet", + "Punk Rock", "Drum Solo", "A capella", "Euro-House", "Dance Hall", + "Goa", "Drum & Bass", "Club House", "Hardcore", "Terror", + "Indie", "BritPop", "NegerPunk", "Polsk Punk", "Beat", + "Christian Gangsta", "Heavy Metal", "Black Metal", "Crossover", "Contemporary C", + "Christian Rock", "Merengue", "Salsa", "Thrash Metal", "Anime", "JPop", + "SynthPop", }; -int GenreToString(char** GenreStr, const int genre) +void GenreToString(char** GenreStr, const int genre) { if (genre > 0 && genre <= (int)(sizeof(ID3v1GenreList)/sizeof(*ID3v1GenreList))) { - *GenreStr = (char*)malloc((strlen(ID3v1GenreList[genre-1])+1)*sizeof(char)); - memset(*GenreStr, 0, (strlen(ID3v1GenreList[genre-1])+1)*sizeof(char)); - strcpy(*GenreStr, ID3v1GenreList[genre-1]); - return 0; - } else { - *GenreStr = (char*)malloc(2*sizeof(char)); - memset(*GenreStr, 0, 2*sizeof(char)); - return 1; - } + uint len = strlen(ID3v1GenreList[genre-1])+1; + *GenreStr = (char*)malloc(len); + if (*GenreStr == NULL) return; + // no need for strncpy; enough was malloced + strcpy(*GenreStr, ID3v1GenreList[genre-1]); + return; + } + *GenreStr = (char*)malloc(2*sizeof(char)); + if (*GenreStr == NULL) return; + memset(*GenreStr, 0, 2*sizeof(char)); + return; } int StringToGenre(const char* GenreStr) { - unsigned int i; + unsigned int i; - for (i = 0; i < sizeof(ID3v1GenreList)/sizeof(*ID3v1GenreList); i++) + for (i = 0; i < sizeof(ID3v1GenreList)/sizeof(*ID3v1GenreList); i++) { - if (strcasecmp(GenreStr, ID3v1GenreList[i]) == 0) - return i+1; + if (strcasecmp(GenreStr, ID3v1GenreList[i]) == 0) + return i+1; } - return 0; + return 0; } bool MP4File::SetMetadataGenre(const char* value) { - u_int16_t genreIndex = 0; - unsigned char t[3]; - MP4BytesProperty *pMetadataProperty = NULL; - MP4Atom *pMetaAtom = NULL; - - genreIndex = StringToGenre(value); - - if (genreIndex != 0) + u_int16_t genreIndex = 0; + unsigned char t[3]; + MP4BytesProperty *pMetadataProperty = NULL; + MP4Atom *pMetaAtom = NULL; + + genreIndex = StringToGenre(value); + + const char *s = "moov.udta.meta.ilst.gnre.data"; + const char *sroot = "moov.udta.meta.ilst.gnre"; + const char *s2 = "moov.udta.meta.ilst.\251gen.data"; + const char *s2root = "moov.udta.meta.ilst.\251gen"; + if (genreIndex != 0) { - const char *s = "moov.udta.meta.ilst.gnre.data"; - pMetaAtom = m_pRootAtom->FindAtom(s); - - if (!pMetaAtom) + pMetaAtom = m_pRootAtom->FindAtom(s); + if (!pMetaAtom) { - if (!CreateMetadataAtom("gnre")) - return false; + if (!CreateMetadataAtom("gnre")) + return false; - pMetaAtom = m_pRootAtom->FindAtom(s); + pMetaAtom = m_pRootAtom->FindAtom(s); + if (pMetaAtom == NULL) return false; } - memset(t, 0, 3*sizeof(unsigned char)); - t[0] = (unsigned char)(genreIndex>>8)&0xFF; - t[1] = (unsigned char)(genreIndex)&0xFF; - - pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); - ASSERT(pMetadataProperty); + memset(t, 0, 3*sizeof(unsigned char)); + t[0] = (unsigned char)(genreIndex>>8)&0xFF; + t[1] = (unsigned char)(genreIndex)&0xFF; + + ASSERT(pMetaAtom->FindProperty("data.metadata", + (MP4Property**)&pMetadataProperty)); + ASSERT(pMetadataProperty); + + pMetadataProperty->SetValue((u_int8_t*)t, 2); + + // remove other style of genre atom, if this one is added + pMetaAtom = m_pRootAtom->FindAtom(s2root); + if (pMetaAtom != NULL) { + MP4Atom *pParent = pMetaAtom->GetParentAtom(); + if (pParent != NULL) { + pParent->DeleteChildAtom(pMetaAtom); + delete pMetaAtom; + } + } + - pMetadataProperty->SetValue((u_int8_t*)t, 2); + (void)DeleteMetadataAtom( "\251gen" ); - return true; + return true; } else { - const char *s2 = "moov.udta.meta.ilst.\251gen.data"; - pMetaAtom = m_pRootAtom->FindAtom(s2); + pMetaAtom = m_pRootAtom->FindAtom(s2); - if (!pMetaAtom) - { - if (!CreateMetadataAtom("\251gen")) - return false; + if (!pMetaAtom) + { + if (!CreateMetadataAtom("\251gen")) + return false; - pMetaAtom = m_pRootAtom->FindAtom(s2); - } + pMetaAtom = m_pRootAtom->FindAtom(s2); + } - pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); - ASSERT(pMetadataProperty); + ASSERT(pMetaAtom->FindProperty("data.metadata", + (MP4Property**)&pMetadataProperty)); + ASSERT(pMetadataProperty); - pMetadataProperty->SetValue((u_int8_t*)value, strlen(value)); + pMetadataProperty->SetValue((u_int8_t*)value, strlen(value)); - return true; + // remove other gnre atom if this one is entered + pMetaAtom = m_pRootAtom->FindAtom(sroot); + if (pMetaAtom != NULL) { + MP4Atom *pParent = pMetaAtom->GetParentAtom(); + pParent->DeleteChildAtom(pMetaAtom); + delete pMetaAtom; } + return true; + } - return false; + return false; } bool MP4File::GetMetadataGenre(char** value) { - u_int16_t genreIndex = 0; - unsigned char *val = NULL; - u_int32_t valSize = 0; - const char *t = "moov.udta.meta.ilst.gnre"; - const char *s = "moov.udta.meta.ilst.gnre.data.metadata"; + u_int16_t genreIndex = 0; + unsigned char *val = NULL; + u_int32_t valSize = 0; + const char *t = "moov.udta.meta.ilst.gnre"; + const char *s = "moov.udta.meta.ilst.gnre.data.metadata"; - MP4Atom *gnre = FindAtom(t); + *value = NULL; - if (gnre) + MP4Atom *gnre = FindAtom(t); + + if (gnre) { - GetBytesProperty(s, (u_int8_t**)&val, &valSize); + GetBytesProperty(s, (u_int8_t**)&val, &valSize); - if (valSize != 2) - return false; + if (valSize != 2) { + CHECK_AND_FREE(val); + return false; + } - genreIndex = (u_int16_t)(val[1]); - genreIndex += (u_int16_t)(val[0]<<8); + genreIndex = (u_int16_t)(val[1]); + genreIndex += (u_int16_t)(val[0]<<8); - GenreToString(value, genreIndex); + GenreToString(value, genreIndex); - return true; + (void)DeleteMetadataAtom( "gnre" ); + free(val); + return true; } else { - const char *s2 = "moov.udta.meta.ilst.\251gen.data.metadata"; + const char *s2 = "moov.udta.meta.ilst.\251gen.data.metadata"; - val = NULL; - valSize = 0; + val = NULL; + valSize = 0; - GetBytesProperty(s2, (u_int8_t**)&val, &valSize); + GetBytesProperty(s2, (u_int8_t**)&val, &valSize); - if (valSize > 0) - { - *value = (char*)malloc((valSize+1)*sizeof(unsigned char)); - memset(*value, 0, (valSize+1)*sizeof(unsigned char)); - memcpy(*value, val, valSize*sizeof(unsigned char)); - return true; - } else { - *value = NULL; - return false; - } - } - - return false; + if (valSize > 0) + { + *value = (char*)malloc((valSize+1)*sizeof(unsigned char)); + if (*value != NULL) { + memset(*value, 0, (valSize+1)*sizeof(unsigned char)); + memcpy(*value, val, valSize*sizeof(unsigned char)); + } + free(val); + return true; + } else { + CHECK_AND_FREE(val); + } + } + + return false; +} + +bool MP4File::DeleteMetadataGenre() +{ + bool val1 = DeleteMetadataAtom("\251gen"); + bool val2 = DeleteMetadataAtom("gnre"); + return val1 || val2; } bool MP4File::SetMetadataTempo(u_int16_t tempo) { - unsigned char t[3]; - const char *s = "moov.udta.meta.ilst.tmpo.data"; - MP4BytesProperty *pMetadataProperty = NULL; - MP4Atom *pMetaAtom = NULL; + unsigned char t[3]; + const char *s = "moov.udta.meta.ilst.tmpo.data"; + MP4BytesProperty *pMetadataProperty = NULL; + MP4Atom *pMetaAtom = NULL; - pMetaAtom = m_pRootAtom->FindAtom(s); + pMetaAtom = m_pRootAtom->FindAtom(s); - if (!pMetaAtom) + if (!pMetaAtom) { - if (!CreateMetadataAtom("tmpo")) - return false; + if (!CreateMetadataAtom("tmpo")) + return false; - pMetaAtom = m_pRootAtom->FindAtom(s); + pMetaAtom = m_pRootAtom->FindAtom(s); + if (pMetaAtom == NULL) return false; } - memset(t, 0, 3*sizeof(unsigned char)); - t[0] = (unsigned char)(tempo>>8)&0xFF; - t[1] = (unsigned char)(tempo)&0xFF; + memset(t, 0, 3*sizeof(unsigned char)); + t[0] = (unsigned char)(tempo>>8)&0xFF; + t[1] = (unsigned char)(tempo)&0xFF; - pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); - ASSERT(pMetadataProperty); + ASSERT(pMetaAtom->FindProperty("data.metadata", + (MP4Property**)&pMetadataProperty)); + ASSERT(pMetadataProperty); - pMetadataProperty->SetValue((u_int8_t*)t, 2); + pMetadataProperty->SetValue((u_int8_t*)t, 2); - return true; + return true; } bool MP4File::GetMetadataTempo(u_int16_t* tempo) { - unsigned char *val = NULL; - u_int32_t valSize = 0; - const char *s = "moov.udta.meta.ilst.tmpo.data.metadata"; - GetBytesProperty(s, (u_int8_t**)&val, &valSize); + unsigned char *val = NULL; + u_int32_t valSize = 0; + const char *s = "moov.udta.meta.ilst.tmpo.data.metadata"; - *tempo = 0; + *tempo = 0; - if (valSize != 2) - return false; + GetBytesProperty(s, (u_int8_t**)&val, &valSize); - *tempo = (u_int16_t)(val[1]); - *tempo += (u_int16_t)(val[0]<<8); + if (valSize != 2) { + CHECK_AND_FREE(val); + return false; + } - return true; + *tempo = (u_int16_t)(val[1]); + *tempo += (u_int16_t)(val[0]<<8); + free(val); + return true; } - -bool MP4File::SetMetadataCompilation(u_int8_t compilation) +bool MP4File::SetMetadataUint8 (const char *atom, uint8_t value) { - const char *s = "moov.udta.meta.ilst.cpil.data"; - MP4BytesProperty *pMetadataProperty = NULL; - MP4Atom *pMetaAtom = NULL; - - pMetaAtom = m_pRootAtom->FindAtom(s); + char atompath[36]; + MP4BytesProperty *pMetadataProperty = NULL; + MP4Atom *pMetaAtom = NULL; - if (!pMetaAtom) - { - if (!CreateMetadataAtom("cpil")) - return false; + snprintf(atompath, 36, "moov.udta.meta.ilst.%s.data", atom); - pMetaAtom = m_pRootAtom->FindAtom(s); - } + pMetaAtom = m_pRootAtom->FindAtom(atompath); - pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); - ASSERT(pMetadataProperty); + if (pMetaAtom == NULL) { + if (!CreateMetadataAtom(atom)) + return false; - compilation &= 0x1; - pMetadataProperty->SetValue((u_int8_t*)&compilation, 1); + pMetaAtom = m_pRootAtom->FindAtom(atompath); + if (pMetaAtom == NULL) return false; + } - return true; + ASSERT(pMetaAtom->FindProperty("data.metadata", + (MP4Property**)&pMetadataProperty)); + ASSERT(pMetadataProperty); + + pMetadataProperty->SetValue(&value, 1); + + return true; } -bool MP4File::GetMetadataCompilation(u_int8_t* compilation) + +bool MP4File::GetMetadataUint8(const char *atom, u_int8_t* retvalue) { - unsigned char *val = NULL; - u_int32_t valSize = 0; - const char *s = "moov.udta.meta.ilst.cpil.data.metadata"; - GetBytesProperty(s, (u_int8_t**)&val, &valSize); + unsigned char *val = NULL; + u_int32_t valSize = 0; + char atompath[80]; + snprintf(atompath, 80, "moov.udta.meta.ilst.%s.data.metadata", atom); - *compilation = 0; + *retvalue = 0; - if (valSize != 1) - return false; + GetBytesProperty(atompath, (u_int8_t**)&val, &valSize); - *compilation = (u_int16_t)(val[0]); + if (valSize != 1) { + CHECK_AND_FREE(val); + return false; + } - return true; + *retvalue = val[0]; + free(val); + return true; } bool MP4File::SetMetadataCoverArt(u_int8_t *coverArt, u_int32_t size) { - const char *s = "moov.udta.meta.ilst.covr.data"; - MP4BytesProperty *pMetadataProperty = NULL; - MP4Atom *pMetaAtom = NULL; + const char *s = "moov.udta.meta.ilst.covr.data"; + MP4BytesProperty *pMetadataProperty = NULL; + MP4Atom *pMetaAtom = NULL; - pMetaAtom = m_pRootAtom->FindAtom(s); + pMetaAtom = m_pRootAtom->FindAtom(s); - if (!pMetaAtom) + if (!pMetaAtom) { - if (!CreateMetadataAtom("covr")) - return false; + if (!CreateMetadataAtom("covr")) + return false; - pMetaAtom = m_pRootAtom->FindAtom(s); + pMetaAtom = m_pRootAtom->FindAtom(s); + if (pMetaAtom == NULL) return false; } - pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); - ASSERT(pMetadataProperty); + ASSERT(pMetaAtom->FindProperty("data.metadata", + (MP4Property**)&pMetadataProperty)); + ASSERT(pMetadataProperty); - pMetadataProperty->SetValue(coverArt, size); + pMetadataProperty->SetValue(coverArt, size); - return true; + return true; } -bool MP4File::GetMetadataCoverArt(u_int8_t **coverArt, u_int32_t *size) +bool MP4File::GetMetadataCoverArt(u_int8_t **coverArt, u_int32_t *size, + uint32_t index) { - const char *s = "moov.udta.meta.ilst.covr.data.metadata"; - GetBytesProperty(s, coverArt, size); + char buffer[256]; + if (size == NULL || coverArt == NULL) return false; - if (size == 0) - return false; + if (index > 0 && index > GetMetadataCoverArtCount()) return false; - return true; -} + snprintf(buffer, 256, "moov.udta.meta.ilst.covr.data[%d].metadata", index); -bool MP4File::SetMetadataFreeForm(char *name, u_int8_t* pValue, u_int32_t valueSize) -{ - MP4Atom *pMetaAtom = NULL; - MP4BytesProperty *pMetadataProperty = NULL; - char s[256]; - int i = 0; + *coverArt = NULL; + *size = 0; - while (1) - { - MP4BytesProperty *pMetadataProperty; + GetBytesProperty(buffer, coverArt, size); - sprintf(s, "moov.udta.meta.ilst.----[%u].name", i); - - MP4Atom *pTagAtom = m_pRootAtom->FindAtom(s); - - if (!pTagAtom) - break; - - pTagAtom->FindProperty("name.metadata", (MP4Property**)&pMetadataProperty); - if (pMetadataProperty) - { - u_int8_t* pV; - u_int32_t VSize = 0; - - pMetadataProperty->GetValue(&pV, &VSize); - - if (VSize != 0) - { - if (memcmp(pV, name, VSize) == 0) - { - sprintf(s, "moov.udta.meta.ilst.----[%u].data.metadata", i); - SetBytesProperty(s, pValue, valueSize); - - return true; - } - } - } - - i++; - } - - /* doesn't exist yet, create it */ - char t[256]; - - sprintf(t, "udta.meta.ilst.----[%u]", i); - sprintf(s, "moov.udta.meta.ilst.----[%u].data", i); - AddDescendantAtoms("moov", t); - - pMetaAtom = m_pRootAtom->FindAtom(s); - - if (!pMetaAtom) - return false; - - pMetaAtom->SetFlags(0x1); - - MP4Atom *pHdlrAtom = m_pRootAtom->FindAtom("moov.udta.meta.hdlr"); - MP4StringProperty *pStringProperty = NULL; - MP4BytesProperty *pBytesProperty = NULL; - ASSERT(pHdlrAtom); - - pHdlrAtom->FindProperty( - "hdlr.handlerType", (MP4Property**)&pStringProperty); - ASSERT(pStringProperty); - pStringProperty->SetValue("mdir"); - - u_int8_t val[12]; - memset(val, 0, 12*sizeof(u_int8_t)); - val[0] = 0x61; - val[1] = 0x70; - val[2] = 0x70; - val[3] = 0x6c; - pHdlrAtom->FindProperty( - "hdlr.reserved2", (MP4Property**)&pBytesProperty); - ASSERT(pBytesProperty); - pBytesProperty->SetReadOnly(false); - pBytesProperty->SetValue(val, 12); - pBytesProperty->SetReadOnly(true); - - pMetaAtom = m_pRootAtom->FindAtom(s); - pMetaAtom->FindProperty("data.metadata", (MP4Property**)&pMetadataProperty); - ASSERT(pMetadataProperty); - pMetadataProperty->SetValue(pValue, valueSize); - - sprintf(s, "moov.udta.meta.ilst.----[%u].name", i); - pMetaAtom = m_pRootAtom->FindAtom(s); - pMetaAtom->FindProperty("name.metadata", (MP4Property**)&pMetadataProperty); - ASSERT(pMetadataProperty); - pMetadataProperty->SetValue((u_int8_t*)name, strlen(name)); - - sprintf(s, "moov.udta.meta.ilst.----[%u].mean", i); - pMetaAtom = m_pRootAtom->FindAtom(s); - pMetaAtom->FindProperty("mean.metadata", (MP4Property**)&pMetadataProperty); - ASSERT(pMetadataProperty); - pMetadataProperty->SetValue((u_int8_t*)"com.apple.iTunes", 16); /* ?? */ + if (size == 0) + return false; - return true; + return true; } -bool MP4File::GetMetadataFreeForm(char *name, u_int8_t** ppValue, u_int32_t *pValueSize) +u_int32_t MP4File::GetMetadataCoverArtCount (void) { - char s[256]; - int i = 0; - - while (1) - { - MP4BytesProperty *pMetadataProperty; + MP4Atom *pMetaAtom = m_pRootAtom->FindAtom("moov.udta.meta.ilst.covr"); + if (!pMetaAtom) + return 0; - sprintf(s, "moov.udta.meta.ilst.----[%u].name", i); + return pMetaAtom->GetNumberOfChildAtoms(); +} - MP4Atom *pTagAtom = m_pRootAtom->FindAtom(s); +bool MP4File::SetMetadataFreeForm (const char *name, + const u_int8_t* pValue, + u_int32_t valueSize, + const char *owner) +{ + MP4Atom *pMetaAtom = NULL; + MP4BytesProperty *pMetadataProperty = NULL; + char s[256]; + int i = 0; + size_t nameLen = strlen(name); + size_t ownerLen = owner != NULL ? strlen(owner) : 0; + + while (1) + { + snprintf(s, 256, "moov.udta.meta.ilst.----[%u].name", i); + + MP4Atom *pTagAtom = m_pRootAtom->FindAtom(s); + + if (!pTagAtom) + break; + + snprintf(s, 256, "moov.udta.meta.ilst.----[%u].mean", i); + + MP4Atom *pMeanAtom = m_pRootAtom->FindAtom(s); + + if (pTagAtom->FindProperty("name.metadata", + (MP4Property**)&pMetadataProperty) && + pMetadataProperty) { + u_int8_t* pV; + u_int32_t VSize = 0; + + pMetadataProperty->GetValue(&pV, &VSize); + + if (VSize == nameLen && memcmp(pV, name, VSize) == 0) { + u_int8_t* pOwner=0; + u_int32_t ownerSize = 0; + + if (pMeanAtom && + pMeanAtom->FindProperty("mean.metadata", + (MP4Property**)&pMetadataProperty) && + pMetadataProperty) { + pMetadataProperty->GetValue(&pOwner, &ownerSize); + } + + if (owner == NULL|| + (pOwner && + ownerLen == ownerSize && + memcmp(owner, pOwner, ownerSize))) { + snprintf(s, 256, "moov.udta.meta.ilst.----[%u].data.metadata", i); + SetBytesProperty(s, pValue, valueSize); + CHECK_AND_FREE(pV); + CHECK_AND_FREE(pOwner); + + return true; + } + CHECK_AND_FREE(pOwner); + } + CHECK_AND_FREE(pV); + } + + i++; + } + + /* doesn't exist yet, create it */ + char t[256]; + + snprintf(t, 256, "udta.meta.ilst.----[%u]", i); + snprintf(s, 256, "moov.udta.meta.ilst.----[%u].data", i); + (void)AddDescendantAtoms("moov", t); - if (!pTagAtom) - return false; + pMetaAtom = m_pRootAtom->FindAtom(s); - pTagAtom->FindProperty("name.metadata", (MP4Property**)&pMetadataProperty); - if (pMetadataProperty) - { - u_int8_t* pV; - u_int32_t VSize = 0; + if (!pMetaAtom) + return false; - pMetadataProperty->GetValue(&pV, &VSize); + pMetaAtom->SetFlags(0x1); - if (VSize != 0) - { - if (memcmp(pV, name, VSize) == 0) - { - sprintf(s, "moov.udta.meta.ilst.----[%u].data.metadata", i); - GetBytesProperty(s, ppValue, pValueSize); - - return true; - } - } - } + MP4Atom *pHdlrAtom = m_pRootAtom->FindAtom("moov.udta.meta.hdlr"); + MP4StringProperty *pStringProperty = NULL; + MP4BytesProperty *pBytesProperty = NULL; + ASSERT(pHdlrAtom); + + ASSERT(pHdlrAtom->FindProperty("hdlr.handlerType", + (MP4Property**)&pStringProperty)); + ASSERT(pStringProperty); + pStringProperty->SetValue("mdir"); + + u_int8_t val[12]; + memset(val, 0, 12*sizeof(u_int8_t)); + val[0] = 0x61; + val[1] = 0x70; + val[2] = 0x70; + val[3] = 0x6c; + ASSERT(pHdlrAtom->FindProperty("hdlr.reserved2", + (MP4Property**)&pBytesProperty)); + ASSERT(pBytesProperty); + pBytesProperty->SetReadOnly(false); + pBytesProperty->SetValue(val, 12); + pBytesProperty->SetReadOnly(true); + + pMetaAtom = m_pRootAtom->FindAtom(s); + ASSERT(pMetaAtom); + ASSERT(pMetaAtom->FindProperty("data.metadata", + (MP4Property**)&pMetadataProperty)); + ASSERT(pMetadataProperty); + pMetadataProperty->SetValue(pValue, valueSize); + + snprintf(s, 256, "moov.udta.meta.ilst.----[%u].name", i); + pMetaAtom = m_pRootAtom->FindAtom(s); + ASSERT(pMetaAtom->FindProperty("name.metadata", + (MP4Property**)&pMetadataProperty)); + ASSERT(pMetadataProperty); + pMetadataProperty->SetValue((const u_int8_t*)name, strlen(name)); + + snprintf(s, 256, "moov.udta.meta.ilst.----[%u].mean", i); + pMetaAtom = m_pRootAtom->FindAtom(s); + ASSERT(pMetaAtom->FindProperty("mean.metadata", + (MP4Property**)&pMetadataProperty)); + ASSERT(pMetadataProperty); + if (!owner || !*owner) + pMetadataProperty->SetValue((u_int8_t*)"com.apple.iTunes", 16); /* com.apple.iTunes is the default*/ + else + pMetadataProperty->SetValue((const u_int8_t*)owner, strlen((const char *)owner)); + + return true; +} + +bool MP4File::GetMetadataFreeForm(const char *name, + u_int8_t** ppValue, + u_int32_t *pValueSize, + const char *owner) +{ + char s[256]; + int i = 0; + + *ppValue = NULL; + *pValueSize = 0; + + size_t nameLen = strlen(name); + size_t ownerLen = owner?strlen(owner):0; + + while (1) + { + MP4BytesProperty *pMetadataProperty; + + snprintf(s, 256,"moov.udta.meta.ilst.----[%u].name", i); + MP4Atom *pTagAtom = m_pRootAtom->FindAtom(s); + + snprintf(s, 256,"moov.udta.meta.ilst.----[%u].mean", i); + MP4Atom *pMeanAtom = m_pRootAtom->FindAtom(s); + + if (!pTagAtom) + return false; + + if (pTagAtom->FindProperty("name.metadata", + (MP4Property**)&pMetadataProperty) && + pMetadataProperty) { + u_int8_t* pV; + u_int32_t VSize = 0; + + pMetadataProperty->GetValue(&pV, &VSize); + + if (VSize == nameLen && memcmp(pV, name, VSize) == 0) { + u_int8_t* pOwner=0; + u_int32_t ownerSize = 0; + + if (pMeanAtom && pMeanAtom->FindProperty("mean.metadata", + (MP4Property**)&pMetadataProperty) && + pMetadataProperty) { + pMetadataProperty->GetValue(&pOwner, &ownerSize); + } + + if (!owner || (pOwner && ownerLen == ownerSize && memcmp(owner, pOwner, ownerSize))) { + snprintf(s, 256, "moov.udta.meta.ilst.----[%u].data.metadata", i); + GetBytesProperty(s, ppValue, pValueSize); + CHECK_AND_FREE(pV); + CHECK_AND_FREE(pOwner); + return true; + } + CHECK_AND_FREE(pOwner); + } + CHECK_AND_FREE(pV); + } + + i++; + } +} + +bool MP4File::DeleteMetadataFreeForm(const char *name, const char *owner) +{ + char s[256]; + int i = 0; + + size_t nameLen = strlen(name); + size_t ownerLen = owner?strlen(owner):0; + + while (1) + { + MP4BytesProperty *pMetadataProperty; + + snprintf(s, 256, "moov.udta.meta.ilst.----[%u].name", i); + MP4Atom *pTagAtom = m_pRootAtom->FindAtom(s); + + snprintf(s, 256,"moov.udta.meta.ilst.----[%u].mean", i); + MP4Atom *pMeanAtom = m_pRootAtom->FindAtom(s); + + + if (!pTagAtom) + return false; + + if (pTagAtom->FindProperty("name.metadata", + (MP4Property**)&pMetadataProperty) && + pMetadataProperty) { + u_int8_t* pV; + u_int32_t VSize = 0; + + pMetadataProperty->GetValue(&pV, &VSize); + + if (VSize != 0) + { + if (VSize == nameLen && memcmp(pV, name, VSize) == 0) + { + u_int8_t* pOwner=0; + u_int32_t ownerSize = 0; + + if (pMeanAtom && pMeanAtom->FindProperty("mean.metadata", + (MP4Property**)&pMetadataProperty) && + pMetadataProperty) + { + pMetadataProperty->GetValue(&pOwner, &ownerSize); + } + + if (!owner || (pOwner && ownerLen == ownerSize && memcmp(owner, pOwner, ownerSize))) + { + snprintf(s, 256, "----[%u]", i); + CHECK_AND_FREE(pOwner); + CHECK_AND_FREE(pV); + return DeleteMetadataAtom(s); + } + CHECK_AND_FREE(pOwner); + + } + } + CHECK_AND_FREE(pV); + } - i++; + i++; } } bool MP4File::MetadataDelete() { - MP4Atom *pMetaAtom = NULL; - char s[256]; + MP4Atom *pMetaAtom = NULL; + char s[256]; - sprintf(s, "moov.udta.meta"); - pMetaAtom = m_pRootAtom->FindAtom(s); + snprintf(s, 256, "moov.udta.meta"); + pMetaAtom = m_pRootAtom->FindAtom(s); - /* if it exists, delete it */ - if (pMetaAtom) + /* if it exists, delete it */ + if (pMetaAtom) { - MP4Atom *pParent = pMetaAtom->GetParentAtom(); + MP4Atom *pParent = pMetaAtom->GetParentAtom(); - pParent->DeleteChildAtom(pMetaAtom); + pParent->DeleteChildAtom(pMetaAtom); - delete pMetaAtom; + delete pMetaAtom; - return true; + return true; } - return false; + return false; } diff -Nru faac-1.26/common/mp4v2/mp4property.cpp faac-1.28/common/mp4v2/mp4property.cpp --- faac-1.26/common/mp4v2/mp4property.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/mp4property.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -150,8 +150,13 @@ return; } Indent(pFile, indent); - fprintf(pFile, "%s = %u (0x%02x)\n", - m_name, m_values[index], m_values[index]); + if (index != 0) + fprintf(pFile, "%s[%u] = %u (0x%02x)\n", + m_name, index, m_values[index], m_values[index]); + else + fprintf(pFile, "%s = %u (0x%02x)\n", + m_name, m_values[index], m_values[index]); + fflush(pFile); } void MP4Integer16Property::Dump(FILE* pFile, u_int8_t indent, @@ -161,8 +166,13 @@ return; } Indent(pFile, indent); - fprintf(pFile, "%s = %u (0x%04x)\n", - m_name, m_values[index], m_values[index]); + if (index != 0) + fprintf(pFile, "%s[%u] = %u (0x%04x)\n", + m_name, index, m_values[index], m_values[index]); + else + fprintf(pFile, "%s = %u (0x%04x)\n", + m_name, m_values[index], m_values[index]); + fflush(pFile); } void MP4Integer24Property::Dump(FILE* pFile, u_int8_t indent, @@ -172,8 +182,13 @@ return; } Indent(pFile, indent); - fprintf(pFile, "%s = %u (0x%06x)\n", - m_name, m_values[index], m_values[index]); + if (index != 0) + fprintf(pFile, "%s[%u] = %u (0x%06x)\n", + m_name, index, m_values[index], m_values[index]); + else + fprintf(pFile, "%s = %u (0x%06x)\n", + m_name, m_values[index], m_values[index]); + fflush(pFile); } void MP4Integer32Property::Dump(FILE* pFile, u_int8_t indent, @@ -183,8 +198,13 @@ return; } Indent(pFile, indent); - fprintf(pFile, "%s = %u (0x%08x)\n", + if (index != 0) + fprintf(pFile, "%s[%u] = %u (0x%08x)\n", + m_name, index, m_values[index], m_values[index]); + else + fprintf(pFile, "%s = %u (0x%08x)\n", m_name, m_values[index], m_values[index]); + fflush(pFile); } void MP4Integer64Property::Dump(FILE* pFile, u_int8_t indent, @@ -194,9 +214,14 @@ return; } Indent(pFile, indent); - fprintf(pFile, - "%s = "U64" (0x%016"X64F")\n", - m_name, m_values[index], m_values[index]); + if (index != 0) + fprintf(pFile, "%s[%u] = "U64" (0x%016"X64F")\n", + m_name, index, m_values[index], m_values[index]); + else + fprintf(pFile, + "%s = "U64" (0x%016"X64F")\n", + m_name, m_values[index], m_values[index]); + fflush(pFile); } // MP4BitfieldProperty @@ -229,9 +254,15 @@ if (hexWidth == 0 || (m_numBits % 4)) { hexWidth++; } + if (index != 0) fprintf(pFile, - "%s = "U64" (0x%0*"X64F") <%u bits>\n", - m_name, m_values[index], (int)hexWidth, m_values[index], m_numBits); + "%s[%u] = "U64" (0x%0*"X64F") <%u bits>\n", + m_name, index, m_values[index], (int)hexWidth, m_values[index], m_numBits); + else + fprintf(pFile, + "%s = "U64" (0x%0*"X64F") <%u bits>\n", + m_name, m_values[index], (int)hexWidth, m_values[index], m_numBits); + fflush(pFile); } // MP4Float32Property @@ -271,8 +302,13 @@ return; } Indent(pFile, indent); - fprintf(pFile, "%s = %f\n", - m_name, m_values[index]); + if (index != 0) + fprintf(pFile, "%s[%u] = %f\n", + m_name, index, m_values[index]); + else + fprintf(pFile, "%s = %f\n", + m_name, m_values[index]); + fflush(pFile); } // MP4StringProperty @@ -369,11 +405,17 @@ return; } Indent(pFile, indent); + char indexd[32]; + if (index != 0) { + snprintf(indexd, 32, "[%u]", index); + } else indexd[0] = '\0'; + if (m_useUnicode) { - fprintf(pFile, "%s = %ls\n", m_name, (wchar_t*)m_values[index]); + fprintf(pFile, "%s%s = %ls\n", m_name, indexd, (wchar_t*)m_values[index]); } else { - fprintf(pFile, "%s = %s\n", m_name, m_values[index]); + fprintf(pFile, "%s%s = %s\n", m_name, indexd, m_values[index]); } + fflush(pFile); } // MP4BytesProperty @@ -418,8 +460,12 @@ } if (m_fixedValueSize) { if (valueSize > m_fixedValueSize) { - throw new MP4Error("value size exceeds fixed value size", - "MP4BytesProperty::SetValue"); + throw new MP4Error("%s.%s value size %d exceeds fixed value size %d", + "MP4BytesProperty::SetValue", + GetParentAtom()->GetType(), + GetName(), + valueSize, + m_fixedValueSize); } if (m_values[index] == NULL) { m_values[index] = (u_int8_t*)MP4Calloc(m_fixedValueSize); @@ -487,7 +533,9 @@ return; } Indent(pFile, indent); - fprintf(pFile, "%s = <%u bytes> ", m_name, m_valueSizes[index]); + fputs(m_name, pFile); + if (index != 0) fprintf(pFile, "[%u]", index); + fprintf(pFile, " = <%u bytes> ", m_valueSizes[index]); for (u_int32_t i = 0; i < m_valueSizes[index]; i++) { if ((i % 16) == 0 && m_valueSizes[index] > 16) { fprintf(pFile, "\n"); @@ -496,15 +544,14 @@ fprintf(pFile, "%02x ", m_values[index][i]); } fprintf(pFile, "\n"); + fflush(pFile); } // MP4TableProperty -MP4TableProperty::MP4TableProperty(char* name, MP4Property* pCountProperty) +MP4TableProperty::MP4TableProperty(char* name, MP4IntegerProperty* pCountProperty) : MP4Property(name) { - ASSERT(pCountProperty->GetType() == Integer8Property - || pCountProperty->GetType() == Integer32Property); m_pCountProperty = pCountProperty; m_pCountProperty->SetReadOnly(); } @@ -629,7 +676,14 @@ u_int32_t numEntries = GetCount(); - ASSERT(m_pProperties[0]->GetCount() == numEntries); + if (m_pProperties[0]->GetCount() != numEntries) { + fprintf(stderr, "%s %s \"%s\"table entries %u doesn't match count %u\n", + GetParentAtom() != NULL ? GetParentAtom()->GetType() : "", + GetName(), m_pProperties[0]->GetName(), + m_pProperties[0]->GetCount(), numEntries); + + ASSERT(m_pProperties[0]->GetCount() == numEntries); + } for (u_int32_t i = 0; i < numEntries; i++) { WriteEntry(pFile, i); @@ -858,7 +912,10 @@ if (m_name) { Indent(pFile, indent); - fprintf(pFile, "%s\n", m_name); + if (index != 0) + fprintf(pFile, "%s[%u]\n", m_name, index); + else + fprintf(pFile, "%s\n", m_name); indent++; } diff -Nru faac-1.26/common/mp4v2/mp4property.h faac-1.28/common/mp4v2/mp4property.h --- faac-1.26/common/mp4v2/mp4property.h 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/mp4property.h 2009-01-25 01:14:34.000000000 +0000 @@ -301,7 +301,7 @@ void SetValue(const char* value, u_int32_t index = 0); - void AddValue(char* value) { + void AddValue(const char* value) { u_int32_t count = GetCount(); SetCount(count + 1); SetValue(value, count); @@ -387,7 +387,7 @@ void SetValue(const u_int8_t* pValue, u_int32_t valueSize, u_int32_t index = 0); - void AddValue(u_int8_t* pValue, u_int32_t valueSize) { + void AddValue(const u_int8_t* pValue, u_int32_t valueSize) { u_int32_t count = GetCount(); SetCount(count + 1); SetValue(pValue, valueSize, count); @@ -419,7 +419,7 @@ class MP4TableProperty : public MP4Property { public: - MP4TableProperty(char* name, MP4Property* pCountProperty); + MP4TableProperty(char* name, MP4IntegerProperty* pCountProperty); ~MP4TableProperty(); @@ -440,19 +440,11 @@ return m_pProperties[index]; } - u_int32_t GetCount() { - if (m_pCountProperty->GetType() == Integer8Property) { - return ((MP4Integer8Property*)m_pCountProperty)->GetValue(); - } else { - return ((MP4Integer32Property*)m_pCountProperty)->GetValue(); - } + virtual u_int32_t GetCount() { + return m_pCountProperty->GetValue(); } - void SetCount(u_int32_t count) { - if (m_pCountProperty->GetType() == Integer8Property) { - ((MP4Integer8Property*)m_pCountProperty)->SetValue(count); - } else { - ((MP4Integer32Property*)m_pCountProperty)->SetValue(count); - } + virtual void SetCount(u_int32_t count) { + m_pCountProperty->SetValue(count); } void Read(MP4File* pFile, u_int32_t index = 0); @@ -471,7 +463,7 @@ MP4Property** ppProperty, u_int32_t* pIndex); protected: - MP4Property* m_pCountProperty; + MP4IntegerProperty* m_pCountProperty; MP4PropertyArray m_pProperties; }; diff -Nru faac-1.26/common/mp4v2/mp4track.cpp faac-1.28/common/mp4v2/mp4track.cpp --- faac-1.26/common/mp4v2/mp4track.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/mp4track.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -52,10 +52,15 @@ m_chunkSamples = 0; m_chunkDuration = 0; + // m_bytesPerSample should be set to 1, except for the + // quicktime audio constant bit rate samples, which have non-1 values + m_bytesPerSample = 1; m_samplesPerChunk = 0; m_durationPerChunk = 0; m_isAmr = AMR_UNINITIALIZED; m_curMode = 0; + + m_cachedSttsSid = MP4_INVALID_SAMPLE_ID; bool success = true; @@ -97,17 +102,37 @@ // get handles on sample size information - success &= m_pTrakAtom->FindProperty( - "trak.mdia.minf.stbl.stsz.sampleSize", - (MP4Property**)&m_pStszFixedSampleSizeProperty); + + m_pStszFixedSampleSizeProperty = NULL; + bool have_stsz = + m_pTrakAtom->FindProperty("trak.mdia.minf.stbl.stsz.sampleSize", + (MP4Property**)&m_pStszFixedSampleSizeProperty); - success &= m_pTrakAtom->FindProperty( + if (have_stsz) { + success &= m_pTrakAtom->FindProperty( "trak.mdia.minf.stbl.stsz.sampleCount", (MP4Property**)&m_pStszSampleCountProperty); - success &= m_pTrakAtom->FindProperty( - "trak.mdia.minf.stbl.stsz.entries.sampleSize", + success &= m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.stsz.entries.entrySize", (MP4Property**)&m_pStszSampleSizeProperty); + m_stsz_sample_bits = 32; + } else { + success &= m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.stz2.sampleCount", + (MP4Property**)&m_pStszSampleCountProperty); + success &= m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.stz2.entries.entrySize", + (MP4Property**)&m_pStszSampleSizeProperty); + MP4Integer8Property *stz2_field_size; + if (m_pTrakAtom->FindProperty( + "trak.mdia.minf.stbl.stz2.fieldSize", + (MP4Property **)&stz2_field_size)) { + m_stsz_sample_bits = stz2_field_size->GetValue(); + m_have_stz2_4bit_sample = false; + } else success = false; + } + // get handles on information needed to map sample id's to file offsets @@ -199,12 +224,13 @@ } // edit list - InitEditListProperties(); + (void)InitEditListProperties(); // was everything found? if (!success) { throw new MP4Error("invalid track", "MP4Track::MP4Track"); } + CalculateBytesPerSample(); } MP4Track::~MP4Track() @@ -220,7 +246,8 @@ void MP4Track::SetType(const char* type) { - m_pTypeProperty->SetValue(NormalizeTrackType(type)); + m_pTypeProperty->SetValue(MP4NormalizeTrackType(type, + m_pFile->GetVerbosity())); } void MP4Track::ReadSample( @@ -368,7 +395,7 @@ if (m_isAmr == AMR_UNINITIALIZED ) { // figure out if this is an AMR audio track if (m_pTrakAtom->FindAtom("trak.mdia.minf.stbl.stsd.samr") || - m_pTrakAtom->FindAtom("trak.mdia.minf.stbl.stsd.sawb")) { + m_pTrakAtom->FindAtom("trak.mdia.minf.stbl.stsd.sawb")) { m_isAmr = AMR_TRUE; m_curMode = (pBytes[0] >> 3) & 0x000F; } else { @@ -396,6 +423,7 @@ // append sample bytes to chunk buffer m_pChunkBuffer = (u_int8_t*)MP4Realloc(m_pChunkBuffer, m_chunkBufferSize + numBytes); + if (m_pChunkBuffer == NULL) return; memcpy(&m_pChunkBuffer[m_chunkBufferSize], pBytes, numBytes); m_chunkBufferSize += numBytes; m_chunkSamples++; @@ -409,8 +437,7 @@ UpdateSyncSamples(m_writeSampleId, isSyncSample); - if ((m_isAmr == AMR_FALSE) && - IsChunkFull(m_writeSampleId)) { + if (IsChunkFull(m_writeSampleId)) { WriteChunkBuffer(); m_curMode = curMode; } @@ -457,6 +484,14 @@ // write out any remaining samples in chunk buffer WriteChunkBuffer(); + if (m_pStszFixedSampleSizeProperty == NULL && + m_stsz_sample_bits == 4) { + if (m_have_stz2_4bit_sample) { + ((MP4Integer8Property *)m_pStszSampleSizeProperty)->AddValue(m_stz2_4bit_sample_value); + m_pStszSampleSizeProperty->IncrementValue(); + } + } + // record buffer size and bitrates MP4BitfieldProperty* pBufferSizeProperty; @@ -498,23 +533,36 @@ u_int32_t MP4Track::GetSampleSize(MP4SampleId sampleId) { + if (m_pStszFixedSampleSizeProperty != NULL) { u_int32_t fixedSampleSize = m_pStszFixedSampleSizeProperty->GetValue(); if (fixedSampleSize != 0) { - return fixedSampleSize; + return fixedSampleSize * m_bytesPerSample; } - return m_pStszSampleSizeProperty->GetValue(sampleId - 1); + } + // will have to check for 4 bit sample size here + if (m_stsz_sample_bits == 4) { + uint8_t value = m_pStszSampleSizeProperty->GetValue((sampleId - 1) / 2); + if ((sampleId - 1) / 2 == 0) { + value >>= 4; + } else value &= 0xf; + return m_bytesPerSample * value; + } + return m_bytesPerSample * + m_pStszSampleSizeProperty->GetValue(sampleId - 1); } u_int32_t MP4Track::GetMaxSampleSize() { + if (m_pStszFixedSampleSizeProperty != NULL) { u_int32_t fixedSampleSize = m_pStszFixedSampleSizeProperty->GetValue(); if (fixedSampleSize != 0) { - return fixedSampleSize; + return fixedSampleSize * m_bytesPerSample; } + } u_int32_t maxSampleSize = 0; u_int32_t numSamples = m_pStszSampleSizeProperty->GetCount(); @@ -525,18 +573,24 @@ maxSampleSize = sampleSize; } } - return maxSampleSize; + return maxSampleSize * m_bytesPerSample; } u_int64_t MP4Track::GetTotalOfSampleSizes() { + uint64_t retval; + if (m_pStszFixedSampleSizeProperty != NULL) { u_int32_t fixedSampleSize = m_pStszFixedSampleSizeProperty->GetValue(); // if fixed sample size, just need to multiply by number of samples if (fixedSampleSize != 0) { - return fixedSampleSize * GetNumberOfSamples(); + retval = m_bytesPerSample; + retval *= fixedSampleSize; + retval *= GetNumberOfSamples(); + return retval; } + } // else non-fixed sample size, sum them u_int64_t totalSampleSizes = 0; @@ -546,46 +600,105 @@ m_pStszSampleSizeProperty->GetValue(sid - 1); totalSampleSizes += sampleSize; } - return totalSampleSizes; + return totalSampleSizes * m_bytesPerSample; } -void MP4Track::UpdateSampleSizes(MP4SampleId sampleId, u_int32_t numBytes) +void MP4Track::SampleSizePropertyAddValue (uint32_t size) { - // for first sample - if (sampleId == 1) { - if (numBytes > 0) { - // presume sample size is fixed - m_pStszFixedSampleSizeProperty->SetValue(numBytes); - } else { - // special case of first sample is zero bytes in length - // leave m_pStszFixedSampleSizeProperty at 0 - // start recording variable sample sizes - m_pStszSampleSizeProperty->AddValue(0); - } + // this has to deal with different sample size values + switch (m_pStszSampleSizeProperty->GetType()) { + case Integer32Property: + ((MP4Integer32Property *)m_pStszSampleSizeProperty)->AddValue(size); + break; + case Integer16Property: + ((MP4Integer16Property *)m_pStszSampleSizeProperty)->AddValue(size); + break; + case Integer8Property: + if (m_stsz_sample_bits == 4) { + if (m_have_stz2_4bit_sample == false) { + m_have_stz2_4bit_sample = true; + m_stz2_4bit_sample_value = size << 4; + return; + } else { + m_have_stz2_4bit_sample = false; + size &= 0xf; + size |= m_stz2_4bit_sample_value; + } + } + ((MP4Integer8Property *)m_pStszSampleSizeProperty)->AddValue(size); + break; + default: break; + } - } else { // sampleId > 1 - u_int32_t fixedSampleSize = - m_pStszFixedSampleSizeProperty->GetValue(); - if (fixedSampleSize == 0 || numBytes != fixedSampleSize) { - // sample size is not fixed + // m_pStszSampleSizeProperty->IncrementValue(); +} - if (fixedSampleSize) { - // need to clear fixed sample size - m_pStszFixedSampleSizeProperty->SetValue(0); - - // and create sizes for all previous samples - for (MP4SampleId sid = 1; sid < sampleId; sid++) { - m_pStszSampleSizeProperty->AddValue(fixedSampleSize); - } - } +void MP4Track::UpdateSampleSizes(MP4SampleId sampleId, u_int32_t numBytes) +{ + if (m_bytesPerSample > 1) { + if ((numBytes % m_bytesPerSample) != 0) { + // error + VERBOSE_ERROR(m_pFile->GetVerbosity(), + printf("UpdateSampleSize: numBytes %u not divisible by bytesPerSample %u sampleId %u\n", + numBytes, m_bytesPerSample, sampleId); + ); + } + numBytes /= m_bytesPerSample; + } + // for first sample + // wmay - if we are adding, we want to make sure that + // we don't inadvertently set up the fixed size again. + // so, we check the number of samples + if (sampleId == 1 && GetNumberOfSamples() == 0) { + if (m_pStszFixedSampleSizeProperty == NULL || + numBytes == 0) { + // special case of first sample is zero bytes in length + // leave m_pStszFixedSampleSizeProperty at 0 + // start recording variable sample sizes + if (m_pStszFixedSampleSizeProperty != NULL) + m_pStszFixedSampleSizeProperty->SetValue(0); + SampleSizePropertyAddValue(0); + } else { + // presume sample size is fixed + m_pStszFixedSampleSizeProperty->SetValue(numBytes); + } + } else { // sampleId > 1 - // add size value for this sample - m_pStszSampleSizeProperty->AddValue(numBytes); - } + u_int32_t fixedSampleSize = 0; + if (m_pStszFixedSampleSizeProperty != NULL) { + fixedSampleSize = m_pStszFixedSampleSizeProperty->GetValue(); + } + + // if we don't have a fixed size, or the current sample size + // doesn't match our sample size, we need to write the current + // sample size into the table + if (fixedSampleSize == 0 || numBytes != fixedSampleSize) { + if (fixedSampleSize != 0) { + // fixed size was set; we need to clear fixed sample size + m_pStszFixedSampleSizeProperty->SetValue(0); + + // and create sizes for all previous samples + // use GetNumberOfSamples due to needing the total number + // not just the appended part of the file + uint32_t samples = GetNumberOfSamples(); + for (MP4SampleId sid = 1; sid <= samples; sid++) { + SampleSizePropertyAddValue(fixedSampleSize); + } + } + // add size value for this sample + SampleSizePropertyAddValue(numBytes); + } } - + // either way, we increment the number of samples. m_pStszSampleCountProperty->IncrementValue(); +#if 0 + printf("track %u sample id %u bytes %u fixed %u count %u prop %u\n", + m_trackId, sampleId, numBytes, + m_pStszFixedSampleSizeProperty->GetValue(), + m_pStszSampleSizeProperty->GetCount(), + m_pStszSampleCountProperty->GetValue()); +#endif } u_int32_t MP4Track::GetAvgBitrate() @@ -594,14 +707,13 @@ return 0; } - u_int64_t durationSecs = - MP4ConvertTime(GetDuration(), GetTimeScale(), MP4_SECS_TIME_SCALE); - - if (GetDuration() % GetTimeScale() != 0) { - durationSecs++; - } - - return (GetTotalOfSampleSizes() * 8) / durationSecs; + double calc = UINT64_TO_DOUBLE(GetTotalOfSampleSizes()); + // this is a bit better - we use the whole duration + calc *= 8.0; + calc *= GetTimeScale(); + calc /= UINT64_TO_DOUBLE(GetDuration()); + // we might want to think about rounding to the next 100 or 1000 + return (uint32_t) ceil(calc); } u_int32_t MP4Track::GetMaxBitrate() @@ -610,32 +722,48 @@ MP4SampleId numSamples = GetNumberOfSamples(); u_int32_t maxBytesPerSec = 0; u_int32_t bytesThisSec = 0; - MP4Timestamp thisSec = 0; + MP4Timestamp thisSecStart = 0; + MP4Timestamp lastSampleTime = 0; + uint32_t lastSampleSize = 0; + MP4SampleId thisSecStartSid = 1; for (MP4SampleId sid = 1; sid <= numSamples; sid++) { - u_int32_t sampleSize; - MP4Timestamp sampleTime; - - sampleSize = GetSampleSize(sid); - - GetSampleTimes(sid, &sampleTime, NULL); - - // sample counts for current second - if (sampleTime < thisSec + timeScale) { - bytesThisSec += sampleSize; - } else { // sample is in a future second - if (bytesThisSec > maxBytesPerSec) { - maxBytesPerSec = bytesThisSec; - } - - thisSec = sampleTime - (sampleTime % timeScale); - bytesThisSec = sampleSize; - } - } + uint32_t sampleSize; + MP4Timestamp sampleTime; - // last second (or partial second) - if (bytesThisSec > maxBytesPerSec) { - maxBytesPerSec = bytesThisSec; + sampleSize = GetSampleSize(sid); + GetSampleTimes(sid, &sampleTime, NULL); + + if (sampleTime < thisSecStart + timeScale) { + bytesThisSec += sampleSize; + lastSampleSize = sampleSize; + lastSampleTime = sampleTime; + } else { + // we've already written the last sample and sampleSize. + // this means that we've probably overflowed the last second + // calculate the time we've overflowed + MP4Duration overflow_dur = + (thisSecStart + timeScale) - lastSampleTime; + // calculate the duration of the last sample + MP4Duration lastSampleDur = sampleTime - lastSampleTime; + uint32_t overflow_bytes; + // now, calculate the number of bytes we overflowed. Round up. + overflow_bytes = + ((lastSampleSize * overflow_dur) + (lastSampleDur - 1)) / lastSampleDur; + + if (bytesThisSec - overflow_bytes > maxBytesPerSec) { + maxBytesPerSec = bytesThisSec - overflow_bytes; + } + + // now adjust the values for this sample. Remove the bytes + // from the first sample in this time frame + lastSampleTime = sampleTime; + lastSampleSize = sampleSize; + bytesThisSec += sampleSize; + bytesThisSec -= GetSampleSize(thisSecStartSid); + thisSecStartSid++; + GetSampleTimes(thisSecStartSid, &thisSecStart, NULL); + } } return maxBytesPerSec * 8; @@ -687,11 +815,11 @@ ASSERT(pStsdEntryAtom); MP4Integer16Property* pDrefIndexProperty = NULL; - pStsdEntryAtom->FindProperty( - "*.dataReferenceIndex", - (MP4Property**)&pDrefIndexProperty); + if (!pStsdEntryAtom->FindProperty( + "*.dataReferenceIndex", + (MP4Property**)&pDrefIndexProperty) || - if (pDrefIndexProperty == NULL) { + pDrefIndexProperty == NULL) { throw new MP4Error("invalid stsd entry", "GetSampleFile"); } @@ -712,9 +840,9 @@ pFile = NULL; // self-contained } else { MP4StringProperty* pLocationProperty = NULL; - pUrlAtom->FindProperty( - "*.location", - (MP4Property**)&pLocationProperty); + ASSERT(pUrlAtom->FindProperty( + "*.location", + (MP4Property**)&pLocationProperty)); ASSERT(pLocationProperty); const char* url = pLocationProperty->GetValue(); @@ -756,6 +884,9 @@ u_int32_t stscIndex = GetSampleStscIndex(sampleId); + // firstChunk is the chunk index of the first chunk with + // samplesPerChunk samples in the chunk. There may be multiples - + // ie: several chunks with the same number of samples per chunk. u_int32_t firstChunk = m_pStscFirstChunkProperty->GetValue(stscIndex); @@ -765,9 +896,12 @@ u_int32_t samplesPerChunk = m_pStscSamplesPerChunkProperty->GetValue(stscIndex); + // chunkId tells which is the absolute chunk number that this sample + // is stored in. MP4ChunkId chunkId = firstChunk + ((sampleId - firstSample) / samplesPerChunk); + // chunkOffset is the file offset (absolute) for the start of the chunk u_int64_t chunkOffset = m_pChunkOffsetProperty->GetValue(chunkId - 1); MP4SampleId firstSampleInChunk = @@ -827,26 +961,36 @@ return m_pSttsSampleDeltaProperty->GetValue(0); } -bool MP4Track::SetFixedSampleDuration(MP4Duration duration) +void MP4Track::SetFixedSampleDuration(MP4Duration duration) { u_int32_t numStts = m_pSttsCountProperty->GetValue(); // setting this is only allowed before samples have been written if (numStts != 0) { - return false; + return; } m_fixedSampleDuration = duration; - return true; + return; } void MP4Track::GetSampleTimes(MP4SampleId sampleId, MP4Timestamp* pStartTime, MP4Duration* pDuration) { u_int32_t numStts = m_pSttsCountProperty->GetValue(); - MP4SampleId sid = 1; - MP4Duration elapsed = 0; + MP4SampleId sid; + MP4Duration elapsed; + + + if (m_cachedSttsSid != MP4_INVALID_SAMPLE_ID && sampleId >= m_cachedSttsSid) { + sid = m_cachedSttsSid; + elapsed = m_cachedSttsElapsed; + } else { + m_cachedSttsIndex = 0; + sid = 1; + elapsed = 0; + } - for (u_int32_t sttsIndex = 0; sttsIndex < numStts; sttsIndex++) { + for (u_int32_t sttsIndex = m_cachedSttsIndex; sttsIndex < numStts; sttsIndex++) { u_int32_t sampleCount = m_pSttsSampleCountProperty->GetValue(sttsIndex); u_int32_t sampleDelta = @@ -861,6 +1005,11 @@ if (pDuration) { *pDuration = sampleDelta; } + + m_cachedSttsIndex = sttsIndex; + m_cachedSttsSid = sid; + m_cachedSttsElapsed = elapsed; + return; } sid += sampleCount; @@ -987,17 +1136,17 @@ MP4Atom* pCttsAtom = AddAtom("trak.mdia.minf.stbl", "ctts"); // and get handles on the properties - pCttsAtom->FindProperty( + ASSERT(pCttsAtom->FindProperty( "ctts.entryCount", - (MP4Property**)&m_pCttsCountProperty); + (MP4Property**)&m_pCttsCountProperty)); - pCttsAtom->FindProperty( + ASSERT(pCttsAtom->FindProperty( "ctts.entries.sampleCount", - (MP4Property**)&m_pCttsSampleCountProperty); + (MP4Property**)&m_pCttsSampleCountProperty)); - pCttsAtom->FindProperty( + ASSERT(pCttsAtom->FindProperty( "ctts.entries.sampleOffset", - (MP4Property**)&m_pCttsSampleOffsetProperty); + (MP4Property**)&m_pCttsSampleOffsetProperty)); // if this is not the first sample if (sampleId > 1) { @@ -1132,16 +1281,22 @@ } u_int32_t numStss = m_pStssCountProperty->GetValue(); + u_int32_t stssLIndex = 0; + u_int32_t stssRIndex = numStss - 1; - for (u_int32_t stssIndex = 0; stssIndex < numStss; stssIndex++) { + while (stssRIndex >= stssLIndex){ + u_int32_t stssIndex = (stssRIndex + stssLIndex) >> 1; MP4SampleId syncSampleId = m_pStssSampleProperty->GetValue(stssIndex); if (sampleId == syncSampleId) { return true; } - if (sampleId < syncSampleId) { - break; + + if (sampleId > syncSampleId) { + stssLIndex = stssIndex + 1; + } else { + stssRIndex = stssIndex - 1; } } @@ -1174,34 +1329,35 @@ void MP4Track::UpdateSyncSamples(MP4SampleId sampleId, bool isSyncSample) { - if (isSyncSample) { - // if stss atom exists, add entry - if (m_pStssCountProperty) { - m_pStssSampleProperty->AddValue(sampleId); - m_pStssCountProperty->IncrementValue(); - } // else nothing to do (yet) - - } else { // !isSyncSample - // if stss atom doesn't exist, create one - if (m_pStssCountProperty == NULL) { - - MP4Atom* pStssAtom = AddAtom("trak.mdia.minf.stbl", "stss"); - - pStssAtom->FindProperty( - "stss.entryCount", - (MP4Property**)&m_pStssCountProperty); - - pStssAtom->FindProperty( - "stss.entries.sampleNumber", - (MP4Property**)&m_pStssSampleProperty); - - // set values for all samples that came before this one - for (MP4SampleId sid = 1; sid < sampleId; sid++) { - m_pStssSampleProperty->AddValue(sid); - m_pStssCountProperty->IncrementValue(); - } - } // else nothing to do - } + if (isSyncSample) { + // if stss atom exists, add entry + if (m_pStssCountProperty) { + m_pStssSampleProperty->AddValue(sampleId); + m_pStssCountProperty->IncrementValue(); + } // else nothing to do (yet) + + } else { // !isSyncSample + // if stss atom doesn't exist, create one + if (m_pStssCountProperty == NULL) { + + MP4Atom* pStssAtom = AddAtom("trak.mdia.minf.stbl", "stss"); + + ASSERT(pStssAtom->FindProperty( + "stss.entryCount", + (MP4Property**)&m_pStssCountProperty)); + + ASSERT(pStssAtom->FindProperty( + "stss.entries.sampleNumber", + (MP4Property**)&m_pStssSampleProperty)); + + // set values for all samples that came before this one + uint32_t samples = GetNumberOfSamples(); + for (MP4SampleId sid = 1; sid < samples; sid++) { + m_pStssSampleProperty->AddValue(sid); + m_pStssCountProperty->IncrementValue(); + } + } // else nothing to do + } } MP4Atom* MP4Track::AddAtom(char* parentName, char* childName) @@ -1379,87 +1535,51 @@ // map track type name aliases to official names -const char* MP4Track::NormalizeTrackType(const char* type) -{ - if (!strcasecmp(type, "vide") - || !strcasecmp(type, "video") - || !strcasecmp(type, "mp4v") - || !strcasecmp(type, "s263") // 3GPP H.263 - || !strcasecmp(type, "encv")) { - return MP4_VIDEO_TRACK_TYPE; - } - - if (!strcasecmp(type, "soun") - || !strcasecmp(type, "sound") - || !strcasecmp(type, "audio") - || !strcasecmp(type, "enca") - || !strcasecmp(type, "samr") // 3GPP AMR - || !strcasecmp(type, "sawb") // 3GPP AMR/WB - || !strcasecmp(type, "mp4a")) { - return MP4_AUDIO_TRACK_TYPE; - } - - if (!strcasecmp(type, "sdsm") - || !strcasecmp(type, "scene") - || !strcasecmp(type, "bifs")) { - return MP4_SCENE_TRACK_TYPE; - } - - if (!strcasecmp(type, "odsm") - || !strcasecmp(type, "od")) { - return MP4_OD_TRACK_TYPE; - } - - return type; -} bool MP4Track::InitEditListProperties() { - m_pElstCountProperty = NULL; - m_pElstMediaTimeProperty = NULL; - m_pElstDurationProperty = NULL; - m_pElstRateProperty = NULL; - m_pElstReservedProperty = NULL; - - MP4Atom* pElstAtom = - m_pTrakAtom->FindAtom("trak.edts.elst"); - - if (!pElstAtom) { - return false; - } - - pElstAtom->FindProperty( - "elst.entryCount", - (MP4Property**)&m_pElstCountProperty); - - pElstAtom->FindProperty( - "elst.entries.mediaTime", - (MP4Property**)&m_pElstMediaTimeProperty); - - pElstAtom->FindProperty( - "elst.entries.segmentDuration", - (MP4Property**)&m_pElstDurationProperty); - - pElstAtom->FindProperty( - "elst.entries.mediaRate", - (MP4Property**)&m_pElstRateProperty); - - pElstAtom->FindProperty( - "elst.entries.reserved", - (MP4Property**)&m_pElstReservedProperty); - - return m_pElstCountProperty - && m_pElstMediaTimeProperty - && m_pElstDurationProperty - && m_pElstRateProperty - && m_pElstReservedProperty; + m_pElstCountProperty = NULL; + m_pElstMediaTimeProperty = NULL; + m_pElstDurationProperty = NULL; + m_pElstRateProperty = NULL; + m_pElstReservedProperty = NULL; + + MP4Atom* pElstAtom = + m_pTrakAtom->FindAtom("trak.edts.elst"); + + if (!pElstAtom) { + return false; + } + + (void)pElstAtom->FindProperty( + "elst.entryCount", + (MP4Property**)&m_pElstCountProperty); + (void)pElstAtom->FindProperty( + "elst.entries.mediaTime", + (MP4Property**)&m_pElstMediaTimeProperty); + (void)pElstAtom->FindProperty( + "elst.entries.segmentDuration", + (MP4Property**)&m_pElstDurationProperty); + (void)pElstAtom->FindProperty( + "elst.entries.mediaRate", + (MP4Property**)&m_pElstRateProperty); + + (void)pElstAtom->FindProperty( + "elst.entries.reserved", + (MP4Property**)&m_pElstReservedProperty); + + return m_pElstCountProperty + && m_pElstMediaTimeProperty + && m_pElstDurationProperty + && m_pElstRateProperty + && m_pElstReservedProperty; } MP4EditId MP4Track::AddEdit(MP4EditId editId) { if (!m_pElstCountProperty) { - m_pFile->AddDescendantAtoms(m_pTrakAtom, "edts.elst"); - InitEditListProperties(); + (void)m_pFile->AddDescendantAtoms(m_pTrakAtom, "edts.elst"); + if (InitEditListProperties() == false) return MP4_INVALID_EDIT_ID; } if (editId == MP4_INVALID_EDIT_ID) { @@ -1668,3 +1788,23 @@ return sampleId; } +void MP4Track::CalculateBytesPerSample () +{ + MP4Atom *pMedia = m_pTrakAtom->FindAtom("trak.mdia.minf.stbl.stsd"); + MP4Atom *pMediaData; + const char *media_data_name; + if (pMedia == NULL) return; + + if (pMedia->GetNumberOfChildAtoms() != 1) return; + + pMediaData = pMedia->GetChildAtom(0); + media_data_name = pMediaData->GetType(); + if ((ATOMID(media_data_name) == ATOMID("twos")) || + (ATOMID(media_data_name) == ATOMID("sowt"))) { + MP4IntegerProperty *chan, *sampleSize; + chan = (MP4IntegerProperty *)pMediaData->GetProperty(4); + sampleSize = (MP4IntegerProperty *)pMediaData->GetProperty(5); + m_bytesPerSample = chan->GetValue() * (sampleSize->GetValue() / 8); + } +} + diff -Nru faac-1.26/common/mp4v2/mp4track.h faac-1.28/common/mp4v2/mp4track.h --- faac-1.26/common/mp4v2/mp4track.h 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/mp4track.h 2009-01-25 01:14:34.000000000 +0000 @@ -93,7 +93,7 @@ u_int32_t GetMaxBitrate(); // in bps MP4Duration GetFixedSampleDuration(); - bool SetFixedSampleDuration(MP4Duration duration); + void SetFixedSampleDuration(MP4Duration duration); void GetSampleTimes(MP4SampleId sampleId, MP4Timestamp* pStartTime, MP4Duration* pDuration); @@ -125,8 +125,6 @@ MP4Timestamp* pStartTime = NULL, MP4Duration* pDuration = NULL); - static const char* NormalizeTrackType(const char* type); - // special operation for use during hint track packet assembly void ReadSampleFragment( MP4SampleId sampleId, @@ -179,6 +177,7 @@ void WriteChunkBuffer(); + void CalculateBytesPerSample(); protected: MP4File* m_pFile; MP4Atom* m_pTrakAtom; // moov.trak[] @@ -205,6 +204,8 @@ u_int32_t m_samplesPerChunk; MP4Duration m_durationPerChunk; + u_int32_t m_bytesPerSample; + // controls for AMR chunking int m_isAmr; u_int8_t m_curMode; @@ -217,7 +218,12 @@ MP4Integer32Property* m_pStszFixedSampleSizeProperty; MP4Integer32Property* m_pStszSampleCountProperty; - MP4Integer32Property* m_pStszSampleSizeProperty; + + void SampleSizePropertyAddValue(uint32_t bytes); + uint8_t m_stsz_sample_bits; + bool m_have_stz2_4bit_sample; + uint8_t m_stz2_4bit_sample_value; + MP4IntegerProperty* m_pStszSampleSizeProperty; MP4Integer32Property* m_pStscCountProperty; MP4Integer32Property* m_pStscFirstChunkProperty; @@ -232,6 +238,11 @@ MP4Integer32Property* m_pSttsSampleCountProperty; MP4Integer32Property* m_pSttsSampleDeltaProperty; + // for improve sequental timestamp index access + u_int32_t m_cachedSttsIndex; + MP4SampleId m_cachedSttsSid; + MP4Timestamp m_cachedSttsElapsed; + MP4Integer32Property* m_pCttsCountProperty; MP4Integer32Property* m_pCttsSampleCountProperty; MP4Integer32Property* m_pCttsSampleOffsetProperty; diff -Nru faac-1.26/common/mp4v2/mp4util.cpp faac-1.28/common/mp4v2/mp4util.cpp --- faac-1.26/common/mp4v2/mp4util.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/mp4util.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -13,16 +13,30 @@ * * The Initial Developer of the Original Code is Cisco Systems Inc. * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved. + * Copyright (C) Cisco Systems Inc. 2001-2005. All Rights Reserved. * * Contributor(s): * Dave Mackie dmackie@cisco.com + * Bill May wmay@cisco.com */ #include "mp4common.h" +static lib_message_func_t libfunc = NULL; +extern "C" void MP4SetLibFunc(lib_message_func_t libf) +{ + libfunc = libf; +} + void MP4Error::Print(FILE* pFile) { + if (libfunc != NULL) { + (libfunc)(LOG_ERR, "MP4ERROR", "%s:%s:%s", + m_where == NULL ? "" : m_where, + m_errstring == NULL ? "" : m_errstring, + m_errno ? strerror(m_errno) : ""); + return; + } fprintf(pFile, "MP4ERROR: "); if (m_where) { fprintf(pFile, "%s", m_where); @@ -149,12 +163,12 @@ if (dataSize) { ASSERT(pData); } - - char* s = (char*)MP4Calloc((2 * dataSize) + 1); + uint size = 2 * dataSize + 1; + char* s = (char*)MP4Calloc(size); u_int32_t i, j; for (i = 0, j = 0; i < dataSize; i++) { - sprintf(&s[j], "%02x", pData[i]); + size -= snprintf(&s[j], size, "%02x", pData[i]); j += 2; } @@ -163,11 +177,9 @@ char* MP4ToBase64(const u_int8_t* pData, u_int32_t dataSize) { - if (dataSize) { - ASSERT(pData); - } + if (pData == NULL || dataSize == 0) return NULL; - static char encoding[64] = { + static const char encoding[64] = { 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P', 'Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f', 'g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v', @@ -177,6 +189,7 @@ char* s = (char*)MP4Calloc((((dataSize + 2) * 4) / 3) + 1); const u_int8_t* src = pData; + if (pData == NULL) return NULL; char* dest = s; u_int32_t numGroups = dataSize / 3; @@ -199,10 +212,77 @@ *dest++ = encoding[((src[1] & 0x0F) << 2)]; *dest++ = '='; } - + *dest = '\0'; return s; /* N.B. caller is responsible for free'ing s */ } +static bool convertBase64 (const char data, uint8_t *value) +{ + static const uint8_t decodingarr64[128] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x3e, 0xff, 0xff, 0xff, 0x3f, + 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, + 0x3c, 0x3d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, + 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, + 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, + 0x17, 0x18, 0x19, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, + 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, + 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, + 0x31, 0x32, 0x33, 0xff, 0xff, 0xff, 0xff, 0xff, + }; + uint8_t index = (uint8_t)data; + if ((index & 0x80) != 0) return false; + + if (decodingarr64[index] == 0xff) return false; + *value = decodingarr64[index]; + return true; +} + +uint8_t *Base64ToBinary (const char *pData, uint32_t decodeSize, uint32_t *pDataSize) +{ + uint8_t *ret; + uint32_t size, ix, groups; + if (pData == NULL || decodeSize == 0 || pDataSize == NULL) + return NULL; + + if ((decodeSize % 4) != 0) { + // must be multiples of 4 characters + return NULL; + } + size = (decodeSize * 3) / 4; + groups = decodeSize / 4; + ret = (uint8_t *)MP4Calloc(size); + if (ret == NULL) return NULL; + for (ix = 0; ix < groups; ix++) { + uint8_t value[4]; + for (uint8_t jx = 0; jx < 4; jx++) { + if (pData[jx] == '=') { + if (ix != (groups - 1)) { + free(ret); + return NULL; + } + size--; + value[jx] = 0; + } else if (convertBase64(pData[jx], &value[jx]) == false) { + free(ret); + return NULL; + } + } + ret[(ix * 3)] = value[0] << 2 | ((value[1] >> 4) & 0x3); + ret[(ix * 3) + 1] = (value[1] << 4) | (value[2] >> 2 & 0xf); + ret[(ix * 3) + 2] = ((value[2] & 0x3) << 6) | value[3]; + pData += 4; + } + *pDataSize = size; + return ret; +} + // log2 of value, rounded up static u_int8_t ilog2(u_int64_t value) { @@ -224,15 +304,59 @@ throw new MP4Error("division by zero", "MP4ConvertTime"); } + if (oldTimeScale == newTimeScale) return t; + // check if we can safely use integer operations if (ilog2(t) + ilog2(newTimeScale) <= 64) { return (t * newTimeScale) / oldTimeScale; } // final resort is to use floating point - double d = ((double)newTimeScale / (double)oldTimeScale) + 0.5; + double d = (double)newTimeScale; d *= UINT64_TO_DOUBLE(t); + d /= (double)oldTimeScale; + d += 0.5; // round up. return (u_int64_t)d; } +const char* MP4NormalizeTrackType (const char* type, + uint32_t verbosity) +{ + if (!strcasecmp(type, "vide") + || !strcasecmp(type, "video") + || !strcasecmp(type, "mp4v") + || !strcasecmp(type, "avc1") + || !strcasecmp(type, "s263") // 3GPP H.263 + || !strcasecmp(type, "encv")) { + return MP4_VIDEO_TRACK_TYPE; + } + + if (!strcasecmp(type, "soun") + || !strcasecmp(type, "sound") + || !strcasecmp(type, "audio") + || !strcasecmp(type, "enca") + || !strcasecmp(type, "samr") // 3GPP AMR + || !strcasecmp(type, "sawb") // 3GPP AMR/WB + || !strcasecmp(type, "mp4a")) { + return MP4_AUDIO_TRACK_TYPE; + } + + if (!strcasecmp(type, "sdsm") + || !strcasecmp(type, "scene") + || !strcasecmp(type, "bifs")) { + return MP4_SCENE_TRACK_TYPE; + } + + if (!strcasecmp(type, "odsm") + || !strcasecmp(type, "od")) { + return MP4_OD_TRACK_TYPE; + } + if (strcasecmp(type, "cntl") == 0) { + return MP4_CNTL_TRACK_TYPE; + } + VERBOSE_WARNING(verbosity, + printf("Attempt to normalize %s did not match\n", + type)); + return type; +} diff -Nru faac-1.26/common/mp4v2/mp4util.h faac-1.28/common/mp4v2/mp4util.h --- faac-1.26/common/mp4v2/mp4util.h 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/mp4util.h 2009-01-25 01:14:34.000000000 +0000 @@ -24,26 +24,17 @@ #include #ifndef ASSERT -#ifdef NDEBUG -#define ASSERT(expr) -#else #define ASSERT(expr) \ if (!(expr)) { \ - fflush(stdout); \ - assert((expr)); \ + throw new MP4Error("assert failure", __STRING((expr))); \ } #endif -#endif -#ifdef NDEBUG -#define WARNING(expr) -#else #define WARNING(expr) \ if (expr) { \ fflush(stdout); \ fprintf(stderr, "Warning (%s) in %s at line %u\n", \ __STRING(expr), __FILE__, __LINE__); \ } -#endif #define VERBOSE(exprverbosity, verbosity, expr) \ if (((exprverbosity) & (verbosity)) == (exprverbosity)) { expr; } @@ -172,6 +163,7 @@ FILE* pFile = stdout, u_int8_t indent = 0); inline void* MP4Malloc(size_t size) { + if (size == 0) return NULL; void* p = malloc(size); if (p == NULL && size > 0) { throw new MP4Error(errno); @@ -180,6 +172,7 @@ } inline void* MP4Calloc(size_t size) { + if (size == 0) return NULL; return memset(MP4Malloc(size), 0, size); } @@ -189,6 +182,14 @@ return s2; } +#ifdef _WIN32 +inline wchar_t* MP4Stralloc(const wchar_t* s1) { + wchar_t* s2 = (wchar_t*)MP4Malloc((wcslen(s1) + 1)*sizeof(wchar_t)); + wcscpy(s2, s1); + return s2; +} +#endif + inline void* MP4Realloc(void* p, u_int32_t newSize) { // workaround library bug if (p == NULL && newSize == 0) { @@ -201,17 +202,13 @@ return p; } -inline void MP4Free(void* p) { - free(p); -} - inline u_int32_t STRTOINT32(const char* s) { - return (s[0] << 24) | (s[1] << 16) | (s[2] << 8) | s[3]; + return ntohl(*(uint32_t *)s); } inline void INT32TOSTR(u_int32_t i, char* s) { - s[0] = ((i >> 24) & 0xFF); s[1] = ((i >> 16) & 0xFF); - s[2] = ((i >> 8) & 0xFF); s[3] = (i & 0xFF); s[4] = 0; + *(uint32_t *)s = htonl(i); + s[4] = 0; } inline MP4Timestamp MP4GetAbsTimestamp() { @@ -239,4 +236,7 @@ char* MP4ToBase64(const u_int8_t* pData, u_int32_t dataSize); +const char* MP4NormalizeTrackType(const char* type, + uint32_t verbosity); + #endif /* __MP4_UTIL_INCLUDED__ */ diff -Nru faac-1.26/common/mp4v2/mpeg4ip.h faac-1.28/common/mp4v2/mpeg4ip.h --- faac-1.26/common/mp4v2/mpeg4ip.h 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/mpeg4ip.h 2009-01-26 22:42:35.000000000 +0000 @@ -13,10 +13,11 @@ * * The Initial Developer of the Original Code is Cisco Systems Inc. * Portions created by Cisco Systems Inc. are - * Copyright (C) Cisco Systems Inc. 2000, 2001. All Rights Reserved. + * Copyright (C) Cisco Systems Inc. 2000-2005. All Rights Reserved. * * Contributor(s): * Dave Mackie dmackie@cisco.com + * Bill May wmay@cisco.com */ #ifndef __MPEG4IP_INCLUDED__ @@ -25,116 +26,41 @@ /* project wide applicable stuff here */ -#ifdef WIN32 -#define HAVE_IN_PORT_T -#define HAVE_SOCKLEN_T -#define NEED_SDL_VIDEO_IN_MAIN_THREAD +#ifndef _WIN32 +#ifdef PACKAGE_BUGREPORT +#define TEMP_PACKAGE_BUGREPORT PACKAGE_BUGREPORT +#define TEMP_PACKAGE_NAME PACKAGE_NAME +#define TEMP_PACKAGE_STRING PACKAGE_STRING +#define TEMP_PACKAGE_TARNAME PACKAGE_TARNAME +#define TEMP_PACKAGE_VERSION PACKAGE_VERSION +#undef PACKAGE_BUGREPORT +#undef PACKAGE_NAME +#undef PACKAGE_STRING +#undef PACKAGE_TARNAME +#undef PACKAGE_VERSION +#include +#undef PACKAGE_BUGREPORT +#undef PACKAGE_NAME +#undef PACKAGE_STRING +#undef PACKAGE_TARNAME +#undef PACKAGE_VERSION +#define PACKAGE_BUGREPORT TEMP_PACKAGE_BUGREPORT +#define PACKAGE_NAME TEMP_PACKAGE_NAME +#define PACKAGE_STRING TEMP_PACKAGE_STRING +#define PACKAGE_TARNAME TEMP_PACKAGE_TARNAME +#define PACKAGE_VERSION TEMP_PACKAGE_VERSION #else -#undef PACKAGE -#undef VERSION #include -#undef PACKAGE -#undef VERSION -// so these don't propogate +#endif #endif // the mpeg4ip_package and mpeg4ip_version are always in this // file #include "mpeg4ip_version.h" - - - -#ifdef WIN32 - -#define _WIN32_WINNT 0x0400 -#define _WINSOCKAPI_ -#include -#include -#include -#include -#include -#include -#include - -typedef unsigned __int64 uint64_t; -typedef unsigned __int32 uint32_t; -typedef unsigned __int16 uint16_t; -typedef unsigned __int8 uint8_t; -typedef unsigned __int64 u_int64_t; -typedef unsigned __int32 u_int32_t; -typedef unsigned __int16 u_int16_t; -typedef unsigned __int8 u_int8_t; -typedef __int64 int64_t; -typedef __int32 int32_t; -typedef __int16 int16_t; -typedef __int8 int8_t; -typedef unsigned short in_port_t; -typedef int socklen_t; -typedef int ssize_t; -#define snprintf _snprintf -#define strncasecmp _strnicmp -#define strcasecmp _stricmp - -#include -#include -#include -#include -#define write _write -#define lseek _lseek -#define close _close -#define open _open -#define access _access -#define vsnprintf _vsnprintf -#define F_OK 0 -#define OPEN_RDWR (_O_RDWR | _O_BINARY) -#define OPEN_CREAT (_O_CREAT | _O_BINARY) -#define OPEN_RDONLY (_O_RDONLY | _O_BINARY) -#define srandom srand -#define random rand - -#define IOSBINARY ios::binary - -#ifdef __cplusplus -extern "C" { -#endif -int gettimeofday(struct timeval *t, void *); -#ifdef __cplusplus -} -#endif - -#define PATH_MAX MAX_PATH -#define MAX_UINT64 -1 -#define D64F "I64d" -#define U64F "I64u" -#define X64F "I64x" - -#define TO_D64(a) (a##I64) -#define TO_U64(a) (a##UI64) - -#define LOG_EMERG 0 -#define LOG_ALERT 1 -#define LOG_CRIT 2 -#define LOG_ERR 3 -#define LOG_WARNING 4 -#define LOG_NOTICE 5 -#define LOG_INFO 6 -#define LOG_DEBUG 7 - -#if !__STDC__ && _INTEGRAL_MAX_BITS >= 64 -#define VAR_TO_FPOS(fpos, var) (fpos) = (var) -#define FPOS_TO_VAR(fpos, typed, var) (var) = (typed)(_FPOSOFF(fpos)) -#else -#define VAR_TO_FPOS(fpos, var) (fpos).lopart = ((var) & UINT_MAX); (fpos).hipart = ((var) >> 32) -#define FPOS_TO_VAR(fpos, typed, var) (var) = (typed)((uint64_t)((fpos).hipart ) << 32 | (fpos).lopart) -#endif - -#define __STRING(expr) #expr - -#define FOPEN_READ_BINARY "rb" -#define FOPEN_WRITE_BINARY "wb" - -#define UINT64_TO_DOUBLE(a) ((double)((int64_t)(a))) +#ifdef _WIN32 +#include "mpeg4ip_win32.h" +#include "mpeg4ip_version.h" #else /* UNIX */ /***************************************************************************** * UNIX LIKE DEFINES BELOW THIS POINT @@ -166,7 +92,7 @@ #ifdef HAVE_STDINT_H #include #endif -#if !defined(HAVE_INTTYPES_H) || !defined(HAVE_STDINT_H) +#if !defined(HAVE_INTTYPES_H) && !defined(HAVE_STDINT_H) #error "Don't have stdint.h or inttypes.h - no way to get uint8_t" #endif @@ -194,6 +120,14 @@ #endif #include +#ifdef __cplusplus +extern "C" { +#endif +char *strcasestr(const char *haystack, const char *needle); +#ifdef __cplusplus +} +#endif + #define OPEN_RDWR O_RDWR #define OPEN_CREAT O_CREAT #define OPEN_RDONLY O_RDONLY @@ -207,7 +141,7 @@ #define U64F "lu" #define X64F "lx" -#define TO_D64(a) (a##LD) +#define TO_D64(a) (a##L) #define TO_U64(a) (a##LU) #else #define MAX_UINT64 -1LLU @@ -215,7 +149,7 @@ #define U64F "llu" #define X64F "llx" -#define TO_D64(a) (a##LLD) +#define TO_D64(a) (a##LL) #define TO_U64(a) (a##LLU) #endif @@ -336,9 +270,29 @@ #endif #ifndef __cplusplus + #ifndef bool -typedef unsigned char bool; + #if SIZEOF_BOOL == 8 + typedef uint64_t bool; + #else + #if SIZEOF_BOOL == 4 + typedef uint32_t bool; + #else + #if SIZEOF_BOOL == 2 + typedef uint16_t bool; + #else + typedef unsigned char bool; + #endif + #endif + #endif + #ifndef false + #define false FALSE + #endif + #ifndef true + #define true TRUE + #endif #endif + #endif #ifndef ROUND @@ -364,5 +318,18 @@ # define UINT64_MAX TO_U64(0xffffffffffffffff) #endif +typedef enum audio_format_t { + AUDIO_FMT_U8 = 0, + AUDIO_FMT_S8, + AUDIO_FMT_U16LSB, + AUDIO_FMT_S16LSB, + AUDIO_FMT_U16MSB, + AUDIO_FMT_S16MSB, + AUDIO_FMT_U16, + AUDIO_FMT_S16, + AUDIO_FMT_FLOAT, + AUDIO_FMT_HW_AC3, +} audio_format_t; + #endif /* __MPEG4IP_INCLUDED__ */ diff -Nru faac-1.26/common/mp4v2/mpeg4ip_version.h faac-1.28/common/mp4v2/mpeg4ip_version.h --- faac-1.26/common/mp4v2/mpeg4ip_version.h 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/mpeg4ip_version.h 2009-01-25 01:14:34.000000000 +0000 @@ -1,2 +1,6 @@ #define MPEG4IP_PACKAGE "mpeg4ip" -#define MPEG4IP_VERSION "1.1.3" +#define MPEG4IP_VERSION "1.6.1" +#define MPEG4IP_MAJOR_VERSION 0x1 +#define MPEG4IP_MINOR_VERSION 0x6 +#define MPEG4IP_CVS_VERSION 0x1 +#define MPEG4IP_HEX_VERSION ((MPEG4IP_MAJOR_VERSION << 16) | (MPEG4IP_MINOR_VERSION << 8) | MPEG4IP_CVS_VERSION) diff -Nru faac-1.26/common/mp4v2/mpeg4ip_win32.h faac-1.28/common/mp4v2/mpeg4ip_win32.h --- faac-1.26/common/mp4v2/mpeg4ip_win32.h 1970-01-01 00:00:00.000000000 +0000 +++ faac-1.28/common/mp4v2/mpeg4ip_win32.h 2009-01-25 01:14:34.000000000 +0000 @@ -0,0 +1,178 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2005. All Rights Reserved. + * + * Contributor(s): + * Bill May wmay@cisco.com + */ +/* windows defines */ +#ifndef __MPEG4IP_WIN32_H__ +#define __MPEG4IP_WIN32_H__ +#define HAVE_IN_PORT_T +#define HAVE_SOCKLEN_T +#define NEED_SDL_VIDEO_IN_MAIN_THREAD +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0400 +#endif +#define _WINSOCKAPI_ +#define _INTEGRAL_MAX_BITS 64 +#ifndef __GNUC__ +#define _CRT_SECURE_NO_DEPRECATE 1 +#ifndef _WIN32 +#define _WIN32 +#endif +#endif +#include +#include +#include +#include +#include +#include +#include + +#ifndef inline +#define inline __inline +#endif +typedef unsigned __int64 uint64_t; +typedef unsigned __int32 uint32_t; +typedef unsigned __int16 uint16_t; +typedef unsigned __int8 uint8_t; +typedef unsigned __int64 u_int64_t; +typedef unsigned __int32 u_int32_t; +typedef unsigned __int16 u_int16_t; +typedef unsigned __int8 u_int8_t; +typedef signed __int64 int64_t; +typedef signed __int32 int32_t; +typedef signed __int16 int16_t; +typedef signed __int8 int8_t; +typedef unsigned short in_port_t; +typedef int socklen_t; +typedef int ssize_t; +typedef unsigned int uint; +static inline int snprintf(char *buffer, size_t count, + const char *format, ...) { + va_list ap; + int ret; + va_start(ap, format); + ret = vsnprintf_s(buffer, count, _TRUNCATE, format, ap); + va_end(ap); + if (ret == -1) { + if (errno == EINVAL) return -1; + return (int)count; + } + return ret; +} +#define strncasecmp _strnicmp +#define strcasecmp _stricmp +#define localtime_r(a,b) localtime_s(b,a) +#define printf printf_s +#define fprintf fprintf_s + +#include +#include +#include +#include +#ifndef __GNUC__ +#define read _read +#define write _write +#define lseek _lseek +#define close _close +#define open _open +#define access _access +#define vsnprintf _vsnprintf +#define stat _stati64 +#define fstat _fstati64 +#define fileno _fileno +#define strdup _strdup +#endif +#define F_OK 0 +#define OPEN_RDWR (_O_RDWR | _O_BINARY) +#define OPEN_CREAT (_O_CREAT | _O_BINARY) +#define OPEN_RDONLY (_O_RDONLY | _O_BINARY) +#define srandom srand +#define random rand + +#define IOSBINARY ios::binary + +#ifdef __cplusplus +extern "C" { +#endif +int gettimeofday(struct timeval *t, void *); +#ifdef __cplusplus +} +#endif + +#ifndef PATH_MAX +#define PATH_MAX MAX_PATH +#endif +#define MAX_UINT64 -1 + +#define D64F "I64d" +#define U64F "I64u" +#define X64F "I64x" + +#define TO_D64(a) (a##I64) +#define TO_U64(a) (a##UI64) + +#define LOG_EMERG 0 +#define LOG_ALERT 1 +#define LOG_CRIT 2 +#define LOG_ERR 3 +#define LOG_WARNING 4 +#define LOG_NOTICE 5 +#define LOG_INFO 6 +#define LOG_DEBUG 7 + +#if defined (__GNUC__) || (!__STDC__ && _INTEGRAL_MAX_BITS >= 64) +#define VAR_TO_FPOS(fpos, var) (fpos) = (var) +#define FPOS_TO_VAR(fpos, typed, var) (var) = (typed)(fpos) +#else +#define VAR_TO_FPOS(fpos, var) (fpos).lopart = ((var) & UINT_MAX); (fpos).hipart = ((var) >> 32) +#define FPOS_TO_VAR(fpos, typed, var) (var) = (typed)((uint64_t)((fpos).hipart ) << 32 | (fpos).lopart) +#endif + +#define __STRING(expr) #expr + +#define FOPEN_READ_BINARY "rb" +#define FOPEN_WRITE_BINARY "wb" + +#define UINT64_TO_DOUBLE(a) ((double)((int64_t)(a))) +#ifdef __cplusplus +extern "C" { +#endif +char *strcasestr(const char *haystack, const char *needle); +#ifdef __cplusplus +} +#endif + + +#define SIZEOF_BOOL 1 + +#ifndef __GNUC__ +#ifndef _SS_PAD1SIZE +struct sockaddr_storage { + unsigned short ss_family; + uint32_t ss_align; + char __ss_padding[128 - 2 * sizeof(uint32_t)]; +}; +#endif +#pragma warning(disable : 4244) +#pragma warning(disable: 4996) +#define HAVE_STRUCT_SOCKADDR_STORAGE 1 +#define HAVE_INET_PTON 1 +#define HAVE_INET_NTOP 1 +#endif +#endif diff -Nru faac-1.26/common/mp4v2/qosqualifiers.cpp faac-1.28/common/mp4v2/qosqualifiers.cpp --- faac-1.26/common/mp4v2/qosqualifiers.cpp 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/qosqualifiers.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -20,7 +20,51 @@ */ #include "mp4common.h" +#if 1 +MP4QosDescriptorBase::MP4QosDescriptorBase (u_int8_t tag) + : MP4Descriptor(tag) +{ + switch (tag) { + case MP4QosDescrTag: + AddProperty( /* 0 */ + new MP4Integer8Property("predefined")); + AddProperty( /* 1 */ + new MP4QosQualifierProperty("qualifiers", + MP4QosTagsStart, + MP4QosTagsEnd, Optional, Many)); + break; + case MP4MaxDelayQosTag: + AddProperty( /* 0 */ + new MP4Integer32Property("maxDelay")); + break; + case MP4PrefMaxDelayQosTag: + AddProperty( /* 0 */ + new MP4Integer32Property("prefMaxDelay")); + break; + case MP4LossProbQosTag: + AddProperty( /* 0 */ + new MP4Float32Property("lossProb")); + break; + case MP4MaxGapLossQosTag: + AddProperty( /* 0 */ + new MP4Integer32Property("maxGapLoss")); + break; + case MP4MaxAUSizeQosTag: + AddProperty( /* 0 */ + new MP4Integer32Property("maxAUSize")); + break; + case MP4AvgAUSizeQosTag: + AddProperty( /* 0 */ + new MP4Integer32Property("avgAUSize")); + break; + case MP4MaxAURateQosTag: + AddProperty( /* 0 */ + new MP4Integer32Property("maxAURate")); + break; + } +} +#else MP4QosDescriptor::MP4QosDescriptor() : MP4Descriptor(MP4QosDescrTag) { @@ -79,9 +123,9 @@ AddProperty( /* 0 */ new MP4Integer32Property("maxAURate")); } - +#endif MP4UnknownQosQualifier::MP4UnknownQosQualifier() - : MP4QosQualifier() + : MP4Descriptor() { AddProperty( /* 0 */ new MP4BytesProperty("data")); @@ -100,8 +144,8 @@ MP4Descriptor* MP4QosQualifierProperty::CreateDescriptor(u_int8_t tag) { MP4Descriptor* pDescriptor = NULL; - switch (tag) { +#if 0 case MP4MaxDelayQosTag: pDescriptor = new MP4MaxDelayQosQualifier(); break; @@ -123,6 +167,17 @@ case MP4MaxAURateQosTag: pDescriptor = new MP4MaxAURateQosQualifier(); break; +#else + case MP4MaxDelayQosTag: + case MP4PrefMaxDelayQosTag: + case MP4LossProbQosTag: + case MP4MaxGapLossQosTag: + case MP4MaxAUSizeQosTag: + case MP4AvgAUSizeQosTag: + case MP4MaxAURateQosTag: + pDescriptor = new MP4QosDescriptorBase(tag); + break; +#endif default: pDescriptor = new MP4UnknownQosQualifier(); pDescriptor->SetTag(tag); diff -Nru faac-1.26/common/mp4v2/qosqualifiers.h faac-1.28/common/mp4v2/qosqualifiers.h --- faac-1.26/common/mp4v2/qosqualifiers.h 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/qosqualifiers.h 2009-01-25 01:14:34.000000000 +0000 @@ -24,12 +24,14 @@ const u_int8_t MP4QosDescrTag = 0x0C; +#if 0 class MP4QosDescriptor : public MP4Descriptor { public: MP4QosDescriptor(); }; typedef MP4Descriptor MP4QosQualifier; +#endif const u_int8_t MP4QosTagsStart = 0x01; const u_int8_t MP4MaxDelayQosTag = 0x01; @@ -41,6 +43,7 @@ const u_int8_t MP4MaxAURateQosTag = 0x43; const u_int8_t MP4QosTagsEnd = 0xFF; +#if 0 class MP4MaxDelayQosQualifier : public MP4QosQualifier { public: MP4MaxDelayQosQualifier(); @@ -75,8 +78,14 @@ public: MP4MaxAURateQosQualifier(); }; +#else +class MP4QosDescriptorBase : public MP4Descriptor { + public: + MP4QosDescriptorBase(uint8_t tag); +}; -class MP4UnknownQosQualifier : public MP4QosQualifier { +#endif +class MP4UnknownQosQualifier : public MP4Descriptor { public: MP4UnknownQosQualifier(); void Read(MP4File* pFile); diff -Nru faac-1.26/common/mp4v2/README faac-1.28/common/mp4v2/README --- faac-1.26/common/mp4v2/README 2004-07-27 08:28:24.000000000 +0000 +++ faac-1.28/common/mp4v2/README 2009-01-25 01:14:34.000000000 +0000 @@ -17,14 +17,12 @@ The test and util subdirectories contain some simple programs that use this library. +Once make install is run, to use this library, you should: To use this library in your application, it should be sufficient to: -1) add mpeg4ip/include and mpeg4ip/lib/mp4v2 to your INCLUDE path, - e.g. gcc -Impeg4ip/include -Impeg4ip/lib/mp4v2 ... +1) add the installed library to your final link: + e.g. gcc ... -o foo foo.cpp -lmp4v2 -2) add mpeg4ip/lib/mp4v2/libmp4v2.la (or /usr/local/lib/libmp4v2.la) - e.g. gcc ... -o foo foo.cpp mpeg4ip/lib/mp4v2/libmp4v2.a - -3) include mp4.h into your code, +2) include mp4.h into your code, e.g. #include diff -Nru faac-1.26/common/mp4v2/rtphint.cpp faac-1.28/common/mp4v2/rtphint.cpp --- faac-1.26/common/mp4v2/rtphint.cpp 2007-08-22 18:31:49.000000000 +0000 +++ faac-1.28/common/mp4v2/rtphint.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -73,7 +73,7 @@ { if (m_pRefTrack == NULL) { MP4Integer32Property* pRefTrackIdProperty = NULL; - m_pTrakAtom->FindProperty( + (void)m_pTrakAtom->FindProperty( "trak.tref.hint.entries[0].trackId", (MP4Property**)&pRefTrackIdProperty); ASSERT(pRefTrackIdProperty); @@ -85,12 +85,12 @@ void MP4RtpHintTrack::InitRtpStart() { struct timeval tv; - gettimeofday(&tv, NULL); + (void)gettimeofday(&tv, NULL); srandom((tv.tv_usec << 12) | (tv.tv_sec & 0xFFF)); ASSERT(m_pTrakAtom); - m_pTrakAtom->FindProperty( + (void)m_pTrakAtom->FindProperty( "trak.udta.hnti.rtp .snro.offset", (MP4Property**)&m_pSnroProperty); @@ -100,7 +100,7 @@ m_rtpSequenceStart = random(); } - m_pTrakAtom->FindProperty( + (void)m_pTrakAtom->FindProperty( "trak.udta.hnti.rtp .tsro.offset", (MP4Property**)&m_pTsroProperty); @@ -274,7 +274,7 @@ ASSERT(pTsroAtom); - pTsroAtom->FindProperty("offset", + (void)pTsroAtom->FindProperty("offset", (MP4Property**)&m_pTsroProperty); ASSERT(m_pTsroProperty); @@ -289,19 +289,19 @@ ASSERT(m_pTrakAtom); if (m_pRtpMapProperty == NULL) { - m_pTrakAtom->FindProperty( + (void)m_pTrakAtom->FindProperty( "trak.udta.hinf.payt.rtpMap", (MP4Property**)&m_pRtpMapProperty); } if (m_pPayloadNumberProperty == NULL) { - m_pTrakAtom->FindProperty( + (void)m_pTrakAtom->FindProperty( "trak.udta.hinf.payt.payloadNumber", (MP4Property**)&m_pPayloadNumberProperty); } if (m_pMaxPacketSizeProperty == NULL) { - m_pTrakAtom->FindProperty( + (void)m_pTrakAtom->FindProperty( "trak.mdia.minf.stbl.stsd.rtp .maxPacketSize", (MP4Property**)&m_pMaxPacketSizeProperty); } @@ -314,7 +314,7 @@ char **ppEncodingParams) { const char* pRtpMap; - char* pSlash; + const char* pSlash; u_int32_t length; InitPayload(); @@ -325,7 +325,7 @@ *ppEncodingParams = NULL; if (m_pRtpMapProperty) { pRtpMap = m_pRtpMapProperty->GetValue(); - pSlash = strchr((char*)pRtpMap, '/'); + pSlash = strchr(pRtpMap, '/'); if (pSlash) { length = pSlash - pRtpMap; @@ -395,7 +395,7 @@ } char* rtpMapBuf = (char*)MP4Malloc(len); - sprintf(rtpMapBuf, "%s/%u%c%s", + snprintf(rtpMapBuf, len, "%s/%u%c%s", payloadName, GetTimeScale(), encoding_parms != NULL ? '/' : '\0', @@ -415,31 +415,34 @@ sdpMediaType = "audio"; } else if (!strcmp(m_pRefTrack->GetType(), MP4_VIDEO_TRACK_TYPE)) { sdpMediaType = "video"; + } else if (!strcmp(m_pRefTrack->GetType(), MP4_CNTL_TRACK_TYPE)) { + sdpMediaType = "control"; } else { sdpMediaType = "application"; } - char* sdpBuf = (char*)MP4Malloc( - strlen(sdpMediaType) + strlen(rtpMapBuf) + 256); + uint32_t maxlen = + strlen(sdpMediaType) + strlen(rtpMapBuf) + 256; + char* sdpBuf = (char*)MP4Malloc(maxlen); uint32_t buflen; - buflen = sprintf(sdpBuf, + buflen = snprintf(sdpBuf, maxlen, "m=%s 0 RTP/AVP %u\015\012" "a=control:trackID=%u\015\012", sdpMediaType, payloadNumber, m_trackId); if (include_rtp_map) { - buflen += sprintf(sdpBuf + buflen, + buflen += snprintf(sdpBuf + buflen, maxlen - buflen, "a=rtpmap:%u %s\015\012", payloadNumber, rtpMapBuf); } if (include_mpeg4_esid) { - sprintf(sdpBuf + buflen, + snprintf(sdpBuf + buflen, maxlen - buflen, "a=mpeg4-esid:%u\015\012", m_pRefTrack->GetId()); } MP4StringProperty* pSdpProperty = NULL; - m_pTrakAtom->FindProperty("trak.udta.hnti.sdp .sdpText", + (void)m_pTrakAtom->FindProperty("trak.udta.hnti.sdp .sdpText", (MP4Property**)&pSdpProperty); ASSERT(pSdpProperty); pSdpProperty->SetValue(sdpBuf); @@ -673,26 +676,26 @@ ASSERT(pHinfAtom); - pHinfAtom->FindProperty("hinf.trpy.bytes", (MP4Property**)&m_pTrpy); - pHinfAtom->FindProperty("hinf.nump.packets", (MP4Property**)&m_pNump); - pHinfAtom->FindProperty("hinf.tpyl.bytes", (MP4Property**)&m_pTpyl); - pHinfAtom->FindProperty("hinf.maxr.bytes", (MP4Property**)&m_pMaxr); - pHinfAtom->FindProperty("hinf.dmed.bytes", (MP4Property**)&m_pDmed); - pHinfAtom->FindProperty("hinf.dimm.bytes", (MP4Property**)&m_pDimm); - pHinfAtom->FindProperty("hinf.pmax.bytes", (MP4Property**)&m_pPmax); - pHinfAtom->FindProperty("hinf.dmax.milliSecs", (MP4Property**)&m_pDmax); + (void)pHinfAtom->FindProperty("hinf.trpy.bytes", (MP4Property**)&m_pTrpy); + (void)pHinfAtom->FindProperty("hinf.nump.packets", (MP4Property**)&m_pNump); + (void)pHinfAtom->FindProperty("hinf.tpyl.bytes", (MP4Property**)&m_pTpyl); + (void)pHinfAtom->FindProperty("hinf.maxr.bytes", (MP4Property**)&m_pMaxr); + (void)pHinfAtom->FindProperty("hinf.dmed.bytes", (MP4Property**)&m_pDmed); + (void)pHinfAtom->FindProperty("hinf.dimm.bytes", (MP4Property**)&m_pDimm); + (void)pHinfAtom->FindProperty("hinf.pmax.bytes", (MP4Property**)&m_pPmax); + (void)pHinfAtom->FindProperty("hinf.dmax.milliSecs", (MP4Property**)&m_pDmax); MP4Atom* pHmhdAtom = m_pTrakAtom->FindAtom("trak.mdia.minf.hmhd"); ASSERT(pHmhdAtom); - pHmhdAtom->FindProperty("hmhd.maxPduSize", (MP4Property**)&m_pMaxPdu); - pHmhdAtom->FindProperty("hmhd.avgPduSize", (MP4Property**)&m_pAvgPdu); - pHmhdAtom->FindProperty("hmhd.maxBitRate", (MP4Property**)&m_pMaxBitRate); - pHmhdAtom->FindProperty("hmhd.avgBitRate", (MP4Property**)&m_pAvgBitRate); + (void)pHmhdAtom->FindProperty("hmhd.maxPduSize", (MP4Property**)&m_pMaxPdu); + (void)pHmhdAtom->FindProperty("hmhd.avgPduSize", (MP4Property**)&m_pAvgPdu); + (void)pHmhdAtom->FindProperty("hmhd.maxBitRate", (MP4Property**)&m_pMaxBitRate); + (void)pHmhdAtom->FindProperty("hmhd.avgBitRate", (MP4Property**)&m_pAvgBitRate); MP4Integer32Property* pMaxrPeriod = NULL; - pHinfAtom->FindProperty("hinf.maxr.granularity", + (void)pHinfAtom->FindProperty("hinf.maxr.granularity", (MP4Property**)&pMaxrPeriod); if (pMaxrPeriod) { pMaxrPeriod->SetValue(1000); // 1 second @@ -1093,7 +1096,7 @@ ASSERT(pTrakAtom); MP4Integer32Property* pTrackIdProperty = NULL; - pTrakAtom->FindProperty( + (void)pTrakAtom->FindProperty( "trak.tref.hint.entries", (MP4Property**)&pTrackIdProperty); ASSERT(pTrackIdProperty); @@ -1317,7 +1320,7 @@ pSampleTrack->GetTrakAtom(); char sdName[64]; - sprintf(sdName, "trak.mdia.minf.stbl.stsd.*[%u]", sampleDescrIndex); + snprintf(sdName, 64, "trak.mdia.minf.stbl.stsd.*[%u]", sampleDescrIndex); MP4Atom* pSdAtom = pTrakAtom->FindAtom(sdName); diff -Nru faac-1.26/common/mp4v2/virtual_io.cpp faac-1.28/common/mp4v2/virtual_io.cpp --- faac-1.26/common/mp4v2/virtual_io.cpp 1970-01-01 00:00:00.000000000 +0000 +++ faac-1.28/common/mp4v2/virtual_io.cpp 2009-01-25 01:14:34.000000000 +0000 @@ -0,0 +1,92 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001 - 2005. All Rights Reserved. + * + * Contributor(s): + * Ben Allison benski at nullsoft.com + * + * Virtual I/O support, for file support other than fopen/fread/fwrite + */ + +#include "mp4common.h" +#include "virtual_io.h" + +/* --------- Virtual IO for FILE * --------- */ + +u_int64_t FILE_GetFileLength(void *user) +{ + FILE *fp = (FILE *)user; + struct stat s; + if (fstat(fileno(fp), &s) < 0) { + throw new MP4Error(errno, "stat failed", "MP4Open"); + } + return s.st_size; +} + +int FILE_SetPosition(void *user, u_int64_t position) +{ + FILE *fp = (FILE *)user; + fpos_t fpos; + VAR_TO_FPOS(fpos, position); + return fsetpos(fp, &fpos); +} + +int FILE_GetPosition(void *user, u_int64_t *position) +{ + FILE *fp = (FILE *)user; + fpos_t fpos; + if (fgetpos(fp, &fpos) < 0) { + throw new MP4Error(errno, "MP4GetPosition"); + } + + FPOS_TO_VAR(fpos, u_int64_t, *position); + return 0; +} + +size_t FILE_Read(void *user, void *buffer, size_t size) +{ + FILE *fp = (FILE *)user; + return fread(buffer, 1, size, fp); +} + +size_t FILE_Write(void *user, void *buffer, size_t size) +{ + FILE *fp = (FILE *)user; + return fwrite(buffer, 1, size, fp); +} + +int FILE_EndOfFile(void *user) +{ + FILE *fp = (FILE *)user; + return feof(fp); +} + +int FILE_Close(void *user) +{ + FILE *fp = (FILE *)user; + return fclose(fp); +} + +Virtual_IO FILE_virtual_IO = +{ + FILE_GetFileLength, + FILE_SetPosition, + FILE_GetPosition, + FILE_Read, + FILE_Write, + FILE_EndOfFile, + FILE_Close, +}; diff -Nru faac-1.26/common/mp4v2/virtual_io.h faac-1.28/common/mp4v2/virtual_io.h --- faac-1.26/common/mp4v2/virtual_io.h 1970-01-01 00:00:00.000000000 +0000 +++ faac-1.28/common/mp4v2/virtual_io.h 2009-01-25 01:14:34.000000000 +0000 @@ -0,0 +1,31 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is MPEG4IP. + * + * The Initial Developer of the Original Code is Cisco Systems Inc. + * Portions created by Cisco Systems Inc. are + * Copyright (C) Cisco Systems Inc. 2001 - 2005. All Rights Reserved. + * + * Contributor(s): + * Ben Allison benski at nullsoft.com + * + * Virtual I/O support, for file support other than fopen/fread/fwrite + */ + +#ifndef __VIRTUAL_IO_INCLUDED__ +#define __VIRTUAL_IO_INCLUDED__ + +#include "mpeg4ip.h" + +extern Virtual_IO FILE_virtual_IO; + +#endif diff -Nru faac-1.26/config.guess faac-1.28/config.guess --- faac-1.26/config.guess 2007-08-17 03:14:13.000000000 +0000 +++ faac-1.28/config.guess 2009-02-10 08:37:01.000000000 +0000 @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. -timestamp='2007-07-22' +timestamp='2006-07-02' # 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 @@ -161,7 +161,6 @@ arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched @@ -330,7 +329,7 @@ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) @@ -781,7 +780,7 @@ i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; - *:MINGW*:*) + i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) @@ -791,15 +790,12 @@ i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; - *:Interix*:[3456]*) - case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - EM64T | authenticamd) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - esac ;; + x86:Interix*:[3456]*) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T:Interix*:[3456]*) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; @@ -954,9 +950,6 @@ x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; - xtensa:Linux:*:*) - echo xtensa-unknown-linux-gnu - exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent @@ -1215,15 +1208,6 @@ SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; diff -Nru faac-1.26/config.sub faac-1.28/config.sub --- faac-1.26/config.sub 2007-08-17 03:14:13.000000000 +0000 +++ faac-1.28/config.sub 2009-02-10 08:37:01.000000000 +0000 @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. -timestamp='2007-06-28' +timestamp='2006-07-02' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -245,12 +245,12 @@ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ - | fido | fr30 | frv \ + | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep \ + | maxq | mb | microblaze | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -276,7 +276,6 @@ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | score \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ @@ -285,7 +284,7 @@ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; @@ -324,7 +323,7 @@ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ @@ -368,7 +367,7 @@ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) @@ -475,8 +474,8 @@ basic_machine=craynv-cray os=-unicosmp ;; - cr16) - basic_machine=cr16-unknown + cr16c) + basic_machine=cr16c-unknown os=-elf ;; crds | unos) @@ -683,10 +682,6 @@ basic_machine=i386-pc os=-mingw32 ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; miniframe) basic_machine=m68000-convergent ;; @@ -914,10 +909,6 @@ sb1el) basic_machine=mipsisa64sb1el-unknown ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; sei) basic_machine=mips-sei os=-seiux @@ -929,9 +920,6 @@ basic_machine=sh-hitachi os=-hms ;; - sh5el) - basic_machine=sh5le-unknown - ;; sh64) basic_machine=sh64-unknown ;; @@ -1226,7 +1214,7 @@ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) + | -skyos* | -haiku* | -rdos* | -toppers*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1378,9 +1366,6 @@ # system, and we'll never get to this point. case $basic_machine in - score-*) - os=-elf - ;; spu-*) os=-elf ;; @@ -1421,9 +1406,6 @@ m68*-cisco) os=-aout ;; - mep-*) - os=-elf - ;; mips*-cisco) os=-elf ;; diff -Nru faac-1.26/configure faac-1.28/configure --- faac-1.26/configure 2007-10-15 08:11:34.000000000 +0000 +++ faac-1.28/configure 2009-02-10 08:36:58.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for FAAC 1.25. +# Generated by GNU Autoconf 2.61 for FAAC 1.28. # # Report bugs to . # @@ -728,8 +728,8 @@ # Identity of this package. PACKAGE_NAME='FAAC' PACKAGE_TARNAME='faac' -PACKAGE_VERSION='1.25' -PACKAGE_STRING='FAAC 1.25' +PACKAGE_VERSION='1.28' +PACKAGE_STRING='FAAC 1.28' PACKAGE_BUGREPORT='faac-dev@lists.sourceforge.net' # Factoring default headers for most tests. @@ -808,7 +808,6 @@ INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA -am__isrc CYGPATH_W PACKAGE VERSION @@ -857,7 +856,6 @@ host_cpu host_vendor host_os -SED GREP EGREP LN_S @@ -1394,7 +1392,7 @@ # 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 FAAC 1.25 to adapt to many kinds of systems. +\`configure' configures FAAC 1.28 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1464,7 +1462,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of FAAC 1.25:";; + short | recursive ) echo "Configuration of FAAC 1.28:";; esac cat <<\_ACEOF @@ -1569,7 +1567,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -FAAC configure 1.25 +FAAC configure 1.28 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1583,7 +1581,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by FAAC $as_me 1.25, which was +It was created by FAAC $as_me 1.28, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -1967,8 +1965,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. -am__api_version='1.10' - +am__api_version="1.9" # 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: @@ -2120,53 +2117,38 @@ echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi -{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 -echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } -if test -z "$MKDIR_P"; then - if test "${ac_cv_path_mkdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - '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 - - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" +if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' 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. - test -d ./--version && rmdir ./--version - MKDIR_P="$ac_install_sh -d" + mkdir_p='$(install_sh) -d' fi fi -{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 -echo "${ECHO_T}$MKDIR_P" >&6; } - -mkdir_p="$MKDIR_P" -case $mkdir_p in - [\\/$]* | ?:[\\/]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac for ac_prog in gawk mawk nawk awk do @@ -2249,16 +2231,12 @@ fi rmdir .tst 2>/dev/null -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 - { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } - fi fi # test whether we have cygpath @@ -2273,7 +2251,7 @@ # Define the identity of the package. PACKAGE='faac' - VERSION='1.25' + VERSION='1.28' cat >>confdefs.h <<_ACEOF @@ -2301,7 +2279,7 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} -install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} +install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right @@ -2405,7 +2383,7 @@ fi fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. @@ -3414,7 +3392,9 @@ am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi - if test "x$enable_dependency_tracking" != xno; then + + +if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else @@ -3424,6 +3404,7 @@ + depcc="$CC" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 @@ -3491,7 +3472,6 @@ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} 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 sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then @@ -3521,7 +3501,9 @@ echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - if + + +if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= @@ -3963,7 +3945,6 @@ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} 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 sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then @@ -3993,7 +3974,9 @@ echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type - if + + +if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= @@ -4173,13 +4156,12 @@ test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$lt_ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$lt_ac_prog$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done -IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris @@ -4214,7 +4196,6 @@ fi SED=$lt_cv_path_SED - { echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6; } @@ -4576,8 +4557,8 @@ echo "${ECHO_T}no, using $LN_S" >&6; } fi -{ echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 -echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 +echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; } if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4618,15 +4599,9 @@ mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump', - # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi + # func_win32_libid shell function, so use a weaker test based on 'objdump'. + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) @@ -4671,7 +4646,7 @@ esac ;; -interix[3-9]*) +interix3*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; @@ -4721,10 +4696,6 @@ lt_cv_deplibs_check_method=pass_all ;; -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - solaris*) lt_cv_deplibs_check_method=pass_all ;; @@ -4812,7 +4783,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4815 "configure"' > conftest.$ac_ext + echo '#line 4786 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -4847,8 +4818,7 @@ rm -rf conftest* ;; -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ -s390*-*linux*|sparc*-*linux*) +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 @@ -4859,9 +4829,6 @@ case `/usr/bin/file conftest.o` in *32-bit*) case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; @@ -4878,9 +4845,6 @@ ;; *64-bit*) case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; @@ -6201,27 +6165,24 @@ fi ;; *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - teststring= - # Add a significant safety factor because C++ compilers can tack on massive - # amounts of additional arguments before passing them to the linker. - # It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac @@ -6238,7 +6199,6 @@ - # Check for command to grab the raw symbol name followed by C symbol from nm. { echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } @@ -6827,7 +6787,7 @@ test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= @@ -7027,10 +6987,10 @@ objext=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" +lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' +lt_simple_link_test_code='int main(){return(0);}\n' # If no C compiler was specified, use CC. @@ -7045,13 +7005,13 @@ # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext +printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* @@ -7071,7 +7031,7 @@ else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. @@ -7082,11 +7042,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7085: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7045: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7089: \$? = $ac_status" >&5 + echo "$as_me:7049: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7137,15 +7097,13 @@ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2*) + mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; @@ -7155,7 +7113,7 @@ lt_prog_compiler_pic='-fno-common' ;; - interix[3-9]*) + interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; @@ -7213,7 +7171,7 @@ esac ;; - mingw* | cygwin* | pw32* | os2*) + mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' @@ -7265,22 +7223,6 @@ # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C 5.9 - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Wl,' - ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' - ;; - esac - ;; esac ;; @@ -7290,10 +7232,6 @@ lt_prog_compiler_static='-non_shared' ;; - rdos*) - lt_prog_compiler_static='-non_shared' - ;; - solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' @@ -7361,7 +7299,7 @@ else lt_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. @@ -7372,11 +7310,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7375: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7313: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7379: \$? = $ac_status" >&5 + echo "$as_me:7317: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7425,7 +7363,7 @@ lt_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext + printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings @@ -7465,7 +7403,7 @@ mkdir conftest cd conftest mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or @@ -7476,11 +7414,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7479: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7417: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7483: \$? = $ac_status" >&5 + echo "$as_me:7421: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -7672,7 +7610,7 @@ allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -7690,7 +7628,7 @@ fi ;; - interix[3-9]*) + interix3*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' @@ -7705,7 +7643,7 @@ archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in @@ -7723,22 +7661,13 @@ ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - *) - tmp_sharedflag='-shared' ;; - esac - archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi link_all_deplibs=no else @@ -7898,7 +7827,7 @@ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 - : + hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported @@ -7972,18 +7901,11 @@ } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -8038,18 +7960,11 @@ } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -8103,7 +8018,7 @@ # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; @@ -8145,10 +8060,10 @@ case $cc_basename in xlc*) output_verbose_link_cmd='echo' - archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' + archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) @@ -8310,28 +8225,24 @@ ;; openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct=yes - hardcode_shlibpath_var=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi + hardcode_direct=yes + hardcode_shlibpath_var=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' else - ld_shlibs=no + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac fi ;; @@ -8390,16 +8301,17 @@ case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' - fi - ;; + case $wlarc in + '') + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; esac link_all_deplibs=yes ;; @@ -8456,7 +8368,7 @@ fi ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no @@ -8533,7 +8445,7 @@ { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 @@ -8591,55 +8503,17 @@ version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" - if test "$GCC" = yes; then - case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'` + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else - lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[lt_foo]++; } - if (lt_freq[lt_foo] == 1) { print lt_foo; } -}'` - sys_lib_search_path_spec=`echo $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi @@ -8799,8 +8673,12 @@ shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; @@ -8854,7 +8732,7 @@ shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; - *) # from 4.6 on, and DragonFly + freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; @@ -8917,7 +8795,7 @@ postinstall_cmds='chmod 555 $lib' ;; -interix[3-9]*) +interix3*) version_type=linux need_lib_prefix=no need_version=no @@ -8988,7 +8866,7 @@ # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -9094,10 +8972,6 @@ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; -rdos*) - dynamic_linker=no - ;; - solaris*) version_type=linux need_lib_prefix=no @@ -9251,7 +9125,6 @@ darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" - old_striplib="$STRIP -S" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else @@ -9838,7 +9711,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <conftest.$ac_ext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext +printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* @@ -10958,7 +10830,7 @@ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 - : + hardcode_direct_CXX=yes else # We have old collect2 hardcode_direct_CXX=unsupported @@ -11032,18 +10904,11 @@ } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -11099,18 +10964,11 @@ } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -11229,10 +11087,10 @@ case $cc_basename in xlc*) output_verbose_link_cmd='echo' - archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' + archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) @@ -11315,7 +11173,9 @@ hardcode_libdir_separator_CXX=: case $host_cpu in - hppa*64*|ia64*) ;; + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_CXX='+b $libdir' + ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; @@ -11383,7 +11243,7 @@ ;; esac ;; - interix[3-9]*) + interix3*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' @@ -11503,29 +11363,6 @@ # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' - hardcode_libdir_flag_spec_CXX='-R$libdir' - whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - - # Not sure whether something based on - # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 - # would be better. - output_verbose_link_cmd='echo' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' - ;; - esac - ;; esac ;; lynxos*) @@ -11564,20 +11401,16 @@ ld_shlibs_CXX=no ;; openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - export_dynamic_flag_spec_CXX='${wl}-E' - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd='echo' - else - ld_shlibs_CXX=no + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='${wl}-E' + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi + output_verbose_link_cmd='echo' ;; osf3*) case $cc_basename in @@ -11739,10 +11572,15 @@ case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac link_all_deplibs_CXX=yes @@ -11789,12 +11627,6 @@ fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - ;; - esac fi ;; esac @@ -11986,7 +11818,7 @@ # PORTME: override above test on systems where it is broken case $host_os in -interix[3-9]*) +interix3*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= @@ -11994,46 +11826,13 @@ postdeps_CXX= ;; -linux*) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - # - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - if test "$solaris_use_stlport4" != yes; then - postdeps_CXX='-library=Cstd -library=Crun' - fi - ;; - esac - ;; - solaris*) case $cc_basename in CC*) - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. - if test "$solaris_use_stlport4" != yes; then - postdeps_CXX='-library=Cstd -library=Crun' - fi + postdeps_CXX='-lCstd -lCrun' ;; esac ;; @@ -12070,14 +11869,12 @@ # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | cygwin* | os2* | pw32*) + mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) @@ -12089,7 +11886,7 @@ # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; - interix[3-9]*) + interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; @@ -12225,14 +12022,6 @@ lt_prog_compiler_static_CXX='-non_shared' ;; *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - lt_prog_compiler_wl_CXX='-Qoption ld ' - ;; - esac ;; esac ;; @@ -12347,7 +12136,7 @@ else lt_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. @@ -12358,11 +12147,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12361: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12150: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12365: \$? = $ac_status" >&5 + echo "$as_me:12154: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -12411,7 +12200,7 @@ lt_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext + printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings @@ -12451,7 +12240,7 @@ mkdir conftest cd conftest mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or @@ -12462,11 +12251,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12465: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12254: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12469: \$? = $ac_status" >&5 + echo "$as_me:12258: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12532,7 +12321,7 @@ export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' ;; linux* | k*bsd*-gnu) link_all_deplibs_CXX=no @@ -12566,7 +12355,7 @@ { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 @@ -12624,7 +12413,20 @@ version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" - +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi need_lib_prefix=unknown hardcode_into_libs=no @@ -12781,7 +12583,12 @@ shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; @@ -12835,7 +12642,7 @@ shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; - *) # from 4.6 on, and DragonFly + freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; @@ -12898,7 +12705,7 @@ postinstall_cmds='chmod 555 $lib' ;; -interix[3-9]*) +interix3*) version_type=linux need_lib_prefix=no need_version=no @@ -12969,7 +12776,7 @@ # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -13075,10 +12882,6 @@ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; -rdos*) - dynamic_linker=no - ;; - solaris*) version_type=linux need_lib_prefix=no @@ -13273,7 +13076,6 @@ module_cmds_CXX \ module_expsym_cmds_CXX \ lt_cv_prog_compiler_c_o_CXX \ - fix_srcfile_path_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX; do @@ -13594,7 +13396,7 @@ sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path=$lt_fix_srcfile_path +fix_srcfile_path="$fix_srcfile_path_CXX" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_CXX @@ -13685,17 +13487,10 @@ objext_F77=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code="\ - subroutine t - return - end -" +lt_simple_compile_test_code=" subroutine t\n return\n end\n" # Code to be used in simple link tests -lt_simple_link_test_code="\ - program t - end -" +lt_simple_link_test_code=" program t\n end\n" # ltmain only uses $CC for tagged configurations so make sure $CC is set. @@ -13711,13 +13506,13 @@ # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext +printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* @@ -13804,15 +13599,13 @@ lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' ;; - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2*) + mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; @@ -13822,7 +13615,7 @@ lt_prog_compiler_pic_F77='-fno-common' ;; - interix[3-9]*) + interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; @@ -13880,7 +13673,7 @@ esac ;; - mingw* | cygwin* | pw32* | os2*) + mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' @@ -13932,22 +13725,6 @@ # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C 5.9 - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - lt_prog_compiler_wl_F77='-Wl,' - ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - lt_prog_compiler_wl_F77='' - ;; - esac - ;; esac ;; @@ -13957,10 +13734,6 @@ lt_prog_compiler_static_F77='-non_shared' ;; - rdos*) - lt_prog_compiler_static_F77='-non_shared' - ;; - solaris*) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' @@ -14028,7 +13801,7 @@ else lt_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. @@ -14039,11 +13812,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14042: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13815: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14046: \$? = $ac_status" >&5 + echo "$as_me:13819: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -14092,7 +13865,7 @@ lt_prog_compiler_static_works_F77=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext + printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings @@ -14132,7 +13905,7 @@ mkdir conftest cd conftest mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or @@ -14143,11 +13916,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14146: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13919: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14150: \$? = $ac_status" >&5 + echo "$as_me:13923: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14339,7 +14112,7 @@ allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -14357,7 +14130,7 @@ fi ;; - interix[3-9]*) + interix3*) hardcode_direct_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' @@ -14372,7 +14145,7 @@ archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in @@ -14390,22 +14163,13 @@ ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec_F77='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - *) - tmp_sharedflag='-shared' ;; - esac - archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi link_all_deplibs_F77=no else @@ -14565,7 +14329,7 @@ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 - : + hardcode_direct_F77=yes else # We have old collect2 hardcode_direct_F77=unsupported @@ -14629,18 +14393,11 @@ } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -14685,18 +14442,11 @@ } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -14750,7 +14500,7 @@ # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. - old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs' + old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_F77='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; @@ -14792,10 +14542,10 @@ case $cc_basename in xlc*) output_verbose_link_cmd='echo' - archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' + archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) @@ -14957,28 +14707,24 @@ ;; openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - export_dynamic_flag_spec_F77='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - ;; - *) - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - ;; - esac - fi + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' else - ld_shlibs_F77=no + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + ;; + *) + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + ;; + esac fi ;; @@ -15037,16 +14783,17 @@ case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - whole_archive_flag_spec_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' - fi - ;; + case $wlarc in + '') + whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; esac link_all_deplibs_F77=yes ;; @@ -15103,7 +14850,7 @@ fi ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag_F77='${wl}-z,text' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no @@ -15180,7 +14927,7 @@ { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 @@ -15238,7 +14985,20 @@ version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" - +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi need_lib_prefix=unknown hardcode_into_libs=no @@ -15395,7 +15155,12 @@ shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; @@ -15449,7 +15214,7 @@ shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; - *) # from 4.6 on, and DragonFly + freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; @@ -15512,7 +15277,7 @@ postinstall_cmds='chmod 555 $lib' ;; -interix[3-9]*) +interix3*) version_type=linux need_lib_prefix=no need_version=no @@ -15583,7 +15348,7 @@ # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -15689,10 +15454,6 @@ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; -rdos*) - dynamic_linker=no - ;; - solaris*) version_type=linux need_lib_prefix=no @@ -15887,7 +15648,6 @@ module_cmds_F77 \ module_expsym_cmds_F77 \ lt_cv_prog_compiler_c_o_F77 \ - fix_srcfile_path_F77 \ exclude_expsyms_F77 \ include_expsyms_F77; do @@ -16208,7 +15968,7 @@ sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path=$lt_fix_srcfile_path +fix_srcfile_path="$fix_srcfile_path_F77" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_F77 @@ -16266,10 +16026,10 @@ objext_GCJ=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}" +lt_simple_compile_test_code="class foo {}\n" # Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }' +lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. @@ -16285,13 +16045,13 @@ # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext +printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* @@ -16332,7 +16092,7 @@ else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. @@ -16343,11 +16103,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16346: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16106: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16350: \$? = $ac_status" >&5 + echo "$as_me:16110: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16398,15 +16158,13 @@ lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' ;; - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2*) + mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; @@ -16416,7 +16174,7 @@ lt_prog_compiler_pic_GCJ='-fno-common' ;; - interix[3-9]*) + interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; @@ -16474,7 +16232,7 @@ esac ;; - mingw* | cygwin* | pw32* | os2*) + mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' @@ -16526,22 +16284,6 @@ # All Alpha code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C 5.9 - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - lt_prog_compiler_wl_GCJ='-Wl,' - ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - lt_prog_compiler_wl_GCJ='' - ;; - esac - ;; esac ;; @@ -16551,10 +16293,6 @@ lt_prog_compiler_static_GCJ='-non_shared' ;; - rdos*) - lt_prog_compiler_static_GCJ='-non_shared' - ;; - solaris*) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' @@ -16622,7 +16360,7 @@ else lt_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_GCJ" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. @@ -16633,11 +16371,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16636: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16374: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16640: \$? = $ac_status" >&5 + echo "$as_me:16378: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16686,7 +16424,7 @@ lt_prog_compiler_static_works_GCJ=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext + printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings @@ -16726,7 +16464,7 @@ mkdir conftest cd conftest mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or @@ -16737,11 +16475,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16740: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16478: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16744: \$? = $ac_status" >&5 + echo "$as_me:16482: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -16933,7 +16671,7 @@ allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes - export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -16951,7 +16689,7 @@ fi ;; - interix[3-9]*) + interix3*) hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' @@ -16966,7 +16704,7 @@ archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in @@ -16984,22 +16722,13 @@ ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec_GCJ='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - *) - tmp_sharedflag='-shared' ;; - esac - archive_cmds_GCJ='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi link_all_deplibs_GCJ=no else @@ -17159,7 +16888,7 @@ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 - : + hardcode_direct_GCJ=yes else # We have old collect2 hardcode_direct_GCJ=unsupported @@ -17233,18 +16962,11 @@ } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -17299,18 +17021,11 @@ } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -17364,7 +17079,7 @@ # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. - old_archive_cmds_GCJ='lib -OUT:$oldlib$oldobjs$old_deplibs' + old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; @@ -17406,10 +17121,10 @@ case $cc_basename in xlc*) output_verbose_link_cmd='echo' - archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' + archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) @@ -17571,28 +17286,24 @@ ;; openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - export_dynamic_flag_spec_GCJ='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - ;; - *) - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - ;; - esac - fi + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' else - ld_shlibs_GCJ=no + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + ;; + *) + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + ;; + esac fi ;; @@ -17651,16 +17362,17 @@ case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' - fi - ;; + case $wlarc in + '') + whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; esac link_all_deplibs_GCJ=yes ;; @@ -17717,7 +17429,7 @@ fi ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag_GCJ='${wl}-z,text' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no @@ -17794,7 +17506,7 @@ { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 @@ -17852,7 +17564,20 @@ version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" - +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi need_lib_prefix=unknown hardcode_into_libs=no @@ -18009,7 +17734,12 @@ shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; @@ -18063,7 +17793,7 @@ shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; - *) # from 4.6 on, and DragonFly + freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; @@ -18126,7 +17856,7 @@ postinstall_cmds='chmod 555 $lib' ;; -interix[3-9]*) +interix3*) version_type=linux need_lib_prefix=no need_version=no @@ -18197,7 +17927,7 @@ # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -18303,10 +18033,6 @@ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; -rdos*) - dynamic_linker=no - ;; - solaris*) version_type=linux need_lib_prefix=no @@ -18501,7 +18227,6 @@ module_cmds_GCJ \ module_expsym_cmds_GCJ \ lt_cv_prog_compiler_c_o_GCJ \ - fix_srcfile_path_GCJ \ exclude_expsyms_GCJ \ include_expsyms_GCJ; do @@ -18822,7 +18547,7 @@ sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path=$lt_fix_srcfile_path +fix_srcfile_path="$fix_srcfile_path_GCJ" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_GCJ @@ -18879,7 +18604,7 @@ objext_RC=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" @@ -18898,13 +18623,13 @@ # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext +printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* @@ -18982,7 +18707,6 @@ module_cmds_RC \ module_expsym_cmds_RC \ lt_cv_prog_compiler_c_o_RC \ - fix_srcfile_path_RC \ exclude_expsyms_RC \ include_expsyms_RC; do @@ -19303,7 +19027,7 @@ sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path=$lt_fix_srcfile_path +fix_srcfile_path="$fix_srcfile_path_RC" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_RC @@ -19931,7 +19655,9 @@ fi - if false; then + + +if false; then WITH_MP4V2_TRUE= WITH_MP4V2_FALSE='#' else @@ -20212,24 +19938,13 @@ if test x$external_mp4v2 = xyes; then { echo "$as_me:$LINENO: *** Building with external mp4v2 ***" >&5 echo "$as_me: *** Building with external mp4v2 ***" >&6;} - if false; then - WITH_MP4V2_TRUE= - WITH_MP4V2_FALSE='#' -else - WITH_MP4V2_TRUE='#' - WITH_MP4V2_FALSE= -fi - - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LIBMP4V2 1 -_ACEOF - else if test x$WITHMP4V2 = xyes; then { echo "$as_me:$LINENO: *** Building with internal mp4v2 ***" >&5 echo "$as_me: *** Building with internal mp4v2 ***" >&6;} - if true; then + + +if true; then WITH_MP4V2_TRUE= WITH_MP4V2_FALSE='#' else @@ -20256,7 +19971,9 @@ #define DRM 1 _ACEOF - if true; then + + +if true; then USE_DRM_TRUE= USE_DRM_FALSE='#' else @@ -20266,7 +19983,9 @@ CFLAGS="$CFLAGS -DDRM" else - if false; then + + +if false; then USE_DRM_TRUE= USE_DRM_FALSE='#' else @@ -22289,13 +22008,6 @@ Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi -if test -z "${WITH_MP4V2_TRUE}" && test -z "${WITH_MP4V2_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WITH_MP4V2\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WITH_MP4V2\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi if test -z "${USE_DRM_TRUE}" && test -z "${USE_DRM_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_DRM\" was never defined. Usually this means the macro was only invoked conditionally." >&5 @@ -22610,7 +22322,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by FAAC $as_me 1.25, which was +This file was extended by FAAC $as_me 1.28, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -22667,7 +22379,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -FAAC config.status 1.25 +FAAC config.status 1.28 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -22678,7 +22390,6 @@ ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' -MKDIR_P='$MKDIR_P' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -22893,7 +22604,6 @@ INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim -am__isrc!$am__isrc$ac_delim CYGPATH_W!$CYGPATH_W$ac_delim PACKAGE!$PACKAGE$ac_delim VERSION!$VERSION$ac_delim @@ -22942,7 +22652,6 @@ host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim -SED!$SED$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim LN_S!$LN_S$ac_delim @@ -22950,6 +22659,8 @@ AR!$AR$ac_delim RANLIB!$RANLIB$ac_delim CPP!$CPP$ac_delim +CXXCPP!$CXXCPP$ac_delim +F77!$F77$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -22991,8 +22702,6 @@ ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF -CXXCPP!$CXXCPP$ac_delim -F77!$F77$ac_delim FFLAGS!$FFLAGS$ac_delim ac_ct_F77!$ac_ct_F77$ac_delim LIBTOOL!$LIBTOOL$ac_delim @@ -23004,7 +22713,7 @@ LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 11; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 9; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 @@ -23231,11 +22940,6 @@ [\\/$]* | ?:[\\/]* ) 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 @@ -23289,7 +22993,6 @@ 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 " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out @@ -23480,9 +23183,8 @@ # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ diff -Nru faac-1.26/configure.in faac-1.28/configure.in --- faac-1.26/configure.in 2007-10-15 08:11:10.000000000 +0000 +++ faac-1.28/configure.in 2009-02-05 00:55:38.000000000 +0000 @@ -1,5 +1,5 @@ AC_PREREQ(2.50) -AC_INIT(FAAC, 1.25, faac-dev@lists.sourceforge.net) +AC_INIT(FAAC, 1.28, faac-dev@lists.sourceforge.net) AC_CONFIG_AUX_DIR(.) AM_INIT_AUTOMAKE @@ -8,7 +8,7 @@ AC_ARG_WITH( mp4v2, [ --with-mp4v2 compile libmp4v2],WITHMP4V2=$withval, WITHMP4V2=yes) AC_ARG_ENABLE( drm, [ --enable-drm Digital Radio Mondiale support], enable_drm=$enableval, enable_drm=no) -AC_DEFUN(MY_DEFINE, [ AC_DEFINE($1, 1, [define if needed]) ]) +AC_DEFUN([MY_DEFINE], [ AC_DEFINE($1, 1, [define if needed]) ]) CFLAGS=${CFLAGS:-"-O2 -Wall"} @@ -36,8 +36,6 @@ if test x$external_mp4v2 = xyes; then AC_MSG_NOTICE([*** Building with external mp4v2 ***]) - AM_CONDITIONAL(WITH_MP4V2, false) - MY_DEFINE(HAVE_LIBMP4V2, false) else if test x$WITHMP4V2 = xyes; then AC_MSG_NOTICE([*** Building with internal mp4v2 ***]) diff -Nru faac-1.26/debian/changelog faac-1.28/debian/changelog --- faac-1.26/debian/changelog 2011-08-28 00:37:20.000000000 +0000 +++ faac-1.28/debian/changelog 2011-08-28 00:25:42.000000000 +0000 @@ -1,99 +1,56 @@ -faac (1.26-0.1ubuntu2) intrepid; urgency=low +faac (1.28-0ubuntu1~natty1) natty; urgency=low - * Add manpage for faac (LP: #58012) + * Backport - -- Jean-Baptiste Lallement Sat, 26 Jul 2008 11:18:01 +0200 + -- Cosme Domínguez Díaz Sun, 28 Aug 2011 00:25:35 +0000 -faac (1.26-0.1ubuntu1) hardy; urgency=low +faac (1.28-0ubuntu1) oneiric; urgency=low - * Sync from debian-multimedia - * Ubuntu Changes: - - Maintainer Spec - - Versioned mp4v2 dep + * New upstream release. Package based on Debian Multimedia team git. + (LP: #395902) + * debian/copyright documents all applicable licenses. The package as a whole + is not LGPL and will stay in multiverse. (LP: #374900) + * Back to using a bundled internal copy of libmp4v2 in the frontend. The + external libmp4v2 will eventually be removed. - -- John Dong Sun, 06 Jan 2008 22:47:35 -0500 + -- Maia Kozheva Thu, 09 Jun 2011 12:00:51 +0700 -faac (1.26-0.1) unstable; urgency=high +faac (1.28-0fab3) unstable; urgency=low - * Build without --enable-drm, now faac encoding works with ffmpeg or with - faac. + [ Andres Mejia ] + * Various fixes for getting faac working on current Debian sid. + * Include myself in Uploaders field. + * Clarify comment about build fixes in patch. + * Change this package section to non-free due to its conflicting + licensing terms. + * Don't include libtool file. - -- Christian Marillat Tue, 13 Nov 2007 10:32:20 +0100 + [ Maia Kozheva ] + * Add .gitignore. + * Remove explicit quilt dependency, migrate to 3.0 source format. + * Remove autoreconf.patch, using dh_autoreconf. + * debian/control: + - Reword binary package descriptions to remove initial articles. + - Bump Standards-Version to 3.9.2. + - Update maintainer field. + - Add myself to uploaders. + * debian/control, debian/rules: + - Remove quilt, add dh-autoreconf support. + * debian/faac.manpages, debian/manpages/faac.1: + - Add manpage from Ubuntu version 1.26-0.1ubuntu2, with manpage hyphen + issues corrected. -faac (1.26-0.0) unstable; urgency=low + -- Maia Kozheva Thu, 09 Jun 2011 11:24:43 +0700 - * New upstream release. - * Build with --enable-drm +faac (1.28-0fab2) unstable; urgency=low - -- Christian Marillat Mon, 15 Oct 2007 10:22:24 +0200 + * debian/control, debian/rules: Ported from debhelper (>= 7) to cdbs. + * debian/control: Wrapped Build-Depends and Depends fields. -faac (1.25-0.1) unstable; urgency=low + -- Fabian Greffrath Mon, 29 Jun 2009 12:00:00 +0200 - * Build with --without-mp4v2 and add libmp4v2-dev in build-depends. +faac (1.28-0fab1) unstable; urgency=low - -- Christian Marillat Sat, 14 Oct 2006 23:40:31 +0200 - -faac (1.25-0.0) unstable; urgency=low - - * New upstream release. - - -- Christian Marillat Wed, 6 Sep 2006 19:35:19 +0200 - -faac (1.24+cvs20060416-0.3) unstable; urgency=low - - * Add dpatch and libmp4v2-dev in Build-Depends. - * Little hack to link against libmp4v2 to add mp4 support. - - -- Christian Marillat Wed, 10 May 2006 16:22:04 +0200 - -faac (1.24+cvs20060416-0.2) unstable; urgency=low - - * The -dev package don't need to depends on libmp4-dev. - * Don't need to Build-Depends on libmp4-dev. - * Build with --without-mp4v2 - - -- Christian Marillat Mon, 8 May 2006 16:23:17 +0200 - -faac (1.24+cvs20060416-0.1) unstable; urgency=low - - * Add libmp4-dev in Build-Depends. - - -- Christian Marillat Sun, 16 Apr 2006 19:38:25 +0200 - -faac (1.24+cvs20060416-0.0) unstable; urgency=low - - * CVS release. - - -- Christian Marillat Sun, 16 Apr 2006 15:28:51 +0200 - -faac (1.24-0.4) unstable; urgency=low - - * Rebuild for gcc 4.0 - - -- Christian Marillat Sat, 16 Jul 2005 17:32:59 +0200 - -faac (1.24-0.3) unstable; urgency=low - - * Add a patch for faac to return the rigth track with --track or --disk - option, thanks to Arnaud Rouanet for the patch. - - -- Christian Marillat Mon, 7 Feb 2005 16:35:28 +0100 - -faac (1.24-0.2) unstable; urgency=low - - * The -dev package need to depends on libmp4-dev. - - -- Christian Marillat Wed, 24 Nov 2004 17:25:41 +0100 - -faac (1.24-0.1) unstable; urgency=low - - * Add mp4 support. - - -- Christian Marillat Sun, 31 Oct 2004 17:45:32 +0100 - -faac (1.24-0.0) unstable; urgency=low - - * Initial Release. - - -- Christian Marillat Thu, 22 Jul 2004 15:11:42 +0200 + * Initial release. + -- Fabian Greffrath Mon, 01 Jun 2009 00:00:00 +0200 diff -Nru faac-1.26/debian/compat faac-1.28/debian/compat --- faac-1.26/debian/compat 2011-08-28 00:37:20.000000000 +0000 +++ faac-1.28/debian/compat 2011-06-09 03:51:49.000000000 +0000 @@ -1 +1 @@ -5 +7 diff -Nru faac-1.26/debian/control faac-1.28/debian/control --- faac-1.26/debian/control 2011-08-28 00:37:20.000000000 +0000 +++ faac-1.28/debian/control 2011-06-09 04:59:35.000000000 +0000 @@ -1,40 +1,54 @@ Source: faac -Section: sound +Section: non-free/sound Priority: optional -Maintainer: Ubuntu MOTU Developers -XSBC-Original-Maintainer: Christian Marillat -Bugs: mailto:marillat@debian.org -Standards-Version: 3.7.2 -Build-Depends: debhelper (>= 5), libmp4v2-dev (>= 1:1.6-0.1) +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Debian Multimedia Maintainers +Uploaders: Fabian Greffrath , + Reinhard Tartler , + Andres Mejia , + Maia Kozheva +Build-Depends: debhelper (>= 7), + dh-autoreconf +Standards-Version: 3.9.2 +Homepage: http://www.audiocoding.com/ -Package: libfaac0 +Package: faac Architecture: any -Section: libs -Depends: ${shlibs:Depends} -Description: an AAC audio encoder - library files - FAAC currently supports MPEG-4 LTP, MAIN and LOW COMPLEXITY object types - and MAIN and LOW MPEG-2 object types. It also supports multichannel and - gapless encoding. +Depends: ${shlibs:Depends}, + ${misc:Depends} +Description: AAC audio encoder (frontend) + The FAAC project includes the AAC encoder FAAC and decoder FAAD2. It supports + several MPEG-4 object types (LC, Main, LTP, HE AAC, PS) and file formats + (ADTS AAC, raw AAC, MP4), multichannel and gapless en/decoding as well as MP4 + metadata tags. The codecs are compatible with standard-compliant audio + applications using one or more of these profiles. . - Homepage: http://www.audiocoding.com/ + This package contains the frontend. -Package: libfaac-dev +Package: libfaac0 +Section: non-free/libs Architecture: any -Section: libdevel -Depends: libfaac0 (>= ${source:Version}) -Description: an AAC audio encoder - devel files - FAAC currently supports MPEG-4 LTP, MAIN and LOW COMPLEXITY object types - and MAIN and LOW MPEG-2 object types. It also supports multichannel and - gapless encoding. +Depends: ${shlibs:Depends}, + ${misc:Depends} +Description: AAC audio encoder (library) + The FAAC project includes the AAC encoder FAAC and decoder FAAD2. It supports + several MPEG-4 object types (LC, Main, LTP, HE AAC, PS) and file formats + (ADTS AAC, raw AAC, MP4), multichannel and gapless en/decoding as well as MP4 + metadata tags. The codecs are compatible with standard-compliant audio + applications using one or more of these profiles. . - Homepage: http://www.audiocoding.com/ + This package contains the shared library. -Package: faac +Package: libfaac-dev +Section: non-free/libdevel Architecture: any -Depends: ${shlibs:Depends} -Description: an AAC audio encoder - FAAC currently supports MPEG-4 LTP, MAIN and LOW COMPLEXITY object types - and MAIN and LOW MPEG-2 object types. It also supports multichannel and - gapless encoding. +Depends: libfaac0 (= ${binary:Version}), + ${misc:Depends} +Description: AAC audio encoder (development) + The FAAC project includes the AAC encoder FAAC and decoder FAAD2. It supports + several MPEG-4 object types (LC, Main, LTP, HE AAC, PS) and file formats + (ADTS AAC, raw AAC, MP4), multichannel and gapless en/decoding as well as MP4 + metadata tags. The codecs are compatible with standard-compliant audio + applications using one or more of these profiles. . - Homepage: http://www.audiocoding.com/ + This package contains the development files. diff -Nru faac-1.26/debian/copyright faac-1.28/debian/copyright --- faac-1.26/debian/copyright 2011-08-28 00:37:20.000000000 +0000 +++ faac-1.28/debian/copyright 2011-06-09 03:51:49.000000000 +0000 @@ -1,12 +1,150 @@ -This package was debianized by Christian Marillat on -Thu, 22 Jul 2004 15:11:42 +0200. +Author: Menno Bakker +Download: http://www.audiocoding.com/ -It was downloaded from http://faac.sourceforge.net/index.php +Files: * +Copyright: © 1999-2001, Menno Bakker + © 2002-2004, Krzysztof Nikiel + © 2004, Dan Villiom P. Christiansen + © 2004, Volker Fischer +License: LGPL-2.1+ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + . + This library 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 + Lesser General Public License for more details. + . + You should have received a copy of the GNU Lesser General Public + License along with this package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + . + On Debian systems, the complete text of the GNU Lesser General + Public License can be found in `/usr/share/common-licenses/LGPL'. -Upstream Author: See README file. +Files: common/Cfaac/*, + plugins/* +Copyright: © 2002-2004, Antonio Foranna +License: GPL + 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. + . + 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. + . + On Debian systems, the complete text of the GNU General + Public License can be found in `/usr/share/common-licenses/GPL'. -Copyright: 2001 M. Bakker - You should have received a copy of the GNU General Public License with the - Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL; if - not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth - Floor, Boston, MA 02110-1301, USA. +Files: common/mp4v2/* +Copyright: © 2001, Cisco Systems Inc. + © 2003-2004, Ximpo Group Ltd. +License: MPL-1.1 + The contents of this file are subject to the Mozilla Public + License Version 1.1 (the "License"); you may not use this file + except in compliance with the License. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + . + Software distributed under the License is distributed on an "AS + IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + implied. See the License for the specific language governing + rights and limitations under the License. + +Files: frontend/getopt.* +Copyright: © 1987-1993, Free Software Foundation, Inc. +License: GPL-2+ + 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, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + . + On Debian systems, the complete text of the GNU General + Public License can be found in `/usr/share/common-licenses/GPL'. + +Files: libfaac/channels.c, + libfaac/filtbank.c, + libfaac/ltp.c, + libfaac/huffman.{c,h}, + libfaac/bitstream.{c,h}, + libfaac/tns.h, + libfaac/backpred.c, + libfaac/tns.c +Copyright: © 1996-1997 +License: other + This software module was originally developed by + . + FirstName LastName (CompanyName) + . + and edited by + . + FirstName LastName (CompanyName) + FirstName LastName (CompanyName) + . + in the course of development of the MPEG-2 NBC/MPEG-4 Audio standard + ISO/IEC 13818-7, 14496-1,2 and 3. This software module is an + implementation of a part of one or more MPEG-2 NBC/MPEG-4 Audio tools + as specified by the MPEG-2 NBC/MPEG-4 Audio standard. ISO/IEC gives + users of the MPEG-2 NBC/MPEG-4 Audio standards free license to this + software module or modifications thereof for use in hardware or + software products claiming conformance to the MPEG-2 NBC/ MPEG-4 Audio + standards. Those intending to use this software module in hardware or + software products are advised that this use may infringe existing + patents. The original developer of this software module and his/her + company, the subsequent editors and their companies, and ISO/IEC have + no liability for use of this software module or modifications thereof + in an implementation. Copyright is not released for non MPEG-2 + NBC/MPEG-4 Audio conforming products. The original developer retains + full right to use the code for his/her own purpose, assign or donate + the code to a third party and to inhibit third party from using the + code for non MPEG-2 NBC/MPEG-4 Audio conforming products. This + copyright notice must be included in all copies or derivative works. + +Files: libfaac/kiss_fft/* +Copyright: © 2003-2004, Mark Borgerding +License: BSD + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + . + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the author nor the names of any contributors may be used to endorse + or promote products derived from this software without specific prior written + permission. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Files: debian/* +Copyright: © 2005-2009, Fabian Greffrath +License: GAP + Copying and distribution of this file, with or without modification, + are permitted in any medium without royalty provided the copyright + notice and this notice are preserved. diff -Nru faac-1.26/debian/faac.install faac-1.28/debian/faac.install --- faac-1.26/debian/faac.install 2011-08-28 00:37:20.000000000 +0000 +++ faac-1.28/debian/faac.install 2011-06-09 03:51:49.000000000 +0000 @@ -1 +1,2 @@ -debian/tmp/usr/bin +usr/bin +usr/share diff -Nru faac-1.26/debian/gbp.conf faac-1.28/debian/gbp.conf --- faac-1.26/debian/gbp.conf 1970-01-01 00:00:00.000000000 +0000 +++ faac-1.28/debian/gbp.conf 2011-05-04 06:30:28.000000000 +0000 @@ -0,0 +1,2 @@ +[DEFAULT] +pristine-tar = True diff -Nru faac-1.26/debian/libfaac0.install faac-1.28/debian/libfaac0.install --- faac-1.26/debian/libfaac0.install 2011-08-28 00:37:20.000000000 +0000 +++ faac-1.28/debian/libfaac0.install 2011-06-09 03:51:49.000000000 +0000 @@ -1,3 +1 @@ -debian/tmp/usr/lib/libfaac.so.0 -debian/tmp/usr/lib/libfaac.so.0.0.0 - +usr/lib/*.so.* diff -Nru faac-1.26/debian/libfaac-dev.install faac-1.28/debian/libfaac-dev.install --- faac-1.26/debian/libfaac-dev.install 2011-08-28 00:37:20.000000000 +0000 +++ faac-1.28/debian/libfaac-dev.install 2011-06-09 03:51:49.000000000 +0000 @@ -1,2 +1,3 @@ -debian/tmp/usr/include -debian/tmp/usr/lib/libfaac.{a,la,so} +usr/include +usr/lib/*.a +usr/lib/*.so diff -Nru faac-1.26/debian/manpages/faac.1 faac-1.28/debian/manpages/faac.1 --- faac-1.26/debian/manpages/faac.1 2011-08-28 00:37:20.000000000 +0000 +++ faac-1.28/debian/manpages/faac.1 2011-06-09 04:11:06.000000000 +0000 @@ -6,7 +6,7 @@ faac \- encode audio to the MPEG-2/-4 AAC format . .SH SYNOPSIS -faac [options] [-o outfile] infiles ... +faac [options] [\-o outfile] infiles ... . .SH DESCRIPTION .PP @@ -19,19 +19,19 @@ .SS "Quality-related options" . .TP -.BI -q " quality" +.BI \-q " quality" Set the default variable bitrate (VBR) quantizer quality in percent. Default is 100 which is approximately 120 kbps VBR for a normal stereo 16-bit 44.1 kHz input. Min value 10, max value 500. . .TP -.BI -b " bitrate" +.BI \-b " bitrate" Set the average bitrate (ABR) to approximately .I bitrate kbps. . .TP -.BI -c " freq" +.BI \-c " freq" Set the bandwidth in Hz. By default, FAAC will automatically adapt the maximum value to the input sample rate. . @@ -39,11 +39,11 @@ .SS "Input/Output options" . .TP -.B - +.B \- Use stdin as input file. . .TP -.BI -o " outfile" +.BI \-o " outfile" Set the output file to .I outfile ; you can use a dash (\*(lq-\*(rq) to specify stdout as the output file. @@ -55,26 +55,26 @@ \fB-B\fR, and \fB-C\fR unless otherwise modified. . .TP -.BI -R " rate" +.BI \-R " rate" Set the raw PCM input sample rate to \fIrate\fR Hz. Default is 44100, max is 96000. . .TP -.BI -B " bitsize" +.BI \-B " bitsize" Set the raw PCM input sample size to \fIbitsize\fR bits. Default is 16, other available sizes are 8, 24, and 32. Input is assumed to be big endian unless otherwise specified with -.B -X +.B \-X . .TP -.B -X +.B \-X Change raw PCM input byte order from big endian to little endian. . .TP -.BI -C " channels" +.BI \-C " channels" Set the raw PCM input channel count. Default is 2 (stereo), max is 33 + 1 LFE. . .TP -.BI -I " centre[,lfe]" +.BI \-I " centre[,lfe]" Set the raw PCM input multichannel configuration. .I centre specifies which channel is the centre channel (default 3), and @@ -82,67 +82,67 @@ specifies which channel is the LFE channel (default 4). . .TP -.B -r +.B \-r Output file as raw AAC data (i.e. without ADTS headers). . .PP .SS "MP4-specific options" . .TP -.B -w +.B \-w Wrap AAC data in an MP4 container. This is enabled by default for output files with the extensions .mp4 and .m4a. . .TP -.BI --artist " artist" +.BI \-\-artist " artist" Set artist to .I artist . .TP -.BI --writer " writer" +.BI \-\-writer " writer" Set writer to .I writer . .TP -.BI --title " title" +.BI \-\-title " title" Set title to .I title . .TP -.BI --genre " genre" +.BI \-\-genre " genre" Set genre to .I genre . .TP -.BI --album " album" +.BI \-\-album " album" Set album to .I album . .TP -.B --compilation +.B \-\-compilation Set compilation . .TP -.BI --track " track" +.BI \-\-track " track" Set track to \fItrack\fR in the format \*(lqnumber/total\*(rq . .TP -.BI --disc " disc" +.BI \-\-disc " disc" Set disc to .I disc in the format \*(lqnumber/total\*(rq . .TP -.BI --year " year" +.BI \-\-year " year" Set year to .I year . .TP -.BI --cover-art " file" +.BI \-\-cover\-art " file" Set cover art to image in \fIfile\fR; supported formats are GIF, JPEG, and PNG. . .TP -.BI --comment " comment" +.BI \-\-comment " comment" Set comment to .I comment . @@ -150,24 +150,24 @@ .SS "Expert options" . .TP -.B --no-tns +.B \-\-no\-tns Disable temporal noise shaping coding. . .TP -.B --no-midside +.B \-\-no\-midside Disable mid/side coding. . .TP -.BI --mpeg-vers " version" +.BI \-\-mpeg\-vers " version" Set the AAC MPEG version to either 2 or 4. . .TP -.BI --obj-type " type" +.BI \-\-obj\-type " type" Set the AAC object type to LC (Low Complexity, default), Main, or LTP (Long Term Prediction). . .TP -.BI --shortctl " type" +.BI \-\-shortctl " type" Force block type of short (1), long (2), or both (by default). . .SH CONFORMING TO diff -Nru faac-1.26/debian/patches/00list faac-1.28/debian/patches/00list --- faac-1.26/debian/patches/00list 2011-08-28 00:37:20.000000000 +0000 +++ faac-1.28/debian/patches/00list 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -02_filter_pv.c -03_vob2divx.pl diff -Nru faac-1.26/debian/patches/01_clamp_scale_factor.dpatch faac-1.28/debian/patches/01_clamp_scale_factor.dpatch --- faac-1.26/debian/patches/01_clamp_scale_factor.dpatch 2011-08-28 00:37:20.000000000 +0000 +++ faac-1.28/debian/patches/01_clamp_scale_factor.dpatch 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 01_clamp_scale_factor.dpatch by -## -## All lines beginning with ## DP:' are a description of the patch. -## DP: Replace xterm by x-terminal-emulator. - -@DPATCH@ - ---- faac-1.25.orig/libfaac/aacquant.c 2007-01-06 18:08:32.000000000 +0100 -+++ faac-1.25/libfaac/aacquant.c 2007-01-18 18:19:59.000000000 +0100 -@@ -142,6 +142,14 @@ static void BalanceEnergy(CoderInfo *cod - shift -= 1000; - - shift += coderInfo->scale_factor[sb]; -+ if (sb > 0) -+ { -+ int diff = shift - coderInfo->scale_factor[sb - 1]; -+ if (diff < -59) -+ shift += -59 - diff; -+ else if (diff > 60) -+ shift += 60 - diff; -+ } - coderInfo->scale_factor[sb] = shift; - } - } diff -Nru faac-1.26/debian/patches/02_filter_pv.c.dpatch faac-1.28/debian/patches/02_filter_pv.c.dpatch --- faac-1.26/debian/patches/02_filter_pv.c.dpatch 2011-08-28 00:37:20.000000000 +0000 +++ faac-1.28/debian/patches/02_filter_pv.c.dpatch 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 02_filter_pv.c.dpatch by Christian Marillat -## -## All lines beginning with ## DP:' are a description of the patch. -## DP: Replace xterm by x-terminal-emulator. - -@DPATCH@ - ---- transcode-1.0.0.orig/filter/preview/filter_pv.c.orig 2003-01-31 16:11:26.000000000 +0100 -+++ transcode-1.0.0/filter/preview/filter_pv.c 2003-01-31 16:11:49.000000000 +0100 -@@ -420,7 +420,7 @@ - - // build commandline - snprintf (buf, 1024, -- "xterm -title \"Transcode Filter select\" -e %s/filter_list.awk %s %s && cat %s && rm -f %s", -+ "x-terminal-emulator -title \"Transcode Filter select\" -e %s/filter_list.awk %s %s && cat %s && rm -f %s", - vob->mod_path, vob->mod_path, tmpfile, tmpfile, tmpfile); - if ((f = popen (buf, "r")) == NULL) { - perror ("popen filter select"); -@@ -487,7 +487,7 @@ - memset (buf, 0, 1024); - - snprintf (buf, 1024, -- "xterm -title \"Transcode parameters\" -e %s/parse_csv.awk %s %s %s && cat %s && rm -f %s %s", -+ "x-terminal-emulator -title \"Transcode parameters\" -e %s/parse_csv.awk %s %s %s && cat %s && rm -f %s %s", - vob->mod_path, tmpfile, filter_name, infile, infile, tmpfile, infile); - - if ((f = popen (buf, "r")) == NULL) { diff -Nru faac-1.26/debian/patches/build-fix.patch faac-1.28/debian/patches/build-fix.patch --- faac-1.26/debian/patches/build-fix.patch 1970-01-01 00:00:00.000000000 +0000 +++ faac-1.28/debian/patches/build-fix.patch 2011-06-09 03:51:49.000000000 +0000 @@ -0,0 +1,327 @@ +Patch fixing build error and warnings. Error consisted of redefining +strcasestr function from string.h. Warnings consisted of deprecated conversions +of string constants to char*, using '%llu' for type uint64_t (which on 64 bit +systems, is defined as unsigned long int by stdint.h), and using '==' for +equality of two strings. +========================================================================== +--- a/common/mp4v2/mpeg4ip.h ++++ b/common/mp4v2/mpeg4ip.h +@@ -120,14 +120,6 @@ + #endif + #include + +-#ifdef __cplusplus +-extern "C" { +-#endif +-char *strcasestr(const char *haystack, const char *needle); +-#ifdef __cplusplus +-} +-#endif +- + #define OPEN_RDWR O_RDWR + #define OPEN_CREAT O_CREAT + #define OPEN_RDONLY O_RDONLY +@@ -135,7 +127,6 @@ + #define closesocket close + #define IOSBINARY ios::bin + +-#if SIZEOF_LONG == 8 + #define MAX_UINT64 -1LU + #define D64F "ld" + #define U64F "lu" +@@ -143,15 +134,6 @@ + + #define TO_D64(a) (a##L) + #define TO_U64(a) (a##LU) +-#else +-#define MAX_UINT64 -1LLU +-#define D64F "lld" +-#define U64F "llu" +-#define X64F "llx" +- +-#define TO_D64(a) (a##LL) +-#define TO_U64(a) (a##LLU) +-#endif + + #ifdef HAVE_FPOS_T___POS + #define FPOS_TO_VAR(fpos, typed, var) (var) = (typed)((fpos).__pos) +--- a/configure.in ++++ b/configure.in +@@ -4,6 +4,9 @@ + AM_INIT_AUTOMAKE + + AM_CONFIG_HEADER(config.h) ++AH_TOP([#ifndef CONFIG_H ++#define CONFIG_H]) ++AH_BOTTOM([#endif /* CONFIG_H */]) + + AC_ARG_WITH( mp4v2, [ --with-mp4v2 compile libmp4v2],WITHMP4V2=$withval, WITHMP4V2=yes) + AC_ARG_ENABLE( drm, [ --enable-drm Digital Radio Mondiale support], enable_drm=$enableval, enable_drm=no) +--- a/common/mp4v2/atom_avcC.cpp ++++ b/common/mp4v2/atom_avcC.cpp +@@ -29,7 +29,7 @@ + class SizeTableProperty : public MP4TableProperty + { + public: +- SizeTableProperty(char *name, MP4IntegerProperty *pCountProperty) : ++ SizeTableProperty(const char *name, MP4IntegerProperty *pCountProperty) : + MP4TableProperty(name, pCountProperty) {}; + protected: + void ReadEntry(MP4File *pFile, u_int32_t index) { +--- a/common/mp4v2/atom_ohdr.cpp ++++ b/common/mp4v2/atom_ohdr.cpp +@@ -21,7 +21,7 @@ + \param useCountedFormat counted format flag. + \param useUnicode unicode flag. + */ +- OhdrMP4StringProperty(char* name, bool useCountedFormat = false, ++ OhdrMP4StringProperty(const char* name, bool useCountedFormat = false, + bool useUnicode = false): MP4StringProperty(name, useCountedFormat, + useUnicode) { + } +--- a/common/mp4v2/atom_stz2.cpp ++++ b/common/mp4v2/atom_stz2.cpp +@@ -30,7 +30,7 @@ + class MP4HalfSizeTableProperty : public MP4TableProperty + { + public: +- MP4HalfSizeTableProperty(char *name, MP4IntegerProperty *pCountProperty) : ++ MP4HalfSizeTableProperty(const char *name, MP4IntegerProperty *pCountProperty) : + MP4TableProperty(name, pCountProperty) {}; + + // The count is half the actual size +--- a/common/mp4v2/mp4atom.cpp ++++ b/common/mp4v2/mp4atom.cpp +@@ -806,7 +806,7 @@ + AddProperty(new MP4Integer24Property("flags")); + } + +-void MP4Atom::AddReserved(char* name, u_int32_t size) ++void MP4Atom::AddReserved(const char* name, u_int32_t size) + { + MP4BytesProperty* pReserved = new MP4BytesProperty(name, size); + pReserved->SetReadOnly(); +--- a/common/mp4v2/mp4atom.h ++++ b/common/mp4v2/mp4atom.h +@@ -204,7 +204,7 @@ + + void AddVersionAndFlags(); + +- void AddReserved(char* name, u_int32_t size); ++ void AddReserved(const char* name, u_int32_t size); + + void ExpectChildAtom(const char* name, + bool mandatory, bool onlyOne = true); +--- a/common/mp4v2/mp4file.cpp ++++ b/common/mp4v2/mp4file.cpp +@@ -718,7 +718,7 @@ + } + } + +-void MP4File::ProtectWriteOperation(char* where) ++void MP4File::ProtectWriteOperation(const char* where) + { + if (m_mode == 'r') { + throw new MP4Error("operation not permitted in read mode", where); +@@ -1274,7 +1274,7 @@ + } + + // NULL terminated list of brands which require the IODS atom +-char *brandsWithIods[] = { "mp42", ++const char *brandsWithIods[] = { "mp42", + "isom", + NULL}; + +@@ -2211,11 +2211,11 @@ + for (u_int32_t i = 0; i < m_pTracks.Size(); i++) { + if (!strcmp(normType, m_pTracks[i]->GetType())) { + if (subType) { +- if (normType == MP4_AUDIO_TRACK_TYPE) { ++ if (!strcmp(normType,MP4_AUDIO_TRACK_TYPE)) { + if (subType != GetTrackEsdsObjectTypeId(m_pTracks[i]->GetId())) { + continue; + } +- } else if (normType == MP4_VIDEO_TRACK_TYPE) { ++ } else if (!strcmp(normType,MP4_VIDEO_TRACK_TYPE)) { + if (subType != GetTrackEsdsObjectTypeId(m_pTracks[i]->GetId())) { + continue; + } +@@ -2278,11 +2278,11 @@ + for (u_int32_t i = 0; i < m_pTracks.Size(); i++) { + if (!strcmp(normType, m_pTracks[i]->GetType())) { + if (subType) { +- if (normType == MP4_AUDIO_TRACK_TYPE) { ++ if (!strcmp(normType,MP4_AUDIO_TRACK_TYPE)) { + if (subType != GetTrackEsdsObjectTypeId(m_pTracks[i]->GetId())) { + continue; + } +- } else if (normType == MP4_VIDEO_TRACK_TYPE) { ++ } else if (!strcmp(normType,MP4_VIDEO_TRACK_TYPE)) { + if (subType != GetTrackEsdsObjectTypeId(m_pTracks[i]->GetId())) { + continue; + } +--- a/common/mp4v2/mp4file.h ++++ b/common/mp4v2/mp4file.h +@@ -700,7 +700,7 @@ + const char* TempFileName(); + void Rename(const char* existingFileName, const char* newFileName); + +- void ProtectWriteOperation(char* where); ++ void ProtectWriteOperation(const char* where); + + void FindIntegerProperty(const char* name, + MP4Property** ppProperty, u_int32_t* pIndex = NULL); +--- a/common/mp4v2/mp4property.cpp ++++ b/common/mp4v2/mp4property.cpp +@@ -313,7 +313,7 @@ + + // MP4StringProperty + +-MP4StringProperty::MP4StringProperty(char* name, ++MP4StringProperty::MP4StringProperty(const char* name, + bool useCountedFormat, bool useUnicode) + : MP4Property(name) + { +@@ -420,7 +420,7 @@ + + // MP4BytesProperty + +-MP4BytesProperty::MP4BytesProperty(char* name, u_int32_t valueSize, ++MP4BytesProperty::MP4BytesProperty(const char* name, u_int32_t valueSize, + u_int32_t defaultValueSize) + : MP4Property(name) + { +@@ -549,7 +549,7 @@ + + // MP4TableProperty + +-MP4TableProperty::MP4TableProperty(char* name, MP4IntegerProperty* pCountProperty) ++MP4TableProperty::MP4TableProperty(const char* name, MP4IntegerProperty* pCountProperty) + : MP4Property(name) + { + m_pCountProperty = pCountProperty; +@@ -725,7 +725,7 @@ + + // MP4DescriptorProperty + +-MP4DescriptorProperty::MP4DescriptorProperty(char* name, ++MP4DescriptorProperty::MP4DescriptorProperty(const char* name, + u_int8_t tagsStart, u_int8_t tagsEnd, bool mandatory, bool onlyOne) + : MP4Property(name) + { +--- a/common/mp4v2/mp4property.h ++++ b/common/mp4v2/mp4property.h +@@ -100,7 +100,7 @@ + + class MP4IntegerProperty : public MP4Property { + protected: +- MP4IntegerProperty(char* name) ++ MP4IntegerProperty(const char* name) + : MP4Property(name) { }; + + public: +@@ -118,7 +118,7 @@ + #define MP4INTEGER_PROPERTY_DECL2(isize, xsize) \ + class MP4Integer##xsize##Property : public MP4IntegerProperty { \ + public: \ +- MP4Integer##xsize##Property(char* name) \ ++ MP4Integer##xsize##Property(const char* name) \ + : MP4IntegerProperty(name) { \ + SetCount(1); \ + m_values[0] = 0; \ +@@ -188,7 +188,7 @@ + + class MP4BitfieldProperty : public MP4Integer64Property { + public: +- MP4BitfieldProperty(char* name, u_int8_t numBits) ++ MP4BitfieldProperty(const char* name, u_int8_t numBits) + : MP4Integer64Property(name) { + ASSERT(numBits != 0); + ASSERT(numBits <= 64); +@@ -213,7 +213,7 @@ + + class MP4Float32Property : public MP4Property { + public: +- MP4Float32Property(char* name) ++ MP4Float32Property(const char* name) + : MP4Property(name) { + m_useFixed16Format = false; + m_useFixed32Format = false; +@@ -280,7 +280,7 @@ + + class MP4StringProperty : public MP4Property { + public: +- MP4StringProperty(char* name, ++ MP4StringProperty(const char* name, + bool useCountedFormat = false, bool useUnicode = false); + + ~MP4StringProperty(); +@@ -355,7 +355,7 @@ + + class MP4BytesProperty : public MP4Property { + public: +- MP4BytesProperty(char* name, u_int32_t valueSize = 0, ++ MP4BytesProperty(const char* name, u_int32_t valueSize = 0, + u_int32_t defaultValueSize = 0); + + ~MP4BytesProperty(); +@@ -419,7 +419,7 @@ + + class MP4TableProperty : public MP4Property { + public: +- MP4TableProperty(char* name, MP4IntegerProperty* pCountProperty); ++ MP4TableProperty(const char* name, MP4IntegerProperty* pCountProperty); + + ~MP4TableProperty(); + +@@ -469,7 +469,7 @@ + + class MP4DescriptorProperty : public MP4Property { + public: +- MP4DescriptorProperty(char* name = NULL, ++ MP4DescriptorProperty(const char* name = NULL, + u_int8_t tagsStart = 0, u_int8_t tagsEnd = 0, + bool mandatory = false, bool onlyOne = false); + +@@ -531,7 +531,7 @@ + + class MP4QosQualifierProperty : public MP4DescriptorProperty { + public: +- MP4QosQualifierProperty(char* name = NULL, ++ MP4QosQualifierProperty(const char* name = NULL, + u_int8_t tagsStart = 0, u_int8_t tagsEnd = 0, + bool mandatory = false, bool onlyOne = false) : + MP4DescriptorProperty(name, tagsStart, tagsEnd, mandatory, onlyOne) { } +--- a/common/mp4v2/mp4track.cpp ++++ b/common/mp4v2/mp4track.cpp +@@ -1360,7 +1360,7 @@ + } + } + +-MP4Atom* MP4Track::AddAtom(char* parentName, char* childName) ++MP4Atom* MP4Track::AddAtom(const char* parentName, const char* childName) + { + MP4Atom* pChildAtom = MP4Atom::CreateAtom(childName); + +--- a/common/mp4v2/mp4track.h ++++ b/common/mp4v2/mp4track.h +@@ -168,7 +168,7 @@ + void UpdateSyncSamples(MP4SampleId sampleId, + bool isSyncSample); + +- MP4Atom* AddAtom(char* parentName, char* childName); ++ MP4Atom* AddAtom(const char* parentName, const char* childName); + + void UpdateDurations(MP4Duration duration); + MP4Duration ToMovieDuration(MP4Duration trackDuration); +--- a/common/mp4v2/ocidescriptors.cpp ++++ b/common/mp4v2/ocidescriptors.cpp +@@ -171,7 +171,7 @@ + + class MP4CreatorTableProperty : public MP4TableProperty { + public: +- MP4CreatorTableProperty(char* name, MP4Integer8Property* pCountProperty) : ++ MP4CreatorTableProperty(const char* name, MP4Integer8Property* pCountProperty) : + MP4TableProperty(name, pCountProperty) { + }; + protected: diff -Nru faac-1.26/debian/patches/series faac-1.28/debian/patches/series --- faac-1.26/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ faac-1.28/debian/patches/series 2011-06-09 03:58:41.000000000 +0000 @@ -0,0 +1 @@ +build-fix.patch diff -Nru faac-1.26/debian/rules faac-1.28/debian/rules --- faac-1.26/debian/rules 2011-08-28 00:37:20.000000000 +0000 +++ faac-1.28/debian/rules 2011-06-09 03:58:53.000000000 +0000 @@ -1,87 +1,4 @@ #!/usr/bin/make -f -#export DH_VERBOSE=1 - -version := $(shell sed -n 's/Package: \(.*\)/\1/p' debian/control | head -n 1) - -DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) - -NCPUS := $(shell getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1) - -ifeq ($(NCPUS),-1) - NCPUS:=1 -endif - -ifeq ($(NCPUS),0) - NCPUS:=1 -endif - -CFLAGS = -Wall -g - -ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) - CFLAGS += -O0 -else - CFLAGS += -O2 -endif - -configure: configure-stamp -configure-stamp: - dh_testdir - - CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) \ - --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr - - touch configure-stamp - -build: configure-stamp build-stamp -build-stamp: - dh_testdir - - $(MAKE) -j $(NCPUS) - - touch build-stamp - -clean: - dh_testdir - dh_testroot - rm -f build-stamp configure-stamp - - [ ! -f Makefile ] || $(MAKE) distclean - - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp - - dh_install --fail-missing - -# Build architecture-independent files here. -binary-indep: build install -# We have nothing to do by default. - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot - dh_installchangelogs ChangeLog - dh_installdocs -A README TODO NEWS - dh_installman - dh_link - dh_strip - dh_compress - dh_fixperms - dh_makeshlibs -p${version} -V - dh_installdeb - dh_shlibdeps -ldebian/${version}/usr/lib - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install +%: + dh --with=autoreconf $@ diff -Nru faac-1.26/debian/source/format faac-1.28/debian/source/format --- faac-1.26/debian/source/format 1970-01-01 00:00:00.000000000 +0000 +++ faac-1.28/debian/source/format 2011-08-28 00:37:22.000000000 +0000 @@ -0,0 +1 @@ +3.0 (quilt) diff -Nru faac-1.26/debian/watch faac-1.28/debian/watch --- faac-1.26/debian/watch 2011-08-28 00:37:20.000000000 +0000 +++ faac-1.28/debian/watch 2011-06-09 03:51:49.000000000 +0000 @@ -1,3 +1,2 @@ version=3 - -http://sf.net/faac/faac-(.*)\.tar\.gz +http://sf.net/faac/faac-(.*)\.tar.gz diff -Nru faac-1.26/depcomp faac-1.28/depcomp --- faac-1.26/depcomp 2007-10-15 07:24:48.000000000 +0000 +++ faac-1.28/depcomp 2009-02-10 08:37:01.000000000 +0000 @@ -1,10 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2006-10-15.18 +scriptversion=2005-07-09.11 -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software -# Foundation, Inc. +# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # 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 @@ -92,20 +91,7 @@ ## 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 - "$@" + "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else @@ -290,46 +276,6 @@ 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. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - 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 -eq 0; then : - else - 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,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" - # Add `dependent.h:' lines. - sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" - else - echo "#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'. @@ -342,13 +288,13 @@ if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a - # static library. This mechanism is used in libtool 1.4 series to + # static library. This mecanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two - # compilations output dependencies in $dir.libs/$base.o.d and + # compilations output dependencies in 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 diff -Nru faac-1.26/docs/faac.1 faac-1.28/docs/faac.1 --- faac-1.26/docs/faac.1 1970-01-01 00:00:00.000000000 +0000 +++ faac-1.28/docs/faac.1 2009-01-25 00:36:54.000000000 +0000 @@ -0,0 +1,127 @@ +.TH FAAC 1 "2007-10-11" "1.26" "Free Advanced Audio Coder" + +.SH NAME +faac \- open source MPEG-4 and MPEG-2 AAC encoder + +.SH SYNOPSIS +.B faac +.RI [ options ] +.RI [\-o\ outfile ] +.I infiles +.RI ... +.PP +.RI < infiles > +and/or +.RI < outfile > +can be "\-", which means stdin/stdout. + +.SH DESCRIPTION +.B FAAC +is an open source MPEG-4 and MPEG-2 AAC encoder, it is licensed under the LGPL license. +Note that the quality of +.B FAAC +is not up to par with the currently best AAC encoders available. + +.SH FEATURES +.TP +* Portable +.TP +* Reasonably fast +.TP +* LC, Main, LTP support +.TP +* DRM support through DreaM (optional) + +.SH OPTIONS +.TP +.BR \-q\ <\fIquality\fP> +Set default variable bitrate (VBR) quantizer quality in percent (default: 100). +.TP +.BR \-b\ <\fIbitrate\fP> +Set average bitrate (ABR, lower quality mode) to approximately \fIbitrate\fP kbps. +.TP +.BR \-c\ <\fIfreq\fP> +Set the bandwidth in Hz (default: automatic). +.TP +.BR \-o\ \fIX\fP +Set output file to \fIX\fP (only for one input file). +.TP +.BR \-r +Use RAW AAC output file. +.TP +.BR \-P +Raw PCM input mode (default: 44100Hz 16bit stereo). +.TP +.BR \-R +Raw PCM input rate. +.TP +.BR \-B +Raw PCM input sample size (8, 16 [default], 24 or 32bits). +.TP +.BR \-C +Raw PCM input channels. +.TP +.BR \-X +Raw PCM swap input bytes +.TP +.BR \-I\ <\fIC\fP,\fILF\fP> +Input channel config (default: 3,4 [which means Center is third and LFE is fourth]). + +.SH MP4-SPECIFIC OPTIONS (if built with MP4V2) +.TP +.BR \-w +Wrap AAC data in MP4 container (default for *.mp4 and *.m4a). +.TP +.BR \-s +Optimize MP4 container layout after encoding. +.TP +.BR \-\-artist\ \fIX\fP +Set artist to \fIX\fP +.TP +.BR \-\-writer\ \fIX\fP +Set writer to \fIX\fP +.TP +.BR \-\-title\ \fIX\fP +Set title to \fIX\fP +.TP +.BR \-\-genre\ \fIX\fP +Set genre to \fIX\fP +.TP +.BR \-\-album\ \fIX\fP +Set album to \fIX\fP +.TP +.BR \-\-compilation +Set compilation +.TP +.BR \-\-track\ \fIX\fP +Set track to \fIX\fP (number/total) +.TP +.BR \-\-disc\ \fIX\fP +Set disc to \fIX\fP (number/total) +.TP +.BR \-\-year\ \fIX\fP +Set year to \fIX\fP +.TP +.BR \-\-cover-art\ \fIX\fP +Read cover art from file \fIX\fP +.TP +.BR \-\-comment\ \fIX\fP +Set comment to \fIX\fP + +.SH DOCUMENTATION +.TP +.BR \-\-help +for short help on using FAAC. +.TP +.BR \-\-long-help +for a description of all options for FAAC. +.TP +.BR \-\-license +for the license terms for FAAC. + +.SH AUTHORS +.B FAAC +was written by M. Bakker . +.PP +This manpage was written by Fabian Greffrath +for the Debian Unofficial project (but may be used by others, of course). \ No newline at end of file diff -Nru faac-1.26/faac.dsw faac-1.28/faac.dsw --- faac-1.26/faac.dsw 2001-10-22 18:39:51.000000000 +0000 +++ faac-1.28/faac.dsw 1970-01-01 00:00:00.000000000 +0000 @@ -1,134 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "FAAD"=.\plugins\cooledit\FAAD.DSP - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name libfaac - End Project Dependency - Begin Project Dependency - Project_Dep_Name libfaad - End Project Dependency -}}} - -############################################################################### - -Project: "faac"=.\frontend\faac.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name libfaac - End Project Dependency - Begin Project Dependency - Project_Dep_Name libsndfile - End Project Dependency -}}} - -############################################################################### - -Project: "faacgui"=.\frontend\faacgui.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name libfaac - End Project Dependency - Begin Project Dependency - Project_Dep_Name libsndfile - End Project Dependency -}}} - -############################################################################### - -Project: "libfaac"=.\libfaac\libfaac.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "libfaac_dll"=.\libfaac\libfaac_dll.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "libfaad"=..\faad\libfaad\libfaad.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "libsndfile"=.\common\libsndfile\Win32\libsndfile.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "out_FAAC"=.\plugins\winamp\out_FAAC.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name libfaac - End Project Dependency -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff -Nru faac-1.26/frontend/faac.dsp faac-1.28/frontend/faac.dsp --- faac-1.26/frontend/faac.dsp 2004-07-27 08:34:38.000000000 +0000 +++ faac-1.28/frontend/faac.dsp 1970-01-01 00:00:00.000000000 +0000 @@ -1,123 +0,0 @@ -# Microsoft Developer Studio Project File - Name="faac" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=faac - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "faac.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "faac.mak" CFG="faac - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "faac - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "faac - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=xicl6.exe -RSC=rc.exe - -!IF "$(CFG)" == "faac - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /O1 /I "../include" /I "../common/libsndfile/src" /I "../common/getopt" /I "../common/mp4v2" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD BASE RSC /l 0x413 /d "NDEBUG" -# ADD RSC /l 0x413 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=xilink6.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /subsystem:console /machine:I386 -# SUBTRACT LINK32 /profile /debug /nodefaultlib - -!ELSEIF "$(CFG)" == "faac - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../include" /I "../common/libsndfile/src" /I "../common/getopt" /I "../common/mp4v2" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD BASE RSC /l 0x413 /d "_DEBUG" -# ADD RSC /l 0x413 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=xilink6.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "faac - Win32 Release" -# Name "faac - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\input.c -# End Source File -# Begin Source File - -SOURCE=.\main.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE="E:\Program Files\Microsoft Visual Studio\VC98\Include\BASETSD.H" -# End Source File -# Begin Source File - -SOURCE=..\include\faac.h -# End Source File -# Begin Source File - -SOURCE=..\common\getopt\getopt.h -# End Source File -# Begin Source File - -SOURCE=..\common\libsndfile\src\sndfile.h -# End Source File -# Begin Source File - -SOURCE="E:\Program Files\Microsoft Visual Studio\VC98\Include\sndfile.h" -# End Source File -# End Group -# End Target -# End Project diff -Nru faac-1.26/frontend/faac.dsw faac-1.28/frontend/faac.dsw --- faac-1.26/frontend/faac.dsw 2004-07-27 08:25:22.000000000 +0000 +++ faac-1.28/frontend/faac.dsw 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "faac"=.\faac.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name libfaac - End Project Dependency - Begin Project Dependency - Project_Dep_Name libsndfile - End Project Dependency - Begin Project Dependency - Project_Dep_Name libmp4v2_st - End Project Dependency -}}} - -############################################################################### - -Project: "libfaac"=..\LIBFAAC\libfaac.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "libmp4v2_st"=..\common\mp4v2\libmp4v2_st60.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff -Nru faac-1.26/frontend/faacgui.dsp faac-1.28/frontend/faacgui.dsp --- faac-1.26/frontend/faacgui.dsp 2007-03-19 19:57:40.000000000 +0000 +++ faac-1.28/frontend/faacgui.dsp 1970-01-01 00:00:00.000000000 +0000 @@ -1,140 +0,0 @@ -# Microsoft Developer Studio Project File - Name="faacgui" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=faacgui - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "faacgui.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "faacgui.mak" CFG="faacgui - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "faacgui - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "faacgui - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "faacgui - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "faacgui___Win32_Release" -# PROP BASE Intermediate_Dir "faacgui___Win32_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ReleaseGUI" -# PROP Intermediate_Dir "ReleaseGUI" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "../include" /I "../common/libsndfile/src" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x413 /d "NDEBUG" -# ADD RSC /l 0x413 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 -# SUBTRACT LINK32 /profile /nodefaultlib - -!ELSEIF "$(CFG)" == "faacgui - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "faacgui___Win32_Debug" -# PROP BASE Intermediate_Dir "faacgui___Win32_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "DebugGUI" -# PROP Intermediate_Dir "DebugGUI" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../include" /I "../common/libsndfile/src" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x413 /d "_DEBUG" -# ADD RSC /l 0x413 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "faacgui - Win32 Release" -# Name "faacgui - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\input.c -# End Source File -# Begin Source File - -SOURCE=.\maingui.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE="E:\Program Files\Microsoft Visual Studio\VC98\Include\BASETSD.H" -# End Source File -# Begin Source File - -SOURCE=..\include\faac.h -# End Source File -# Begin Source File - -SOURCE=..\include\faaccfg.h -# End Source File -# Begin Source File - -SOURCE=.\input.h -# End Source File -# Begin Source File - -SOURCE=.\resource.h -# End Source File -# Begin Source File - -SOURCE=..\common\libsndfile\src\sndfile.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=.\faacgui.rc -# End Source File -# End Group -# End Target -# End Project diff -Nru faac-1.26/frontend/faacgui.dsw faac-1.28/frontend/faacgui.dsw --- faac-1.26/frontend/faacgui.dsw 2003-02-25 10:51:59.000000000 +0000 +++ faac-1.28/frontend/faacgui.dsw 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "faacgui"=.\faacgui.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name libfaac - End Project Dependency - Begin Project Dependency - Project_Dep_Name libsndfile - End Project Dependency -}}} - -############################################################################### - -Project: "libfaac"=..\libfaac\libfaac.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff -Nru faac-1.26/frontend/faac.sln faac-1.28/frontend/faac.sln --- faac-1.26/frontend/faac.sln 2007-08-22 18:31:50.000000000 +0000 +++ faac-1.28/frontend/faac.sln 2009-01-24 00:15:11.000000000 +0000 @@ -1,15 +1,15 @@  Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 +# Visual Studio 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "faac", "faac.vcproj", "{92992E74-AEDE-46DC-AD8C-ADEA876F1A4C}" ProjectSection(ProjectDependencies) = postProject - {C7A305F1-8C73-4E1F-BB1B-623707D44D24} = {C7A305F1-8C73-4E1F-BB1B-623707D44D24} + {55C87BFB-9C9C-41E0-B9DC-57F41F679D4B} = {55C87BFB-9C9C-41E0-B9DC-57F41F679D4B} {9CC48C6E-92EB-4814-AD37-97AB3622AB65} = {9CC48C6E-92EB-4814-AD37-97AB3622AB65} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaac", "..\LIBFAAC\libfaac.vcproj", "{9CC48C6E-92EB-4814-AD37-97AB3622AB65}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaac", "..\libfaac\libfaac.vcproj", "{9CC48C6E-92EB-4814-AD37-97AB3622AB65}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmp4v2_st", "..\common\mp4v2\libmp4v2_st60.vcproj", "{C7A305F1-8C73-4E1F-BB1B-623707D44D24}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmp4v2_st", "..\common\mp4v2\libmp4v2_st60.vcproj", "{55C87BFB-9C9C-41E0-B9DC-57F41F679D4B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -25,10 +25,10 @@ {9CC48C6E-92EB-4814-AD37-97AB3622AB65}.Debug|Win32.Build.0 = Debug|Win32 {9CC48C6E-92EB-4814-AD37-97AB3622AB65}.Release|Win32.ActiveCfg = Release|Win32 {9CC48C6E-92EB-4814-AD37-97AB3622AB65}.Release|Win32.Build.0 = Release|Win32 - {C7A305F1-8C73-4E1F-BB1B-623707D44D24}.Debug|Win32.ActiveCfg = Debug|Win32 - {C7A305F1-8C73-4E1F-BB1B-623707D44D24}.Debug|Win32.Build.0 = Debug|Win32 - {C7A305F1-8C73-4E1F-BB1B-623707D44D24}.Release|Win32.ActiveCfg = Release|Win32 - {C7A305F1-8C73-4E1F-BB1B-623707D44D24}.Release|Win32.Build.0 = Release|Win32 + {55C87BFB-9C9C-41E0-B9DC-57F41F679D4B}.Debug|Win32.ActiveCfg = Debug|Win32 + {55C87BFB-9C9C-41E0-B9DC-57F41F679D4B}.Debug|Win32.Build.0 = Debug|Win32 + {55C87BFB-9C9C-41E0-B9DC-57F41F679D4B}.Release|Win32.ActiveCfg = Release|Win32 + {55C87BFB-9C9C-41E0-B9DC-57F41F679D4B}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff -Nru faac-1.26/frontend/faac.vcproj faac-1.28/frontend/faac.vcproj --- faac-1.26/frontend/faac.vcproj 2007-08-22 18:31:50.000000000 +0000 +++ faac-1.28/frontend/faac.vcproj 2008-11-24 21:51:32.000000000 +0000 @@ -132,7 +132,7 @@ #include -#ifdef WIN32 +#ifdef _WIN32 #include #include #endif @@ -61,10 +61,14 @@ } riffsub_t; +#ifdef _MSC_VER +#pragma pack(push, 1) +#endif + #define WAVE_FORMAT_PCM 1 #define WAVE_FORMAT_FLOAT 3 #define WAVE_FORMAT_EXTENSIBLE 0xfffe -typedef struct +struct WAVEFORMATEX { u_int16_t wFormatTag; u_int16_t nChannels; @@ -74,11 +78,14 @@ u_int16_t wBitsPerSample; u_int16_t cbSize; } -WAVEFORMATEX; +#ifdef __GNUC +__attribute__((packed)) +#endif +; -typedef struct +struct WAVEFORMATEXTENSIBLE { - WAVEFORMATEX Format; + struct WAVEFORMATEX Format; union { u_int16_t wValidBitsPerSample; // bits of precision u_int16_t wSamplesPerBlock; // valid if wBitsPerSample==0 @@ -86,7 +93,15 @@ } Samples; u_int32_t dwChannelMask; // which channels are present in stream unsigned char SubFormat[16]; // guid -} WAVEFORMATEXTENSIBLE; +} +#ifdef __GNUC +__attribute__((packed)) +#endif +; + +#ifdef _MSC_VER +#pragma pack(pop) +#endif static unsigned char waveformat_pcm_guid[16] = { @@ -108,7 +123,7 @@ FILE *wave_f; riff_t riff; riffsub_t riffsub; - WAVEFORMATEXTENSIBLE wave; + struct WAVEFORMATEXTENSIBLE wave; char *riffl = "RIFF"; char *wavel = "WAVE"; char *bextl = "BEXT"; @@ -120,8 +135,8 @@ if (!strcmp(name, "-")) { -#ifdef WIN32 - setmode(fileno(stdin), O_BINARY); +#ifdef _WIN32 + _setmode(_fileno(stdin), O_BINARY); #endif wave_f = stdin; dostdin = 1; @@ -158,6 +173,7 @@ if (memcmp(&(riffsub.label), fmtl, 4)) return NULL; memset(&wave, 0, sizeof(wave)); + fmtsize = (riffsub.len < sizeof(wave)) ? riffsub.len : sizeof(wave); if (fread(&wave, 1, fmtsize, wave_f) != fmtsize) return NULL; @@ -186,8 +202,12 @@ return NULL; if (memcmp(wave.SubFormat, waveformat_pcm_guid, 16)) { - unsuperr(name); - return NULL; + waveformat_pcm_guid[0] = WAVE_FORMAT_FLOAT; + if (memcmp(wave.SubFormat, waveformat_pcm_guid, 16)) + { + unsuperr(name); + return NULL; + } } } else @@ -201,7 +221,12 @@ sndf = malloc(sizeof(*sndf)); memset(sndf, 0, sizeof(*sndf)); sndf->f = wave_f; - sndf->isfloat = (UINT16(wave.Format.wFormatTag) == WAVE_FORMAT_FLOAT); + + if (UINT16(wave.Format.wFormatTag) == WAVE_FORMAT_FLOAT) { + sndf->isfloat = 1; + } else { + sndf->isfloat = (wave.SubFormat[0] == WAVE_FORMAT_FLOAT); + } if (rawinput) { sndf->bigendian = 1; diff -Nru faac-1.26/frontend/input.h faac-1.28/frontend/input.h --- faac-1.26/frontend/input.h 2003-08-17 19:38:15.000000000 +0000 +++ faac-1.28/frontend/input.h 2008-11-24 22:00:11.000000000 +0000 @@ -16,7 +16,7 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: input.h,v 1.5 2003/08/17 19:38:15 menno Exp $ + * $Id: input.h,v 1.7 2008/11/24 22:00:11 menno Exp $ */ #ifndef _INPUT_H @@ -31,6 +31,8 @@ #ifdef HAVE_SYS_TYPES_H # include #endif +#ifndef __MPEG4IP_INCLUDED__ +/* Let's avoid some boring conflicting declarations */ #ifdef HAVE_INTTYPES_H # include #endif @@ -39,10 +41,10 @@ #endif #ifndef HAVE_INT32_T -typedef int int32_t; +typedef signed int int32_t; #endif #ifndef HAVE_INT16_T -typedef short int16_t; +typedef signed short int16_t; #endif #ifndef HAVE_U_INT32_T typedef unsigned int u_int32_t; @@ -50,6 +52,7 @@ #ifndef HAVE_U_INT16_T typedef unsigned short u_int16_t; #endif +#endif /* #ifndef __MPEG4IP_INCLUDED__ */ #ifdef __cplusplus extern "C" diff -Nru faac-1.26/frontend/main.c faac-1.28/frontend/main.c --- faac-1.26/frontend/main.c 2007-03-19 19:57:40.000000000 +0000 +++ faac-1.28/frontend/main.c 2009-01-24 01:10:20.000000000 +0000 @@ -18,7 +18,7 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: main.c,v 1.80 2007/03/19 19:57:40 menno Exp $ + * $Id: main.c,v 1.82 2009/01/24 01:10:20 menno Exp $ */ #ifdef _MSC_VER @@ -108,6 +108,7 @@ "MP4 specific options:\n" #ifdef HAVE_LIBMP4V2 " -w\t\tWrap AAC data in MP4 container. (default for *.mp4 and *.m4a)\n" + " -s\t\tOptimize MP4 container layout after encoding\n" " --artist X\tSet artist to X\n" " --writer X\tSet writer to X\n" " --title X\tSet title to X\n" @@ -175,6 +176,7 @@ #ifdef HAVE_LIBMP4V2 " -w\t\tWrap AAC data in MP4 container. (default for *.mp4, *.m4a and\n" "\t\t*.m4b)\n" + " -s\t\tOptimize MP4 container layout after encoding.\n" " --artist X\tSet artist to X\n" " --writer X\tSet writer/composer to X\n" " --title X\tSet title/track name to X\n" @@ -330,8 +332,8 @@ static int check_image_header(const char *buf) { if (!strncmp(buf, "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A", 8)) return 1; /* PNG */ - else if (!strncmp(buf, "\xFF\xD8\xFF\xE0", 4) && - !strncmp(buf + 6, "JFIF\0", 5)) + else if (!strncmp(buf, "\xFF\xD8\xFF\xE0", 4) || + !strncmp(buf, "\xFF\xD8\xFF\xE1", 4)) return 1; /* JPEG */ else if (!strncmp(buf, "GIF87a", 6) || !strncmp(buf, "GIF89a", 6)) return 1; /* GIF */ @@ -404,6 +406,7 @@ unsigned int useMidSide = 1; static unsigned int useTns = DEFAULT_TNS; enum container_format container = NO_CONTAINER; + int optimizeFlag = 0; enum stream_format stream = ADTS_STREAM; int cutOff = -1; int bitRate = 0; @@ -489,6 +492,7 @@ { "license", 0, 0, 'L'}, #ifdef HAVE_LIBMP4V2 { "createmp4", 0, 0, 'w'}, + { "optimize", 0, 0, 's'}, { "artist", 1, 0, ARTIST_FLAG}, { "title", 1, 0, TITLE_FLAG}, { "album", 1, 0, ALBUM_FLAG}, @@ -509,7 +513,7 @@ c = getopt_long(argc, argv, "Hhb:m:o:rnc:q:PR:B:C:I:X" #ifdef HAVE_LIBMP4V2 - "w" + "ws" #endif ,long_options, &option_index); @@ -606,6 +610,9 @@ case 'w': container = MP4_CONTAINER; break; + case 's': + optimizeFlag = 1; + break; case ARTIST_FLAG: artist = optarg; break; @@ -1126,15 +1133,23 @@ #endif } } - fprintf(stderr, "\n\n"); #ifdef HAVE_LIBMP4V2 /* clean up */ if (container == MP4_CONTAINER) + { MP4Close(MP4hFile); - else + if (optimizeFlag == 1) + { + fprintf(stderr, "\n\nMP4 format optimization... "); + MP4Optimize(aacFileName, NULL, 0); + fprintf(stderr, "Done!"); + } + } else #endif fclose(outfile); + + fprintf(stderr, "\n\n"); } faacEncClose(hEncoder); @@ -1152,6 +1167,12 @@ /* $Log: main.c,v $ +Revision 1.82 2009/01/24 01:10:20 menno +Made JPEG detection less restrictive + +Revision 1.81 2009/01/24 00:15:12 menno +Added -s option for output of optimized mp4 layout + Revision 1.80 2007/03/19 19:57:40 menno Made faacgui buildable again Made stdout as output possible (use - as output filename) diff -Nru faac-1.26/frontend/Makefile.am faac-1.28/frontend/Makefile.am --- faac-1.26/frontend/Makefile.am 2007-10-15 08:13:02.000000000 +0000 +++ faac-1.28/frontend/Makefile.am 2008-12-16 00:56:00.000000000 +0000 @@ -1,11 +1,12 @@ bin_PROGRAMS = faac +man_MANS = ../docs/faac.1 faac_SOURCES = main.c input.c if WITH_MP4V2 INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/common/mp4v2 -LDADD = $(top_builddir)/libfaac/libfaac.la $(top_srcdir)/common/mp4v2/libmp4v2.la -lm -lstdc++ +LDADD = $(top_builddir)/libfaac/libfaac.la $(top_srcdir)/common/mp4v2/libmp4v2.a -lm -lstdc++ else INCLUDES = -I$(top_srcdir)/include -LDADD = $(top_builddir)/libfaac/libfaac.la -lm -lmp4v2 +LDADD = $(top_builddir)/libfaac/libfaac.la -lm endif diff -Nru faac-1.26/frontend/Makefile.in faac-1.28/frontend/Makefile.in --- faac-1.26/frontend/Makefile.in 2007-10-15 08:13:09.000000000 +0000 +++ faac-1.28/frontend/Makefile.in 2009-02-10 08:37:00.000000000 +0000 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005 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. @@ -14,11 +14,15 @@ @SET_MAKE@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -42,7 +46,7 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_faac_OBJECTS = main.$(OBJEXT) input.$(OBJEXT) @@ -52,25 +56,29 @@ @WITH_MP4V2_FALSE@ $(top_builddir)/libfaac/libfaac.la @WITH_MP4V2_TRUE@faac_DEPENDENCIES = \ @WITH_MP4V2_TRUE@ $(top_builddir)/libfaac/libfaac.la \ -@WITH_MP4V2_TRUE@ $(top_srcdir)/common/mp4v2/libmp4v2.la -DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +@WITH_MP4V2_TRUE@ $(top_srcdir)/common/mp4v2/libmp4v2.a +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(faac_SOURCES) DIST_SOURCES = $(faac_SOURCES) +man1dir = $(mandir)/man1 +NROFF = nroff +MANS = $(man_MANS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ @@ -98,7 +106,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ -INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -110,7 +117,6 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -120,18 +126,21 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ -SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +USE_DRM_FALSE = @USE_DRM_FALSE@ +USE_DRM_TRUE = @USE_DRM_TRUE@ VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ +WITH_MP4V2_FALSE = @WITH_MP4V2_FALSE@ +WITH_MP4V2_TRUE = @WITH_MP4V2_TRUE@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -143,7 +152,6 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ -builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ @@ -171,16 +179,14 @@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ +man_MANS = ../docs/faac.1 faac_SOURCES = main.c input.c @WITH_MP4V2_FALSE@INCLUDES = -I$(top_srcdir)/include @WITH_MP4V2_TRUE@INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/common/mp4v2 -@WITH_MP4V2_FALSE@LDADD = $(top_builddir)/libfaac/libfaac.la -lm -lmp4v2 -@WITH_MP4V2_TRUE@LDADD = $(top_builddir)/libfaac/libfaac.la $(top_srcdir)/common/mp4v2/libmp4v2.la -lm -lstdc++ +@WITH_MP4V2_FALSE@LDADD = $(top_builddir)/libfaac/libfaac.la -lm +@WITH_MP4V2_TRUE@LDADD = $(top_builddir)/libfaac/libfaac.la $(top_srcdir)/common/mp4v2/libmp4v2.a -lm -lstdc++ all: all-am .SUFFIXES: @@ -216,7 +222,7 @@ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ @@ -244,7 +250,7 @@ done faac$(EXEEXT): $(faac_OBJECTS) $(faac_DEPENDENCIES) @rm -f faac$(EXEEXT) - $(LINK) $(faac_OBJECTS) $(faac_LDADD) $(LIBS) + $(LINK) $(faac_LDFLAGS) $(faac_OBJECTS) $(faac_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -256,22 +262,22 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< @@ -282,6 +288,55 @@ clean-libtool: -rm -rf .libs _libs +distclean-libtool: + -rm -f libtool +uninstall-info-am: +install-man1: $(man1_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)" + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ + done +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ + done + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -331,21 +386,22 @@ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(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 \ + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ @@ -358,10 +414,10 @@ done check-am: all-am check: check-am -all-am: Makefile $(PROGRAMS) +all-am: Makefile $(PROGRAMS) $(MANS) installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am @@ -395,7 +451,7 @@ -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags + distclean-libtool distclean-tags dvi: dvi-am @@ -407,21 +463,13 @@ info-am: -install-data-am: - -install-dvi: install-dvi-am +install-data-am: install-man install-exec-am: install-binPROGRAMS -install-html: install-html-am - install-info: install-info-am -install-man: - -install-pdf: install-pdf-am - -install-ps: install-ps-am +install-man: install-man1 installcheck-am: @@ -443,23 +491,22 @@ ps-am: -uninstall-am: uninstall-binPROGRAMS +uninstall-am: uninstall-binPROGRAMS uninstall-info-am uninstall-man -.MAKE: install-am install-strip +uninstall-man: uninstall-man1 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool 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 mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am \ - uninstall-binPROGRAMS + install-binPROGRAMS install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-man1 install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-binPROGRAMS uninstall-info-am \ + uninstall-man uninstall-man1 # 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. diff -Nru faac-1.26/include/faac.h faac-1.28/include/faac.h --- faac-1.26/include/faac.h 2004-07-04 12:12:05.000000000 +0000 +++ faac-1.28/include/faac.h 2009-01-25 18:50:32.000000000 +0000 @@ -16,7 +16,7 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: faac.h,v 1.33 2004/07/04 12:12:05 corrados Exp $ + * $Id: faac.h,v 1.36 2009/01/25 18:50:32 menno Exp $ */ #ifndef _FAAC_H_ @@ -26,7 +26,7 @@ extern "C" { #endif /* __cplusplus */ -#ifdef WIN32 +#if defined(_WIN32) && !defined(__MINGW32__) # ifndef FAACAPI # define FAACAPI __stdcall # endif @@ -50,7 +50,7 @@ typedef void *faacEncHandle; #ifndef HAVE_INT32_T -typedef int int32_t; +typedef signed int int32_t; #endif /* diff -Nru faac-1.26/include/Makefile.in faac-1.28/include/Makefile.in --- faac-1.26/include/Makefile.in 2007-10-15 08:13:09.000000000 +0000 +++ faac-1.28/include/Makefile.in 2009-02-10 08:37:01.000000000 +0000 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005 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. @@ -14,11 +14,15 @@ @SET_MAKE@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -57,6 +61,8 @@ CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ @@ -84,7 +90,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ -INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -96,7 +101,6 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -106,18 +110,21 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ -SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +USE_DRM_FALSE = @USE_DRM_FALSE@ +USE_DRM_TRUE = @USE_DRM_TRUE@ VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ +WITH_MP4V2_FALSE = @WITH_MP4V2_FALSE@ +WITH_MP4V2_TRUE = @WITH_MP4V2_TRUE@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -129,7 +136,6 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ -builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ @@ -157,11 +163,8 @@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ include_HEADERS = faac.h faaccfg.h all: all-am @@ -201,9 +204,13 @@ clean-libtool: -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) - test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" + test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ @@ -268,21 +275,22 @@ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(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 \ + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ @@ -298,7 +306,7 @@ all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(includedir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am @@ -330,7 +338,8 @@ distclean: distclean-am -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-tags +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags dvi: dvi-am @@ -344,20 +353,12 @@ install-data-am: install-includeHEADERS -install-dvi: install-dvi-am - 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 - installcheck-am: maintainer-clean: maintainer-clean-am @@ -376,22 +377,19 @@ ps-am: -uninstall-am: uninstall-includeHEADERS - -.MAKE: install-am install-strip +uninstall-am: uninstall-includeHEADERS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool ctags distclean distclean-generic \ distclean-libtool 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-data-am install-exec install-exec-am \ install-includeHEADERS install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ + install-man install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags uninstall uninstall-am uninstall-includeHEADERS + ps ps-am tags uninstall uninstall-am uninstall-includeHEADERS \ + uninstall-info-am # 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. diff -Nru faac-1.26/INSTALL faac-1.28/INSTALL --- faac-1.26/INSTALL 2007-10-15 07:24:48.000000000 +0000 +++ faac-1.28/INSTALL 2009-02-10 08:37:01.000000000 +0000 @@ -1,8 +1,8 @@ Installation Instructions ************************* -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006 Free Software Foundation, Inc. +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free +Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. @@ -10,10 +10,7 @@ Basic Installation ================== -Briefly, the shell commands `./configure; make; make install' should -configure, build, and install this package. The following -more-detailed instructions are generic; see the `README' file for -instructions specific to this package. +These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses @@ -26,9 +23,9 @@ It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. Caching is +the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale -cache files. +cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail @@ -38,17 +35,20 @@ may remove or edit it. The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You need `configure.ac' if -you want to change it or regenerate `configure' using a newer version -of `autoconf'. +`configure' by a program called `autoconf'. You only need +`configure.ac' if you want to change it or regenerate `configure' using +a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. - Running `configure' might take a while. While running, it prints - some messages telling which features it is checking for. + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. 2. Type `make' to compile the package. @@ -78,7 +78,7 @@ by setting variables in the command line or in the environment. Here is an example: - ./configure CC=c99 CFLAGS=-g LIBS=-lposix + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. @@ -87,15 +87,17 @@ You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their -own directory. To do this, you can use GNU `make'. `cd' to the +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. - With a non-GNU `make', it is safer to compile the package for one -architecture at a time in the source code directory. After you have -installed the package for one architecture, use `make distclean' before -reconfiguring for another architecture. + If you have to use a `make' that does not support the `VPATH' +variable, you have to compile the package for one architecture at a +time in the source code directory. After you have installed the +package for one architecture, use `make distclean' before reconfiguring +for another architecture. Installation Names ================== @@ -188,12 +190,12 @@ ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). +overridden in the site shell script). Here is a another example: -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf bug. Until the bug is fixed you can use this workaround: + /bin/bash ./configure CONFIG_SHELL=/bin/bash - CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash +Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent +configuration-related scripts to be executed by `/bin/bash'. `configure' Invocation ====================== diff -Nru faac-1.26/install-sh faac-1.28/install-sh --- faac-1.26/install-sh 2007-10-15 07:24:47.000000000 +0000 +++ faac-1.28/install-sh 2009-02-10 08:37:00.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2006-10-14.15 +scriptversion=2005-05-14.22 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -39,24 +39,15 @@ # when there is no Makefile. # # This script is compatible with the BSD install script, but was written -# from scratch. - -nl=' -' -IFS=" "" $nl" +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi -# Put in absolute file names if you don't have them in your path; -# or use environment vars. +# put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" @@ -67,13 +58,7 @@ rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" -posix_glob= -posix_mkdir= - -# Desired mode of installed file. -mode=0755 - -chmodcmd=$chmodprog +chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= @@ -110,7 +95,7 @@ CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " -while test $# -ne 0; do +while test -n "$1"; do case $1 in -c) shift continue;; @@ -126,15 +111,9 @@ --help) echo "$usage"; exit $?;; - -m) mode=$2 + -m) chmodcmd="$chmodprog $2" shift shift - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac continue;; -o) chowncmd="$chownprog $2" @@ -157,33 +136,25 @@ --version) echo "$0 $scriptversion"; exit $?;; - --) shift + *) # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + test -n "$dir_arg$dstarg" && break + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dstarg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dstarg" + shift # fnord + fi + shift # arg + dstarg=$arg + done break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; esac done -if test $# -ne 0 && test -z "$dir_arg$dstarg"; 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 "$dstarg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dstarg" - shift # fnord - fi - shift # arg - dstarg=$arg - done -fi - -if test $# -eq 0; then +if test -z "$1"; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 @@ -193,33 +164,6 @@ exit 0 fi -if test -z "$dir_arg"; then - trap '(exit $?); exit' 1 2 13 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 starting with `-'. @@ -229,11 +173,15 @@ if test -n "$dir_arg"; then dst=$src - dstdir=$dst - test -d "$dstdir" - dstdir_status=$? - else + src= + if test -d "$dst"; then + mkdircmd=: + chmodcmd= + else + mkdircmd=$mkdirprog + 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 '*'. @@ -260,188 +208,53 @@ echo "$0: $dstarg: Is a directory" >&2 exit 1 fi - dstdir=$dst - dst=$dstdir/`basename "$src"` - dstdir_status=0 - else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - - test -d "$dstdir" - dstdir_status=$? + dst=$dst/`basename "$src"` fi fi - obsolete_mkdir_used=false + # This sed command emulates the dirname command. + dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` - if test $dstdir_status != 0; then - case $posix_mkdir in - '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # 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 - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/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-writeable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; - esac + # Make sure that the destination directory exists. - if - $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" - ) - then : - else + # Skip lots of stat calls in the usual case. + if test ! -d "$dstdir"; then + defaultIFS=' + ' + IFS="${IFS-$defaultIFS}" + + oIFS=$IFS + # Some sh's can't handle IFS=/ for some reason. + IFS='%' + set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` + shift + IFS=$oIFS - # The umask is ridiculous, or 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 - - case $posix_glob in - '') - if (set -f) 2>/dev/null; then - posix_glob=true - else - posix_glob=false - fi ;; - esac - - oIFS=$IFS - IFS=/ - $posix_glob && set -f - set fnord $dstdir - shift - $posix_glob && set +f - IFS=$oIFS + pathcomp= - prefixes= - - for d - do - test -z "$d" && 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 + while test $# -ne 0 ; do + pathcomp=$pathcomp$1 + shift + if test ! -d "$pathcomp"; then + $mkdirprog "$pathcomp" + # mkdir can fail with a `File exist' error in case several + # install-sh are creating the directory concurrently. This + # is OK. + test -d "$pathcomp" || exit fi - fi + pathcomp=$pathcomp/ + done 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 + $doit $mkdircmd "$dst" \ + && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } + else + dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ @@ -449,9 +262,10 @@ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + $doit $cpprog "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits. # @@ -462,10 +276,10 @@ { 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"; } && + && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && # Now rename the file to the real destination. - { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \ + { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 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 @@ -477,12 +291,11 @@ # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { - if test -f "$dst"; then - $doit $rmcmd -f "$dst" 2>/dev/null \ - || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \ - && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\ + if test -f "$dstdir/$dstfile"; then + $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ + || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { - echo "$0: cannot unlink or rename $dst" >&2 + echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit 1 } else @@ -491,14 +304,17 @@ } && # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" + $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" } - } || exit 1 - - trap '' 0 - fi + } + fi || { (exit 1); exit 1; } done +# The final little trick to "correctly" pass the exit status to the exit trap. +{ + (exit 0); exit 0 +} + # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" diff -Nru faac-1.26/libfaac/aacquant.c faac-1.28/libfaac/aacquant.c --- faac-1.26/libfaac/aacquant.c 2004-07-12 08:46:43.000000000 +0000 +++ faac-1.28/libfaac/aacquant.c 2008-03-23 23:00:25.000000000 +0000 @@ -17,7 +17,7 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: aacquant.c,v 1.31 2004/07/12 08:46:43 corrados Exp $ + * $Id: aacquant.c,v 1.32 2008/03/23 23:00:25 menno Exp $ */ #include @@ -226,6 +226,27 @@ for (i = 0; i < coderInfo->nr_of_sfb; i++) printf("sf %d: %d\n", i, coderInfo->scale_factor[i]); #endif + // clamp to valid diff range + { + int previous_scale_factor = coderInfo->global_gain; + int previous_is_factor = 0; + for (i = 0; i < coderInfo->nr_of_sfb; i++) { + if ((coderInfo->book_vector[i]==INTENSITY_HCB) || + (coderInfo->book_vector[i]==INTENSITY_HCB2)) { + const int diff = scale_factor[i] - previous_is_factor; + if (diff < -60) scale_factor[i] = previous_is_factor - 60; + else if (diff > 59) scale_factor[i] = previous_is_factor + 59; + previous_is_factor = scale_factor[i]; +// printf("sf %d: %d diff=%d **\n", i, coderInfo->scale_factor[i], diff); + } else if (coderInfo->book_vector[i]) { + const int diff = scale_factor[i] - previous_scale_factor; + if (diff < -60) scale_factor[i] = previous_scale_factor - 60; + else if (diff > 59) scale_factor[i] = previous_scale_factor + 59; + previous_scale_factor = scale_factor[i]; +// printf("sf %d: %d diff=%d\n", i, coderInfo->scale_factor[i], diff); + } + } + } /* place the codewords and their respective lengths in arrays data[] and len[] respectively */ /* there are 'counter' elements in each array, and these are variable length arrays depending on the input */ diff -Nru faac-1.26/libfaac/frame.h faac-1.28/libfaac/frame.h --- faac-1.26/libfaac/frame.h 2003-11-24 18:09:38.000000000 +0000 +++ faac-1.28/libfaac/frame.h 2009-01-25 18:50:32.000000000 +0000 @@ -16,7 +16,7 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: frame.h,v 1.27 2003/11/24 18:09:38 knik Exp $ + * $Id: frame.h,v 1.30 2009/01/25 18:50:32 menno Exp $ */ #ifndef FRAME_H @@ -37,7 +37,7 @@ #endif #ifndef HAVE_INT32_T -typedef int int32_t; +typedef signed int int32_t; #endif #ifdef __cplusplus @@ -50,7 +50,7 @@ #include "aacquant.h" #include "fft.h" -#ifdef WIN32 +#if defined(_WIN32) && !defined(__MINGW32__) #ifndef FAACAPI #define FAACAPI __stdcall #endif diff -Nru faac-1.26/libfaac/libfaac_dll_drm.sln faac-1.28/libfaac/libfaac_dll_drm.sln --- faac-1.26/libfaac/libfaac_dll_drm.sln 2005-02-02 07:54:30.000000000 +0000 +++ faac-1.28/libfaac/libfaac_dll_drm.sln 2008-04-06 00:51:52.000000000 +0000 @@ -1,27 +1,25 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaac", "libfaac_dll_drm.vcproj", "{AA2D0EFE-E73D-40AD-ADCE-8A2B54F34C6F}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual C++ Express 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaac_dll", "libfaac_dll_drm.vcproj", "{AA2D0EFE-E73D-40AD-ADCE-8A2B54F34C6F}" EndProject Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Debug DRM = Debug DRM - Release = Release - Release DRM = Release DRM + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug DRM|Win32 = Debug DRM|Win32 + Debug|Win32 = Debug|Win32 + Release DRM|Win32 = Release DRM|Win32 + Release|Win32 = Release|Win32 EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {AA2D0EFE-E73D-40AD-ADCE-8A2B54F34C6F}.Debug.ActiveCfg = Debug|Win32 - {AA2D0EFE-E73D-40AD-ADCE-8A2B54F34C6F}.Debug.Build.0 = Debug|Win32 - {AA2D0EFE-E73D-40AD-ADCE-8A2B54F34C6F}.Debug DRM.ActiveCfg = Debug DRM|Win32 - {AA2D0EFE-E73D-40AD-ADCE-8A2B54F34C6F}.Debug DRM.Build.0 = Debug DRM|Win32 - {AA2D0EFE-E73D-40AD-ADCE-8A2B54F34C6F}.Release.ActiveCfg = Release|Win32 - {AA2D0EFE-E73D-40AD-ADCE-8A2B54F34C6F}.Release.Build.0 = Release|Win32 - {AA2D0EFE-E73D-40AD-ADCE-8A2B54F34C6F}.Release DRM.ActiveCfg = Release DRM|Win32 - {AA2D0EFE-E73D-40AD-ADCE-8A2B54F34C6F}.Release DRM.Build.0 = Release DRM|Win32 + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AA2D0EFE-E73D-40AD-ADCE-8A2B54F34C6F}.Debug DRM|Win32.ActiveCfg = Debug DRM|Win32 + {AA2D0EFE-E73D-40AD-ADCE-8A2B54F34C6F}.Debug DRM|Win32.Build.0 = Debug DRM|Win32 + {AA2D0EFE-E73D-40AD-ADCE-8A2B54F34C6F}.Debug|Win32.ActiveCfg = Debug|Win32 + {AA2D0EFE-E73D-40AD-ADCE-8A2B54F34C6F}.Debug|Win32.Build.0 = Debug|Win32 + {AA2D0EFE-E73D-40AD-ADCE-8A2B54F34C6F}.Release DRM|Win32.ActiveCfg = Release DRM|Win32 + {AA2D0EFE-E73D-40AD-ADCE-8A2B54F34C6F}.Release DRM|Win32.Build.0 = Release DRM|Win32 + {AA2D0EFE-E73D-40AD-ADCE-8A2B54F34C6F}.Release|Win32.ActiveCfg = Release|Win32 + {AA2D0EFE-E73D-40AD-ADCE-8A2B54F34C6F}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE EndGlobalSection EndGlobal diff -Nru faac-1.26/libfaac/libfaac_dll_drm.vcproj faac-1.28/libfaac/libfaac_dll_drm.vcproj --- faac-1.26/libfaac/libfaac_dll_drm.vcproj 2005-02-02 07:55:11.000000000 +0000 +++ faac-1.28/libfaac/libfaac_dll_drm.vcproj 2008-04-06 00:51:52.000000000 +0000 @@ -1,84 +1,137 @@ + > + Name="Win32" + /> + + + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + + + + + + SuppressStartupBanner="true" + /> + + + Name="VCPreLinkEventTool" + /> - + TargetMachine="1" + /> + Name="VCALinkTool" + /> + Name="VCManifestTool" + /> + Name="VCXDCMakeTool" + /> + Name="VCBscMakeTool" + /> + Name="VCFxCopTool" + /> + Name="VCAppVerifierTool" + /> - + Name="VCWebDeploymentTool" + /> + Name="VCPostBuildEventTool" + /> + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + + + + + + SuppressStartupBanner="true" + DebugInformationFormat="4" + /> + + + Name="VCPreLinkEventTool" + /> - + TargetMachine="1" + /> + Name="VCALinkTool" + /> + Name="VCManifestTool" + /> + Name="VCXDCMakeTool" + /> + Name="VCBscMakeTool" + /> + Name="VCFxCopTool" + /> + Name="VCAppVerifierTool" + /> - + Name="VCWebDeploymentTool" + /> + Name="VCPostBuildEventTool" + /> + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + + + + + + SuppressStartupBanner="true" + /> + + + Name="VCPreLinkEventTool" + /> - + SetChecksum="true" + TargetMachine="1" + /> + Name="VCALinkTool" + /> + Name="VCManifestTool" + /> + Name="VCXDCMakeTool" + /> + Name="VCBscMakeTool" + /> + Name="VCFxCopTool" + /> + Name="VCAppVerifierTool" + /> + ApplicationProtection="0" + /> - + Name="VCPostBuildEventTool" + /> + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + + + + + + SuppressStartupBanner="true" + DebugInformationFormat="4" + /> + + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1031" + /> + + TargetMachine="1" + /> + Name="VCALinkTool" + /> + Name="VCManifestTool" + /> + Name="VCXDCMakeTool" + /> + Name="VCBscMakeTool" + /> - + Name="VCFxCopTool" + /> + Name="VCAppVerifierTool" + /> - + Name="VCWebDeploymentTool" + /> + Name="VCPostBuildEventTool" + /> @@ -261,126 +381,165 @@ + Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + > + RelativePath=".\aacquant.c" + > + RelativePath=".\backpred.c" + > + RelativePath=".\bitstream.c" + > + RelativePath=".\channels.c" + > + RelativePath=".\fft.c" + > + RelativePath=".\filtbank.c" + > + RelativePath=".\frame.c" + > + RelativePath=".\huffman.c" + > + RelativePath=".\ltp.c" + > + RelativePath=".\midside.c" + > + RelativePath=".\psychkni.c" + > + RelativePath=".\tns.c" + > + RelativePath=".\util.c" + > + Filter="h;hpp;hxx;hm;inl" + > + RelativePath=".\aacquant.h" + > + RelativePath=".\backpred.h" + > + RelativePath=".\bitstream.h" + > + RelativePath=".\channels.h" + > + RelativePath=".\coder.h" + > + RelativePath=".\fft.h" + > + RelativePath=".\filtbank.h" + > + RelativePath=".\frame.h" + > + RelativePath=".\huffman.h" + > + RelativePath=".\hufftab.h" + > + RelativePath=".\ltp.h" + > + RelativePath=".\midside.h" + > + RelativePath=".\psych.h" + > + RelativePath=".\tns.h" + > + RelativePath=".\util.h" + > + RelativePath=".\version.h" + > + > + RelativePath=".\kiss_fft\_kiss_fft_guts.h" + > + RelativePath=".\kiss_fft\kiss_fft.c" + > + RelativePath=".\kiss_fft\kiss_fft.h" + > + RelativePath=".\kiss_fft\kiss_fftr.c" + > + RelativePath=".\kiss_fft\kiss_fftr.h" + > + RelativePath="..\include\faac.h" + > + RelativePath="..\include\faaccfg.h" + > + RelativePath=".\libfaacdrm.def" + > diff -Nru faac-1.26/libfaac/libfaac_dll.dsp faac-1.28/libfaac/libfaac_dll.dsp --- faac-1.26/libfaac/libfaac_dll.dsp 2004-01-23 10:22:43.000000000 +0000 +++ faac-1.28/libfaac/libfaac_dll.dsp 1970-01-01 00:00:00.000000000 +0000 @@ -1,223 +0,0 @@ -# Microsoft Developer Studio Project File - Name="libfaac_dll" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=libfaac_dll - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "libfaac_dll.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "libfaac_dll.mak" CFG="libfaac_dll - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libfaac_dll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libfaac_dll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "libfaac_dll - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ReleaseDLL" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBFAAC_DLL_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBFAAC_DLL_EXPORTS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 /nologo /dll /machine:I386 /out:"ReleaseDLL/libfaac.dll" - -!ELSEIF "$(CFG)" == "libfaac_dll - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "libfaac_dll___Win32_Debug" -# PROP BASE Intermediate_Dir "libfaac_dll___Win32_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "DebugDLL" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBFAAC_DLL_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBFAAC_DLL_EXPORTS" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 /nologo /dll /debug /machine:I386 /out:"DebugDLL/libfaac.dll" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "libfaac_dll - Win32 Release" -# Name "libfaac_dll - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\aacquant.c -# End Source File -# Begin Source File - -SOURCE=.\backpred.c -# End Source File -# Begin Source File - -SOURCE=.\bitstream.c -# End Source File -# Begin Source File - -SOURCE=.\channels.c -# End Source File -# Begin Source File - -SOURCE=.\fft.c -# End Source File -# Begin Source File - -SOURCE=.\filtbank.c -# End Source File -# Begin Source File - -SOURCE=.\frame.c -# End Source File -# Begin Source File - -SOURCE=.\huffman.c -# End Source File -# Begin Source File - -SOURCE=.\ltp.c -# End Source File -# Begin Source File - -SOURCE=.\midside.c -# End Source File -# Begin Source File - -SOURCE=.\psychkni.c -# End Source File -# Begin Source File - -SOURCE=.\tns.c -# End Source File -# Begin Source File - -SOURCE=.\util.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\aacquant.h -# End Source File -# Begin Source File - -SOURCE=.\backpred.h -# End Source File -# Begin Source File - -SOURCE=.\bitstream.h -# End Source File -# Begin Source File - -SOURCE=.\channels.h -# End Source File -# Begin Source File - -SOURCE=.\coder.h -# End Source File -# Begin Source File - -SOURCE=..\faac\include\faaccfg.h -# End Source File -# Begin Source File - -SOURCE=.\fft.h -# End Source File -# Begin Source File - -SOURCE=.\filtbank.h -# End Source File -# Begin Source File - -SOURCE=.\frame.h -# End Source File -# Begin Source File - -SOURCE=.\huffman.h -# End Source File -# Begin Source File - -SOURCE=.\hufftab.h -# End Source File -# Begin Source File - -SOURCE=.\ltp.h -# End Source File -# Begin Source File - -SOURCE=.\midside.h -# End Source File -# Begin Source File - -SOURCE=.\psych.h -# End Source File -# Begin Source File - -SOURCE=.\tns.h -# End Source File -# Begin Source File - -SOURCE=.\util.h -# End Source File -# Begin Source File - -SOURCE=.\version.h -# End Source File -# End Group -# Begin Source File - -SOURCE=.\libfaac.def -# End Source File -# End Target -# End Project diff -Nru faac-1.26/libfaac/libfaac_dll.dsw faac-1.28/libfaac/libfaac_dll.dsw --- faac-1.26/libfaac/libfaac_dll.dsw 2001-07-12 12:14:49.000000000 +0000 +++ faac-1.28/libfaac/libfaac_dll.dsw 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "libfaac_dll"=.\libfaac_dll.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff -Nru faac-1.26/libfaac/libfaac_dll.sln faac-1.28/libfaac/libfaac_dll.sln --- faac-1.26/libfaac/libfaac_dll.sln 2002-10-11 18:04:21.000000000 +0000 +++ faac-1.28/libfaac/libfaac_dll.sln 2008-04-06 00:51:51.000000000 +0000 @@ -1,21 +1,19 @@ -Microsoft Visual Studio Solution File, Format Version 7.00 +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual C++ Express 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaac_dll", "libfaac_dll.vcproj", "{856BB8CF-B944-4D7A-9D59-4945316229AA}" EndProject Global - GlobalSection(SolutionConfiguration) = preSolution - ConfigName.0 = Debug - ConfigName.1 = Release + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 EndGlobalSection - GlobalSection(ProjectDependencies) = postSolution + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {856BB8CF-B944-4D7A-9D59-4945316229AA}.Debug|Win32.ActiveCfg = Debug|Win32 + {856BB8CF-B944-4D7A-9D59-4945316229AA}.Debug|Win32.Build.0 = Debug|Win32 + {856BB8CF-B944-4D7A-9D59-4945316229AA}.Release|Win32.ActiveCfg = Release|Win32 + {856BB8CF-B944-4D7A-9D59-4945316229AA}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {856BB8CF-B944-4D7A-9D59-4945316229AA}.Debug.ActiveCfg = Debug|Win32 - {856BB8CF-B944-4D7A-9D59-4945316229AA}.Debug.Build.0 = Debug|Win32 - {856BB8CF-B944-4D7A-9D59-4945316229AA}.Release.ActiveCfg = Release|Win32 - {856BB8CF-B944-4D7A-9D59-4945316229AA}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE EndGlobalSection EndGlobal diff -Nru faac-1.26/libfaac/libfaac_dll.vcproj faac-1.28/libfaac/libfaac_dll.vcproj --- faac-1.26/libfaac/libfaac_dll.vcproj 2002-10-11 18:04:21.000000000 +0000 +++ faac-1.28/libfaac/libfaac_dll.vcproj 2008-04-06 00:51:52.000000000 +0000 @@ -1,228 +1,334 @@ - + + ProjectGUID="{856BB8CF-B944-4D7A-9D59-4945316229AA}" + > + Name="Win32" + /> + + + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + + + + + + SuppressStartupBanner="true" + /> + Name="VCManagedResourceCompilerTool" + /> + + + ImportLibrary=".\ReleaseDLL/libfaac.lib" + /> + Name="VCALinkTool" + /> + Name="VCManifestTool" + /> + Name="VCXDCMakeTool" + /> + Name="VCBscMakeTool" + /> + Name="VCFxCopTool" + /> + Name="VCAppVerifierTool" + /> + Name="VCWebDeploymentTool" + /> + + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + + + + + + SuppressStartupBanner="true" + DebugInformationFormat="4" + /> + + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1031" + /> + + ImportLibrary=".\DebugDLL/libfaac.lib" + /> + Name="VCALinkTool" + /> + Name="VCManifestTool" + /> + Name="VCXDCMakeTool" + /> + Name="VCBscMakeTool" + /> + Name="VCFxCopTool" + /> + + Name="VCWebDeploymentTool" + /> + Name="VCPostBuildEventTool" + /> + + - - + Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + > + RelativePath=".\aacquant.c" + > + RelativePath=".\backpred.c" + > + RelativePath=".\bitstream.c" + > + RelativePath=".\channels.c" + > + RelativePath=".\fft.c" + > + RelativePath=".\filtbank.c" + > + RelativePath=".\frame.c" + > + RelativePath=".\huffman.c" + > + RelativePath=".\ltp.c" + > + RelativePath=".\midside.c" + > + RelativePath=".\psychkni.c" + > + RelativePath=".\tns.c" + > + RelativePath=".\util.c" + > + Filter="h;hpp;hxx;hm;inl" + > + RelativePath=".\aacquant.h" + > + RelativePath=".\backpred.h" + > + RelativePath=".\bitstream.h" + > + RelativePath=".\channels.h" + > + RelativePath=".\coder.h" + > + RelativePath=".\fft.h" + > + RelativePath=".\filtbank.h" + > + RelativePath=".\frame.h" + > + RelativePath=".\huffman.h" + > + RelativePath=".\hufftab.h" + > + RelativePath=".\joint.h" + > + RelativePath=".\ltp.h" + > + RelativePath=".\psych.h" + > + RelativePath=".\tns.h" + > + RelativePath=".\util.h" + > + RelativePath=".\libfaac.def" + > diff -Nru faac-1.26/libfaac/libfaac.dsp faac-1.28/libfaac/libfaac.dsp --- faac-1.26/libfaac/libfaac.dsp 2004-07-27 08:25:22.000000000 +0000 +++ faac-1.28/libfaac/libfaac.dsp 1970-01-01 00:00:00.000000000 +0000 @@ -1,208 +0,0 @@ -# Microsoft Developer Studio Project File - Name="libfaac" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=libfaac - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "libfaac.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "libfaac.mak" CFG="libfaac - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libfaac - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "libfaac - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=xicl6.exe -RSC=rc.exe - -!IF "$(CFG)" == "libfaac - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -F90=df.exe -MTL=midl.exe -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /G6 /MD /W3 /O2 /I "..\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD BASE RSC /l 0x413 /d "NDEBUG" -# ADD RSC /l 0x413 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "libfaac - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -F90=df.exe -MTL=midl.exe -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD BASE RSC /l 0x413 /d "_DEBUG" -# ADD RSC /l 0x413 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "libfaac - Win32 Release" -# Name "libfaac - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\aacquant.c -# End Source File -# Begin Source File - -SOURCE=.\backpred.c -# End Source File -# Begin Source File - -SOURCE=.\bitstream.c -# End Source File -# Begin Source File - -SOURCE=.\channels.c -# End Source File -# Begin Source File - -SOURCE=.\fft.c -# End Source File -# Begin Source File - -SOURCE=.\filtbank.c -# End Source File -# Begin Source File - -SOURCE=.\frame.c -# End Source File -# Begin Source File - -SOURCE=.\huffman.c -# End Source File -# Begin Source File - -SOURCE=.\ltp.c -# End Source File -# Begin Source File - -SOURCE=.\midside.c -# End Source File -# Begin Source File - -SOURCE=.\psychkni.c -# End Source File -# Begin Source File - -SOURCE=.\tns.c -# End Source File -# Begin Source File - -SOURCE=.\util.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\aacquant.h -# End Source File -# Begin Source File - -SOURCE=.\backpred.h -# End Source File -# Begin Source File - -SOURCE=.\bitstream.h -# End Source File -# Begin Source File - -SOURCE=.\channels.h -# End Source File -# Begin Source File - -SOURCE=.\coder.h -# End Source File -# Begin Source File - -SOURCE=.\fft.h -# End Source File -# Begin Source File - -SOURCE=.\filtbank.h -# End Source File -# Begin Source File - -SOURCE=.\frame.h -# End Source File -# Begin Source File - -SOURCE=.\huffman.h -# End Source File -# Begin Source File - -SOURCE=.\hufftab.h -# End Source File -# Begin Source File - -SOURCE=.\joint.h -# End Source File -# Begin Source File - -SOURCE=.\ltp.h -# End Source File -# Begin Source File - -SOURCE=.\psych.h -# End Source File -# Begin Source File - -SOURCE=.\tns.h -# End Source File -# Begin Source File - -SOURCE=.\util.h -# End Source File -# End Group -# End Target -# End Project diff -Nru faac-1.26/libfaac/Makefile.in faac-1.28/libfaac/Makefile.in --- faac-1.26/libfaac/Makefile.in 2007-10-15 08:13:09.000000000 +0000 +++ faac-1.28/libfaac/Makefile.in 2009-02-10 08:37:01.000000000 +0000 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005 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. @@ -14,11 +14,15 @@ @SET_MAKE@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -60,24 +64,25 @@ @USE_DRM_TRUE@am__objects_2 = kiss_fftr.lo kiss_fft.lo am_libfaac_la_OBJECTS = $(am__objects_1) $(am__objects_2) libfaac_la_OBJECTS = $(am_libfaac_la_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libfaac_la_SOURCES) DIST_SOURCES = $(am__libfaac_la_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ @@ -105,7 +110,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ -INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -117,7 +121,6 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -127,18 +130,21 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ -SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +USE_DRM_FALSE = @USE_DRM_FALSE@ +USE_DRM_TRUE = @USE_DRM_TRUE@ VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ +WITH_MP4V2_FALSE = @WITH_MP4V2_FALSE@ +WITH_MP4V2_TRUE = @WITH_MP4V2_TRUE@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -150,7 +156,6 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ -builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ @@ -178,11 +183,8 @@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libfaac.la main_SOURCES = aacquant.c bitstream.c fft.c frame.c midside.c psychkni.c util.c backpred.c channels.c filtbank.c huffman.c ltp.c tns.c @USE_DRM_TRUE@drm_SOURCES = kiss_fft/kiss_fftr.c kiss_fft/kiss_fft.c @@ -225,7 +227,7 @@ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ @@ -236,7 +238,7 @@ uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ @@ -251,7 +253,7 @@ rm -f "$${dir}/so_locations"; \ done libfaac.la: $(libfaac_la_OBJECTS) $(libfaac_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libfaac_la_OBJECTS) $(libfaac_la_LIBADD) $(LIBS) + $(LINK) -rpath $(libdir) $(libfaac_la_LDFLAGS) $(libfaac_la_OBJECTS) $(libfaac_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -276,39 +278,39 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< kiss_fftr.lo: kiss_fft/kiss_fftr.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT kiss_fftr.lo -MD -MP -MF $(DEPDIR)/kiss_fftr.Tpo -c -o kiss_fftr.lo `test -f 'kiss_fft/kiss_fftr.c' || echo '$(srcdir)/'`kiss_fft/kiss_fftr.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/kiss_fftr.Tpo $(DEPDIR)/kiss_fftr.Plo +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT kiss_fftr.lo -MD -MP -MF "$(DEPDIR)/kiss_fftr.Tpo" -c -o kiss_fftr.lo `test -f 'kiss_fft/kiss_fftr.c' || echo '$(srcdir)/'`kiss_fft/kiss_fftr.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/kiss_fftr.Tpo" "$(DEPDIR)/kiss_fftr.Plo"; else rm -f "$(DEPDIR)/kiss_fftr.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='kiss_fft/kiss_fftr.c' object='kiss_fftr.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o kiss_fftr.lo `test -f 'kiss_fft/kiss_fftr.c' || echo '$(srcdir)/'`kiss_fft/kiss_fftr.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o kiss_fftr.lo `test -f 'kiss_fft/kiss_fftr.c' || echo '$(srcdir)/'`kiss_fft/kiss_fftr.c kiss_fft.lo: kiss_fft/kiss_fft.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT kiss_fft.lo -MD -MP -MF $(DEPDIR)/kiss_fft.Tpo -c -o kiss_fft.lo `test -f 'kiss_fft/kiss_fft.c' || echo '$(srcdir)/'`kiss_fft/kiss_fft.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/kiss_fft.Tpo $(DEPDIR)/kiss_fft.Plo +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT kiss_fft.lo -MD -MP -MF "$(DEPDIR)/kiss_fft.Tpo" -c -o kiss_fft.lo `test -f 'kiss_fft/kiss_fft.c' || echo '$(srcdir)/'`kiss_fft/kiss_fft.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/kiss_fft.Tpo" "$(DEPDIR)/kiss_fft.Plo"; else rm -f "$(DEPDIR)/kiss_fft.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='kiss_fft/kiss_fft.c' object='kiss_fft.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o kiss_fft.lo `test -f 'kiss_fft/kiss_fft.c' || echo '$(srcdir)/'`kiss_fft/kiss_fft.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o kiss_fft.lo `test -f 'kiss_fft/kiss_fft.c' || echo '$(srcdir)/'`kiss_fft/kiss_fft.c mostlyclean-libtool: -rm -f *.lo @@ -316,6 +318,10 @@ clean-libtool: -rm -rf .libs _libs +distclean-libtool: + -rm -f libtool +uninstall-info-am: + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -365,21 +371,22 @@ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(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 \ + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ @@ -395,7 +402,7 @@ all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am @@ -430,7 +437,7 @@ -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags + distclean-libtool distclean-tags dvi: dvi-am @@ -444,20 +451,12 @@ install-data-am: -install-dvi: install-dvi-am - install-exec-am: install-libLTLIBRARIES -install-html: install-html-am - install-info: install-info-am install-man: -install-pdf: install-pdf-am - -install-ps: install-ps-am - installcheck-am: maintainer-clean: maintainer-clean-am @@ -478,23 +477,20 @@ ps-am: -uninstall-am: uninstall-libLTLIBRARIES - -.MAKE: install-am install-strip +uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ 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-libLTLIBRARIES install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-libLTLIBRARIES + tags uninstall uninstall-am uninstall-info-am \ + uninstall-libLTLIBRARIES # 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. diff -Nru faac-1.26/libfaac/version.h faac-1.28/libfaac/version.h --- faac-1.26/libfaac/version.h 2007-03-19 19:57:40.000000000 +0000 +++ faac-1.28/libfaac/version.h 2009-02-02 23:29:33.000000000 +0000 @@ -1,8 +1,8 @@ #ifndef _VERSION_H_ #define _VERSION_H_ -#define FAAC_RELEASE 0 +#define FAAC_RELEASE 1 -#define FAAC_VERSION "1.26" +#define FAAC_VERSION "1.28" #endif diff -Nru faac-1.26/ltmain.sh faac-1.28/ltmain.sh --- faac-1.26/ltmain.sh 2007-07-11 21:11:42.000000000 +0000 +++ faac-1.28/ltmain.sh 2006-03-22 00:06:55.000000000 +0000 @@ -1,8 +1,8 @@ # ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify @@ -43,22 +43,14 @@ PROGRAM=ltmain.sh PACKAGE=libtool -VERSION="1.5.24 Debian 1.5.24-1" -TIMESTAMP=" (1.1220.2.456 2007/06/24 02:25:32)" +VERSION="1.5.22 Debian 1.5.22-4" +TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" -# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes. +if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh # Check that we have a working $echo. if test "X$1" = X--no-reexec; then @@ -113,14 +105,12 @@ # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). # We save the old values to restore during execute mode. -for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES -do - eval "if test \"\${$lt_var+set}\" = set; then - save_$lt_var=\$$lt_var - $lt_var=C - export $lt_var - fi" -done +if test "${LC_ALL+set}" = set; then + save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL +fi +if test "${LANG+set}" = set; then + save_LANG="$LANG"; LANG=C; export LANG +fi # Make sure IFS has a sensible default lt_nl=' @@ -146,8 +136,6 @@ preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" -extracted_archives= -extracted_serial=0 ##################################### # Shell function definitions: @@ -208,13 +196,7 @@ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ - $SED -n -e '1,100{ - / I /{ - s,.*,import, - p - q - } - }'` + $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; @@ -345,17 +327,7 @@ *) my_xabs=`pwd`"/$my_xlib" ;; esac my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` - my_xlib_u=$my_xlib - while :; do - case " $extracted_archives " in - *" $my_xlib_u "*) - extracted_serial=`expr $extracted_serial + 1` - my_xlib_u=lt$extracted_serial-$my_xlib ;; - *) break ;; - esac - done - extracted_archives="$extracted_archives $my_xlib_u" - my_xdir="$my_gentop/$my_xlib_u" + my_xdir="$my_gentop/$my_xlib" $show "${rm}r $my_xdir" $run ${rm}r "$my_xdir" @@ -482,12 +454,11 @@ ;; --version) - echo "\ -$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP - -Copyright (C) 2007 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." + $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" + $echo + $echo "Copyright (C) 2005 Free Software Foundation, Inc." + $echo "This is free software; see the source for copying conditions. There is NO" + $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit $? ;; @@ -784,10 +755,9 @@ *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; - *.[fF][09]?) xform=[fF][09]. ;; + *.f90) xform=f90 ;; *.for) xform=for ;; *.java) xform=java ;; - *.obj) xform=obj ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` @@ -1168,9 +1138,8 @@ for arg do case $arg in - -all-static | -static | -static-libtool-libs) - case $arg in - -all-static) + -all-static | -static) + if test "X$arg" = "X-all-static"; then if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 fi @@ -1178,20 +1147,12 @@ dlopen_self=$dlopen_self_static fi prefer_static_libs=yes - ;; - -static) + else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built - ;; - -static-libtool-libs) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - esac + fi build_libtool_libs=no build_old_libs=yes break @@ -1639,7 +1600,7 @@ continue ;; - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" @@ -1659,11 +1620,10 @@ # -m* pass through architecture-specific compiler args for GCC # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC - # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC - # -F/path gives path to uninstalled frameworks, gcc on darwin + # -pg pass through profiling flag for GCC # @file GCC response files - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ + -t[45]*|-txscale*|@*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. @@ -1691,9 +1651,9 @@ -no-install) case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows - # and Darwin in order for the loader to find any dlls it needs. + # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no @@ -1752,7 +1712,7 @@ continue ;; - -static | -static-libtool-libs) + -static) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects @@ -2137,7 +2097,7 @@ lib= found=no case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" @@ -2533,9 +2493,7 @@ if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && - { { test "$prefer_static_libs" = no || - test "$prefer_static_libs,$installed" = "built,yes"; } || - test -z "$old_library"; }; then + { test "$prefer_static_libs" = no || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. @@ -3231,7 +3189,7 @@ # which has an extra 1 added just for fun # case $version_type in - darwin|linux|osf|windows|none) + darwin|linux|osf|windows) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" @@ -3242,10 +3200,9 @@ age="0" ;; irix|nonstopux) - current=`expr $number_major + $number_minor` + current=`expr $number_major + $number_minor - 1` age="$number_minor" revision="$number_minor" - lt_irix_increment=no ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 @@ -3309,8 +3266,7 @@ versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` - xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" ;; freebsd-aout) @@ -3324,11 +3280,8 @@ ;; irix | nonstopux) - if test "X$lt_irix_increment" = "Xno"; then - major=`expr $current - $age` - else - major=`expr $current - $age + 1` - fi + major=`expr $current - $age + 1` + case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; @@ -3465,11 +3418,11 @@ fi # Eliminate all temporary directories. - #for path in $notinst_path; do - # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` - # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` - # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` - #done + for path in $notinst_path; do + lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` + deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` + dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` + done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. @@ -3570,12 +3523,13 @@ int main() { return 0; } EOF $rm conftest - if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then + $LTCC $LTCFLAGS -o conftest conftest.c $deplibs + if test "$?" -eq 0 ; then ldd_output=`ldd conftest` for i in $deplibs; do name=`expr $i : '-l\(.*\)'` # If $name is empty we are operating on a -L argument. - if test "$name" != "" && test "$name" != "0"; then + if test "$name" != "" && test "$name" -ne "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) @@ -3614,7 +3568,9 @@ # If $name is empty we are operating on a -L argument. if test "$name" != "" && test "$name" != "0"; then $rm conftest - if $LTCC $LTCFLAGS -o conftest conftest.c $i; then + $LTCC $LTCFLAGS -o conftest conftest.c $i + # Did it work? + if test "$?" -eq 0 ; then ldd_output=`ldd conftest` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in @@ -3646,7 +3602,7 @@ droppeddeps=yes $echo $echo "*** Warning! Library $i is needed by this library but I was not able to" - $echo "*** make it link in! You will probably need to install it or some" + $echo "*** make it link in! You will probably need to install it or some" $echo "*** library that it depends on before this library will be fully" $echo "*** functional. Installing it before continuing would be even better." fi @@ -3932,10 +3888,7 @@ test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then - case $archive_cmds in - *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;; - *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;; - esac + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi @@ -4294,14 +4247,12 @@ reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec and hope we can get by with - # turning comma into space.. + # -Wl from whole_archive_flag_spec wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then - eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` + eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" generated="$generated $gentop" @@ -4749,16 +4700,16 @@ case $host in *cygwin* | *mingw* ) if test -f "$output_objdir/${outputname}.def" ; then - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` + compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` else - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` fi ;; * ) - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` + compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; esac ;; @@ -4773,13 +4724,13 @@ # really was required. # Nullify the symbol file. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` + compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP` + compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. @@ -4866,7 +4817,7 @@ if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then - relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP` + relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= @@ -4903,7 +4854,7 @@ fi done relink_command="(cd `pwd`; $relink_command)" - relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $echo for shipping. @@ -5310,20 +5261,6 @@ Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' -# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). -if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH @@ -5466,7 +5403,7 @@ ;; esac $echo >> $output "\ - \$echo \"\$0: cannot exec \$program \$*\" + \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit $EXIT_FAILURE fi else @@ -5652,7 +5589,7 @@ done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi @@ -5997,9 +5934,9 @@ if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. - relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP` + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else - relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP` + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi $echo "$modename: warning: relinking \`$file'" 1>&2 @@ -6208,7 +6145,7 @@ file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. - relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP` + relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $show "$relink_command" if $run eval "$relink_command"; then : @@ -6419,10 +6356,8 @@ if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else - if test ! -f "$dir/$dlname"; then - $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 - exit $EXIT_FAILURE - fi + $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 + exit $EXIT_FAILURE fi ;; @@ -6486,12 +6421,12 @@ fi # Restore saved environment variables - for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES - do - eval "if test \"\${save_$lt_var+set}\" = set; then - $lt_var=\$save_$lt_var; export $lt_var - fi" - done + if test "${save_LC_ALL+set}" = set; then + LC_ALL="$save_LC_ALL"; export LC_ALL + fi + if test "${save_LANG+set}" = set; then + LANG="$save_LANG"; export LANG + fi # Now prepare to actually exec the command. exec_cmd="\$cmd$args" @@ -6848,9 +6783,9 @@ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE + try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX - try to export only the symbols matching REGEX + try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened @@ -6864,11 +6799,9 @@ -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -static do not do any dynamic linking of uninstalled libtool libraries - -static-libtool-libs - do not do any dynamic linking of libtool libraries + -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] + specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. diff -Nru faac-1.26/Makefile.in faac-1.28/Makefile.in --- faac-1.26/Makefile.in 2007-10-15 08:13:09.000000000 +0000 +++ faac-1.28/Makefile.in 2009-02-10 08:37:01.000000000 +0000 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005 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. @@ -13,11 +13,15 @@ # PARTICULAR PURPOSE. @SET_MAKE@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -31,18 +35,18 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ TODO config.guess config.sub depcomp install-sh ltmain.sh \ missing +subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno config.status.lineno + configure.lineno configure.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = @@ -50,13 +54,10 @@ DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-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 uninstall-recursive -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) @@ -72,6 +73,8 @@ distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ @@ -99,7 +102,6 @@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ -INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -111,7 +113,6 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -121,18 +122,21 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ -SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +USE_DRM_FALSE = @USE_DRM_FALSE@ +USE_DRM_TRUE = @USE_DRM_TRUE@ VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ +WITH_MP4V2_FALSE = @WITH_MP4V2_FALSE@ +WITH_MP4V2_TRUE = @WITH_MP4V2_TRUE@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -144,7 +148,6 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ -builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ @@ -172,11 +175,8 @@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ SUBDIRS = include libfaac common frontend all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -219,7 +219,7 @@ config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ - $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ + $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @@ -241,6 +241,7 @@ distclean-libtool: -rm -f libtool +uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -273,7 +274,8 @@ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -$(RECURSIVE_CLEAN_TARGETS): +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ @@ -375,22 +377,24 @@ distdir: $(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 \ + mkdir $(distdir) + $(mkdir_p) $(distdir)/. + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ @@ -404,7 +408,7 @@ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ + || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ @@ -412,8 +416,6 @@ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ @@ -421,7 +423,7 @@ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -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 {} {} \; \ + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz @@ -496,7 +498,7 @@ $(am__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' + sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ @@ -566,20 +568,12 @@ install-data-am: -install-dvi: install-dvi-recursive - install-exec-am: -install-html: install-html-recursive - install-info: install-info-recursive install-man: -install-pdf: install-pdf-recursive - -install-ps: install-ps-recursive - installcheck-am: maintainer-clean: maintainer-clean-recursive @@ -600,26 +594,24 @@ ps-am: -uninstall-am: +uninstall-am: uninstall-info-am -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ - install-strip +uninstall-info: uninstall-info-recursive -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am am--refresh check check-am clean clean-generic \ - clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ - dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \ +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ + check-am clean clean-generic clean-libtool clean-recursive \ + ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ + dist-shar dist-tarZ dist-zip distcheck distclean \ distclean-generic distclean-hdr distclean-libtool \ - 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-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 mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am + distclean-recursive distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am uninstall-info-am # 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. diff -Nru faac-1.26/missing faac-1.28/missing --- faac-1.26/missing 2007-10-15 07:24:47.000000000 +0000 +++ faac-1.28/missing 2009-02-10 08:37:00.000000000 +0000 @@ -1,9 +1,9 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2006-05-10.23 +scriptversion=2005-06-08.21 -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. @@ -33,8 +33,6 @@ fi run=: -sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' -sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. @@ -46,7 +44,7 @@ msg="missing on your system" -case $1 in +case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= @@ -79,7 +77,6 @@ aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' - autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c @@ -109,7 +106,7 @@ # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). -case $1 in +case "$1" in lex|yacc) # Not GNU programs, they don't have --version. ;; @@ -138,7 +135,7 @@ # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. -case $1 in +case "$1" in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if @@ -167,7 +164,7 @@ test -z "$files" && files="config.h" touch_files= for f in $files; do - case $f in + case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; @@ -195,8 +192,8 @@ You can get \`$1' as part of \`Autoconf' from any GNU archive site." - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` + test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else @@ -217,25 +214,25 @@ in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h - if test $# -ne 1; then + if [ $# -ne 1 ]; then eval LASTARG="\${$#}" - case $LASTARG in + case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if test -f "$SRCFILE"; then + if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if test -f "$SRCFILE"; then + if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi - if test ! -f y.tab.h; then + if [ ! -f y.tab.h ]; then echo >y.tab.h fi - if test ! -f y.tab.c; then + if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; @@ -247,18 +244,18 @@ in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c - if test $# -ne 1; then + if [ $# -ne 1 ]; then eval LASTARG="\${$#}" - case $LASTARG in + case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if test -f "$SRCFILE"; then + if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi - if test ! -f lex.yy.c; then + if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; @@ -270,9 +267,11 @@ \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` + fi + if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file @@ -290,17 +289,11 @@ DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n ' - /^@setfilename/{ - s/.* \([^ ]*\) *$/\1/ - p - q - }' $infile` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi @@ -324,13 +317,13 @@ fi firstarg="$1" if shift; then - case $firstarg in + case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac - case $firstarg in + case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 diff -Nru faac-1.26/plugins/aac_acm/aac_acm.cpp faac-1.28/plugins/aac_acm/aac_acm.cpp --- faac-1.26/plugins/aac_acm/aac_acm.cpp 2002-01-17 12:22:44.000000000 +0000 +++ faac-1.28/plugins/aac_acm/aac_acm.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,192 +0,0 @@ -// aac_acm.cpp : Defines the entry point for the DLL application. -// - -#include "stdafx.h" -#include "codec.h" -#include - -struct messagetype -{ - const char* c; - int i; -}; - -const messagetype g_types[] = -{ - "DRV_LOAD", DRV_LOAD, - "DRV_FREE", DRV_FREE, - "DRV_OPEN", DRV_OPEN, - "DRV_CLOSE", DRV_CLOSE, - "DRV_DISABLE", DRV_DISABLE, - "DRV_ENABLE", DRV_ENABLE, - "DRV_INSTALL", DRV_INSTALL, - "DRV_REMOVE", DRV_REMOVE, - "DRV_CONFIGURE", DRV_CONFIGURE, - "DRV_QUERYCONFIGURE", DRV_QUERYCONFIGURE, - "ACMDM_DRIVER_DETAILS", ACMDM_DRIVER_DETAILS, - "ACMDM_DRIVER_ABOUT", ACMDM_DRIVER_ABOUT, - "ACMDM_FORMATTAG_DETAILS", ACMDM_FORMATTAG_DETAILS, - "ACMDM_FORMAT_DETAILS", ACMDM_FORMAT_DETAILS, - "ACMDM_FORMAT_SUGGEST", ACMDM_FORMAT_SUGGEST, - "ACMDM_STREAM_OPEN", ACMDM_STREAM_OPEN, - "ACMDM_STREAM_CLOSE", ACMDM_STREAM_CLOSE, - "ACMDM_STREAM_SIZE", ACMDM_STREAM_SIZE, - "ACMDM_STREAM_CONVERT", ACMDM_STREAM_CONVERT, - "ACMDM_STREAM_RESET", ACMDM_STREAM_RESET, - "ACMDM_STREAM_PREPARE", ACMDM_STREAM_PREPARE, - "ACMDM_STREAM_UNPREPARE", ACMDM_STREAM_UNPREPARE, - "ACMDM_STREAM_UPDATE", ACMDM_STREAM_UPDATE, -}; - -#include - -static void Message(const char* fmt, ...) -{ -#ifndef NDEBUG - FILE* f=fopen("c:\\msg.log", "ab"); - va_list va; - va_start(va, fmt); - vfprintf(f, fmt, va); - va_end(va); - fclose(f); -#endif -} - -//codec c1; -//codec c2; -//int iCodecs=0; - -bool g_bAttached=false; -std::list g_codec_objects; - -BOOL APIENTRY DllMain( HANDLE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved - ) -{ - Message("DllMain(%d)\n"); - if(ul_reason_for_call==DLL_PROCESS_ATTACH) - g_bAttached=true; - if(ul_reason_for_call==DLL_PROCESS_DETACH) - { - for(std::list::iterator it=g_codec_objects.begin(); - it!=g_codec_objects.end(); - it++) - delete *it; - g_bAttached=false; - } - return TRUE; -} - - -extern "C" LONG WINAPI DriverProc(DWORD dwDriverID, HDRVR hDriver, UINT uiMessage, LPARAM lParam1, LPARAM lParam2) -{ - codec *cdx = (codec *)(UINT)dwDriverID; - ICOPEN *icinfo = (ICOPEN *)lParam2; - - if(g_bAttached==false) - // it really happens! - // and since our heap may be already destroyed, we don't dare to do anything - return E_FAIL; - - for(int i=0; ifccType != ICTYPE_AUDIO) return NULL; - // if(!iCodecs) - // cdx=&c1; - // else - // cdx=&c2; - // iCodecs++; - cdx = new codec; - g_codec_objects.push_back(cdx); - if (icinfo) icinfo->dwError = cdx ? ICERR_OK : ICERR_MEMORY; - Message(" ==> %x\n", cdx); - return (LRESULT)(DWORD)(UINT) cdx; - - case DRV_CLOSE: - g_codec_objects.remove(cdx); - delete cdx; - return (LRESULT)1L; - - case DRV_DISABLE: - case DRV_ENABLE: - return (LRESULT)1L; - - case DRV_INSTALL: - case DRV_REMOVE: - return (LRESULT)DRV_OK; - - case DRV_QUERYCONFIGURE: - return (LRESULT)0L; // does support drive configure with the about box - - case DRV_CONFIGURE: - // return cdx->about(lParam1,lParam2); - MessageBox(0, "Configure", "qqq", MB_OK); - return DRVCNF_OK; - - case ACMDM_DRIVER_DETAILS: - return cdx->details((ACMDRIVERDETAILSW*)lParam1); - - case ACMDM_DRIVER_ABOUT: - return cdx->about((DWORD)lParam1); - - case ACMDM_FORMATTAG_DETAILS: - return cdx->formattag_details((ACMFORMATTAGDETAILSW*)lParam1, (DWORD)lParam2); - - case ACMDM_FORMAT_DETAILS: - return cdx->format_details((ACMFORMATDETAILSW*)lParam1, (DWORD)lParam2); - - case ACMDM_FORMAT_SUGGEST: - return cdx->format_suggest((ACMDRVFORMATSUGGEST*)lParam1); - - case ACMDM_STREAM_OPEN: - return cdx->open((ACMDRVSTREAMINSTANCE*)lParam1); - - case ACMDM_STREAM_PREPARE: - return cdx->prepare((ACMDRVSTREAMINSTANCE*)lParam1, (ACMDRVSTREAMHEADER*) lParam2); - - case ACMDM_STREAM_RESET: - return cdx->reset((ACMDRVSTREAMINSTANCE*)lParam1); - - case ACMDM_STREAM_SIZE: - return cdx->size((ACMDRVSTREAMINSTANCE*)lParam1, (ACMDRVSTREAMSIZE*)lParam2); - - case ACMDM_STREAM_UNPREPARE: - return cdx->unprepare((ACMDRVSTREAMINSTANCE*)lParam1, (ACMDRVSTREAMHEADER*) lParam2); - - case ACMDM_STREAM_CONVERT: - return cdx->convert((ACMDRVSTREAMINSTANCE*)lParam1, (ACMDRVSTREAMHEADER*) lParam2); - - case ACMDM_STREAM_CLOSE: - return cdx->close((ACMDRVSTREAMINSTANCE*)lParam1); - - } - - if (uiMessage < DRV_USER) - return DefDriverProc(dwDriverID, hDriver, uiMessage, lParam1, lParam2); - else - return MMSYSERR_NOTSUPPORTED; -} diff -Nru faac-1.26/plugins/aac_acm/aac_acm.def faac-1.28/plugins/aac_acm/aac_acm.def --- faac-1.26/plugins/aac_acm/aac_acm.def 2002-01-17 12:22:44.000000000 +0000 +++ faac-1.28/plugins/aac_acm/aac_acm.def 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -LIBRARY "aac_acm" -DESCRIPTION 'Windows Dynamic Link Library' - -EXPORTS - DriverProc PRIVATE diff -Nru faac-1.26/plugins/aac_acm/aac_acm.dsp faac-1.28/plugins/aac_acm/aac_acm.dsp --- faac-1.26/plugins/aac_acm/aac_acm.dsp 2002-01-17 12:22:44.000000000 +0000 +++ faac-1.28/plugins/aac_acm/aac_acm.dsp 1970-01-01 00:00:00.000000000 +0000 @@ -1,140 +0,0 @@ -# Microsoft Developer Studio Project File - Name="aac_acm" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=aac_acm - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "aac_acm.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "aac_acm.mak" CFG="aac_acm - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "aac_acm - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "aac_acm - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=xicl6.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "aac_acm - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "../../include" /I "../../../faad/include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x419 /d "NDEBUG" -# ADD RSC /l 0x419 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=xilink6.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib vfw32.lib winmm.lib /nologo /subsystem:windows /dll /machine:I386 /libpath:"bin" - -!ELSEIF "$(CFG)" == "aac_acm - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../../faad/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR /YX /FD /GZ /c -# SUBTRACT CPP /FA -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x419 /d "_DEBUG" -# ADD RSC /l 0x419 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=xilink6.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib vfw32.lib winmm.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept /libpath:"bin" - -!ENDIF - -# Begin Target - -# Name "aac_acm - Win32 Release" -# Name "aac_acm - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\aac_acm.cpp -# End Source File -# Begin Source File - -SOURCE=.\aac_acm.def -# End Source File -# Begin Source File - -SOURCE=.\codec.cpp -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\codec.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\faac.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\faad\include\faad.h -# End Source File -# Begin Source File - -SOURCE=.\msacmdrv.h -# End Source File -# Begin Source File - -SOURCE=.\StdAfx.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff -Nru faac-1.26/plugins/aac_acm/aac_acm.dsw faac-1.28/plugins/aac_acm/aac_acm.dsw --- faac-1.26/plugins/aac_acm/aac_acm.dsw 2002-01-17 12:22:44.000000000 +0000 +++ faac-1.28/plugins/aac_acm/aac_acm.dsw 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "aac_acm"=.\aac_acm.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name libfaac - End Project Dependency - Begin Project Dependency - Project_Dep_Name libfaad - End Project Dependency -}}} - -############################################################################### - -Project: "libfaac"=..\..\libfaac\libfaac.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "libfaad"=..\..\..\faad\libfaad\libfaad.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff -Nru faac-1.26/plugins/aac_acm/aac_acm.inf faac-1.28/plugins/aac_acm/aac_acm.inf --- faac-1.26/plugins/aac_acm/aac_acm.inf 2002-01-17 12:22:44.000000000 +0000 +++ faac-1.28/plugins/aac_acm/aac_acm.inf 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ - - -[Version] -Signature = "$CHICAGO$" -Class = MEDIA - -[SourceDisksNames] -1="AAC Audio Codec Install Disk",, 0001 - -[SourceDisksFiles] -aac_acm.dll=1 -aac_acm.inf=1 - -[Installable.Drivers] -divxa32 = 1:aac_acm.dll, "msacm.aac" , "AAC Audio Codec" , , , - -[DefaultInstall] -CopyFiles=AAC.Copy,AAC.Copy.Inf -Updateinis = AAC.Updateini -addreg = AAC.AddReg9x -MediaType = SOFTWARE - -[DefaultInstall.ntx86] -CopyFiles=AAC.Copy,AAC.Copy.Inf -addreg = AAC.AddRegNT -MediaType = SOFTWARE - -[Remove_AAC] -AddReg = AAC.Unregister -DelFiles = AAC.Copy,AAC.Copy.Inf -UpdateInis = AAC.DelIni - -[AAC.Copy] -aac_acm.dll - -[AAC.Copy.Inf] -aac_acm.inf - -[AAC.UpdateIni] -system.ini, drivers32,,"msacm.aac=aac_acm.dll" - -[AAC.DelIni] -system.ini, drivers32,"msacm.aac=aac_acm.dll" - -[AAC.AddReg9x] -HKLM,SYSTEM\CurrentControlSet\Control\MediaResources\acm\msacm.aac,Description,,%AACAudio% -HKLM,SYSTEM\CurrentControlSet\Control\MediaResources\acm\msacm.aac,Driver,,aac_acm.dll -HKLM,SYSTEM\CurrentControlSet\Control\MediaResources\acm\msacm.aac,FriendlyName,,%AACAudio% - -HKLM,%UnInstallPath%,DisplayName,,%UninstallDispName% -HKLM,%UnInstallPath%,UninstallString,,"%10%\rundll.exe setupx.dll,InstallHinfSection Remove_AAC 132 %17%\%InfFile%" - -[AAC.AddRegNT] -HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\drivers.desc,aac_acm.dll,,%AACAudio% -HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\drivers32,msacm.aac,,aac_acm.dll - - -HKLM,%UnInstallPath%,DisplayName,,%UninstallDispName% -HKLM,%UnInstallPath%,UninstallString,,"%11%\rundll32.exe setupapi,InstallHinfSection Remove_AAC 132 %17%\%InfFile%" - -[AAC.DelReg] -HKLM,SYSTEM\CurrentControlSet\Control\MediaResources\acm\msacm.aac - -HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\drivers.desc,aac_acm.dll,,"" -HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\drivers32,msacm.aac,,"" -HKLM,%UnInstallPath% - -[DestinationDirs] -DefaultDestDir = 11 ; LDID_SYS -AAC.Copy = 11 -AAC.Copy.Inf = 17 - -[Strings] -AACAudio="MPEG-2/4 AAC audio codec" -InfFile="aac_acm.inf" -UninstallDispName="MPEG-2/4 AAC audio codec" -UnInstallPath="Software\Microsoft\Windows\CurrentVersion\Uninstall\AACCodec" -MediaClassName="Media Devices" -mfgname="No more money !" - diff -Nru faac-1.26/plugins/aac_acm/aac_acm.sln faac-1.28/plugins/aac_acm/aac_acm.sln --- faac-1.26/plugins/aac_acm/aac_acm.sln 2002-10-11 18:04:21.000000000 +0000 +++ faac-1.28/plugins/aac_acm/aac_acm.sln 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 7.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aac_acm", "aac_acm.vcproj", "{D99ED960-4DEC-421E-87DE-EDA1D4A83832}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaac", "..\..\libfaac\libfaac.vcproj", "{D959B8AF-46D6-46D3-B839-AAB9F7AB5A56}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaad", "..\..\..\faad\libfaad\libfaad.vcproj", "{8855A63B-544C-4C2F-A254-1B824BE9D5FC}" -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - ConfigName.0 = Debug - ConfigName.1 = Release - EndGlobalSection - GlobalSection(ProjectDependencies) = postSolution - {D99ED960-4DEC-421E-87DE-EDA1D4A83832}.0 = {8855A63B-544C-4C2F-A254-1B824BE9D5FC} - {D99ED960-4DEC-421E-87DE-EDA1D4A83832}.1 = {D959B8AF-46D6-46D3-B839-AAB9F7AB5A56} - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {D99ED960-4DEC-421E-87DE-EDA1D4A83832}.Debug.ActiveCfg = Debug|Win32 - {D99ED960-4DEC-421E-87DE-EDA1D4A83832}.Debug.Build.0 = Debug|Win32 - {D99ED960-4DEC-421E-87DE-EDA1D4A83832}.Release.ActiveCfg = Release|Win32 - {D99ED960-4DEC-421E-87DE-EDA1D4A83832}.Release.Build.0 = Release|Win32 - {D959B8AF-46D6-46D3-B839-AAB9F7AB5A56}.Debug.ActiveCfg = Debug|Win32 - {D959B8AF-46D6-46D3-B839-AAB9F7AB5A56}.Debug.Build.0 = Debug|Win32 - {D959B8AF-46D6-46D3-B839-AAB9F7AB5A56}.Release.ActiveCfg = Release|Win32 - {D959B8AF-46D6-46D3-B839-AAB9F7AB5A56}.Release.Build.0 = Release|Win32 - {8855A63B-544C-4C2F-A254-1B824BE9D5FC}.Debug.ActiveCfg = Debug|Win32 - {8855A63B-544C-4C2F-A254-1B824BE9D5FC}.Debug.Build.0 = Debug|Win32 - {8855A63B-544C-4C2F-A254-1B824BE9D5FC}.Release.ActiveCfg = Release|Win32 - {8855A63B-544C-4C2F-A254-1B824BE9D5FC}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff -Nru faac-1.26/plugins/aac_acm/aac_acm.vcproj faac-1.28/plugins/aac_acm/aac_acm.vcproj --- faac-1.26/plugins/aac_acm/aac_acm.vcproj 2002-10-11 18:04:21.000000000 +0000 +++ faac-1.28/plugins/aac_acm/aac_acm.vcproj 1970-01-01 00:00:00.000000000 +0000 @@ -1,177 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru faac-1.26/plugins/aac_acm/codec.cpp faac-1.28/plugins/aac_acm/codec.cpp --- faac-1.26/plugins/aac_acm/codec.cpp 2002-01-18 11:03:52.000000000 +0000 +++ faac-1.28/plugins/aac_acm/codec.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,669 +0,0 @@ -#include "codec.h" -#include - -// we must register these by emailing to mmreg@microsoft.com -const int codec::m_iCompressedFormatTag = 0x1234; -const int codec::m_iManufacturerID = MM_GADGETLABS; -const int codec::m_iProductID = 7; - -const wchar_t g_sCodecName[]=L"MPEG-2/4 AAC audio codec"; -const wchar_t g_sLongCodecName[]=L"Very special audio codec"; -const wchar_t g_sFormatName[]=L"MPEG-2/4 AAC"; - -codec::codec() -{ -} - -codec::~codec() -{ -} - -HRESULT codec::formattag_details(ACMFORMATTAGDETAILSW* lParam1, DWORD lParam2) -{ - bool bCompressedFormat; - switch(lParam2) - { - case ACM_FORMATTAGDETAILSF_INDEX: - if(lParam1->dwFormatTagIndex>=2) - return ACMERR_NOTPOSSIBLE; - bCompressedFormat=(lParam1->dwFormatTagIndex==1); - break; - case ACM_FORMATTAGDETAILSF_FORMATTAG: - if(lParam1->dwFormatTag==1) - bCompressedFormat=false; - else if(lParam1->dwFormatTag==m_iCompressedFormatTag) - bCompressedFormat=true; - else - return ACMERR_NOTPOSSIBLE; - case ACM_FORMATTAGDETAILSF_LARGESTSIZE: - bCompressedFormat=true; - break; - default: - return ACMERR_NOTPOSSIBLE; - } - lParam1->cbStruct=sizeof(ACMFORMATTAGDETAILSW); - lParam1->cbFormatSize=bCompressedFormat ? 20 : 16; - lParam1->fdwSupport=ACMDRIVERDETAILS_SUPPORTF_CODEC; - if(bCompressedFormat) - lParam1->cStandardFormats=8; // 44 & 48 khz 16 bit, mono & stereo, 64 & 128 kbps - else - lParam1->cStandardFormats=8; // 44 & 48 khz 8 & 16 bit, mono & stereo - if(bCompressedFormat) - { - wcscpy(lParam1->szFormatTag, g_sFormatName); - lParam1->dwFormatTag=m_iCompressedFormatTag; - } - else - { - wcscpy(lParam1->szFormatTag, L"PCM"); - lParam1->dwFormatTag=1; - } - return MMSYSERR_NOERROR; -} - -void codec::fill_pcm_format(WAVEFORMATEX* pwfx, int rate, int bits, int channels) -{ - pwfx->wFormatTag=1; - pwfx->nSamplesPerSec=rate; - pwfx->wBitsPerSample=bits; - pwfx->nChannels=channels; - pwfx->nAvgBytesPerSec=rate * bits * channels / 8; - pwfx->nBlockAlign=channels * bits / 8; - pwfx->cbSize=0; -} - -#define MAIN 0 -#define LOW 1 -#define SSR 2 -#define LTP 3 - -static unsigned int aacSamplingRates[16] = { - 96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, - 16000, 12000, 11025, 8000, 7350, 0, 0, 0 -}; - -void codec::fill_compressed_format(WAVEFORMATEX* pwfx, int rate, int bits, int channels, int bitrate) -{ - pwfx->wFormatTag=m_iCompressedFormatTag; - pwfx->nSamplesPerSec=rate; - pwfx->wBitsPerSample=bits; - pwfx->nChannels=channels; - pwfx->nAvgBytesPerSec=bitrate / 8; - pwfx->nBlockAlign=1024; - pwfx->cbSize=2; - - unsigned char* ext=(unsigned char*)(&pwfx[1]); - int profile = MAIN; - int samplerate_index=-1; - for(int i=0; i<16; i++) - if(aacSamplingRates[i]==rate) - { - samplerate_index=i; - break; - } - if(samplerate_index<0) - return; - ext[0] = ((profile + 1) << 3) | ((samplerate_index & 0xe) >> 1); - ext[1] = ((samplerate_index & 0x1) << 7) | (channels << 3); - // 960 byte frames not used -} - -HRESULT codec::format_details(ACMFORMATDETAILSW* lParam1, DWORD lParam2) -{ - lParam1->cbStruct=sizeof(ACMFORMATDETAILSW); - lParam1->szFormat[0]=0; - lParam1->fdwSupport=ACMDRIVERDETAILS_SUPPORTF_CODEC; - - if(lParam1->dwFormatTag==1) - { - if(lParam2==ACM_FORMATDETAILSF_INDEX) - { - switch(lParam1->dwFormatIndex) - { - case 0: - fill_pcm_format(lParam1->pwfx, 44100, 16, 1); - break; - case 1: - fill_pcm_format(lParam1->pwfx, 44100, 16, 2); - break; - case 2: - fill_pcm_format(lParam1->pwfx, 44100, 8, 1); - break; - case 3: - fill_pcm_format(lParam1->pwfx, 44100, 8, 2); - break; - case 4: - fill_pcm_format(lParam1->pwfx, 48000, 16, 1); - break; - case 5: - fill_pcm_format(lParam1->pwfx, 48000, 16, 2); - break; - case 6: - fill_pcm_format(lParam1->pwfx, 48000, 8, 1); - break; - case 7: - fill_pcm_format(lParam1->pwfx, 48000, 8, 2); - break; - default: - return ACMERR_NOTPOSSIBLE; - } - } - else if(lParam2==ACM_FORMATDETAILSF_FORMAT) - { - if((lParam1->pwfx->nSamplesPerSec != 44100) && (lParam1->pwfx->nSamplesPerSec != 48000)) - return ACMERR_NOTPOSSIBLE; - } - else - return ACMERR_NOTPOSSIBLE; - } - else if(lParam1->dwFormatTag==m_iCompressedFormatTag) - { - if(lParam2==ACM_FORMATDETAILSF_INDEX) - { - switch(lParam1->dwFormatIndex) - { - case 0: - fill_compressed_format(lParam1->pwfx, 44100, 16, 1, 128000); - break; - case 1: - fill_compressed_format(lParam1->pwfx, 44100, 16, 2, 128000); - break; - case 2: - fill_compressed_format(lParam1->pwfx, 44100, 16, 1, 64000); - break; - case 3: - fill_compressed_format(lParam1->pwfx, 44100, 16, 2, 64000); - break; - case 4: - fill_compressed_format(lParam1->pwfx, 48000, 16, 1, 128000); - break; - case 5: - fill_compressed_format(lParam1->pwfx, 48000, 16, 2, 128000); - break; - case 6: - fill_compressed_format(lParam1->pwfx, 48000, 16, 1, 64000); - break; - case 7: - fill_compressed_format(lParam1->pwfx, 48000, 16, 2, 64000); - break; - default: - return ACMERR_NOTPOSSIBLE; - } - } - else if(lParam2==ACM_FORMATDETAILSF_FORMAT) - { - if((lParam1->pwfx->nSamplesPerSec != 44100) && (lParam1->pwfx->nSamplesPerSec != 48000)) - return ACMERR_NOTPOSSIBLE; - } - else - return ACMERR_NOTPOSSIBLE; - } - else - return ACMERR_NOTPOSSIBLE; - return MMSYSERR_NOERROR; -} - -HRESULT codec::format_suggest(ACMDRVFORMATSUGGEST* pFormat) -{ - bool bEncode; - if(pFormat->fdwSuggest & ACM_FORMATSUGGESTF_WFORMATTAG) - { - if((pFormat->pwfxDst->wFormatTag == 1) && (pFormat->pwfxSrc->wFormatTag == m_iCompressedFormatTag)) - bEncode=false; - else - if((pFormat->pwfxDst->wFormatTag == m_iCompressedFormatTag) && (pFormat->pwfxSrc->wFormatTag == 1)) - bEncode=true; - else - return ACMERR_NOTPOSSIBLE; - } - else - { - if(pFormat->pwfxSrc->wFormatTag == m_iCompressedFormatTag) - { - pFormat->pwfxDst->wFormatTag=1; - bEncode=false; - } - else - if(pFormat->pwfxSrc->wFormatTag == 1) - { - pFormat->pwfxDst->wFormatTag=m_iCompressedFormatTag; - bEncode=true; - } - else - return ACMERR_NOTPOSSIBLE; - } - if(pFormat->fdwSuggest & ACM_FORMATSUGGESTF_NCHANNELS) - { - if(pFormat->pwfxDst->nChannels != pFormat->pwfxSrc->nChannels) - return ACMERR_NOTPOSSIBLE; - } - int iChannels = pFormat->pwfxSrc->nChannels; - if(pFormat->fdwSuggest & ACM_FORMATSUGGESTF_NSAMPLESPERSEC) - { - if(pFormat->pwfxDst->nSamplesPerSec != pFormat->pwfxSrc->nSamplesPerSec) - return ACMERR_NOTPOSSIBLE; - } - int iSamplesPerSec = pFormat->pwfxSrc->nSamplesPerSec; - - if(pFormat->fdwSuggest & ACM_FORMATSUGGESTF_WBITSPERSAMPLE) - { - if(pFormat->pwfxDst->wBitsPerSample != pFormat->pwfxSrc->wBitsPerSample) - return ACMERR_NOTPOSSIBLE; - } - int iBitsPerSample = pFormat->pwfxSrc->wBitsPerSample; - - if(bEncode) - fill_compressed_format(pFormat->pwfxDst, iSamplesPerSec, iBitsPerSample, iChannels, 128000); - else - fill_pcm_format(pFormat->pwfxDst, iSamplesPerSec, iBitsPerSample, iChannels); - - return MMSYSERR_NOERROR; -} - -HRESULT codec::details(ACMDRIVERDETAILSW* pDetails) -{ - memset(pDetails, 0, sizeof(ACMDRIVERDETAILSW)); - pDetails->cbStruct=sizeof(ACMDRIVERDETAILSW); - pDetails->fccType=ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC; - pDetails->fccComp=ACMDRIVERDETAILS_FCCCOMP_UNDEFINED; - pDetails->wMid=m_iManufacturerID; - pDetails->wPid=m_iProductID; - pDetails->vdwACM=0x3320000; - pDetails->vdwDriver=0x1000000; - pDetails->fdwSupport=ACMDRIVERDETAILS_SUPPORTF_CODEC; - pDetails->cFormatTags=2; - pDetails->cFilterTags=0; - wcscpy(pDetails->szShortName, g_sCodecName); - wcscpy(pDetails->szLongName, g_sLongCodecName); - return MMSYSERR_NOERROR; -} - -HRESULT codec::about(DWORD h) -{ - if(h==(DWORD)-1) - return MMSYSERR_NOERROR; - MessageBoxW((HWND)h, g_sLongCodecName, L"About", MB_OK); - return MMSYSERR_NOERROR; -} - -HRESULT codec::open(ACMDRVSTREAMINSTANCE* pStream) -{ - if(pStream->pwfxDst->nChannels != pStream->pwfxSrc->nChannels) - return ACMERR_NOTPOSSIBLE; - if(pStream->pwfxDst->nSamplesPerSec != pStream->pwfxSrc->nSamplesPerSec) - return ACMERR_NOTPOSSIBLE; - bool bDecode = (pStream->pwfxDst->wFormatTag == 1); - if(bDecode) - { - if(pStream->pwfxDst->wBitsPerSample!=16) - return ACMERR_NOTPOSSIBLE; - if(pStream->pwfxSrc->wFormatTag!=m_iCompressedFormatTag) - return ACMERR_NOTPOSSIBLE; - } - else - { - // if(pStream->pwfxSrc->wBitsPerSample!=16) - // return ACMERR_NOTPOSSIBLE; - if(pStream->pwfxDst->wFormatTag!=m_iCompressedFormatTag) - return ACMERR_NOTPOSSIBLE; - if(pStream->pwfxSrc->wFormatTag!=1) - return ACMERR_NOTPOSSIBLE; - } - - if(pStream->fdwOpen & ACM_STREAMOPENF_QUERY) - return MMSYSERR_NOERROR; - - if(bDecode) - pStream->dwDriver=(DWORD)new decoder(pStream->pwfxSrc); - else - pStream->dwDriver=(DWORD)new encoder(pStream->pwfxSrc, pStream->pwfxDst); - return MMSYSERR_NOERROR; -} - -HRESULT codec::prepare(ACMDRVSTREAMINSTANCE* pStream, ACMDRVSTREAMHEADER* pHeader) -{ - return MMSYSERR_NOTSUPPORTED; -} - -HRESULT codec::reset(ACMDRVSTREAMINSTANCE* pStream) -{ - stream* pstr=(stream*)pStream->dwDriver; - return pstr->reset(); -} - -HRESULT codec::size(ACMDRVSTREAMINSTANCE* pStream, ACMDRVSTREAMSIZE* pSize) -{ - stream* pstr=(stream*)pStream->dwDriver; - return pstr->size(pSize); -} - -HRESULT codec::unprepare(ACMDRVSTREAMINSTANCE* pStream, ACMDRVSTREAMHEADER* pHeader) -{ - return MMSYSERR_NOTSUPPORTED; -} - -HRESULT codec::convert(ACMDRVSTREAMINSTANCE* pStream, ACMDRVSTREAMHEADER* pHeader) -{ - stream* pstr=(stream*)pStream->dwDriver; - return pstr->convert(pHeader); -} - -HRESULT codec::close(ACMDRVSTREAMINSTANCE* pStream) -{ - stream* pstr=(stream*)pStream->dwDriver; - delete pstr; - return MMSYSERR_NOERROR; -} - -#include "faac.h" - -codec::encoder::encoder(WAVEFORMATEX* pF, WAVEFORMATEX* pFDest) : m_sFormat(*pF) -{ - m_iOutputBytesPerSec=pFDest->nAvgBytesPerSec; - - m_pHandle=faacEncOpen(pF->nSamplesPerSec, pF->nChannels, &m_iInputSamples, &m_iMaxOutputBytes); - - faacEncConfiguration conf; - conf.mpegVersion = MPEG4; - conf.aacObjectType = MAIN; - conf.allowMidside = 1; - conf.useLfe = 1; - conf.useTns = 1; - conf.bitRate = m_iOutputBytesPerSec/pFDest->nChannels; // bits/second per channel - conf.bandWidth = 18000; //Hz - conf.outputFormat = 1; // ADTS - faacEncSetConfiguration(m_pHandle, &conf); -} - -HRESULT codec::encoder::reset() -{ - // fixme (?) - return MMSYSERR_NOERROR; -} - -HRESULT codec::encoder::size(ACMDRVSTREAMSIZE* pSize) -{ - double dwInputBitRate=m_sFormat.nSamplesPerSec * m_sFormat.wBitsPerSample * m_sFormat.nChannels; - double dwOutputBitRate=m_iOutputBytesPerSec;// kbytes/s - - if(pSize->fdwSize == ACM_STREAMSIZEF_SOURCE) - { - if(pSize->cbSrcLength<2*m_iInputSamples) - pSize->cbSrcLength=2*m_iInputSamples; - pSize->cbDstLength = pSize->cbSrcLength * 2 * dwOutputBitRate/dwInputBitRate; - if(pSize->cbDstLengthcbDstLength=m_iMaxOutputBytes; - - } - else - { - if(pSize->cbDstLengthcbDstLength=m_iMaxOutputBytes; - pSize->cbSrcLength = pSize->cbDstLength * 2 * dwInputBitRate/dwOutputBitRate;; - if(pSize->cbSrcLength<2*m_iInputSamples) - pSize->cbSrcLength=2*m_iInputSamples; - } - - return MMSYSERR_NOERROR; -} - -#include - -HRESULT codec::encoder::convert(ACMDRVSTREAMHEADER* pHeader) -{ -#if 0 - short* pSrc, *pDst; - pSrc=(short*)(pHeader->pbSrc); - pDst=(short*)(pHeader->pbDst); - int iSrc=0, iDst=0; - int block_size=m_sFormat.nChannels * 64; - int samples_to_process=pHeader->cbSrcLength / (2 * block_size); - - for(int j=0; jpbSrc, 2 * block_size * samples_to_process, 1, f); - fclose(f); - f=fopen("c:\\enc2.log", "ab"); - fwrite(pHeader->pbDst, 2 * block_size * samples_to_process, 1, f); - fclose(f); - pHeader->cbDstLengthUsed=2 * block_size * samples_to_process; - pHeader->cbSrcLengthUsed=2 * block_size * samples_to_process; - return MMSYSERR_NOERROR; -#else - short* buffer=0; - int length=pHeader->cbSrcLength; - if(m_sFormat.wBitsPerSample!=16) - { - buffer = new short[length]; - for(int i=0; ipbSrc)[i]); - s-=128; - s*=256; - buffer[i]=s; - } - } - short* pointer = buffer ? buffer : (short*)(pHeader->pbSrc); - pHeader->cbSrcLengthUsed=0; - pHeader->cbDstLengthUsed=0; - while(1) - { - if(length-pHeader->cbSrcLengthUsed<2*m_iInputSamples) - break; - if(pHeader->cbDstLength-pHeader->cbDstLengthUsedcbSrcLengthUsed, - m_iInputSamples, - (short*)(pHeader->pbDst+pHeader->cbDstLengthUsed), - pHeader->cbDstLength-pHeader->cbDstLengthUsed); - if(result<0) - { - reset(); - break; - } - pHeader->cbDstLengthUsed+=result; - pHeader->cbSrcLengthUsed+=2*m_iInputSamples; - } - if(buffer) - { - pHeader->cbSrcLengthUsed/=2; - delete[] buffer; - } - return MMSYSERR_NOERROR; -#endif -} - -codec::decoder::decoder(WAVEFORMATEX* pF) : m_sFormat(*pF), m_bInitialized(false), m_pCache(0) -{ - m_pHandle=faacDecOpen(); -} - -HRESULT codec::decoder::reset() -{ - faacDecClose(m_pHandle); - m_pHandle=faacDecOpen(); - m_bInitialized=false; - delete[] m_pCache; - m_pCache=0; - return MMSYSERR_NOERROR; -} - -HRESULT codec::decoder::size(ACMDRVSTREAMSIZE* pSize) -{ - double dwInputBitRate=m_sFormat.nAvgBytesPerSec; - double dwOutputBitRate=m_sFormat.nSamplesPerSec * m_sFormat.wBitsPerSample * m_sFormat.nChannels; - - if(pSize->fdwSize == ACM_STREAMSIZEF_SOURCE) - { - if(pSize->cbSrcLength<768*m_sFormat.nChannels) - pSize->cbSrcLength=768*m_sFormat.nChannels; - pSize->cbDstLength = pSize->cbSrcLength * 2 * dwOutputBitRate/dwInputBitRate; - if(pSize->cbDstLength<4096) - pSize->cbDstLength=4096; - } - else - { - if(pSize->cbDstLength<4096) - pSize->cbDstLength=4096; - pSize->cbSrcLength = pSize->cbDstLength * 2 * dwInputBitRate/dwOutputBitRate;; - if(pSize->cbSrcLength<768*m_sFormat.nChannels) - pSize->cbSrcLength=768*m_sFormat.nChannels; - } - - return MMSYSERR_NOERROR; -} - -//static int iBytesProcessed=0; -HRESULT codec::decoder::convert(ACMDRVSTREAMHEADER* pHeader) -{ -#if 0 - short *pSrc, *pDst; - pSrc=(short*)pHeader->pbSrc; - pDst=(short*)pHeader->pbDst; - int iSrc=0, iDst=0; - int block_size=m_sFormat.nChannels * 64; - int samples_to_process=pHeader->cbSrcLength / (2 * block_size); - for(int j=0; jpbDst, 2 * block_size * samples_to_process, 1, f); - fclose(f); - pHeader->cbDstLengthUsed=2 * block_size * samples_to_process; - pHeader->cbSrcLengthUsed=2 * block_size * samples_to_process; - return MMSYSERR_NOERROR; -#else - // fixme: check fdwConvert contents - - const int iMinInputSize = 768*m_sFormat.nChannels; - pHeader->cbSrcLengthUsed=0; - pHeader->cbDstLengthUsed=0; - int decoded_bytes=0; - if(!m_bInitialized) - { - unsigned long samplerate; - unsigned long channels; - //assert(!m_pCache); - // we don't really need this call - // and it is done only because i am not sure if it's necessary for faac functionality - pHeader->cbSrcLengthUsed=faacDecInit(m_pHandle, pHeader->pbSrc, &samplerate, &channels); - m_bInitialized=true; - } - unsigned long bytesconsumed; - unsigned long samples; - if(pHeader->cbDstLength<4096) - goto finish; - - int iSrcDataLeft=pHeader->cbSrcLength; - - while(m_pCache) - { - int iFillSize = iMinInputSize - m_iCacheSize; - if(iFillSize > iSrcDataLeft) - iFillSize = iSrcDataLeft; - memcpy(&m_pCache[m_iCacheSize], pHeader->pbSrc+pHeader->cbSrcLengthUsed, iFillSize); - m_iCacheSize += iFillSize; - iSrcDataLeft -= iFillSize; - pHeader->cbSrcLengthUsed += iFillSize; - if(m_iCacheSize < iMinInputSize) - goto finish; - int result=faacDecDecode(m_pHandle, m_pCache, &bytesconsumed, - (short*)(pHeader->pbDst+pHeader->cbDstLengthUsed), &samples); // no way to prevent output buffer overrun??? - if(result==FAAD_FATAL_ERROR) - { - reset(); - goto finish; - } - if(result==FAAD_OK) - pHeader->cbDstLengthUsed+=sizeof(short)*samples; - assert(bytesconsumed <= iMinInputSize); - if(bytesconsumed < iMinInputSize) - memmove(m_pCache, &m_pCache[bytesconsumed], iMinInputSize-bytesconsumed); - m_iCacheSize-=bytesconsumed; - if(m_iCacheSize==0) - { - delete[] m_pCache; - m_pCache=0; - } - } - - if(iSrcDataLeft == 0) - goto finish; - - if(iSrcDataLeft < iMinInputSize) - { - m_pCache = new unsigned char[iMinInputSize]; - memcpy(m_pCache, pHeader->pbSrc + pHeader->cbSrcLengthUsed, iSrcDataLeft); - m_iCacheSize = iSrcDataLeft; - pHeader->cbSrcLengthUsed = pHeader->cbSrcLength; - goto finish; - } - - while(iSrcDataLeft>=iMinInputSize) - { - if(pHeader->cbDstLength-pHeader->cbDstLengthUsed<4096) - break; - int result=faacDecDecode(m_pHandle, pHeader->pbSrc+pHeader->cbSrcLengthUsed, &bytesconsumed, - (short*)(pHeader->pbDst+pHeader->cbDstLengthUsed), &samples); // no way to prevent output buffer overrun??? - if(result==FAAD_FATAL_ERROR) - { - pHeader->cbSrcLengthUsed=pHeader->cbSrcLength; - reset(); - goto finish; - } - if(result==FAAD_OK) - pHeader->cbDstLengthUsed+=sizeof(short)*samples; - pHeader->cbSrcLengthUsed+=bytesconsumed; - iSrcDataLeft-=bytesconsumed; - } -finish: - FILE* f=fopen("c:\\aac_acm.bin", "ab"); - fwrite(pHeader->pbSrc, pHeader->cbSrcLengthUsed, 1, f); - fclose(f); - // iBytesProcessed+=pHeader->cbSrcLengthUsed; - return MMSYSERR_NOERROR; -#endif -} - diff -Nru faac-1.26/plugins/aac_acm/codec.h faac-1.28/plugins/aac_acm/codec.h --- faac-1.26/plugins/aac_acm/codec.h 2002-01-17 12:22:44.000000000 +0000 +++ faac-1.28/plugins/aac_acm/codec.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -#ifndef _CODEC_H -#define _CODEC_H - -#include "msacmdrv.h" -#include "faac.h" -#include "faad.h" -class codec -{ - static const int m_iCompressedFormatTag; - static const int m_iManufacturerID; - static const int m_iProductID; - - static void fill_pcm_format(WAVEFORMATEX* pwfx, int rate, int bits, int channels); - static void fill_compressed_format(WAVEFORMATEX* pwfx, int rate, int bits, int channels, int bitrate); - int something; - class stream - { - public: - virtual ~stream() {} - virtual HRESULT reset() =0; - virtual HRESULT size(ACMDRVSTREAMSIZE*) =0; - virtual HRESULT convert(ACMDRVSTREAMHEADER*) =0; - }; - class encoder: public stream - { - WAVEFORMATEX m_sFormat; - unsigned long m_iInputSamples; - unsigned long m_iMaxOutputBytes; - unsigned long m_iOutputBytesPerSec; - faacEncHandle m_pHandle; - public: - encoder(WAVEFORMATEX* pF, WAVEFORMATEX* pFDest); - ~encoder() {} - virtual HRESULT reset(); - virtual HRESULT size(ACMDRVSTREAMSIZE*); - virtual HRESULT convert(ACMDRVSTREAMHEADER*); - }; - class decoder: public stream - { - WAVEFORMATEX m_sFormat; - faacDecHandle m_pHandle; - bool m_bInitialized; - unsigned char* m_pCache; - int m_iCacheSize; - public: - decoder(WAVEFORMATEX* pF); - ~decoder() { delete[] m_pCache; } - virtual HRESULT reset(); - virtual HRESULT size(ACMDRVSTREAMSIZE*); - virtual HRESULT convert(ACMDRVSTREAMHEADER*); - }; - public: - codec(); - ~codec(); - HRESULT formattag_details(ACMFORMATTAGDETAILSW* lParam1, DWORD lParam2); - HRESULT format_details(ACMFORMATDETAILSW* lParam1, DWORD lParam2); - HRESULT format_suggest(ACMDRVFORMATSUGGEST*); - HRESULT details(ACMDRIVERDETAILSW*); - HRESULT about(DWORD); - HRESULT open(ACMDRVSTREAMINSTANCE*); - HRESULT prepare(ACMDRVSTREAMINSTANCE*, ACMDRVSTREAMHEADER*); - HRESULT reset(ACMDRVSTREAMINSTANCE*); - HRESULT size(ACMDRVSTREAMINSTANCE*, ACMDRVSTREAMSIZE*); - HRESULT unprepare(ACMDRVSTREAMINSTANCE*, ACMDRVSTREAMHEADER*); - HRESULT convert(ACMDRVSTREAMINSTANCE*, ACMDRVSTREAMHEADER*); - HRESULT close(ACMDRVSTREAMINSTANCE*); -}; - -#endif - - diff -Nru faac-1.26/plugins/aac_acm/msacmdrv.h faac-1.28/plugins/aac_acm/msacmdrv.h --- faac-1.26/plugins/aac_acm/msacmdrv.h 2002-01-17 12:22:44.000000000 +0000 +++ faac-1.28/plugins/aac_acm/msacmdrv.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,178 +0,0 @@ -#ifndef _MSACMDRV_H -#define _MSACMDRV_H - -#include -#include -#include -#include -#include - -#define ACMDM_DRIVER_DETAILS (ACMDM_BASE + 10) -#define ACMDM_DRIVER_ABOUT (ACMDM_BASE + 11) -#define ACMDM_FORMATTAG_DETAILS (ACMDM_BASE + 25) -#define ACMDM_FORMAT_DETAILS (ACMDM_BASE + 26) -#define ACMDM_FORMAT_SUGGEST (ACMDM_BASE + 27) - -#define ACMDM_STREAM_OPEN (ACMDM_BASE + 76) -#define ACMDM_STREAM_CLOSE (ACMDM_BASE + 77) -#define ACMDM_STREAM_SIZE (ACMDM_BASE + 78) -#define ACMDM_STREAM_CONVERT (ACMDM_BASE + 79) -#define ACMDM_STREAM_RESET (ACMDM_BASE + 80) -#define ACMDM_STREAM_PREPARE (ACMDM_BASE + 81) -#define ACMDM_STREAM_UNPREPARE (ACMDM_BASE + 82) -#define ACMDM_STREAM_UPDATE (ACMDM_BASE + 83) - -typedef struct _ACMDRVOPENDESCA -{ - DWORD cbStruct; - FOURCC fccType; - FOURCC fccComp; - DWORD dwVersion; - DWORD dwFlags; - DWORD dwError; - LPCSTR pszSectionName; - LPCSTR pszAliasName; - DWORD dnDevNode; -} ACMDRVOPENDESCA, *PACMDRVOPENDESCA; - -typedef struct _ACMDRVOPENDESCW -{ - DWORD cbStruct; - FOURCC fccType; - FOURCC fccComp; - DWORD dwVersion; - DWORD dwFlags; - DWORD dwError; - LPCWSTR pszSectionName; - LPCWSTR pszAliasName; - DWORD dnDevNode; -} ACMDRVOPENDESCW, *PACMDRVOPENDESCW; - -typedef struct _ACMDRVOPENDESC16 -{ - DWORD cbStruct; - FOURCC fccType; - FOURCC fccComp; - DWORD dwVersion; - DWORD dwFlags; - DWORD dwError; - LPCSTR pszSectionName; - LPCSTR pszAliasName; - DWORD dnDevNode; -} ACMDRVOPENDESC16, *NPACMDRVOPENDESC16, *LPACMDRVOPENDESC16; -/* -typedef struct _ACMDRVSTREAMINSTANCE16 -{ - DWORD cbStruct; - LPWAVEFORMATEX pwfxSrc; - LPWAVEFORMATEX pwfxDst; - LPWAVEFILTER pwfltr; - DWORD dwCallback; - DWORD dwInstance; - DWORD fdwOpen; - DWORD fdwDriver; - DWORD dwDriver; - HACMSTREAM16 has; -} ACMDRVSTREAMINSTANCE16, *NPACMDRVSTREAMINSTANCE16, *LPACMDRVSTREAMINSTANCE16; -*/ -typedef struct _ACMDRVSTREAMINSTANCE -{ - DWORD cbStruct; - PWAVEFORMATEX pwfxSrc; - PWAVEFORMATEX pwfxDst; - PWAVEFILTER pwfltr; - DWORD dwCallback; - DWORD dwInstance; - DWORD fdwOpen; - DWORD fdwDriver; - DWORD dwDriver; - HACMSTREAM has; -} ACMDRVSTREAMINSTANCE, *PACMDRVSTREAMINSTANCE; - - -typedef struct _ACMDRVSTREAMHEADER16 *LPACMDRVSTREAMHEADER16; -typedef struct _ACMDRVSTREAMHEADER16 { - DWORD cbStruct; - DWORD fdwStatus; - DWORD dwUser; - LPBYTE pbSrc; - DWORD cbSrcLength; - DWORD cbSrcLengthUsed; - DWORD dwSrcUser; - LPBYTE pbDst; - DWORD cbDstLength; - DWORD cbDstLengthUsed; - DWORD dwDstUser; - - DWORD fdwConvert; - LPACMDRVSTREAMHEADER16 *padshNext; - DWORD fdwDriver; - DWORD dwDriver; - - /* Internal fields for ACM */ - DWORD fdwPrepared; - DWORD dwPrepared; - LPBYTE pbPreparedSrc; - DWORD cbPreparedSrcLength; - LPBYTE pbPreparedDst; - DWORD cbPreparedDstLength; -} ACMDRVSTREAMHEADER16, *NPACMDRVSTREAMHEADER16; - -typedef struct _ACMDRVSTREAMHEADER *PACMDRVSTREAMHEADER; -typedef struct _ACMDRVSTREAMHEADER { - DWORD cbStruct; - DWORD fdwStatus; - DWORD dwUser; - LPBYTE pbSrc; - DWORD cbSrcLength; - DWORD cbSrcLengthUsed; - DWORD dwSrcUser; - LPBYTE pbDst; - DWORD cbDstLength; - DWORD cbDstLengthUsed; - DWORD dwDstUser; - - DWORD fdwConvert; - PACMDRVSTREAMHEADER *padshNext; - DWORD fdwDriver; - DWORD dwDriver; - - /* Internal fields for ACM */ - DWORD fdwPrepared; - DWORD dwPrepared; - LPBYTE pbPreparedSrc; - DWORD cbPreparedSrcLength; - LPBYTE pbPreparedDst; - DWORD cbPreparedDstLength; -} ACMDRVSTREAMHEADER; - -typedef struct _ACMDRVSTREAMSIZE -{ - DWORD cbStruct; - DWORD fdwSize; - DWORD cbSrcLength; - DWORD cbDstLength; -} ACMDRVSTREAMSIZE16, *NPACMDRVSTREAMSIZE16, *LPACMDRVSTREAMSIZE16, - ACMDRVSTREAMSIZE, *PACMDRVSTREAMSIZE; - -typedef struct _ACMDRVFORMATSUGGEST16 -{ - DWORD cbStruct; - DWORD fdwSuggest; - LPWAVEFORMATEX pwfxSrc; - DWORD cbwfxSrc; - LPWAVEFORMATEX pwfxDst; - DWORD cbwfxDst; -} ACMDRVFORMATSUGGEST16, *NPACMDRVFORMATSUGGEST, *LPACMDRVFORMATSUGGEST; - -typedef struct _ACMDRVFORMATSUGGEST -{ - DWORD cbStruct; - DWORD fdwSuggest; - PWAVEFORMATEX pwfxSrc; - DWORD cbwfxSrc; - PWAVEFORMATEX pwfxDst; - DWORD cbwfxDst; -} ACMDRVFORMATSUGGEST, *PACMDRVFORMATSUGGEST; - -#endif diff -Nru faac-1.26/plugins/aac_acm/StdAfx.cpp faac-1.28/plugins/aac_acm/StdAfx.cpp --- faac-1.26/plugins/aac_acm/StdAfx.cpp 2002-01-17 12:22:44.000000000 +0000 +++ faac-1.28/plugins/aac_acm/StdAfx.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// aac_acm.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - -// TODO: reference any additional headers you need in STDAFX.H -// and not in this file diff -Nru faac-1.26/plugins/aac_acm/StdAfx.h faac-1.28/plugins/aac_acm/StdAfx.h --- faac-1.26/plugins/aac_acm/StdAfx.h 2002-01-17 12:22:44.000000000 +0000 +++ faac-1.28/plugins/aac_acm/StdAfx.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#if !defined(AFX_STDAFX_H__4B6551ED_F548_4AD7_B0DA_37308A3D8313__INCLUDED_) -#define AFX_STDAFX_H__4B6551ED_F548_4AD7_B0DA_37308A3D8313__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - - -// Insert your headers here -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers - -#include - -// TODO: reference additional headers your program requires here - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_STDAFX_H__4B6551ED_F548_4AD7_B0DA_37308A3D8313__INCLUDED_) diff -Nru faac-1.26/plugins/cooledit/aacInfoLib.dsp faac-1.28/plugins/cooledit/aacInfoLib.dsp --- faac-1.26/plugins/cooledit/aacInfoLib.dsp 2004-10-26 12:48:11.000000000 +0000 +++ faac-1.28/plugins/cooledit/aacInfoLib.dsp 1970-01-01 00:00:00.000000000 +0000 @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="aacInfoLib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=aacInfoLib - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "aacInfoLib.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "aacInfoLib.mak" CFG="aacInfoLib - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "aacInfoLib - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "aacInfoLib - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=xicl6.exe -RSC=rc.exe - -!IF "$(CFG)" == "aacInfoLib - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "aacInfoLib___Win32_Release" -# PROP BASE Intermediate_Dir "aacInfoLib___Win32_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -MTL=midl.exe -F90=df.exe -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../faad2/common/faad" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD BASE RSC /l 0x410 /d "NDEBUG" -# ADD RSC /l 0x410 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=xilink6.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "aacInfoLib - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "aacInfoLib___Win32_Debug" -# PROP BASE Intermediate_Dir "aacInfoLib___Win32_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -MTL=midl.exe -F90=df.exe -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../faad2/common/faad" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD BASE RSC /l 0x410 /d "_DEBUG" -# ADD RSC /l 0x410 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=xilink6.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "aacInfoLib - Win32 Release" -# Name "aacInfoLib - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\..\faad2\common\faad\aacinfo.c -# End Source File -# Begin Source File - -SOURCE=..\..\..\faad2\common\faad\filestream.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\common\faad\aacinfo.h -# End Source File -# Begin Source File - -SOURCE=..\..\common\faad\filestream.h -# End Source File -# End Group -# End Target -# End Project diff -Nru faac-1.26/plugins/cooledit/aacInfoLib.dsw faac-1.28/plugins/cooledit/aacInfoLib.dsw --- faac-1.26/plugins/cooledit/aacInfoLib.dsw 2002-09-30 13:35:08.000000000 +0000 +++ faac-1.28/plugins/cooledit/aacInfoLib.dsw 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "aacInfoLib"=.\aacInfoLib.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff -Nru faac-1.26/plugins/cooledit/aacInfoLib.sln faac-1.28/plugins/cooledit/aacInfoLib.sln --- faac-1.26/plugins/cooledit/aacInfoLib.sln 1970-01-01 00:00:00.000000000 +0000 +++ faac-1.28/plugins/cooledit/aacInfoLib.sln 2009-01-25 20:31:26.000000000 +0000 @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aacInfoLib", "aacInfoLib.vcproj", "{3257D980-5029-486B-94DC-AA520B501C62}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3257D980-5029-486B-94DC-AA520B501C62}.Debug|Win32.ActiveCfg = Debug|Win32 + {3257D980-5029-486B-94DC-AA520B501C62}.Debug|Win32.Build.0 = Debug|Win32 + {3257D980-5029-486B-94DC-AA520B501C62}.Release|Win32.ActiveCfg = Release|Win32 + {3257D980-5029-486B-94DC-AA520B501C62}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff -Nru faac-1.26/plugins/cooledit/aacInfoLib.vcproj faac-1.28/plugins/cooledit/aacInfoLib.vcproj --- faac-1.26/plugins/cooledit/aacInfoLib.vcproj 1970-01-01 00:00:00.000000000 +0000 +++ faac-1.28/plugins/cooledit/aacInfoLib.vcproj 2009-01-25 20:31:26.000000000 +0000 @@ -0,0 +1,235 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru faac-1.26/plugins/cooledit/FAAC.dsp faac-1.28/plugins/cooledit/FAAC.dsp --- faac-1.26/plugins/cooledit/FAAC.dsp 2004-11-01 19:38:23.000000000 +0000 +++ faac-1.28/plugins/cooledit/FAAC.dsp 1970-01-01 00:00:00.000000000 +0000 @@ -1,216 +0,0 @@ -# Microsoft Developer Studio Project File - Name="FAAC" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=FAAC - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "FAAC.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "FAAC.mak" CFG="FAAC - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "FAAC - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "FAAC - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=xicl6.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "FAAC - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FAAC_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../../common/Cfaac" /I "../../../faad2/common/id3lib/include" /I "../../include" /I "../../../faad2/include" /I "../../../faad2/common/faad" /I "../../common/mp4v2" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "WIN32_LEAN_AND_MEAN" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x410 /d "NDEBUG" -# ADD RSC /l 0x410 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=xilink6.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /machine:I386 /out:"Release/FAAC.flt" - -!ELSEIF "$(CFG)" == "FAAC - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FAAC_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I "../../common/Cfaac" /I "../../../faad2/common/id3lib/include" /I "../../include" /I "../../../faad2/include" /I "../../../faad2/common/faad" /I "../../common/mp4v2" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "WIN32_LEAN_AND_MEAN" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x410 /d "_DEBUG" -# ADD RSC /l 0x410 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=xilink6.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"Debug\FAAC.flt" /pdbtype:sept -# SUBTRACT LINK32 /nodefaultlib /force - -!ENDIF - -# Begin Target - -# Name "FAAC - Win32 Release" -# Name "FAAC - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\common\Cfaac\Cfaac.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\common\Cfaac\Cfaad.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\common\Cfaac\CRegistry.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\common\Cfaac\CTag.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\common\Cfaac\DecDialog.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\common\Cfaac\EncDialog.cpp -# End Source File -# Begin Source File - -SOURCE=.\Faac.cpp -# End Source File -# Begin Source File - -SOURCE=.\FAAC.def -# End Source File -# Begin Source File - -SOURCE=..\..\common\Cfaac\FAAC.rc -# End Source File -# Begin Source File - -SOURCE=.\Faad.cpp -# End Source File -# Begin Source File - -SOURCE=.\Main.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\common\Cfaac\Cfaac.h -# End Source File -# Begin Source File - -SOURCE=..\..\common\Cfaac\Cfaad.h -# End Source File -# Begin Source File - -SOURCE=..\..\common\Cfaac\CRegistry.h -# End Source File -# Begin Source File - -SOURCE=..\..\common\Cfaac\CTag.h -# End Source File -# Begin Source File - -SOURCE=..\..\common\Cfaac\DecDialog.h -# End Source File -# Begin Source File - -SOURCE=.\Defines.h -# End Source File -# Begin Source File - -SOURCE=..\..\common\Cfaac\EncDialog.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\faac.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\faad2\include\faad.h -# End Source File -# Begin Source File - -SOURCE=.\Filters.h -# End Source File -# Begin Source File - -SOURCE=..\..\common\Cfaac\resource.h -# End Source File -# Begin Source File - -SOURCE=..\..\common\Cfaac\TypeDef.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=..\..\common\Cfaac\AudioCoding.bmp -# End Source File -# Begin Source File - -SOURCE=..\..\common\Cfaac\Email.bmp -# End Source File -# Begin Source File - -SOURCE=..\..\common\Cfaac\id3v2.ico -# End Source File -# Begin Source File - -SOURCE=..\..\common\Cfaac\Mail.bmp -# End Source File -# Begin Source File - -SOURCE="..\..\common\Cfaac\mpeg4ip-v.bmp" -# End Source File -# End Group -# End Target -# End Project diff -Nru faac-1.26/plugins/cooledit/FAAC.dsw faac-1.28/plugins/cooledit/FAAC.dsw --- faac-1.26/plugins/cooledit/FAAC.dsw 2004-10-26 12:48:11.000000000 +0000 +++ faac-1.28/plugins/cooledit/FAAC.dsw 1970-01-01 00:00:00.000000000 +0000 @@ -1,119 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "FAAC"=.\FAAC.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name libfaac - End Project Dependency - Begin Project Dependency - Project_Dep_Name libfaad - End Project Dependency - Begin Project Dependency - Project_Dep_Name libmp4v2_st - End Project Dependency - Begin Project Dependency - Project_Dep_Name aacInfoLib - End Project Dependency - Begin Project Dependency - Project_Dep_Name id3lib - End Project Dependency - Begin Project Dependency - Project_Dep_Name zlib - End Project Dependency -}}} - -############################################################################### - -Project: "aacInfoLib"=.\aacInfoLib.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "id3lib"=..\..\..\faad2\common\id3lib\libprj\id3lib.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "libfaac"=..\..\libfaac\libfaac.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "libfaad"=..\..\..\faad2\libfaad\libfaad.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "libmp4v2_st"=..\..\..\faad2\common\mp4v2\libmp4v2_st60.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "zlib"=..\..\..\faad2\common\id3lib\zlib\prj\zlib.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff -Nru faac-1.26/plugins/cooledit/FAAC.sln faac-1.28/plugins/cooledit/FAAC.sln --- faac-1.26/plugins/cooledit/FAAC.sln 1970-01-01 00:00:00.000000000 +0000 +++ faac-1.28/plugins/cooledit/FAAC.sln 2009-01-25 20:31:25.000000000 +0000 @@ -0,0 +1,43 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FAAC", "FAAC.vcproj", "{DEC2740A-F3D5-430C-BB81-C57006D20378}" + ProjectSection(ProjectDependencies) = postProject + {2E6FD2E8-55B9-4740-8882-CF823F77F7E1} = {2E6FD2E8-55B9-4740-8882-CF823F77F7E1} + {429A062F-81E0-4EFD-832B-55E0DE931FC8} = {429A062F-81E0-4EFD-832B-55E0DE931FC8} + {BD8FBE75-314D-476B-B13C-A206C52F0BD1} = {BD8FBE75-314D-476B-B13C-A206C52F0BD1} + {7F01A591-0084-4749-B53F-F9D2BFE8DF6E} = {7F01A591-0084-4749-B53F-F9D2BFE8DF6E} + {6440BFC6-57A6-4F6E-A8FB-F960D088ADEE} = {6440BFC6-57A6-4F6E-A8FB-F960D088ADEE} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aacInfoLib", "aacInfoLib.vcproj", "{3257D980-5029-486B-94DC-AA520B501C62}" +EndProject +Project("{059D6162-CD51-11D0-AE1F-00A0C90FFFC3}") = "id3lib", "..\..\..\faad2\common\id3lib\libprj\id3lib.dsp", "{7F01A591-0084-4749-B53F-F9D2BFE8DF6E}" +EndProject +Project("{059D6162-CD51-11D0-AE1F-00A0C90FFFC3}") = "libfaac", "..\..\libfaac\libfaac.dsp", "{2E6FD2E8-55B9-4740-8882-CF823F77F7E1}" +EndProject +Project("{059D6162-CD51-11D0-AE1F-00A0C90FFFC3}") = "libfaad", "..\..\..\faad2\libfaad\libfaad.dsp", "{429A062F-81E0-4EFD-832B-55E0DE931FC8}" +EndProject +Project("{059D6162-CD51-11D0-AE1F-00A0C90FFFC3}") = "libmp4v2_st", "..\..\..\faad2\common\mp4v2\libmp4v2_st60.dsp", "{BD8FBE75-314D-476B-B13C-A206C52F0BD1}" +EndProject +Project("{059D6162-CD51-11D0-AE1F-00A0C90FFFC3}") = "zlib", "..\..\..\faad2\common\id3lib\zlib\prj\zlib.dsp", "{6440BFC6-57A6-4F6E-A8FB-F960D088ADEE}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DEC2740A-F3D5-430C-BB81-C57006D20378}.Debug|Win32.ActiveCfg = Debug|Win32 + {DEC2740A-F3D5-430C-BB81-C57006D20378}.Debug|Win32.Build.0 = Debug|Win32 + {DEC2740A-F3D5-430C-BB81-C57006D20378}.Release|Win32.ActiveCfg = Release|Win32 + {DEC2740A-F3D5-430C-BB81-C57006D20378}.Release|Win32.Build.0 = Release|Win32 + {3257D980-5029-486B-94DC-AA520B501C62}.Debug|Win32.ActiveCfg = Debug|Win32 + {3257D980-5029-486B-94DC-AA520B501C62}.Debug|Win32.Build.0 = Debug|Win32 + {3257D980-5029-486B-94DC-AA520B501C62}.Release|Win32.ActiveCfg = Release|Win32 + {3257D980-5029-486B-94DC-AA520B501C62}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff -Nru faac-1.26/plugins/cooledit/FAAC.vcproj faac-1.28/plugins/cooledit/FAAC.vcproj --- faac-1.26/plugins/cooledit/FAAC.vcproj 1970-01-01 00:00:00.000000000 +0000 +++ faac-1.28/plugins/cooledit/FAAC.vcproj 2009-01-25 20:31:26.000000000 +0000 @@ -0,0 +1,521 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru faac-1.26/plugins/foo_faac/foo_faac.cpp faac-1.28/plugins/foo_faac/foo_faac.cpp --- faac-1.26/plugins/foo_faac/foo_faac.cpp 2003-12-14 12:26:09.000000000 +0000 +++ faac-1.28/plugins/foo_faac/foo_faac.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,805 +0,0 @@ -// FAAC encoder for foobar2000 diskwriter -// Copyright (C) 2003 Janne Hyvärinen -// -// Changes: -// 0.4.2 (2003-12-14): Changed the gapless method again -// 0.4.1 (2003-12-13): Added ctts field writing for MP4 mode -// 0.4 (2003-12-11): Added support for average bitrate controlling -// 0.3.5 (2003-10-17): Changed way gapless encoding is handled (iTunes is buggy...) -// 0.3.4 (2003-10-14): Fixed AAC object type selecting -// 0.3.3 (2003-10-02): Removed gapless support for raw AAC files, it was hacky and recent libfaad changes broke it -// 0.3.2 (2003-09-17): Last fix wasn't perfect and very small input chunks wouldn't have been encoded -// 0.3.1 (2003-09-14): Fixed possible memory access problems -// 0.3 (2003-08-17): Even more corrections to MP4 writing, now encoder delay is taken into account and first MP4 sample is given length 0 -// writes 'TOOL' metadata tag with libfaac version string -// 0.2.9 (2003-08-16): Fixes in MP4 writing -// 0.2.8 (2003-08-16): Added silence padding at the end, new libfaac doesn't do it itself -// 0.2.7 (2003-08-16): MP4 fixes, now MP4 header stores correct length -// 0.2.6 (2003-08-16): MP4 writing uses correct length for last frame -// 0.2.5 (2003-08-15): "libfaac flushing" added for 0.2.2 removed, foo_mp4 was cutting the end away incorrectly -// 0.2.4 (2003-08-09): Added direct M4A writing and one new mode to bandwidth list -// uses LFE mode with 6 channels -// 0.2.3 (2003-08-08): Doesn't write tech info to APEv2 tags anymore -// stores original file length now also for AAC -// no longer limited to 32bit storage for length -// changes to config -// 0.2.2 (2003-08-07): Flushes libfaac now properly to get gapless playback -// fixed bandwidth selecting issues in config -// 0.2.1 (2003-08-07): Fixed MP4 writing -// 0.2 (2003-08-07): Added MP4 creation and tagging, reorganized config -// reports libfaac version in component info string -// 0.1 (2003-08-06): First public version - -#include -#include "../SDK/foobar2000.h" -#include "resource.h" -#include -#include -#include - -#define FOO_FAAC_VERSION "0.4.2" - -#define FF_AAC 0 -#define FF_MP4 1 -#define FF_M4A 2 - -#define FF_DEFAULT_OBJECTTYPE LOW -#define FF_DEFAULT_MIDSIDE 1 -#define FF_DEFAULT_TNS 0 -#define FF_DEFAULT_QUANTQUAL 100 -#define FF_DEFAULT_AVGBRATE 64 -#define FF_DEFAULT_CUTOFF -1 -#define FF_DEFAULT_MP4CONTAINER FF_MP4 -#define FF_DEFAULT_USE_QQ 1 -#define FF_DEFAULT_USE_AB 0 - -static cfg_int cfg_objecttype ( "objecttype", FF_DEFAULT_OBJECTTYPE ); -static cfg_int cfg_midside ( "midside", FF_DEFAULT_MIDSIDE ); -static cfg_int cfg_tns ( "tns", FF_DEFAULT_TNS ); -static cfg_int cfg_quantqual ( "quantqual", FF_DEFAULT_QUANTQUAL ); -static cfg_int cfg_avgbrate ( "avgbrate", FF_DEFAULT_AVGBRATE ); -static cfg_int cfg_cutoff ( "cutoff", FF_DEFAULT_CUTOFF ); -static cfg_int cfg_mp4container ( "mp4container", FF_DEFAULT_MP4CONTAINER ); -static cfg_int cfg_use_qq ( "use_qq", FF_DEFAULT_USE_QQ ); -static cfg_int cfg_use_ab ( "use_ab", FF_DEFAULT_USE_AB ); - -DECLARE_COMPONENT_VERSION ( "FAAC encoder", FOO_FAAC_VERSION, "Uses libfaac version " FAAC_VERSION ); - -class diskwriter_faac : public diskwriter { -private: - // mp4 - MP4FileHandle MP4hFile; - MP4TrackId MP4track; - - // faac - faacEncHandle hEncoder; - faacEncConfigurationPtr myFormat; - unsigned int objectType; - unsigned int useMidSide; - unsigned int useTns; - int cutOff; - int bitRate; - unsigned long quantqual; - int use_qq, use_ab; - - int create_mp4; - - reader *m_reader; - mem_block_t bitbuf; - mem_block_t floatbuf; - unsigned long samplesInput, maxBytesOutput; - int *chanmap; - unsigned int bufferedSamples; - unsigned int frameSize; - - string8 path; - file_info_i_full info; - unsigned int srate, nch, bps; - __int64 total_samples, encoded_samples, delay_samples; - bool encode_error; - -public: - diskwriter_faac() - { - objectType = cfg_objecttype; - useMidSide = cfg_midside; - useTns = cfg_tns; - cutOff = cfg_cutoff; - bitRate = cfg_avgbrate * 1000; - quantqual = cfg_quantqual; - use_qq = cfg_use_qq; - use_ab = cfg_use_ab; - hEncoder = 0; - myFormat = 0; - - MP4hFile = 0; - MP4track = 0; - - create_mp4 = cfg_mp4container; - - m_reader = 0; - } - - ~diskwriter_faac() - { - if ( m_reader ) m_reader->reader_release(); - } - - virtual const char *get_name() { return "AAC"; } - - virtual const char *get_extension() - { - switch ( create_mp4 ) { - case FF_MP4: - default: - return "mp4"; - case FF_M4A: - return "m4a"; - case FF_AAC: - return "aac"; - } - } - - virtual int open ( const char *filename, metadb_handle *src_file ) - { - if ( m_reader ) return 0; - - encode_error = false; - path = filename; - if ( src_file ) src_file->handle_query ( &info ); else info.reset(); - - console::info ( "AAC encoding with FAAC version " FAAC_VERSION ); - console::info ( string_printf ("Source file: %s", (const char *)info.get_file_path()) ); - console::info ( string_printf ("Destination file: %s", (const char *)path) ); - - if ( path.is_empty() ) { - console::error ( "No destination name" ); - return 0; - } - - m_reader = file::g_open ( path, reader::MODE_WRITE_NEW ); - if ( !m_reader ) { - console::error ( "Can't write to destination" ); - return 0; - } - - return 1; - } - - virtual int process_samples ( const audio_chunk *src ) - { - if ( encode_error ) return 0; - - if ( !hEncoder ) { - encode_error = true; - nch = src->get_channels(); - srate = src->get_srate(); - - // get faac version - hEncoder = faacEncOpen ( 44100, 2, &samplesInput, &maxBytesOutput ); - myFormat = faacEncGetCurrentConfiguration ( hEncoder ); - - if ( myFormat->version == FAAC_CFG_VERSION ) { - //console::info ( string_printf ("libfaac version %s", (const char *)myFormat->name) ); - faacEncClose ( hEncoder ); - } else { - console::error ( "Wrong libfaac version" ); - faacEncClose ( hEncoder ); - hEncoder = 0; - return 0; - } - - // open the encoder library - hEncoder = faacEncOpen ( srate, nch, &samplesInput, &maxBytesOutput ); - - bufferedSamples = 0; - frameSize = samplesInput / nch; - total_samples = 0; - encoded_samples = 0; - delay_samples = frameSize; - bitbuf.check_size ( maxBytesOutput ); - floatbuf.check_size ( samplesInput ); - chanmap = mkChanMap ( nch, 3/*chanC*/, 4/*chanLF*/ ); - - if ( cutOff <= 0 ) { - if ( cutOff < 0 ) { - cutOff = 0; - } else { - cutOff = srate / 2; - } - } - if ( (unsigned)cutOff > (srate / 2) ) cutOff = srate / 2; - - // put the options in the configuration struct - myFormat = faacEncGetCurrentConfiguration ( hEncoder ); - myFormat->aacObjectType = objectType; - myFormat->mpegVersion = (create_mp4 || objectType == LTP) ? MPEG4 : MPEG2; - myFormat->useLfe = (nch == 6) ? 1 : 0; - myFormat->useTns = useTns; - myFormat->allowMidside = useMidSide; - if ( use_ab ) myFormat->bitRate = bitRate; - myFormat->bandWidth = cutOff; - if ( use_qq ) myFormat->quantqual = quantqual; - myFormat->outputFormat = create_mp4 ? 0 : 1; - myFormat->inputFormat = FAAC_INPUT_FLOAT; - - if ( !faacEncSetConfiguration (hEncoder, myFormat) ) { - console::error ( "Unsupported output format" ); - return 0; - } - - // initialize MP4 creation - if ( create_mp4 ) { - MP4hFile = MP4CreateCb ( 0, 0, 0, open_cb, close_cb, read_cb, write_cb, setpos_cb, getpos_cb, filesize_cb, (void *)m_reader ); - if ( MP4hFile == MP4_INVALID_FILE_HANDLE ) { - console::error ( "MP4Create() failed" ); - return 0; - } - - MP4SetTimeScale ( MP4hFile, 90000 ); - - MP4track = MP4AddAudioTrack ( MP4hFile, srate, MP4_INVALID_DURATION, MP4_MPEG4_AUDIO_TYPE ); - - MP4SetAudioProfileLevel ( MP4hFile, 0x0F ); - - unsigned char *ASC = 0; - unsigned long ASCLength = 0; - faacEncGetDecoderSpecificInfo(hEncoder, &ASC, &ASCLength); - - MP4SetTrackESConfiguration ( MP4hFile, MP4track, (u_int8_t *)ASC, ASCLength ); - } - - cutOff = myFormat->bandWidth; - quantqual = myFormat->quantqual; - bitRate = myFormat->bitRate; - - if ( bitRate > 0 ) { - console::info ( string_printf ("Using quantizer quality %i and average bitrate of %i kbps per channel", quantqual, bitRate/1000) ); - } else { - console::info ( string_printf ("Using quantizer quality %i and no average bitrate control", quantqual, bitRate) ); - } - - encode_error = false; - } - - if ( srate != src->get_srate() || nch != src->get_channels() ) return 0; - - { - unsigned int samples = src->get_sample_count() * nch; - const audio_sample *s = src->get_data(); - - do { - unsigned int num = (samples+bufferedSamples < samplesInput) ? samples+bufferedSamples : samplesInput; - if ( num == 0 ) break; - - float *d = (float *)floatbuf.get_ptr() + bufferedSamples; - - for ( unsigned int i = bufferedSamples; i < num; i++ ) { - *d++ = (float)((*s++) * 32768.); - - bufferedSamples++; - samples--; - } - - if ( bufferedSamples == samplesInput ) { - if ( nch >= 3 && chanmap ) { - chan_remap ( (int *)floatbuf.get_ptr(), nch, frameSize, chanmap ); - } - - // call the actual encoding routine - int bytesWritten = faacEncEncode ( hEncoder, (int32_t *)floatbuf.get_ptr(), samplesInput, bitbuf.get_ptr(), maxBytesOutput ); - - bufferedSamples = 0; - - if ( bytesWritten < 0 ) { - console::error ( "faacEncEncode() failed" ); - return 0; - } - - if ( bytesWritten > 0 ) { - MP4Duration dur = frameSize; - MP4Duration ofs = 0; - - if ( delay_samples > 0 ) { - dur = 0; - ofs = delay_samples; - delay_samples -= frameSize; - } - - if ( create_mp4 ) { - MP4WriteSample ( MP4hFile, MP4track, (const unsigned __int8 *)bitbuf.get_ptr(), bytesWritten, frameSize, ofs ); - } else { - m_reader->write ( bitbuf.get_ptr(), bytesWritten ); - } - - encoded_samples += dur; - } - } - } while ( bufferedSamples == 0 ); - } - - total_samples += src->get_sample_count(); - - return 1; - } - - virtual void flush() - { - if ( hEncoder ) { - if ( nch >= 3 && chanmap ) { - chan_remap ( (int *)floatbuf.get_ptr(), nch, bufferedSamples/nch, chanmap ); - } - - __int64 samples_left = total_samples - encoded_samples; - - while ( samples_left > 0 ) { - if ( !bufferedSamples ) { - bufferedSamples = samplesInput; - memset ( floatbuf.get_ptr(), 0, samplesInput * sizeof(float) ); - } - - int bytesWritten = faacEncEncode ( hEncoder, (int32_t *)floatbuf.get_ptr(), bufferedSamples, bitbuf.get_ptr(), maxBytesOutput ); - bufferedSamples = 0; - - if ( bytesWritten < 0 ) { - console::error ( "faacEncEncode() failed" ); - break; - } - else if ( bytesWritten > 0 ) { - MP4Duration dur = samples_left > frameSize ? frameSize : samples_left; - - if ( create_mp4 ) { - MP4WriteSample ( MP4hFile, MP4track, (const unsigned __int8 *)bitbuf.get_ptr(), bytesWritten, dur ); - } else { - m_reader->write ( bitbuf.get_ptr(), bytesWritten ); - } - - samples_left -= frameSize; - } - } - - faacEncClose ( hEncoder ); - hEncoder = 0; - } - - if ( m_reader ) { - bool success = !encode_error && (m_reader->get_length() > 0); - - if ( success ) { - write_tag(); - console::info ( "Encoding finished successfully" ); - } - - if ( create_mp4 ) { - MP4Close ( MP4hFile ); - MP4hFile = 0; - } - - m_reader->reader_release(); - m_reader = 0; - - if ( !success ) { - console::info ( "Encoding failed" ); - file::g_remove ( path ); - } - } - } - - virtual const char *get_config_page_name() { return "FAAC encoder"; } - -private: - int write_tag() - { - info.info_remove_all(); - - if ( !create_mp4 ) { - return tag_writer::g_run ( m_reader, &info, "ape" ); - } else { - MP4SetMetadataTool ( MP4hFile, "libfaac version " FAAC_VERSION ); - - for ( int i = 0; i < info.meta_get_count(); i++ ) { - char *pName = (char *)info.meta_enum_name ( i ); - const char *val = info.meta_enum_value ( i ); - if ( !val || (val && !(*val)) ) continue; - - if ( !stricmp (pName, "TITLE") ) { - MP4SetMetadataName ( MP4hFile, val ); - } - else if ( !stricmp (pName, "ARTIST") ) { - MP4SetMetadataArtist ( MP4hFile, val ); - } - else if ( !stricmp (pName, "WRITER") ) { - MP4SetMetadataWriter ( MP4hFile, val ); - } - else if ( !stricmp (pName, "ALBUM") ) { - MP4SetMetadataAlbum ( MP4hFile, val ); - } - else if ( !stricmp (pName, "YEAR") || !stricmp (pName, "DATE") ) { - MP4SetMetadataYear ( MP4hFile, val ); - } - else if ( !stricmp (pName, "COMMENT") ) { - MP4SetMetadataComment ( MP4hFile, val ); - } - else if ( !stricmp (pName, "GENRE") ) { - MP4SetMetadataGenre ( MP4hFile, val ); - } - else if ( !stricmp (pName, "TRACKNUMBER") ) { - unsigned __int16 trkn = atoi ( val ), tot = 0; - MP4SetMetadataTrack ( MP4hFile, trkn, tot ); - } - else if ( !stricmp (pName, "DISKNUMBER") || !stricmp (pName, "DISC") ) { - unsigned __int16 disk = atoi ( val ), tot = 0; - MP4SetMetadataDisk ( MP4hFile, disk, tot ); - } - else if ( !stricmp (pName, "COMPILATION") ) { - unsigned __int8 cpil = atoi ( val ); - MP4SetMetadataCompilation ( MP4hFile, cpil ); - } - else if ( !stricmp (pName, "TEMPO") ) { - unsigned __int16 tempo = atoi ( val ); - MP4SetMetadataTempo ( MP4hFile, tempo ); - } else { - MP4SetMetadataFreeForm ( MP4hFile, pName, (unsigned __int8*)val, strlen(val) ); - } - } - - return 1; - } - } - - int *mkChanMap ( int channels, int center, int lf ) - { - if ( !center && !lf ) return 0; - if ( channels < 3 ) return 0; - - if ( lf > 0 ) { - lf--; - } else { - lf = channels - 1; // default AAC position - } - - if ( center > 0 ) { - center--; - } else { - center = 0; // default AAC position - } - - int *map = (int *)calloc ( channels, sizeof(map[0]) ); - - int outpos = 0; - if ( (center >= 0) && (center < channels) ) map[outpos++] = center; - - int inpos = 0; - for ( ; outpos < (channels - 1); inpos++ ) { - if ( inpos == center ) continue; - if ( inpos == lf ) continue; - - map[outpos++] = inpos; - } - - if ( outpos < channels ) { - if ( (lf >= 0) && (lf < channels) ) { - map[outpos] = lf; - } else { - map[outpos] = inpos; - } - } - - return map; - } - - void chan_remap ( int *buf, unsigned int channels, unsigned int blocks, int *map ) - { - int *tmp = (int *)alloca ( channels * sizeof(int) ); - - for ( unsigned int i = 0; i < blocks; i++ ) { - memcpy ( tmp, buf + i * channels, sizeof(int) * channels ); - - for ( unsigned int chn = 0; chn < channels; chn++ ) { - buf[i * channels + chn] = tmp[map[chn]]; - } - } - } - - // MP4 I/O callbacks - static unsigned __int32 open_cb ( const char *pName, const char *mode, void *userData ) { return 1; } - - static void close_cb ( void *userData ) { return; } - - static unsigned __int32 read_cb ( void *pBuffer, unsigned int nBytesToRead, void *userData ) - { - reader *r = (reader *)userData; - return r->read ( pBuffer, nBytesToRead ); - } - - static unsigned __int32 write_cb ( void *pBuffer, unsigned int nBytesToWrite, void *userData ) - { - reader *r = (reader *)userData; - return r->write ( pBuffer, nBytesToWrite ); - } - - static __int64 getpos_cb ( void *userData ) - { - reader *r = (reader *)userData; - return r->get_position(); - } - - static __int32 setpos_cb ( unsigned __int32 pos, void *userData ) - { - reader *r = (reader *)userData; - return !r->seek ( pos ); - } - - static __int64 filesize_cb ( void *userData ) - { - reader *r = (reader *)userData; - return r->get_length(); - } -}; - -// ------------------------------------- - -typedef struct { - int mp4; - char name[4]; -} format_list_t; - -static format_list_t format_list[] = { - { FF_MP4, "MP4" }, - { FF_M4A, "M4A" }, - { FF_AAC, "AAC" }, -}; - -typedef struct { - int profile; - char name[6]; -} profile_list_t; - -static profile_list_t profile_list[] = { - { LOW, "LC" }, - { MAIN, "Main" }, - { LTP, "LTP" }, -}; - -typedef struct { - int cutoff; - char name[10]; -} cutoff_list_t; - -static cutoff_list_t cutoff_list[] = { - { -1, "Automatic" }, - { 0, "Full" }, - { 20000, "20000" }, - { 19000, "19000" }, - { 18000, "18000" }, - { 17000, "17000" }, - { 16000, "16000" }, - { 15000, "15000" }, - { 14000, "14000" }, - { 13000, "13000" }, - { 12000, "12000" }, - { 11000, "11000" }, - { 10000, "10000" }, -}; - -#define QQ_MIN 10 -#define QQ_MAX 500 -#define AB_MIN 8 -#define AB_MAX 384 - -class config_faac : public config { - static void update ( HWND wnd ) - { - int i; - HWND wnd_format = GetDlgItem ( wnd, IDC_FORMAT ); - HWND wnd_profile = GetDlgItem ( wnd, IDC_PROFILE ); - HWND wnd_cutoff = GetDlgItem ( wnd, IDC_CUTOFF ); - - for ( i = 0; i < sizeof(format_list)/sizeof(*format_list); i++ ) { - if ( (cfg_mp4container == format_list[i].mp4) ) { - uSendMessage ( wnd_format, CB_SETCURSEL, i, 0 ); - break; - } - } - - for ( i = 0; i < sizeof(profile_list)/sizeof(*profile_list); i++ ) { - if ( cfg_objecttype == profile_list[i].profile ) { - uSendMessage ( wnd_profile, CB_SETCURSEL, i, 0 ); - break; - } - } - - bool cutoff_found = false; - - for ( i = 0; i < sizeof(cutoff_list)/sizeof(*cutoff_list); i++ ) { - if ( cfg_cutoff == cutoff_list[i].cutoff ) { - uSendMessage ( wnd_cutoff, CB_SETCURSEL, i, 0 ); - cutoff_found = true; - break; - } - } - - if ( !cutoff_found ) uSetDlgItemText ( wnd, IDC_CUTOFF, string_printf ("%i", (int)cfg_cutoff) ); - - uSendDlgItemMessage ( wnd, IDC_QUANTQUAL_SLIDER, TBM_SETPOS, 1, cfg_quantqual ); - uSetDlgItemText ( wnd, IDC_QUANTQUAL_EDIT, string_printf ("%i", (int)cfg_quantqual) ); - - uSendDlgItemMessage ( wnd, IDC_AVGBRATE_SLIDER, TBM_SETPOS, 1, cfg_avgbrate ); - uSetDlgItemText ( wnd, IDC_AVGBRATE_EDIT, string_printf ("%i", (int)cfg_avgbrate) ); - - CheckDlgButton ( wnd, IDC_USE_QQ, cfg_use_qq ); - CheckDlgButton ( wnd, IDC_USE_AB, cfg_use_ab ); - - CheckDlgButton ( wnd, IDC_MIDSIDE, cfg_midside ); - CheckDlgButton ( wnd, IDC_TNS, cfg_tns ); - } - - static BOOL CALLBACK ConfigProc ( HWND wnd, UINT msg, WPARAM wp, LPARAM lp ) - { - HWND wnd_format = GetDlgItem ( wnd, IDC_FORMAT ); - HWND wnd_profile = GetDlgItem ( wnd, IDC_PROFILE ); - HWND wnd_cutoff = GetDlgItem ( wnd, IDC_CUTOFF ); - - switch ( msg ) { - case WM_INITDIALOG: - { - int i; - - for ( i = 0; i < sizeof(format_list)/sizeof(*format_list); i++ ) { - uSendMessageText ( wnd_format, CB_ADDSTRING, 0, format_list[i].name ); - } - - for ( i = 0; i < sizeof(profile_list)/sizeof(*profile_list); i++ ) { - uSendMessageText ( wnd_profile, CB_ADDSTRING, 0, profile_list[i].name ); - } - - for ( i = 0; i < sizeof(cutoff_list)/sizeof(*cutoff_list); i++ ) { - uSendMessageText ( wnd_cutoff, CB_ADDSTRING, 0, cutoff_list[i].name ); - } - - uSendDlgItemMessage ( wnd, IDC_QUANTQUAL_SLIDER, TBM_SETRANGE, 0, MAKELONG(QQ_MIN, QQ_MAX) ); - uSendDlgItemMessage ( wnd, IDC_AVGBRATE_SLIDER, TBM_SETRANGE, 0, MAKELONG(AB_MIN, AB_MAX) ); - - update ( wnd ); - } - return TRUE; - - case WM_COMMAND: - switch ( wp ) { - case IDC_FORMAT | (CBN_SELCHANGE<<16): - { - int t = (int)uSendMessage ( wnd_format, CB_GETCURSEL, 0, 0 ); - if ( t >= 0 ) cfg_mp4container = format_list[t].mp4; - } - break; - - case IDC_PROFILE | (CBN_SELCHANGE<<16): - { - int t = (int)uSendMessage ( wnd_profile, CB_GETCURSEL, 0, 0 ); - if ( t >= 0 ) cfg_objecttype = profile_list[t].profile; - } - break; - - case IDC_QUANTQUAL_EDIT | (EN_KILLFOCUS<<16): - { - cfg_quantqual = GetDlgItemInt ( wnd, IDC_QUANTQUAL_EDIT, 0, 0 ); - if ( cfg_quantqual < QQ_MIN || cfg_quantqual > QQ_MAX ) { - if ( cfg_quantqual < QQ_MIN ) { - cfg_quantqual = QQ_MIN; - } else { - cfg_quantqual = QQ_MAX; - } - uSetDlgItemText ( wnd, IDC_QUANTQUAL_EDIT, string_printf ("%i", (int)cfg_quantqual) ); - } - uSendDlgItemMessage ( wnd, IDC_QUANTQUAL_SLIDER, TBM_SETPOS, 1, cfg_quantqual ); - } - break; - - case IDC_AVGBRATE_EDIT | (EN_KILLFOCUS<<16): - { - cfg_avgbrate = GetDlgItemInt ( wnd, IDC_AVGBRATE_EDIT, 0, 0 ); - if ( cfg_avgbrate < AB_MIN || cfg_quantqual > AB_MAX ) { - if ( cfg_avgbrate< AB_MIN ) { - cfg_avgbrate = AB_MIN; - } else { - cfg_avgbrate = AB_MAX; - } - uSetDlgItemText ( wnd, IDC_AVGBRATE_EDIT, string_printf ("%i", (int)cfg_avgbrate) ); - } - uSendDlgItemMessage ( wnd, IDC_AVGBRATE_SLIDER, TBM_SETPOS, 1, cfg_avgbrate ); - } - break; - - case IDC_CUTOFF | (CBN_SELCHANGE<<16): - { - int t = (int)uSendMessage ( wnd_cutoff, CB_GETCURSEL, 0, 0 ); - if ( t >= 0 ) cfg_cutoff = cutoff_list[t].cutoff; - } - break; - - case IDC_CUTOFF | (CBN_KILLFOCUS<<16): - { - int t = (int)uSendMessage ( wnd_cutoff, CB_GETCURSEL, 0, 0 ); - if ( t < 0 ) { - cfg_cutoff = GetDlgItemInt ( wnd, IDC_CUTOFF, 0, 0 ); - if ( cfg_cutoff > 0 && cfg_cutoff < 100 ) { - cfg_cutoff = 100; - uSetDlgItemText ( wnd, IDC_CUTOFF, string_printf ("%i", (int)cfg_cutoff) ); - } - else if ( cfg_cutoff <= 0 ) { - uSendMessage ( wnd_cutoff, CB_SETCURSEL, 0, 0 ); - cfg_cutoff = cutoff_list[0].cutoff; - } - } - } - break; - - case IDC_MIDSIDE: - { - cfg_midside = !cfg_midside; - } - break; - - case IDC_TNS: - { - cfg_tns = !cfg_tns; - } - break; - - case IDC_USE_QQ: - { - cfg_use_qq = !cfg_use_qq; - } - break; - - case IDC_USE_AB: - { - cfg_use_ab = !cfg_use_ab; - } - break; - - case IDC_DEFAULTS: - { - cfg_objecttype = FF_DEFAULT_OBJECTTYPE; - cfg_midside = FF_DEFAULT_MIDSIDE; - cfg_tns = FF_DEFAULT_TNS; - cfg_avgbrate = FF_DEFAULT_AVGBRATE; - cfg_quantqual = FF_DEFAULT_QUANTQUAL; - cfg_cutoff = FF_DEFAULT_CUTOFF; - cfg_use_qq = FF_DEFAULT_USE_QQ; - cfg_use_ab = FF_DEFAULT_USE_AB; - update ( wnd ); - } - break; - } - break; - - case WM_HSCROLL: - switch ( uGetWindowLong((HWND)lp, GWL_ID) ) { - case IDC_QUANTQUAL_SLIDER: - cfg_quantqual = uSendMessage ( (HWND)lp, TBM_GETPOS, 0, 0 ); - uSetDlgItemText ( wnd, IDC_QUANTQUAL_EDIT, string_printf ("%i", (int)cfg_quantqual) ); - break; - - case IDC_AVGBRATE_SLIDER: - cfg_avgbrate = uSendMessage ( (HWND)lp, TBM_GETPOS, 0, 0 ); - uSetDlgItemText ( wnd, IDC_AVGBRATE_EDIT, string_printf ("%i", (int)cfg_avgbrate) ); - break; - } - break; - } - - return FALSE; - } - - virtual HWND create ( HWND parent ) { - return uCreateDialog ( IDD_CONFIG, parent, ConfigProc ); - } - - virtual const char *get_name() { return "FAAC encoder"; } - - virtual const char *get_parent_name() { return "Diskwriter"; } -}; - -static service_factory_t foo_faac; -static service_factory_single_t foo_faac_cfg; diff -Nru faac-1.26/plugins/foo_faac/foo_faac.dsp faac-1.28/plugins/foo_faac/foo_faac.dsp --- faac-1.26/plugins/foo_faac/foo_faac.dsp 2003-12-11 18:24:55.000000000 +0000 +++ faac-1.28/plugins/foo_faac/foo_faac.dsp 1970-01-01 00:00:00.000000000 +0000 @@ -1,116 +0,0 @@ -# Microsoft Developer Studio Project File - Name="foo_faac" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=foo_faac - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "foo_faac.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "foo_faac.mak" CFG="foo_faac - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "foo_faac - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "foo_faac - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=xicl6.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "foo_faac - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "foo_faac_EXPORTS" /YX /FD /c -# ADD CPP /nologo /G6 /MD /W3 /O1 /I "../../../faac/include" /I "../../../faac/libfaac" /I "..\..\..\faad2\common\mp4v2" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=xilink6.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /dll /machine:I386 - -!ELSEIF "$(CFG)" == "foo_faac - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "foo_faac_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../faac/include" /I "../../../faac/libfaac" /I "..\..\..\faad2\common\mp4v2" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=xilink6.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "foo_faac - Win32 Release" -# Name "foo_faac - Win32 Debug" -# Begin Group "faac" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\..\..\faac\include\faac.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\faac\libfaac\version.h -# End Source File -# End Group -# Begin Source File - -SOURCE=.\foo_faac.cpp -# ADD CPP /I "../SDK" /I "../../mpc/include" /I "../../ogg/include" -# End Source File -# Begin Source File - -SOURCE=.\foo_faac.rc -# End Source File -# Begin Source File - -SOURCE=.\resource.h -# End Source File -# End Target -# End Project diff -Nru faac-1.26/plugins/foo_faac/foo_faac.dsw faac-1.28/plugins/foo_faac/foo_faac.dsw --- faac-1.26/plugins/foo_faac/foo_faac.dsw 2003-08-17 19:55:04.000000000 +0000 +++ faac-1.28/plugins/foo_faac/foo_faac.dsw 1970-01-01 00:00:00.000000000 +0000 @@ -1,125 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "foo_faac"=.\foo_faac.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name foobar2000_SDK - End Project Dependency - Begin Project Dependency - Project_Dep_Name pfc - End Project Dependency - Begin Project Dependency - Project_Dep_Name foobar2000_component_client - End Project Dependency - Begin Project Dependency - Project_Dep_Name libfaac - End Project Dependency - Begin Project Dependency - Project_Dep_Name utf8api - End Project Dependency - Begin Project Dependency - Project_Dep_Name libmp4v2_cb - End Project Dependency -}}} - -############################################################################### - -Project: "foobar2000_SDK"=..\SDK\foobar2000_SDK.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name utf8api - End Project Dependency -}}} - -############################################################################### - -Project: "foobar2000_component_client"=..\foobar2000_component_client\foobar2000_component_client.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "libfaac"=..\..\..\faac\libfaac\libfaac.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "libmp4v2_cb"=..\..\..\faad2\common\mp4v2\libmp4v2_cb.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "pfc"=..\..\pfc\pfc.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "utf8api"=..\utf8api\utf8api.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name pfc - End Project Dependency -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff -Nru faac-1.26/plugins/foo_faac/foo_faac.rc faac-1.28/plugins/foo_faac/foo_faac.rc --- faac-1.26/plugins/foo_faac/foo_faac.rc 2003-12-11 18:24:55.000000000 +0000 +++ faac-1.28/plugins/foo_faac/foo_faac.rc 1970-01-01 00:00:00.000000000 +0000 @@ -1,121 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_CONFIG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 293 - TOPMARGIN, 7 - BOTTOMMARGIN, 183 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_CONFIG DIALOG DISCARDABLE 0, 0, 300, 190 -STYLE WS_CHILD -FONT 8, "Tahoma" -BEGIN - LTEXT "Output format:",IDC_STATIC,13,16,54,8 - COMBOBOX IDC_FORMAT,68,14,53,50,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP - LTEXT "AAC profile:",IDC_STATIC,21,76,42,8 - COMBOBOX IDC_PROFILE,81,74,60,64,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP - EDITTEXT IDC_QUANTQUAL_EDIT,233,41,32,12,ES_CENTER | - ES_AUTOHSCROLL | ES_NUMBER - LTEXT "Bandwidth (Hz):",IDC_STATIC,21,92,56,8 - CONTROL "Use mid/side coding",IDC_MIDSIDE,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,21,107,79,10 - CONTROL "Use TNS",IDC_TNS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 21,120,43,10 - COMBOBOX IDC_CUTOFF,81,90,60,160,CBS_DROPDOWN | WS_VSCROLL | - WS_TABSTOP - CONTROL "Slider2",IDC_QUANTQUAL_SLIDER,"msctls_trackbar32", - WS_TABSTOP,97,41,132,11 - GROUPBOX "Encoder settings",IDC_STATIC,14,31,258,107 - PUSHBUTTON "Defaults",IDC_DEFAULTS,225,116,40,14 - CONTROL "Quantizer quality:",IDC_USE_QQ,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,21,43,73,10 - CONTROL "Bitrate/ch (kbps):",IDC_USE_AB,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,21,58,72,10 - CONTROL "Slider2",IDC_AVGBRATE_SLIDER,"msctls_trackbar32", - WS_TABSTOP,97,57,132,11 - EDITTEXT IDC_AVGBRATE_EDIT,233,57,32,12,ES_CENTER | - ES_AUTOHSCROLL | ES_NUMBER -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff -Nru faac-1.26/plugins/foo_faac/resource.h faac-1.28/plugins/foo_faac/resource.h --- faac-1.26/plugins/foo_faac/resource.h 2003-12-11 18:24:55.000000000 +0000 +++ faac-1.28/plugins/foo_faac/resource.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by foo_faac.rc -// -#define IDD_CONFIG 116 -#define IDC_FORMAT 1000 -#define IDC_USE_QQ 1001 -#define IDC_USE_AB 1002 -#define IDC_QUANTQUAL_SLIDER 1003 -#define IDC_AVGBRATE_SLIDER 1004 -#define IDC_QUANTQUAL_EDIT 1005 -#define IDC_AVGBRATE_EDIT 1006 -#define IDC_PROFILE 1007 -#define IDC_CUTOFF 1008 -#define IDC_MIDSIDE 1009 -#define IDC_TNS 1010 -#define IDC_DEFAULTS 1011 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 105 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1012 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff -Nru faac-1.26/plugins/winamp/Copying faac-1.28/plugins/winamp/Copying --- faac-1.26/plugins/winamp/Copying 2002-09-30 13:35:08.000000000 +0000 +++ faac-1.28/plugins/winamp/Copying 1970-01-01 00:00:00.000000000 +0000 @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, 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 Library 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 - - Appendix: 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) 19yy - - 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., 675 Mass Ave, Cambridge, MA 02139, 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) 19yy 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 Library General -Public License instead of this License. diff -Nru faac-1.26/plugins/winamp/defines.h faac-1.28/plugins/winamp/defines.h --- faac-1.26/plugins/winamp/defines.h 2004-11-21 16:27:20.000000000 +0000 +++ faac-1.28/plugins/winamp/defines.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -/* -FAAC - codec plugin for Cooledit -Copyright (C) 2002-2004 Antonio Foranna - -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. - -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., 675 Mass Ave, Cambridge, MA 02139, USA. - -The author can be contacted at: -ntnfrn_email-temp@yahoo.it -*/ - -#define APP_NAME "MPEG4-AAC encoder" -#define APP_VER "v1.7" -#define REGISTRY_PROGRAM_NAME "SOFTWARE\\4N\\Winamp\\Out_AAC" - -#define USE_OUTPUT_FOLDER -#define USE_IMPORT_TAG -//#define USE_PATHEXT - -// ----------------------------------------------------------------------------------------------- - -#define FREE_ARRAY(ptr) \ -{ \ - if(ptr!=NULL) \ - free(ptr); \ - ptr=NULL; \ -} - -// ----------------------------------------------------------------------------------------------- - -#define GLOBALLOCK(ptr,handle,type,ret) \ -{ \ - if(!(ptr=(type *)GlobalLock(handle))) \ - { \ - MessageBox(0, "GlobalLock", APP_NAME " plugin", MB_OK|MB_ICONSTOP); \ - ret; \ - } \ -} diff -Nru faac-1.26/plugins/winamp/FILTERS.H faac-1.28/plugins/winamp/FILTERS.H --- faac-1.26/plugins/winamp/FILTERS.H 2001-10-11 09:53:44.000000000 +0000 +++ faac-1.28/plugins/winamp/FILTERS.H 1970-01-01 00:00:00.000000000 +0000 @@ -1,121 +0,0 @@ -////////////////////////////////////////////////////// -// GENERAL PURPOSE DEFS FOR CREATING CUSTOM FILTERS // -////////////////////////////////////////////////////// - - -typedef struct riffspecialdata_t -{ HANDLE hSpecialData; - HANDLE hData; // Actual data handle - DWORD dwSize; // size of data in handle - DWORD dwExtra; // optional extra data (usually a count) - char szListType[8]; // Parent list type (usually "WAVE" or "INFO", or "adtl") - char szType[8]; // Usually a four character code for data, but can be up to 7 chars -} SPECIALDATA; - -// "CUE " dwExtra=number of cues, each cue is 8 bytes ([4] name [4] sample offset) -// "LTXT" dwExtra=number of items, each one is 8 bytes ([4] ltxt len [4] name [4] cue length [4] purpose [n] data) -// "NOTE" dwExtra=number of strings, each one is n bytes ([4] name [n-4] length zero term) -// "LABL" dwExtra=number of strings, each one is n bytes ([4] name [n-4] length zero term) -// "PLST" dwExtra=number if items, each one is 16 bytes ([4] name [4] dwLen [4] dwLoops [4] dwMode) - - -// For special data, .FLT must implement FilterGetFirstSpecialData and FilterGetNextSpecialData - - -typedef DWORD FOURCC; // a four character code - -struct cue_type { DWORD dwName; - DWORD dwPosition; - FOURCC fccChunk; - DWORD dwChunkStart; - DWORD dwBlockStart; - DWORD dwSampleOffset; - }; - -struct play_type {DWORD dwName; - DWORD dwLength; - DWORD dwLoops; - }; - - -typedef struct coolquery_tag - {char szName[24]; - char szCopyright[80]; - - // rate table, bits are set for modes that can be handled - WORD Quad32; // Quads are 3-D encoded - WORD Quad16; - WORD Quad8; - WORD Stereo8; // rates are from lowest bit: - WORD Stereo12; // bit 0 set: 5500 (5512.5) - WORD Stereo16; // bit 1 set: 11025 (11K) - WORD Stereo24; // bit 2 set: 22050 (22K) - WORD Stereo32; // bit 3 set: 32075 (32K, or 32000) - WORD Mono8; // bit 4 set: 44100 (44K) - WORD Mono12; // bit 5 set: 48000 (48K) - WORD Mono16; // bit 6 set: 88200 (88K) (future ultra-sonic rates?) - WORD Mono24; // bit 7 set: 96000 (96K) - WORD Mono32; // bit 8 set: 132300 (132K) - // bit 9 set: 176400 (176K) - DWORD dwFlags; - char szExt[4]; - long lChunkSize; - char szExt2[4]; - char szExt3[4]; - char szExt4[4]; - } COOLQUERY; - -#define R_5500 1 -#define R_11025 2 -#define R_22050 4 -#define R_32075 8 -#define R_44100 16 -#define R_48000 32 -#define R_88200 64 -#define R_96000 128 -#define R_132300 256 -#define R_176400 512 - -#define C_VALIDLIBRARY 1154 - -#define QF_RATEADJUSTABLE 0x001 // if can handle non-standard sample rates - // if not, only rates in bit rate table understood -#define QF_CANSAVE 0x002 -#define QF_CANLOAD 0x004 -#define QF_UNDERSTANDSALL 0x008 // will read ANYTHING, so it is the last resort if no other - // formats match -#define QF_READSPECIALFIRST 0x010 // read special info before trying to read data -#define QF_READSPECIALLAST 0x020 // read special info after reading data -#define QF_WRITESPECIALFIRST 0x040 // when writing a file, special info is sent to DLL before data -#define QF_WRITESPECIALLAST 0x080 // when writing, special info is sent to DLL after data -#define QF_HASOPTIONSBOX 0x100 // set if options box implemented -#define QF_NOASKFORCONVERT 0x200 // set to bypass asking for conversion if original in different rate, auto convert -#define QF_NOHEADER 0x400 // set if this is a raw data format with no header -#define QF_CANDO32BITFLOATS 0x800 // set if file format can handle 32-bit sample data for input -#define QF_CANOPENVIRTUAL 0x1000 // Set if data is in Intel 8-bit or 16-bit sample format, or floats - // and the GetDataOffset() function is implemented - -// special types are read from and written to DLL in the order below -/* -// special types (particular to Windows waveforms) -#define SP_IART 20 -#define SP_ICMT 21 -#define SP_ICOP 22 -#define SP_ICRD 23 -#define SP_IENG 24 -#define SP_IGNR 25 -#define SP_IKEY 26 -#define SP_IMED 27 -#define SP_INAM 28 -#define SP_ISFT 29 -#define SP_ISRC 30 -#define SP_ITCH 31 -#define SP_ISBJ 32 -#define SP_ISRF 33 -#define SP_DISP 34 -#define SP_CUE 40 // returns number of cues of size cue_type -#define SP_LTXT 41 // returns number of adtl texts of size 8 (4,id and 4,len) -#define SP_NOTE 42 // returns LO=size, HI=number of strings (sz sz sz...) -#define SP_LABL 43 // returns LO=size, HI=number of strings (sz sz sz...) -#define SP_PLST 44 // returns number of playlist entries size play_type -*/ \ No newline at end of file diff -Nru faac-1.26/plugins/winamp/Out_faac.cpp faac-1.28/plugins/winamp/Out_faac.cpp --- faac-1.26/plugins/winamp/Out_faac.cpp 2004-10-26 12:59:37.000000000 +0000 +++ faac-1.28/plugins/winamp/Out_faac.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,476 +0,0 @@ -/* -FAAC - codec plugin for Cooledit -Copyright (C) 2002-2004 Antonio Foranna - -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. - -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., 675 Mass Ave, Cambridge, MA 02139, USA. - -The author can be contacted at: -ntnfrn_email-temp@yahoo.it -*/ - -#include -#include "resource.h" -#include "out.h" -#include "wa_ipc.h" -#include "defines.h" -#include "EncDialog.h" -#include "Cfaac.h" - - -// ********************************************************************************************* - - -void Config(HWND); -void About(HWND); -void Init(); -void Quit(); -int Open(int, int, int, int, int); -void Close(); -int Write(char*, int); -int CanWrite(); -int IsPlaying(); -int Pause(int); -void SetVolume(int); -void SetPan(int); -void Flush(int); -int GetOutputTime(); -int GetWrittenTime(); - - - -Cfaac *Cpcmaac; -//char OutDir[MAX_PATH]=""; - -HINSTANCE hInstance=NULL; -HBITMAP hBmBrowse=NULL; -char config_AACoutdir[MAX_PATH]=""; - -static int srate, numchan, bps; -volatile int writtentime, w_offset; -static int last_pause=0; - - -Out_Module out = { - OUT_VER, - APP_NAME " " APP_VER, - NULL, - NULL, // hmainwindow - NULL, // hdllinstance - Config, - About, - Init, - Quit, - Open, - Close, - Write, - CanWrite, - IsPlaying, - Pause, - SetVolume, - SetPan, - Flush, - GetOutputTime, - GetWrittenTime -}; - - - -// ********************************************************************************************* - - - -Out_Module *winampGetOutModule() -{ - return &out; -} -// ********************************************************************************************* - -BOOL WINAPI DllMain (HINSTANCE hInst, DWORD ulReason, LPVOID lpReserved) -{ - switch(ulReason) - { - case DLL_PROCESS_ATTACH: - hInstance=hInst; - DisableThreadLibraryCalls((struct HINSTANCE__ *)hInst); - if(!hBmBrowse) - hBmBrowse=(HBITMAP)LoadImage(hInst,MAKEINTRESOURCE(IDB_BROWSE),IMAGE_BITMAP,0,0,/*LR_CREATEDIBSECTION|*/LR_LOADTRANSPARENT|LR_LOADMAP3DCOLORS); - - /* Code from LibMain inserted here. Return TRUE to keep the - DLL loaded or return FALSE to fail loading the DLL. - - You may have to modify the code in your original LibMain to - account for the fact that it may be called more than once. - You will get one DLL_PROCESS_ATTACH for each process that - loads the DLL. This is different from LibMain which gets - called only once when the DLL is loaded. The only time this - is critical is when you are using shared data sections. - If you are using shared data sections for statically - allocated data, you will need to be careful to initialize it - only once. Check your code carefully. - - Certain one-time initializations may now need to be done for - each process that attaches. You may also not need code from - your original LibMain because the operating system may now - be doing it for you. - */ - break; - - case DLL_THREAD_ATTACH: - /* Called each time a thread is created in a process that has - already loaded (attached to) this DLL. Does not get called - for each thread that exists in the process before it loaded - the DLL. - - Do thread-specific initialization here. - */ - break; - - case DLL_THREAD_DETACH: - /* Same as above, but called when a thread in the process - exits. - - Do thread-specific cleanup here. - */ - break; - - case DLL_PROCESS_DETACH: - hInstance=NULL; - if(hBmBrowse) - { - DeleteObject(hBmBrowse); - hBmBrowse=NULL; - } - /* Code from _WEP inserted here. This code may (like the - LibMain) not be necessary. Check to make certain that the - operating system is not doing it for you. - */ - break; - } - - /* The return value is only used for DLL_PROCESS_ATTACH; all other - conditions are ignored. - */ - return TRUE; // successful DLL_PROCESS_ATTACH -} - -// ********************************************************************************************* - -void About(HWND hWndDlg) -{ - DialogBox(out.hDllInstance, MAKEINTRESOURCE(IDD_ABOUT), hWndDlg, (DLGPROC)DialogMsgProcAbout); - -/*char buf[256]; - unsigned long samplesInput, maxBytesOutput; - faacEncHandle hEncoder = - faacEncOpen(44100, 2, &samplesInput, &maxBytesOutput); - faacEncConfigurationPtr myFormat = - faacEncGetCurrentConfiguration(hEncoder); - - sprintf(buf, - APP_NAME " %s by Antonio Foranna\n\n" - "This plugin uses FAAC encoder engine v%s\n\n" - "Compiled on %s\n", - APP_VER, - myFormat->name, - __DATE__ - ); - faacEncClose(hEncoder); - MessageBox(hWndDlg, buf, "About", MB_OK);*/ -} -// ********************************************************************************************* - -void Config(HWND hWnd) -{ - DialogBox(out.hDllInstance, MAKEINTRESOURCE(IDD_ENCODER), hWnd, DIALOGMsgProcEnc); -// dwOptions=DialogBoxParam((HINSTANCE)out.hDllInstance,(LPCSTR)MAKEINTRESOURCE(IDD_ENCODER), (HWND)hWnd, (DLGPROC)DIALOGMsgProc, dwOptions); -} - -// ********************************************************************************************* -// Utilities -// ********************************************************************************************* - -char *getSourceName(HWND hwnd) -{ -HANDLE hProcess; -DWORD processid; -char filename[MAX_PATH], *pname; -SIZE_T bread; -//HWND hdlgPE; - - memset(filename, 0, MAX_PATH); - GetWindowThreadProcessId(hwnd, &processid); - hProcess = OpenProcess(PROCESS_VM_READ, FALSE, processid); -// hdlgPE=SendMessage(hwnd,WM_WA_IPC,IPC_GETWND_PE,IPC_GETWND); - pname=(char*)SendMessage(hwnd,WM_WA_IPC,SendMessage(hwnd,WM_WA_IPC,0,IPC_GETLISTPOS),IPC_GETPLAYLISTFILE); - ReadProcessMemory(hProcess, pname, filename, MAX_PATH, &bread); - CloseHandle(hProcess); - return strdup(filename); -} - -char *getWASourceName(char *src) -{ -char *dst=NULL, *tmp=src; -int l; - if(!src) - { - if(dst=(char *)malloc(1)) - *dst='\0'; - return dst; - } - - while(*src && *src>='0' && *src<='9') - src++; - if(src[0]=='.' && src[1]==' ') - src+=2; - else - src=tmp; - if(!(dst=(char *)malloc(strlen(src)+1))) - return dst; - strcpy(dst,src); - l=strlen(src); - if(l>9 && !strcmpi(src+l-9," - Winamp")) - dst[l-9]='\0'; - // cut ext - tmp=dst+strlen(dst); - while(tmp!=dst && *tmp!='.') - tmp--; - if(*tmp=='.') - *tmp='\0'; - return dst; -} - -static char *scanstr_back(char *str, char *toscan, char *defval) -{ -char *s=str+strlen(str)-1; - - if (strlen(str) < 1) return defval; - if (strlen(toscan) < 1) return defval; - while (1) - { - char *t=toscan; - while (*t) - if (*t++ == *s) return s; - t=CharPrev(str,s); - if (t==s) return defval; - s=t; - } -} -//------------------------------------------------------------------------------------------ - -void GetNewFileName(char *lpstrFilename) -{ -char temp2[MAX_PATH]; -char *t,*p; - - GetWindowText(out.hMainWindow,temp2,sizeof(temp2)); - t=temp2; - - t=scanstr_back(temp2,"-",NULL); - if (t) t[-1]=0; - - if (temp2[0] && temp2[1] == '.') - { - char *p1,*p2; - p1=lpstrFilename; - p2=temp2; - while (*p2) *p1++=*p2++; - *p1=0; - p1 = temp2+1; - p2 = lpstrFilename; - while (*p2) - { - *p1++ = *p2++; - } - *p1=0; - temp2[0] = '0'; - } - p=temp2; - while (*p != '.' && *p) p++; - if (*p == '.') - { - *p = '-'; - p=CharNext(p); - } - while (*p) - { - if (*p == '.' || *p == '/' || *p == '\\' || *p == '*' || - *p == '?' || *p == ':' || *p == '+' || *p == '\"' || - *p == '\'' || *p == '|' || *p == '<' || *p == '>') *p = '_'; - p=CharNext(p); - } - - p=config_AACoutdir; - if (p[0]) while (p[1]) p++; - - if (!config_AACoutdir[0] || config_AACoutdir[0] == ' ') - Config(out.hMainWindow); - if (!config_AACoutdir[0]) - wsprintf(lpstrFilename,"%s.aac",temp2); - else if (p[0]=='\\') - wsprintf(lpstrFilename,"%s%s.aac",config_AACoutdir,temp2); - else - wsprintf(lpstrFilename,"%s\\%s.aac",config_AACoutdir,temp2); -} - -// ********************************************************************************************* -// Main functions -// ********************************************************************************************* - -void Init() -{ -} -// ********************************************************************************************* - -void Quit() -{ -} -// ********************************************************************************************* - -#define ERROR_O(msg) \ -{ \ - if(msg) \ - MessageBox(0, msg, "FAAC plugin", MB_OK); \ - Close(); \ - return -1; \ -} - -int Open(int lSamprate, int wChannels, int wBitsPerSample, int bufferlenms, int prebufferms) -{ -CMyEncCfg cfg; -char OutFilename[MAX_PATH], - *srcFilename=NULL; -// buf[MAX_PATH], -// *tsrcFilename; - - w_offset = writtentime = 0; - numchan = wChannels; - srate = lSamprate; - bps = wBitsPerSample; - - strcpy(config_AACoutdir,cfg.OutDir); - GetNewFileName(OutFilename); - - Cpcmaac=new Cfaac(); -#ifdef USE_IMPORT_TAG -/* GetWindowText(out.hMainWindow,buf,sizeof(buf)); - tsrcFilename=getWASourceName(buf); - srcFilename=Cpcmaac->getSourceFilename(cfg.TagSrcPath,tsrcFilename,cfg.TagSrcExt); - FREE_ARRAY(tsrcFilename);*/ - srcFilename=getSourceName(out.hMainWindow); -#endif - if(!Cpcmaac->Init(srcFilename,OutFilename,lSamprate,wBitsPerSample,wChannels,-1)) - ERROR_O(0); - - FREE_ARRAY(srcFilename); - return 0; -} -// ********************************************************************************************* - -void Close() -{ - if(Cpcmaac) - { - delete Cpcmaac; - Cpcmaac=NULL; - } -} -// ********************************************************************************************* - -int Write(char *wabuf, int len) -{ - writtentime+=len; - - if(Cpcmaac->processDataBufferized(Cpcmaac->hOutput,(BYTE *)wabuf,len)<0) - return -1; - -// Sleep(10); - return 0; -} -// ********************************************************************************************* - -int CanWrite() -{ - return last_pause ? 0 : 16*1024*1024; -// return last_pause ? 0 : mo->samplesInput*(mo->wBitsPerSample>>3); -} -// ********************************************************************************************* - -int IsPlaying() -{ - return 0; -} -// ********************************************************************************************* - -int Pause(int pause) -{ - int t=last_pause; - last_pause=pause; - return t; -} -// ********************************************************************************************* - -void SetVolume(int volume) -{ -} -// ********************************************************************************************* - -void SetPan(int pan) -{ -} -// ********************************************************************************************* - -void Flush(int t) -{ -int a; - - w_offset=0; - a = t - GetWrittenTime(); - w_offset=a; -} -// ********************************************************************************************* - -int GetOutputTime() -{ -int t=srate*numchan, - ms=writtentime, - l; - - if(t) - { - l=ms%t; - ms /= t; - ms *= 1000; - ms += (l*1000)/t; - if (bps == 16) ms/=2; - } - return ms + w_offset; -} -// ********************************************************************************************* - -int GetWrittenTime() -{ -int t=srate*numchan, - ms=writtentime, - l; - - if(t) - { - l=ms%t; - ms /= t; - ms *= 1000; - ms += (l*1000)/t; - if (bps == 16) ms/=2; - } - return ms + w_offset; -} diff -Nru faac-1.26/plugins/winamp/OUT_FAAC.DEF faac-1.28/plugins/winamp/OUT_FAAC.DEF --- faac-1.26/plugins/winamp/OUT_FAAC.DEF 2002-09-30 13:35:08.000000000 +0000 +++ faac-1.28/plugins/winamp/OUT_FAAC.DEF 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -LIBRARY - -EXPORTS - winampGetOutModule diff -Nru faac-1.26/plugins/winamp/Out_FAAC.dsp faac-1.28/plugins/winamp/Out_FAAC.dsp --- faac-1.26/plugins/winamp/Out_FAAC.dsp 2004-11-01 19:39:04.000000000 +0000 +++ faac-1.28/plugins/winamp/Out_FAAC.dsp 1970-01-01 00:00:00.000000000 +0000 @@ -1,179 +0,0 @@ -# Microsoft Developer Studio Project File - Name="Out_FAAC" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=Out_FAAC - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "Out_FAAC.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "Out_FAAC.mak" CFG="Out_FAAC - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "Out_FAAC - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "Out_FAAC - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=xicl6.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "Out_FAAC - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OUT_FAAC_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../../common/Cfaac" /I "../../include" /I "../../../faad2/include" /I "../../../faad2/common/faad" /I "../../common/mp4v2" /I "../../../faad2/common/id3lib/include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "WIN32_LEAN_AND_MEAN" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x410 /d "NDEBUG" -# ADD RSC /l 0x410 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=xilink6.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /machine:I386 /out:"Release/Out_AAC.dll" - -!ELSEIF "$(CFG)" == "Out_FAAC - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OUT_FAAC_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I "../../common/Cfaac" /I "../../include" /I "../../../faad2/include" /I "../../../faad2/common/faad" /I "../../common/mp4v2" /I "../../../faad2/common/id3lib/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "WIN32_LEAN_AND_MEAN" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x410 /d "_DEBUG" -# ADD RSC /l 0x410 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=xilink6.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"C:\Program Files\Audio\Gen\Winamp\Plugins\Out_AAC.dll" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "Out_FAAC - Win32 Release" -# Name "Out_FAAC - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\common\Cfaac\Cfaac.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\common\Cfaac\CRegistry.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\common\Cfaac\CTag.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\common\Cfaac\EncDialog.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\common\Cfaac\FAAC.rc -# End Source File -# Begin Source File - -SOURCE=.\Out_faac.cpp -# End Source File -# Begin Source File - -SOURCE=.\Out_FAAC.def -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\common\Cfaac\Cfaac.h -# End Source File -# Begin Source File - -SOURCE=..\..\common\Cfaac\CRegistry.h -# End Source File -# Begin Source File - -SOURCE=.\defines.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\faac.h -# End Source File -# Begin Source File - -SOURCE=.\FILTERS.H -# End Source File -# Begin Source File - -SOURCE=.\OUT.H -# End Source File -# Begin Source File - -SOURCE=..\..\common\Cfaac\resource.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=..\..\common\Cfaac\AudioCoding.bmp -# End Source File -# Begin Source File - -SOURCE=..\..\common\Cfaac\Email.bmp -# End Source File -# Begin Source File - -SOURCE="..\..\common\Cfaac\mpeg4ip-v.bmp" -# End Source File -# Begin Source File - -SOURCE=..\..\common\Cfaac\Open.bmp -# End Source File -# Begin Source File - -SOURCE=..\..\common\Cfaac\Open.ico -# End Source File -# End Group -# End Target -# End Project diff -Nru faac-1.26/plugins/winamp/out_FAAC.dsw faac-1.28/plugins/winamp/out_FAAC.dsw --- faac-1.26/plugins/winamp/out_FAAC.dsw 2004-10-26 12:59:37.000000000 +0000 +++ faac-1.28/plugins/winamp/out_FAAC.dsw 1970-01-01 00:00:00.000000000 +0000 @@ -1,89 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "Out_FAAC"=.\Out_FAAC.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name libfaac - End Project Dependency - Begin Project Dependency - Project_Dep_Name libmp4v2_st - End Project Dependency - Begin Project Dependency - Project_Dep_Name id3lib - End Project Dependency - Begin Project Dependency - Project_Dep_Name zlib - End Project Dependency -}}} - -############################################################################### - -Project: "id3lib"=..\..\..\faad2\common\id3lib\libprj\id3lib.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "libfaac"=..\..\libfaac\libfaac.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "libmp4v2_st"=..\..\..\faad2\common\mp4v2\libmp4v2_st60.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "zlib"=..\..\..\faad2\common\id3lib\zlib\prj\zlib.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff -Nru faac-1.26/plugins/winamp/OUT.H faac-1.28/plugins/winamp/OUT.H --- faac-1.26/plugins/winamp/OUT.H 2002-05-26 18:31:22.000000000 +0000 +++ faac-1.28/plugins/winamp/OUT.H 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -#define OUT_VER 0x10 -/* -#ifdef __cplusplus -extern "C" { -#endif -*/ - - -typedef struct -{ - int version; // module version (OUT_VER) - char *description; // description of module, with version string - int id; // module id. each input module gets its own. non-nullsoft modules should - // be >= 65536. - - HWND hMainWindow; // winamp's main window (filled in by winamp) - HINSTANCE hDllInstance; // DLL instance handle (filled in by winamp) - - void (*Config)(HWND hwndParent); // configuration dialog - void (*About)(HWND hwndParent); // about dialog - - void (*Init)(); // called when loaded - void (*Quit)(); // called when unloaded - - int (*Open)(int samplerate, int numchannels, int bitspersamp, int bufferlenms, int prebufferms); - // returns >=0 on success, <0 on failure - // NOTENOTENOTE: bufferlenms and prebufferms are ignored in most if not all output plug-ins. - // ... so don't expect the max latency returned to be what you asked for. - // returns max latency in ms (0 for diskwriters, etc) - // bufferlenms and prebufferms must be in ms. 0 to use defaults. - // prebufferms must be <= bufferlenms - - void (*Close)(); // close the ol' output device. - - int (*Write)(char *buf, int len); - // 0 on success. Len == bytes to write (<= 8192 always). buf is straight audio data. - // 1 returns not able to write (yet). Non-blocking, always. - - int (*CanWrite)(); // returns number of bytes possible to write at a given time. - // Never will decrease unless you call Write (or Close, heh) - - int (*IsPlaying)(); // non0 if output is still going or if data in buffers waiting to be - // written (i.e. closing while IsPlaying() returns 1 would truncate the song - - int (*Pause)(int pause); // returns previous pause state - - void (*SetVolume)(int volume); // volume is 0-255 - void (*SetPan)(int pan); // pan is -128 to 128 - - void (*Flush)(int t); // flushes buffers and restarts output at time t (in ms) - // (used for seeking) - - int (*GetOutputTime)(); // returns played time in MS - int (*GetWrittenTime)(); // returns time written in MS (used for synching up vis stuff) - -} Out_Module; - - -/* -#ifdef __cplusplus -} -#endif -*/ \ No newline at end of file diff -Nru faac-1.26/plugins/winamp/ReadMe.txt faac-1.28/plugins/winamp/ReadMe.txt --- faac-1.26/plugins/winamp/ReadMe.txt 2004-05-13 08:57:26.000000000 +0000 +++ faac-1.28/plugins/winamp/ReadMe.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -+-----------------------------------------------------------------+ -| | -| out_FAAC Readme | -| --------------- | -| | -+-----------------------------------------------------------------+ - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY. - ----------------------------------------------------------------------------- - -out_AAC is an encoder plugin for Winamp 2 and 5 to export .aac/.mp4 files. - -To use it: ----------- - -1) put FAAC and FAAD2 packages into the same folder; -2) open the project, set "Active Configuration = FAAC - win32 Release" and compile; -3) copy out_AAC.dll into Winamp\plugins folder. - ----------------------------------------------------------------------------- - -For suggestions, bugs report, etc., you can contact me at -ntnfrn_email-temp@yahoo.it diff -Nru faac-1.26/plugins/winamp/wa_ipc.h faac-1.28/plugins/winamp/wa_ipc.h --- faac-1.26/plugins/winamp/wa_ipc.h 2004-10-26 12:56:11.000000000 +0000 +++ faac-1.28/plugins/winamp/wa_ipc.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,1022 +0,0 @@ -/* -** Copyright (C) 2003 Nullsoft, Inc. -** -** This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held -** liable for any damages arising from the use of this software. -** -** Permission is granted to anyone to use this software for any purpose, including commercial applications, and to -** alter it and redistribute it freely, subject to the following restrictions: -** -** 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. -** If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. -** -** 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. -** -** 3. This notice may not be removed or altered from any source distribution. -** -*/ - -#ifndef _WA_IPC_H_ -#define _WA_IPC_H_ - -/* -** This is the modern replacement for the classic 'frontend.h'. Most of these -** updates are designed for in-process use, i.e. from a plugin. -** -*/ - -/* message used to sent many messages to winamp's main window. -** most all of the IPC_* messages involve sending the message in the form of: -** result = SendMessage(hwnd_winamp,WM_WA_IPC,(parameter),IPC_*); -*/ -#define WM_WA_IPC WM_USER -/* but some of them use WM_COPYDATA. be afraid. -*/ - -#define IPC_GETVERSION 0 -/* int version = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETVERSION); -** -** Version will be 0x20yx for winamp 2.yx. versions previous to Winamp 2.0 -** typically (but not always) use 0x1zyx for 1.zx versions. Weird, I know. -*/ - -#define IPC_GETREGISTEREDVERSION 770 - - -typedef struct { - char *filename; - char *title; - int length; -} enqueueFileWithMetaStruct; // send this to a IPC_PLAYFILE in a non WM_COPYDATA, -// and you get the nice desired result. if title is NULL, it is treated as a "thing", -// otherwise it's assumed to be a file (for speed) - -#define IPC_PLAYFILE 100 // dont be fooled, this is really the same as enqueufile -#define IPC_ENQUEUEFILE 100 -/* sent as a WM_COPYDATA, with IPC_PLAYFILE as the dwData, and the string to play -** as the lpData. Just enqueues, does not clear the playlist or change the playback -** state. -*/ - - -#define IPC_DELETE 101 -#define IPC_DELETE_INT 1101 // don't use this, it's used internally by winamp when - // dealing with some lame explorer issues. -/* SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_DELETE); -** Use IPC_DELETE to clear Winamp's internal playlist. -*/ - - -#define IPC_STARTPLAY 102 // starts playback. almost like hitting play in Winamp. -#define IPC_STARTPLAY_INT 1102 // used internally, don't bother using it (won't be any fun) - - -#define IPC_CHDIR 103 -/* sent as a WM_COPYDATA, with IPC_CHDIR as the dwData, and the directory to change to -** as the lpData. -*/ - - -#define IPC_ISPLAYING 104 -/* int res = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_ISPLAYING); -** If it returns 1, it is playing. if it returns 3, it is paused, -** if it returns 0, it is not playing. -*/ - - -#define IPC_GETOUTPUTTIME 105 -/* int res = SendMessage(hwnd_winamp,WM_WA_IPC,mode,IPC_GETOUTPUTTIME); -** returns the position in milliseconds of the current track (mode = 0), -** or the track length, in seconds (mode = 1). Returns -1 if not playing or error. -*/ - - -#define IPC_JUMPTOTIME 106 -/* (requires Winamp 1.60+) -** SendMessage(hwnd_winamp,WM_WA_IPC,ms,IPC_JUMPTOTIME); -** IPC_JUMPTOTIME sets the position in milliseconds of the -** current song (approximately). -** Returns -1 if not playing, 1 on eof, or 0 if successful -*/ - -#define IPC_GETMODULENAME 109 -#define IPC_EX_ISRIGHTEXE 666 -/* usually shouldnt bother using these, but here goes: -** send a WM_COPYDATA with IPC_GETMODULENAME, and an internal -** flag gets set, which if you send a normal WM_WA_IPC message with -** IPC_EX_ISRIGHTEXE, it returns whether or not that filename -** matches. lame, I know. -*/ - -#define IPC_WRITEPLAYLIST 120 -/* (requires Winamp 1.666+) -** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_WRITEPLAYLIST); -** -** IPC_WRITEPLAYLIST writes the current playlist to \\Winamp.m3u, -** and returns the current playlist position. -** Kinda obsoleted by some of the 2.x new stuff, but still good for when -** using a front-end (instead of a plug-in) -*/ - - -#define IPC_SETPLAYLISTPOS 121 -/* (requires Winamp 2.0+) -** SendMessage(hwnd_winamp,WM_WA_IPC,position,IPC_SETPLAYLISTPOS) -** IPC_SETPLAYLISTPOS sets the playlist position to 'position'. It -** does not change playback or anything, it just sets position, and -** updates the view if necessary -*/ - - -#define IPC_SETVOLUME 122 -/* (requires Winamp 2.0+) -** SendMessage(hwnd_winamp,WM_WA_IPC,volume,IPC_SETVOLUME); -** IPC_SETVOLUME sets the volume of Winamp (from 0-255). -*/ - - -#define IPC_SETPANNING 123 -/* (requires Winamp 2.0+) -** SendMessage(hwnd_winamp,WM_WA_IPC,panning,IPC_SETPANNING); -** IPC_SETPANNING sets the panning of Winamp (from 0 (left) to 255 (right)). -*/ - - -#define IPC_GETLISTLENGTH 124 -/* (requires Winamp 2.0+) -** int length = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTLENGTH); -** IPC_GETLISTLENGTH returns the length of the current playlist, in -** tracks. -*/ - - -#define IPC_GETLISTPOS 125 -/* (requires Winamp 2.05+) -** int pos=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTPOS); -** IPC_GETLISTPOS returns the playlist position. A lot like IPC_WRITEPLAYLIST -** only faster since it doesn't have to write out the list. Heh, silly me. -*/ - - -#define IPC_GETINFO 126 -/* (requires Winamp 2.05+) -** int inf=SendMessage(hwnd_winamp,WM_WA_IPC,mode,IPC_GETINFO); -** IPC_GETINFO returns info about the current playing song. The value -** it returns depends on the value of 'mode'. -** Mode Meaning -** ------------------ -** 0 Samplerate (i.e. 44100) -** 1 Bitrate (i.e. 128) -** 2 Channels (i.e. 2) -** 3 (5+) Video LOWORD=w HIWORD=h -** 4 (5+) > 65536, string (video description) -*/ - - -#define IPC_GETEQDATA 127 -/* (requires Winamp 2.05+) -** int data=SendMessage(hwnd_winamp,WM_WA_IPC,pos,IPC_GETEQDATA); -** IPC_GETEQDATA queries the status of the EQ. -** The value returned depends on what 'pos' is set to: -** Value Meaning -** ------------------ -** 0-9 The 10 bands of EQ data. 0-63 (+20db - -20db) -** 10 The preamp value. 0-63 (+20db - -20db) -** 11 Enabled. zero if disabled, nonzero if enabled. -** 12 Autoload. zero if disabled, nonzero if enabled. -*/ - - -#define IPC_SETEQDATA 128 -/* (requires Winamp 2.05+) -** SendMessage(hwnd_winamp,WM_WA_IPC,pos,IPC_GETEQDATA); -** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SETEQDATA); -** IPC_SETEQDATA sets the value of the last position retrieved -** by IPC_GETEQDATA. This is pretty lame, and we should provide -** an extended version that lets you do a MAKELPARAM(pos,value). -** someday... - - new (2.92+): - if the high byte is set to 0xDB, then the third byte specifies - which band, and the bottom word specifies the value. -*/ - -#define IPC_ADDBOOKMARK 129 -/* (requires Winamp 2.4+) -** Sent as a WM_COPYDATA, using IPC_ADDBOOKMARK, adds the specified -** file/url to the Winamp bookmark list. -*/ -/* -In winamp 5+, we use this as a normal WM_WA_IPC and the string: - - "filename\0title\0" - - to notify the library/bookmark editor that a bookmark -was added. Note that using this message in this context does not -actually add the bookmark. -do not use :) -*/ - - -#define IPC_INSTALLPLUGIN 130 -/* not implemented, but if it was you could do a WM_COPYDATA with -** a path to a .wpz, and it would install it. -*/ - - -#define IPC_RESTARTWINAMP 135 -/* (requires Winamp 2.2+) -** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_RESTARTWINAMP); -** IPC_RESTARTWINAMP will restart Winamp (isn't that obvious ? :) -*/ - - -#define IPC_ISFULLSTOP 400 -/* (requires winamp 2.7+ I think) -** ret=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_ISFULLSTOP); -** useful for when you're an output plugin, and you want to see -** if the stop/close is a full stop, or just between tracks. -** returns nonzero if it's full, zero if it's just a new track. -*/ - - -#define IPC_INETAVAILABLE 242 -/* (requires Winamp 2.05+) -** val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_INETAVAILABLE); -** IPC_INETAVAILABLE will return 1 if the Internet connection is available for Winamp. -*/ - - -#define IPC_UPDTITLE 243 -/* (requires Winamp 2.2+) -** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_UPDTITLE); -** IPC_UPDTITLE will ask Winamp to update the informations about the current title. -*/ - - -#define IPC_REFRESHPLCACHE 247 -/* (requires Winamp 2.2+) -** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_REFRESHPLCACHE); -** IPC_REFRESHPLCACHE will flush the playlist cache buffer. -** (send this if you want it to go refetch titles for tracks) -*/ - - -#define IPC_GET_SHUFFLE 250 -/* (requires Winamp 2.4+) -** val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_SHUFFLE); -** -** IPC_GET_SHUFFLE returns the status of the Shuffle option (1 if set) -*/ - - -#define IPC_GET_REPEAT 251 -/* (requires Winamp 2.4+) -** val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_REPEAT); -** -** IPC_GET_REPEAT returns the status of the Repeat option (1 if set) -*/ - - -#define IPC_SET_SHUFFLE 252 -/* (requires Winamp 2.4+) -** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SET_SHUFFLE); -** -** IPC_SET_SHUFFLE sets the status of the Shuffle option (1 to turn it on) -*/ - - -#define IPC_SET_REPEAT 253 -/* (requires Winamp 2.4+) -** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SET_REPEAT); -** -** IPC_SET_REPEAT sets the status of the Repeat option (1 to turn it on) -*/ - - -#define IPC_ENABLEDISABLE_ALL_WINDOWS 259 // 0xdeadbeef to disable -/* (requires Winamp 2.9+) -** SendMessage(hwnd_winamp,WM_WA_IPC,enable?0:0xdeadbeef,IPC_MBOPENREAL); -** sending with 0xdeadbeef as the param disables all winamp windows, -** any other values will enable all winamp windows. -*/ - - -#define IPC_GETWND 260 -/* (requires Winamp 2.9+) -** HWND h=SendMessage(hwnd_winamp,WM_WA_IPC,IPC_GETWND_xxx,IPC_GETWND); -** returns the HWND of the window specified. -*/ - #define IPC_GETWND_EQ 0 // use one of these for the param - #define IPC_GETWND_PE 1 - #define IPC_GETWND_MB 2 - #define IPC_GETWND_VIDEO 3 -#define IPC_ISWNDVISIBLE 261 // same param as IPC_GETWND - - - - -/************************************************************************ -***************** in-process only (WE LOVE PLUGINS) -************************************************************************/ - - -#define IPC_SETSKIN 200 -/* (requires Winamp 2.04+, only usable from plug-ins (not external apps)) -** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)"skinname",IPC_SETSKIN); -** IPC_SETSKIN sets the current skin to "skinname". Note that skinname -** can be the name of a skin, a skin .zip file, with or without path. -** If path isn't specified, the default search path is the winamp skins -** directory. -*/ - - -#define IPC_GETSKIN 201 -/* (requires Winamp 2.04+, only usable from plug-ins (not external apps)) -** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)skinname_buffer,IPC_GETSKIN); -** IPC_GETSKIN puts the directory where skin bitmaps can be found -** into skinname_buffer. -** skinname_buffer must be MAX_PATH characters in length. -** When using a .zip'd skin file, it'll return a temporary directory -** where the ZIP was decompressed. -*/ - - -#define IPC_EXECPLUG 202 -/* (requires Winamp 2.04+, only usable from plug-ins (not external apps)) -** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)"vis_file.dll",IPC_EXECPLUG); -** IPC_EXECPLUG executes a visualization plug-in pointed to by WPARAM. -** the format of this string can be: -** "vis_whatever.dll" -** "vis_whatever.dll,0" // (first mod, file in winamp plug-in dir) -** "C:\\dir\\vis_whatever.dll,1" -*/ - - -#define IPC_GETPLAYLISTFILE 211 -/* (requires Winamp 2.04+, only usable from plug-ins (not external apps)) -** char *name=SendMessage(hwnd_winamp,WM_WA_IPC,index,IPC_GETPLAYLISTFILE); -** IPC_GETPLAYLISTFILE gets the filename of the playlist entry [index]. -** returns a pointer to it. returns NULL on error. -*/ - - -#define IPC_GETPLAYLISTTITLE 212 -/* (requires Winamp 2.04+, only usable from plug-ins (not external apps)) -** char *name=SendMessage(hwnd_winamp,WM_WA_IPC,index,IPC_GETPLAYLISTTITLE); -** -** IPC_GETPLAYLISTTITLE gets the title of the playlist entry [index]. -** returns a pointer to it. returns NULL on error. -*/ - - -#define IPC_GETHTTPGETTER 240 -/* retrieves a function pointer to a HTTP retrieval function. -** if this is unsupported, returns 1 or 0. -** the function should be: -** int (*httpRetrieveFile)(HWND hwnd, char *url, char *file, char *dlgtitle); -** if you call this function, with a parent window, a URL, an output file, and a dialog title, -** it will return 0 on successful download, 1 on error. -*/ - - -#define IPC_MBOPEN 241 -/* (requires Winamp 2.05+) -** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_MBOPEN); -** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)url,IPC_MBOPEN); -** IPC_MBOPEN will open a new URL in the minibrowser. if url is NULL, it will open the Minibrowser window. -*/ - - - -#define IPC_CHANGECURRENTFILE 245 -/* (requires Winamp 2.05+) -** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)file,IPC_CHANGECURRENTFILE); -** IPC_CHANGECURRENTFILE will set the current playlist item. -*/ - - -#define IPC_GETMBURL 246 -/* (requires Winamp 2.2+) -** char buffer[4096]; // Urls can be VERY long -** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)buffer,IPC_GETMBURL); -** IPC_GETMBURL will retrieve the current Minibrowser URL into buffer. -** buffer must be at least 4096 bytes long. -*/ - - -#define IPC_MBBLOCK 248 -/* (requires Winamp 2.4+) -** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_MBBLOCK); -** -** IPC_MBBLOCK will block the Minibrowser from updates if value is set to 1 -*/ - -#define IPC_MBOPENREAL 249 -/* (requires Winamp 2.4+) -** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)url,IPC_MBOPENREAL); -** -** IPC_MBOPENREAL works the same as IPC_MBOPEN except that it will works even if -** IPC_MBBLOCK has been set to 1 -*/ - -#define IPC_ADJUST_OPTIONSMENUPOS 280 -/* (requires Winamp 2.9+) -** int newpos=SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)adjust_offset,IPC_ADJUST_OPTIONSMENUPOS); -** moves where winamp expects the Options menu in the main menu. Useful if you wish to insert a -** menu item above the options/skins/vis menus. -*/ - -#define IPC_GET_HMENU 281 -/* (requires Winamp 2.9+) -** HMENU hMenu=SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)0,IPC_GET_HMENU); -** values for data: -** 0 : main popup menu -** 1 : main menubar file menu -** 2 : main menubar options menu -** 3 : main menubar windows menu -** 4 : main menubar help menu -** other values will return NULL. -*/ - -#define IPC_GET_EXTENDED_FILE_INFO 290 //pass a pointer to the following struct in wParam -#define IPC_GET_EXTENDED_FILE_INFO_HOOKABLE 296 -/* (requires Winamp 2.9+) -** to use, create an extendedFileInfoStruct, point the values filename and metadata to the -** filename and metadata field you wish to query, and ret to a buffer, with retlen to the -** length of that buffer, and then SendMessage(hwnd_winamp,WM_WA_IPC,&struct,IPC_GET_EXTENDED_FILE_INFO); -** the results should be in the buffer pointed to by ret. -** returns 1 if the decoder supports a getExtendedFileInfo method -*/ -typedef struct { - char *filename; - char *metadata; - char *ret; - int retlen; -} extendedFileInfoStruct; - -#define IPC_GET_BASIC_FILE_INFO 291 //pass a pointer to the following struct in wParam -typedef struct { - char *filename; - - int quickCheck; // set to 0 to always get, 1 for quick, 2 for default (if 2, quickCheck will be set to 0 if quick wasnot used) - - // filled in by winamp - int length; - char *title; - int titlelen; -} basicFileInfoStruct; - -#define IPC_GET_EXTLIST 292 //returns doublenull delimited. GlobalFree() it when done. if data is 0, returns raw extlist, if 1, returns something suitable for getopenfilename - -#define IPC_INFOBOX 293 -typedef struct { - HWND parent; - char *filename; -} infoBoxParam; - -#define IPC_SET_EXTENDED_FILE_INFO 294 //pass a pointer to the a extendedFileInfoStruct in wParam -/* (requires Winamp 2.9+) -** to use, create an extendedFileInfoStruct, point the values filename and metadata to the -** filename and metadata field you wish to write in ret. (retlen is not used). and then -** SendMessage(hwnd_winamp,WM_WA_IPC,&struct,IPC_SET_EXTENDED_FILE_INFO); -** returns 1 if the metadata is supported -** Call IPC_WRITE_EXTENDED_FILE_INFO once you're done setting all the metadata you want to update -*/ - -#define IPC_WRITE_EXTENDED_FILE_INFO 295 -/* (requires Winamp 2.9+) -** writes all the metadata set thru IPC_SET_EXTENDED_FILE_INFO to the file -** returns 1 if the file has been successfully updated, 0 if error -*/ - -#define IPC_FORMAT_TITLE 297 -typedef struct -{ - char *spec; // NULL=default winamp spec - void *p; - - char *out; - int out_len; - - char * (*TAGFUNC)(char * tag, void * p); //return 0 if not found - void (*TAGFREEFUNC)(char * tag,void * p); -} waFormatTitle; - -#define IPC_GETUNCOMPRESSINTERFACE 331 -/* returns a function pointer to uncompress(). -** int (*uncompress)(unsigned char *dest, unsigned long *destLen, const unsigned char *source, unsigned long sourceLen); -** right out of zlib, useful for decompressing zlibbed data. -** if you pass the parm of 0x10100000, it will return a wa_inflate_struct * to an inflate API. -*/ - -typedef struct { - int (*inflateReset)(void *strm); - int (*inflateInit_)(void *strm,const char *version, int stream_size); - int (*inflate)(void *strm, int flush); - int (*inflateEnd)(void *strm); - unsigned long (*crc32)(unsigned long crc, const unsigned char *buf, unsigned int len); -} wa_inflate_struct; - - -#define IPC_ADD_PREFS_DLG 332 -#define IPC_REMOVE_PREFS_DLG 333 -/* (requires Winamp 2.9+) -** to use, allocate a prefsDlgRec structure (either on the heap or some global -** data, but NOT on the stack), initialze the members: -** hInst to the DLL instance where the resource is located -** dlgID to the ID of the dialog, -** proc to the window procedure for the dialog -** name to the name of the prefs page in the prefs. -** where to 0 (eventually we may add more options) -** then, SendMessage(hwnd_winamp,WM_WA_IPC,&prefsRec,IPC_ADD_PREFS_DLG); -** -** you can also IPC_REMOVE_PREFS_DLG with the address of the same prefsRec, -** but you shouldn't really ever have to. -** -*/ -#define IPC_OPENPREFSTOPAGE 380 // pass an id of a builtin page, or a &prefsDlgRec of prefs page to open - -typedef struct _prefsDlgRec { - HINSTANCE hInst; - int dlgID; - void *proc; - - char *name; - int where; // 0 for options, 1 for plugins, 2 for skins, 3 for bookmarks, 4 for prefs - - - int _id; - struct _prefsDlgRec *next; -} prefsDlgRec; - - -#define IPC_GETINIFILE 334 // returns a pointer to winamp.ini -#define IPC_GETINIDIRECTORY 335 // returns a pointer to the directory to put config files in (if you dont want to use winamp.ini) - -#define IPC_SPAWNBUTTONPOPUP 361 // param = -// 0 = eject -// 1 = previous -// 2 = next -// 3 = pause -// 4 = play -// 5 = stop - -#define IPC_OPENURLBOX 360 // pass a HWND to a parent, returns a HGLOBAL that needs to be freed with GlobalFree(), if successful -#define IPC_OPENFILEBOX 362 // pass a HWND to a parent -#define IPC_OPENDIRBOX 363 // pass a HWND to a parent - -// pass an HWND to a parent. call this if you take over the whole UI so that the dialogs are not appearing on the -// bottom right of the screen since the main winamp window is at 3000x3000, call again with NULL to reset -#define IPC_SETDIALOGBOXPARENT 364 - - - -// pass 0 for a copy of the skin HBITMAP -// pass 1 for name of font to use for playlist editor likeness -// pass 2 for font charset -// pass 3 for font size -#define IPC_GET_GENSKINBITMAP 503 - - -#define IPC_GET_EMBEDIF 505 // pass an embedWindowState -// returns an HWND embedWindow(embedWindowState *); if the data is NULL, otherwise returns the HWND directly -typedef struct -{ - HWND me; //hwnd of the window - - int flags; - - RECT r; - - void *user_ptr; // for application use - - int extra_data[64]; // for internal winamp use -} embedWindowState; - -#define EMBED_FLAGS_NORESIZE 1 // set this bit in embedWindowState.flags to keep window from being resizable -#define EMBED_FLAGS_NOTRANSPARENCY 2 // set this bit in embedWindowState.flags to make gen_ff turn transparency off for this wnd - - -#define IPC_EMBED_ENUM 532 -typedef struct embedEnumStruct -{ - int (*enumProc)(embedWindowState *ws, struct embedEnumStruct *param); // return 1 to abort - int user_data; // or more :) -} embedEnumStruct; - // pass - -#define IPC_EMBED_ISVALID 533 - -#define IPC_CONVERTFILE 506 -/* (requires Winamp 2.92+) -** Converts a given file to a different format (PCM, MP3, etc...) -** To use, pass a pointer to a waFileConvertStruct struct -** This struct can be either on the heap or some global -** data, but NOT on the stack. At least, until the conversion is done. -** -** eg: SendMessage(hwnd_winamp,WM_WA_IPC,&myConvertStruct,IPC_CONVERTFILE); -** -** Return value: -** 0: Can't start the conversion. Look at myConvertStruct->error for details. -** 1: Conversion started. Status messages will be sent to the specified callbackhwnd. -** Be sure to call IPC_CONVERTFILE_END when your callback window receives the -** IPC_CB_CONVERT_DONE message. -*/ -typedef struct -{ - char *sourcefile; // "c:\\source.mp3" - char *destfile; // "c:\\dest.pcm" - int destformat[8]; // like 'PCM ',srate,nch,bps - HWND callbackhwnd; // window that will receive the IPC_CB_CONVERT notification messages - - //filled in by winamp.exe - char *error; //if IPC_CONVERTFILE returns 0, the reason will be here - - int bytes_done; //you can look at both of these values for speed statistics - int bytes_total; - int bytes_out; - - int killswitch; // don't set it manually, use IPC_CONVERTFILE_END - int extra_data[64]; // for internal winamp use -} convertFileStruct; - -#define IPC_CONVERTFILE_END 507 -/* (requires Winamp 2.92+) -** Stop/ends a convert process started from IPC_CONVERTFILE -** You need to call this when you receive the IPC_CB_CONVERTDONE message or when you -** want to abort a conversion process -** -** eg: SendMessage(hwnd_winamp,WM_WA_IPC,&myConvertStruct,IPC_CONVERTFILE_END); -** -** No return value -*/ - -typedef struct { - HWND hwndParent; - int format; - - //filled in by winamp.exe - HWND hwndConfig; - int extra_data[8]; -} convertConfigStruct; -#define IPC_CONVERT_CONFIG 508 -#define IPC_CONVERT_CONFIG_END 509 - -typedef struct -{ - void (*enumProc)(int user_data, const char *desc, int fourcc); - int user_data; -} converterEnumFmtStruct; -#define IPC_CONVERT_CONFIG_ENUMFMTS 510 -/* (requires Winamp 2.92+) -*/ - - -typedef struct -{ - char cdletter; - char *playlist_file; - HWND callback_hwnd; - - //filled in by winamp.exe - char *error; -} burnCDStruct; -#define IPC_BURN_CD 511 -/* (requires Winamp 5.0+) -*/ - -typedef struct -{ - convertFileStruct *cfs; - int priority; -} convertSetPriority; -#define IPC_CONVERT_SET_PRIORITY 512 - -typedef struct -{ - char *filename; - char *title; // 2048 bytes - int length; - int force_useformatting; // can set this to 1 if you want to force a url to use title formatting shit -} waHookTitleStruct; -// return TRUE if you hook this -#define IPC_HOOK_TITLES 850 - -#define IPC_GETSADATAFUNC 800 -// 0: returns a char *export_sa_get() that returns 150 bytes of data -// 1: returns a export_sa_setreq(int want); - -#define IPC_ISMAINWNDVISIBLE 900 - - -#define IPC_SETPLEDITCOLORS 920 -typedef struct -{ - int numElems; - int *elems; - HBITMAP bm; // set if you want to override -} waSetPlColorsStruct; - - -// the following IPC use waSpawnMenuParms as parameter -#define IPC_SPAWNEQPRESETMENU 933 -#define IPC_SPAWNFILEMENU 934 //menubar -#define IPC_SPAWNOPTIONSMENU 935 //menubar -#define IPC_SPAWNWINDOWSMENU 936 //menubar -#define IPC_SPAWNHELPMENU 937 //menubar -#define IPC_SPAWNPLAYMENU 938 //menubar -#define IPC_SPAWNPEFILEMENU 939 //menubar -#define IPC_SPAWNPEPLAYLISTMENU 940 //menubar -#define IPC_SPAWNPESORTMENU 941 //menubar -#define IPC_SPAWNPEHELPMENU 942 //menubar -#define IPC_SPAWNMLFILEMENU 943 //menubar -#define IPC_SPAWNMLVIEWMENU 944 //menubar -#define IPC_SPAWNMLHELPMENU 945 //menubar -#define IPC_SPAWNPELISTOFPLAYLISTS 946 - -typedef struct -{ - HWND wnd; - int xpos; // in screen coordinates - int ypos; -} waSpawnMenuParms; - -// waSpawnMenuParms2 is used by the menubar submenus -typedef struct -{ - HWND wnd; - int xpos; // in screen coordinates - int ypos; - int width; - int height; -} waSpawnMenuParms2; - - -// system tray sends this (you might want to simulate it) -#define WM_WA_SYSTRAY WM_USER+1 - -// input plugins send this when they are done playing back -#define WM_WA_MPEG_EOF WM_USER+2 - - - -//// video stuff - -#define IPC_IS_PLAYING_VIDEO 501 // returns >1 if playing, 0 if not, 1 if old version (so who knows):) -#define IPC_GET_IVIDEOOUTPUT 500 // see below for IVideoOutput interface -#define VIDEO_MAKETYPE(A,B,C,D) ((A) | ((B)<<8) | ((C)<<16) | ((D)<<24)) -#define VIDUSER_SET_INFOSTRING 0x1000 -#define VIDUSER_GET_VIDEOHWND 0x1001 -#define VIDUSER_SET_VFLIP 0x1002 - -#ifndef NO_IVIDEO_DECLARE -#ifdef __cplusplus - -class VideoOutput; -class SubsItem; - -typedef struct { - unsigned char* baseAddr; - long rowBytes; -} YV12_PLANE; - -typedef struct { - YV12_PLANE y; - YV12_PLANE u; - YV12_PLANE v; -} YV12_PLANES; - -class IVideoOutput -{ - public: - virtual ~IVideoOutput() { } - virtual int open(int w, int h, int vflip, double aspectratio, unsigned int fmt)=0; - virtual void setcallback(LRESULT (*msgcallback)(void *token, HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam), void *token) { } - virtual void close()=0; - virtual void draw(void *frame)=0; - virtual void drawSubtitle(SubsItem *item) { } - virtual void showStatusMsg(const char *text) { } - virtual int get_latency() { return 0; } - virtual void notifyBufferState(int bufferstate) { } /* 0-255*/ - - virtual int extended(int param1, int param2, int param3) { return 0; } // Dispatchable, eat this! -}; -#endif //cplusplus -#endif//NO_IVIDEO_DECLARE - -// these messages are callbacks that you can grab by subclassing the winamp window - -// wParam = -#define IPC_CB_WND_EQ 0 // use one of these for the param -#define IPC_CB_WND_PE 1 -#define IPC_CB_WND_MB 2 -#define IPC_CB_WND_VIDEO 3 -#define IPC_CB_WND_MAIN 4 - -#define IPC_CB_ONSHOWWND 600 -#define IPC_CB_ONHIDEWND 601 - -#define IPC_CB_GETTOOLTIP 602 - -#define IPC_CB_MISC 603 - #define IPC_CB_MISC_TITLE 0 - #define IPC_CB_MISC_VOLUME 1 // volume/pan - #define IPC_CB_MISC_STATUS 2 - #define IPC_CB_MISC_EQ 3 - #define IPC_CB_MISC_INFO 4 - #define IPC_CB_MISC_VIDEOINFO 5 - -#define IPC_CB_CONVERT_STATUS 604 // param value goes from 0 to 100 (percent) -#define IPC_CB_CONVERT_DONE 605 - -#define IPC_ADJUST_FFWINDOWSMENUPOS 606 -/* (requires Winamp 2.9+) -** int newpos=SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)adjust_offset,IPC_ADJUST_FFWINDOWSMENUPOS); -** moves where winamp expects the freeform windows in the menubar windows main menu. Useful if you wish to insert a -** menu item above extra freeform windows. -*/ - -#define IPC_ISDOUBLESIZE 608 - -#define IPC_ADJUST_FFOPTIONSMENUPOS 609 -/* (requires Winamp 2.9+) -** int newpos=SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)adjust_offset,IPC_ADJUST_FFOPTIONSMENUPOS); -** moves where winamp expects the freeform preferences item in the menubar windows main menu. Useful if you wish to insert a -** menu item above preferences item. -*/ - -#define IPC_GETTIMEDISPLAYMODE 610 // returns 0 if displaying elapsed time or 1 if displaying remaining time - -#define IPC_SETVISWND 611 // param is hwnd, setting this allows you to receive ID_VIS_NEXT/PREVOUS/RANDOM/FS wm_commands -#define ID_VIS_NEXT 40382 -#define ID_VIS_PREV 40383 -#define ID_VIS_RANDOM 40384 -#define ID_VIS_FS 40389 -#define ID_VIS_CFG 40390 -#define ID_VIS_MENU 40391 - -#define IPC_GETVISWND 612 // returns the vis cmd handler hwnd -#define IPC_ISVISRUNNING 613 -#define IPC_CB_VISRANDOM 628 // param is status of random - -#define IPC_SETIDEALVIDEOSIZE 614 // sent by winamp to winamp, trap it if you need it. width=HIWORD(param), height=LOWORD(param) - -#define IPC_GETSTOPONVIDEOCLOSE 615 -#define IPC_SETSTOPONVIDEOCLOSE 616 - -typedef struct { - HWND hwnd; - int uMsg; - int wParam; - int lParam; -} transAccelStruct; - -#define IPC_TRANSLATEACCELERATOR 617 - -typedef struct { - int cmd; - int x; - int y; - int align; -} windowCommand; // send this as param to an IPC_PLCMD, IPC_MBCMD, IPC_VIDCMD - -#define IPC_CB_ONTOGGLEAOT 618 - -#define IPC_GETPREFSWND 619 - -#define IPC_SET_PE_WIDTHHEIGHT 620 // data is a pointer to a POINT structure that holds width & height - -#define IPC_GETLANGUAGEPACKINSTANCE 621 - -#define IPC_CB_PEINFOTEXT 622 // data is a string, ie: "04:21/45:02" - -#define IPC_CB_OUTPUTCHANGED 623 // output plugin was changed in config - -#define IPC_GETOUTPUTPLUGIN 625 - -#define IPC_SETDRAWBORDERS 626 -#define IPC_DISABLESKINCURSORS 627 -#define IPC_CB_RESETFONT 629 - -#define IPC_IS_FULLSCREEN 630 // returns 1 if video or vis is in fullscreen mode -#define IPC_SET_VIS_FS_FLAG 631 // a vis should send this message with 1/as param to notify winamp that it has gone to or has come back from fullscreen mode - -#define IPC_SHOW_NOTIFICATION 632 - -#define IPC_GETSKININFO 633 - -// >>>>>>>>>>> Next is 634 - -#define IPC_PLCMD 1000 - -#define PLCMD_ADD 0 -#define PLCMD_REM 1 -#define PLCMD_SEL 2 -#define PLCMD_MISC 3 -#define PLCMD_LIST 4 - -#define IPC_MBCMD 1001 - -#define MBCMD_BACK 0 -#define MBCMD_FORWARD 1 -#define MBCMD_STOP 2 -#define MBCMD_RELOAD 3 -#define MBCMD_MISC 4 - -#define IPC_VIDCMD 1002 - -#define VIDCMD_FULLSCREEN 0 -#define VIDCMD_1X 1 -#define VIDCMD_2X 2 -#define VIDCMD_LIB 3 -#define VIDPOPUP_MISC 4 - -#define IPC_MBURL 1003 //sets the URL -#define IPC_MBGETCURURL 1004 //copies the current URL into wParam (have a 4096 buffer ready) -#define IPC_MBGETDESC 1005 //copies the current URL description into wParam (have a 4096 buffer ready) -#define IPC_MBCHECKLOCFILE 1006 //checks that the link file is up to date (otherwise updates it). wParam=parent HWND -#define IPC_MBREFRESH 1007 //refreshes the "now playing" view in the library -#define IPC_MBGETDEFURL 1008 //copies the default URL into wParam (have a 4096 buffer ready) - -#define IPC_STATS_LIBRARY_ITEMCNT 1300 // updates library count status - -// IPC 2000-3000 reserved for freeform messages, see gen_ff/ff_ipc.h -#define IPC_FF_FIRST 2000 -#define IPC_FF_LAST 3000 - -#define IPC_GETDROPTARGET 3001 - -#define IPC_PLAYLIST_MODIFIED 3002 // sent to main wnd whenever the playlist is modified - -#define IPC_PLAYING_FILE 3003 // sent to main wnd with the file as parm whenever a file is played -#define IPC_FILE_TAG_MAY_HAVE_UPDATED 3004 // sent to main wnd with the file as parm whenever a file tag might be updated - - -#define IPC_ALLOW_PLAYTRACKING 3007 -// send nonzero to allow, zero to disallow - -#define IPC_HOOK_OKTOQUIT 3010 // return 0 to abort a quit, nonzero if quit is OK - -#define IPC_WRITECONFIG 3011 // pass 2 to write all, 1 to write playlist + common, 0 to write common+less common - -// pass a string to be the name to register, and returns a value > 65536, which is a unique value you can use -// for custom WM_WA_IPC messages. -#define IPC_REGISTER_WINAMP_IPCMESSAGE 65536 - -/**************************************************************************/ - -/* -** Finally there are some WM_COMMAND messages that you can use to send -** Winamp misc commands. -** -** To send these, use: -** -** SendMessage(hwnd_winamp, WM_COMMAND,command_name,0); -*/ - -#define WINAMP_OPTIONS_EQ 40036 // toggles the EQ window -#define WINAMP_OPTIONS_PLEDIT 40040 // toggles the playlist window -#define WINAMP_VOLUMEUP 40058 // turns the volume up a little -#define WINAMP_VOLUMEDOWN 40059 // turns the volume down a little -#define WINAMP_FFWD5S 40060 // fast forwards 5 seconds -#define WINAMP_REW5S 40061 // rewinds 5 seconds - -// the following are the five main control buttons, with optionally shift -// or control pressed -// (for the exact functions of each, just try it out) -#define WINAMP_BUTTON1 40044 -#define WINAMP_BUTTON2 40045 -#define WINAMP_BUTTON3 40046 -#define WINAMP_BUTTON4 40047 -#define WINAMP_BUTTON5 40048 -#define WINAMP_BUTTON1_SHIFT 40144 -#define WINAMP_BUTTON2_SHIFT 40145 -#define WINAMP_BUTTON3_SHIFT 40146 -#define WINAMP_BUTTON4_SHIFT 40147 -#define WINAMP_BUTTON5_SHIFT 40148 -#define WINAMP_BUTTON1_CTRL 40154 -#define WINAMP_BUTTON2_CTRL 40155 -#define WINAMP_BUTTON3_CTRL 40156 -#define WINAMP_BUTTON4_CTRL 40157 -#define WINAMP_BUTTON5_CTRL 40158 - -#define WINAMP_FILE_PLAY 40029 // pops up the load file(s) box -#define WINAMP_FILE_DIR 40187 // pops up the load directory box -#define WINAMP_OPTIONS_PREFS 40012 // pops up the preferences -#define WINAMP_OPTIONS_AOT 40019 // toggles always on top -#define WINAMP_HELP_ABOUT 40041 // pops up the about box :) - -#define ID_MAIN_PLAY_AUDIOCD1 40323 // starts playing the audio CD in the first CD reader -#define ID_MAIN_PLAY_AUDIOCD2 40323 // plays the 2nd -#define ID_MAIN_PLAY_AUDIOCD3 40323 // plays the 3nd -#define ID_MAIN_PLAY_AUDIOCD4 40323 // plays the 4nd - -// IDs 42000 to 45000 are reserved for gen_ff -// IDs from 45000 to 57000 are reserved for library - -#endif//_WA_IPC_H_ - -/* -** EOF.. Enjoy. -*/ \ No newline at end of file