diff --git a/ChangeLog b/ChangeLog index be909a3..ba0cd5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2.8.7: + - MSVC build fixes + - fixed a coulple bugs 2.8.6: 2.8.5: - another package fix diff --git a/Makefile.am b/Makefile.am index e6407a4..058a38e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = libfaad common frontend plugins -EXTRA_DIST = faad2.spec docs/libfaad.3 +EXTRA_DIST = faad2.spec docs/libfaad.3 project utils rpm: Makefile make dist diff --git a/Makefile.in b/Makefile.in index c1b4492..84a3ed3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -331,7 +331,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = libfaad common frontend plugins -EXTRA_DIST = faad2.spec docs/libfaad.3 +EXTRA_DIST = faad2.spec docs/libfaad.3 project utils all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive diff --git a/configure b/configure index 5ee6770..050c633 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for faad2 2.8.6. +# Generated by GNU Autoconf 2.69 for faad2 2.8.8. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ # Identity of this package. PACKAGE_NAME='faad2' PACKAGE_TARNAME='faad2' -PACKAGE_VERSION='2.8.6' -PACKAGE_STRING='faad2 2.8.6' +PACKAGE_VERSION='2.8.8' +PACKAGE_STRING='faad2 2.8.8' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1344,7 +1344,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 faad2 2.8.6 to adapt to many kinds of systems. +\`configure' configures faad2 2.8.8 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1415,7 +1415,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of faad2 2.8.6:";; + short | recursive ) echo "Configuration of faad2 2.8.8:";; esac cat <<\_ACEOF @@ -1531,7 +1531,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -faad2 configure 2.8.6 +faad2 configure 2.8.8 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2071,7 +2071,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by faad2 $as_me 2.8.6, which was +It was created by faad2 $as_me 2.8.8, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2934,7 +2934,7 @@ # Define the identity of the package. PACKAGE='faad2' - VERSION='2.8.6' + VERSION='2.8.8' cat >>confdefs.h <<_ACEOF @@ -18296,7 +18296,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by faad2 $as_me 2.8.6, which was +This file was extended by faad2 $as_me 2.8.8, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -18362,7 +18362,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -faad2 config.status 2.8.6 +faad2 config.status 2.8.8 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index cd2933a..a03cafe 100644 --- a/configure.ac +++ b/configure.ac @@ -8,7 +8,7 @@ dnl - mpeg4ip plugin (requires mpeg4ip's libmp4v2 to be installed) AC_PREREQ(2.50) -AC_INIT(faad2, 2.8.6) +AC_INIT(faad2, 2.8.8) AC_CONFIG_AUX_DIR(.) AM_INIT_AUTOMAKE([subdir-objects]) diff --git a/faad2.spec b/faad2.spec index ae2d45a..904f33c 100644 --- a/faad2.spec +++ b/faad2.spec @@ -24,7 +24,7 @@ Summary: C library and frontend for decoding MPEG2/4 AAC Name: faad2 -Version: 2.8.6 +Version: 2.8.8 Release: 1 License: GPL Group: Applications/Multimedia diff --git a/frontend/Makefile.am b/frontend/Makefile.am index 5f096d8..c11c25d 100644 --- a/frontend/Makefile.am +++ b/frontend/Makefile.am @@ -5,6 +5,6 @@ faad_LDADD = $(top_builddir)/libfaad/libfaad.la -faad_SOURCES = mp4read.c audio.c main.c audio.h mp4read.h +faad_SOURCES = mp4read.c audio.c main.c audio.h mp4read.h unicode_support.c unicode_support.h EXTRA_faad_SOURCES = getopt.c diff --git a/frontend/Makefile.in b/frontend/Makefile.in index 08b2650..eb3d0aa 100644 --- a/frontend/Makefile.in +++ b/frontend/Makefile.in @@ -101,7 +101,8 @@ CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) -am_faad_OBJECTS = mp4read.$(OBJEXT) audio.$(OBJEXT) main.$(OBJEXT) +am_faad_OBJECTS = mp4read.$(OBJEXT) audio.$(OBJEXT) main.$(OBJEXT) \ + unicode_support.$(OBJEXT) faad_OBJECTS = $(am_faad_OBJECTS) faad_DEPENDENCIES = $(top_builddir)/libfaad/libfaad.la AM_V_lt = $(am__v_lt_@AM_V@) @@ -331,7 +332,7 @@ dist_man1_MANS = faad.man AM_CPPFLAGS = -I$(top_srcdir)/include faad_LDADD = $(top_builddir)/libfaad/libfaad.la -faad_SOURCES = mp4read.c audio.c main.c audio.h mp4read.h +faad_SOURCES = mp4read.c audio.c main.c audio.h mp4read.h unicode_support.c unicode_support.h EXTRA_faad_SOURCES = getopt.c all: all-am @@ -430,6 +431,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp4read.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unicode_support.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ diff --git a/frontend/audio.c b/frontend/audio.c index 9ab7a2a..c8df015 100644 --- a/frontend/audio.c +++ b/frontend/audio.c @@ -38,6 +38,7 @@ #include #include +#include "unicode_support.h" #include "audio.h" @@ -74,13 +75,13 @@ if(infile[0] == '-') { #ifdef _WIN32 - setmode(fileno(stdout), O_BINARY); + _setmode(_fileno(stdout), O_BINARY); #endif aufile->sndfile = stdout; aufile->toStdio = 1; } else { aufile->toStdio = 0; - aufile->sndfile = fopen(infile, "wb"); + aufile->sndfile = faad_fopen(infile, "wb"); } if (aufile->sndfile == NULL) diff --git a/frontend/main.c b/frontend/main.c index deaa039..3b0850d 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -35,6 +35,7 @@ #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #include +#include #ifndef __MINGW32__ #define off_t __int64 #endif @@ -51,6 +52,7 @@ #include +#include "unicode_support.h" #include "audio.h" #include "mp4read.h" @@ -68,6 +70,7 @@ #define MAX_CHANNELS 6 /* make this higher to support files with more channels */ +#define MAX_PERCENTS 384 static int quiet = 0; @@ -78,11 +81,16 @@ if (!quiet) { va_start(ap, fmt); - vfprintf(stream, fmt, ap); - va_end(ap); } + +#ifdef _WIN32 + if (!_isatty(_fileno(stream))) + { + fflush(stream); /*ensure real-time progress output on Win32*/ + } +#endif } /* FAAD file buffering routines */ @@ -462,7 +470,7 @@ NeAACDecFrameInfo frameInfo; NeAACDecConfigurationPtr config; - char percents[200]; + char percents[MAX_PERCENTS]; int percent, old_percent = -1; int bread, fileread; int header_type = 0; @@ -479,7 +487,7 @@ if (adts_out) { - adtsFile = fopen(adts_fn, "wb"); + adtsFile = faad_fopen(adts_fn, "wb"); if (adtsFile == NULL) { faad_fprintf(stderr, "Error opening file: %s\n", adts_fn); @@ -491,12 +499,12 @@ { b.infile = stdin; #ifdef _WIN32 - setmode(fileno(stdin), O_BINARY); + _setmode(_fileno(stdin), O_BINARY); #endif } else { - b.infile = fopen(aacfile, "rb"); + b.infile = faad_fopen(aacfile, "rb"); if (b.infile == NULL) { /* unable to open file */ @@ -727,7 +735,7 @@ if (percent > old_percent) { old_percent = percent; - sprintf(percents, "%d%% decoding %s.", percent, aacfile); + snprintf(percents, MAX_PERCENTS, "%d%% decoding %s.", percent, aacfile); faad_fprintf(stderr, "%s\r", percents); #ifdef _WIN32 SetConsoleTitle(percents); @@ -795,7 +803,7 @@ NeAACDecFrameInfo frameInfo; mp4AudioSpecificConfig mp4ASC; - char percents[200]; + char percents[MAX_PERCENTS]; int percent, old_percent = -1; int first_time = 1; @@ -833,7 +841,7 @@ if (adts_out) { - adtsFile = fopen(adts_fn, "wb"); + adtsFile = faad_fopen(adts_fn, "wb"); if (adtsFile == NULL) { faad_fprintf(stderr, "Error opening file: %s\n", adts_fn); @@ -953,7 +961,7 @@ outputFormat, fileType, aacChannelConfig2wavexChannelMask(&frameInfo)); } else { #ifdef _WIN32 - setmode(fileno(stdout), O_BINARY); + _setmode(_fileno(stdout), O_BINARY); #endif aufile = open_audio_file("-", frameInfo.samplerate, frameInfo.channels, outputFormat, fileType, aacChannelConfig2wavexChannelMask(&frameInfo)); @@ -972,7 +980,7 @@ if (percent > old_percent) { old_percent = percent; - sprintf(percents, "%d%% decoding %s.", percent, mp4file); + snprintf(percents, MAX_PERCENTS, "%d%% decoding %s.", percent, mp4file); faad_fprintf(stderr, "%s\r", percents); #ifdef _WIN32 SetConsoleTitle(percents); @@ -1007,7 +1015,7 @@ return frameInfo.error; } -int main(int argc, char *argv[]) +static int faad_main(int argc, char *argv[]) { int result; int infoOnly = 0; @@ -1265,13 +1273,13 @@ readFromStdin = 1; hMP4File = stdin; #ifdef _WIN32 - setmode(fileno(stdin), O_BINARY); + _setmode(_fileno(stdin), O_BINARY); #endif } else { mp4file = 0; - hMP4File = fopen(aacFileName, "rb"); + hMP4File = faad_fopen(aacFileName, "rb"); if (!hMP4File) { faad_fprintf(stderr, "Error opening file: %s\n", aacFileName); @@ -1338,3 +1346,19 @@ return 0; } + +int main(int argc, char *argv[]) +{ +#if defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64 + int argc_utf8, exit_code; + char **argv_utf8; + init_console_utf8(stderr); + init_commandline_arguments_utf8(&argc_utf8, &argv_utf8); + exit_code = faad_main(argc_utf8, argv_utf8); + free_commandline_arguments_utf8(&argc_utf8, &argv_utf8); + uninit_console_utf8(); + return exit_code; +#else + return faad_main(argc, argv); +#endif +} \ No newline at end of file diff --git a/frontend/mp4read.c b/frontend/mp4read.c index 9d92bf5..9767383 100644 --- a/frontend/mp4read.c +++ b/frontend/mp4read.c @@ -24,6 +24,7 @@ #include #include +#include "unicode_support.h" #include "mp4read.h" enum ATOM_TYPE @@ -45,17 +46,29 @@ static FILE *g_fin = NULL; -static inline uint32_t bswap32(uint32_t u32) +static inline uint32_t bswap32(const uint32_t u32) { #ifndef WORDS_BIGENDIAN +#ifdef _MSC_VER + return _byteswap_ulong(u32); +#else return __builtin_bswap32(u32); #endif -} - -static inline uint16_t bswap16(uint16_t u16) +#else + return u32; +#endif +} + +static inline uint16_t bswap16(const uint16_t u16) { #ifndef WORDS_BIGENDIAN - return __builtin_bswap16(u16); +#ifdef _MSC_VER + return _byteswap_ushort(u16); +#else + return __builtin_bswap16(u16); +#endif +#else + return u16; #endif } @@ -927,7 +940,7 @@ static void mp4info(void) { - fprintf(stderr, "Modification Time:\t\%s", mp4time(mp4config.mtime)); + fprintf(stderr, "Modification Time:\t\t%s", mp4time(mp4config.mtime)); fprintf(stderr, "Samplerate:\t\t%d\n", mp4config.samplerate); fprintf(stderr, "Total samples:\t\t%d\n", mp4config.samples); fprintf(stderr, "Total channels:\t\t%d\n", mp4config.channels); @@ -958,7 +971,7 @@ mp4read_close(); - g_fin = fopen(name, "rb"); + g_fin = faad_fopen(name, "rb"); if (!g_fin) return ERR_FAIL; diff --git a/frontend/unicode_support.c b/frontend/unicode_support.c new file mode 100644 index 0000000..96ea5a4 --- /dev/null +++ b/frontend/unicode_support.c @@ -0,0 +1,172 @@ +/* Copyright (c) 2004-2012 LoRd_MuldeR + File: unicode_support.c + + This file was originally part of a patch included with LameXP, + released under the same license as the original audio tools. + + 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. + + 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 FOUNDATION 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. +*/ +#if defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64 + +#include "unicode_support.h" + +#include +#include + +static UINT g_old_output_cp = ((UINT)-1); + +char *utf16_to_utf8(const wchar_t *input) +{ + char *Buffer; + int BuffSize = 0, Result = 0; + + BuffSize = WideCharToMultiByte(CP_UTF8, 0, input, -1, NULL, 0, NULL, NULL); + Buffer = (char*) malloc(sizeof(char) * BuffSize); + if(Buffer) + { + Result = WideCharToMultiByte(CP_UTF8, 0, input, -1, Buffer, BuffSize, NULL, NULL); + } + + return ((Result > 0) && (Result <= BuffSize)) ? Buffer : NULL; +} + +char *utf16_to_ansi(const wchar_t *input) +{ + char *Buffer; + int BuffSize = 0, Result = 0; + + BuffSize = WideCharToMultiByte(CP_ACP, 0, input, -1, NULL, 0, NULL, NULL); + Buffer = (char*) malloc(sizeof(char) * BuffSize); + if(Buffer) + { + Result = WideCharToMultiByte(CP_ACP, 0, input, -1, Buffer, BuffSize, NULL, NULL); + } + + return ((Result > 0) && (Result <= BuffSize)) ? Buffer : NULL; +} + +wchar_t *utf8_to_utf16(const char *input) +{ + wchar_t *Buffer; + int BuffSize = 0, Result = 0; + + BuffSize = MultiByteToWideChar(CP_UTF8, 0, input, -1, NULL, 0); + Buffer = (wchar_t*) malloc(sizeof(wchar_t) * BuffSize); + if(Buffer) + { + Result = MultiByteToWideChar(CP_UTF8, 0, input, -1, Buffer, BuffSize); + } + + return ((Result > 0) && (Result <= BuffSize)) ? Buffer : NULL; +} + +void init_commandline_arguments_utf8(int *argc, char ***argv) +{ + int i, nArgs; + LPWSTR *szArglist; + + szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs); + + if(NULL == szArglist) + { + fprintf(stderr, "\nFATAL: CommandLineToArgvW failed\n\n"); + exit(-1); + } + + *argv = (char**) malloc(sizeof(char*) * nArgs); + *argc = nArgs; + + if(NULL == *argv) + { + fprintf(stderr, "\nFATAL: Malloc failed\n\n"); + exit(-1); + } + + for(i = 0; i < nArgs; i++) + { + (*argv)[i] = utf16_to_utf8(szArglist[i]); + if(NULL == (*argv)[i]) + { + fprintf(stderr, "\nFATAL: utf16_to_utf8 failed\n\n"); + exit(-1); + } + } + + LocalFree(szArglist); +} + +void free_commandline_arguments_utf8(int *argc, char ***argv) +{ + int i = 0; + + if(*argv != NULL) + { + for(i = 0; i < *argc; i++) + { + if((*argv)[i] != NULL) + { + free((*argv)[i]); + (*argv)[i] = NULL; + } + } + free(*argv); + *argv = NULL; + } +} + +FILE *fopen_utf8(const char *filename_utf8, const char *mode_utf8) +{ + FILE *ret = NULL; + wchar_t *filename_utf16 = utf8_to_utf16(filename_utf8); + wchar_t *mode_utf16 = utf8_to_utf16(mode_utf8); + + if(filename_utf16 && mode_utf16) + { + ret = _wfopen(filename_utf16, mode_utf16); + } + + if(filename_utf16) free(filename_utf16); + if(mode_utf16) free(mode_utf16); + + return ret; +} + +void init_console_utf8(FILE *const stream) +{ + if (_isatty(_fileno(stream))) + { + g_old_output_cp = GetConsoleOutputCP(); + SetConsoleOutputCP(CP_UTF8); + } +} + +void uninit_console_utf8(void) +{ + if(g_old_output_cp != ((UINT)-1)) + { + SetConsoleOutputCP(g_old_output_cp); + } +} + +#endif \ No newline at end of file diff --git a/frontend/unicode_support.h b/frontend/unicode_support.h new file mode 100644 index 0000000..064fa34 --- /dev/null +++ b/frontend/unicode_support.h @@ -0,0 +1,49 @@ +/* Copyright (c) 2004-2012 LoRd_MuldeR + File: unicode_support.h + + This file was originally part of a patch included with LameXP, + released under the same license as the original audio tools. + + 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. + + 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 FOUNDATION 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. +*/ +#ifndef UNICODE_SUPPORT_H_INCLUDED +#define UNICODE_SUPPORT_H_INCLUDED + +#include + +#if defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64 +char *utf16_to_utf8(const wchar_t *input); +char *utf16_to_ansi(const wchar_t *input); +wchar_t *utf8_to_utf16(const char *input); +void init_commandline_arguments_utf8(int *argc, char ***argv); +void free_commandline_arguments_utf8(int *argc, char ***argv); +FILE *fopen_utf8(const char *filename_utf8, const char *mode_utf8); +void init_console_utf8(FILE *const stream); +void uninit_console_utf8(void); +#define faad_fopen(X,Y) fopen_utf8((X),(Y)) +#else +#define faad_fopen(X,Y) fopen((X),(Y)) +#endif + +#endif //UNICODE_SUPPORT_H_INCLUDED diff --git a/libfaad/decoder.c b/libfaad/decoder.c index 44762f6..52a387f 100644 --- a/libfaad/decoder.c +++ b/libfaad/decoder.c @@ -51,6 +51,10 @@ #ifdef ANALYSIS uint16_t dbg_count; +#endif + +#if defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64 +#include "win32_ver.h" #endif /* static function declarations */ diff --git a/project/msvc/aacinfo.vcxproj b/project/msvc/aacinfo.vcxproj new file mode 100644 index 0000000..4cca6d6 --- /dev/null +++ b/project/msvc/aacinfo.vcxproj @@ -0,0 +1,111 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {FE985E4D-79DB-4DD3-BFED-824B4677A161} + 8.1 + + + + Application + v141 + false + MultiByte + + + Application + v141 + false + MultiByte + + + + + + + + + + + + + <_ProjectFileVersion>15.0.26730.12 + + + .\bin\$(Configuration)\ + .\intermediate\$(Configuration)\$(ProjectName)\ + true + MinimumRecommendedRules.ruleset + + + + + .\bin\$(Configuration)\ + .\intermediate\$(Configuration)\$(ProjectName)\ + false + MinimumRecommendedRules.ruleset + + + + + + Disabled + _CRT_SECURE_NO_WARNINGS;_DEBUG;WIN32;_CONSOLE;TEST;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0413 + + + /MACHINE:I386 %(AdditionalOptions) + true + Console + ws2_32.lib;%(AdditionalDependencies) + + + + + OnlyExplicitInline + _CRT_SECURE_NO_WARNINGS;NDEBUG;WIN32;_CONSOLE;TEST;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreaded + true + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0413 + + + /MACHINE:I386 %(AdditionalOptions) + Console + ws2_32.lib;%(AdditionalDependencies) + + + + + + + + + + + + + + \ No newline at end of file diff --git a/project/msvc/aacinfo.vcxproj.filters b/project/msvc/aacinfo.vcxproj.filters new file mode 100644 index 0000000..44b0428 --- /dev/null +++ b/project/msvc/aacinfo.vcxproj.filters @@ -0,0 +1,29 @@ + + + + + {791f5160-53a5-4c5e-a4a5-23a05c773c22} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {f1d3687c-4d55-4c4e-98b4-657ceb0b9ad2} + h;hpp;hxx;hm;inl + + + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/project/msvc/faad.vcxproj b/project/msvc/faad.vcxproj new file mode 100644 index 0000000..c741e31 --- /dev/null +++ b/project/msvc/faad.vcxproj @@ -0,0 +1,125 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58} + 8.1 + + + + Application + v141 + + + Application + v141 + + + + + + + + + + + + + <_ProjectFileVersion>15.0.26730.12 + + + .\bin\$(Configuration)\ + .\intermediate\$(Configuration)\$(ProjectName)\ + true + MinimumRecommendedRules.ruleset + + + + + .\bin\$(Configuration)\ + .\intermediate\$(Configuration)\$(ProjectName)\ + false + MinimumRecommendedRules.ruleset + + + + + + .\Debug/faad.tlb + + + Disabled + ../../include;../../common/mp4ff;../../frontend;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0413 + + + true + Console + + + + + .\Release/faad.tlb + + + MinSpace + OnlyExplicitInline + true + Speed + ../../include;../../common/mp4ff;../../frontend;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0413 + + + Console + + + + + + + + + + + + + + + + + + + {bc3efe27-9015-4c9c-ad3c-72b3b7ed2114} + + + + + + \ No newline at end of file diff --git a/project/msvc/faad.vcxproj.filters b/project/msvc/faad.vcxproj.filters new file mode 100644 index 0000000..47e778a --- /dev/null +++ b/project/msvc/faad.vcxproj.filters @@ -0,0 +1,47 @@ + + + + + {6471b163-f0fb-4df0-b3f4-a98d81d5acd5} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {b68959bb-0fd2-4bc1-92be-187b7a5161e4} + h;hpp;hxx;hm;inl + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/project/msvc/faad2.sln b/project/msvc/faad2.sln new file mode 100644 index 0000000..cecc722 --- /dev/null +++ b/project/msvc/faad2.sln @@ -0,0 +1,45 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26730.12 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aacinfo", "aacinfo.vcxproj", "{FE985E4D-79DB-4DD3-BFED-824B4677A161}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaad", "libfaad.vcxproj", "{BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaad2_dll", "libfaad2_dll.vcxproj", "{482DA264-EE88-4575-B208-87C4CB80CD08}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "faad", "faad.vcxproj", "{2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FE985E4D-79DB-4DD3-BFED-824B4677A161}.Debug|Win32.ActiveCfg = Debug|Win32 + {FE985E4D-79DB-4DD3-BFED-824B4677A161}.Debug|Win32.Build.0 = Debug|Win32 + {FE985E4D-79DB-4DD3-BFED-824B4677A161}.Release|Win32.ActiveCfg = Release|Win32 + {FE985E4D-79DB-4DD3-BFED-824B4677A161}.Release|Win32.Build.0 = Release|Win32 + {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Debug|Win32.ActiveCfg = Debug|Win32 + {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Debug|Win32.Build.0 = Debug|Win32 + {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Release|Win32.ActiveCfg = Release|Win32 + {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Release|Win32.Build.0 = Release|Win32 + {482DA264-EE88-4575-B208-87C4CB80CD08}.Debug|Win32.ActiveCfg = Debug|Win32 + {482DA264-EE88-4575-B208-87C4CB80CD08}.Debug|Win32.Build.0 = Debug|Win32 + {482DA264-EE88-4575-B208-87C4CB80CD08}.Release|Win32.ActiveCfg = Release|Win32 + {482DA264-EE88-4575-B208-87C4CB80CD08}.Release|Win32.Build.0 = Release|Win32 + {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Debug|Win32.ActiveCfg = Debug|Win32 + {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Debug|Win32.Build.0 = Debug|Win32 + {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Release|Win32.ActiveCfg = Release|Win32 + {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {89E2B8B3-42E4-4058-9565-E79943F3445F} + EndGlobalSection + GlobalSection(DPCodeReviewSolutionGUID) = preSolution + DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000} + EndGlobalSection +EndGlobal diff --git a/project/msvc/libfaad.vcxproj b/project/msvc/libfaad.vcxproj new file mode 100644 index 0000000..5f194b5 --- /dev/null +++ b/project/msvc/libfaad.vcxproj @@ -0,0 +1,200 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114} + 8.1 + + + + StaticLibrary + v141 + + + StaticLibrary + v141 + + + + + + + + + + + + + <_ProjectFileVersion>15.0.26730.12 + + + .\bin\$(Configuration)\ + .\intermediate\$(Configuration)\$(ProjectName)\ + MinimumRecommendedRules.ruleset + + + + + .\bin\$(Configuration)\ + .\intermediate\$(Configuration)\$(ProjectName)\ + MinimumRecommendedRules.ruleset + + + + + + MaxSpeed + OnlyExplicitInline + ../../include;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_WARNINGS;NDEBUG;WIN32;_LIB;HAVE_LRINTF;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0413 + + + + "$(SolutionDir)..\..\utils\win32\ac2ver.exe" "faad2" "$(SolutionDir)..\..\configure.ac" > "$(SolutionDir)..\..\libfaad\win32_ver.h" + + + Retrieving package version... + + + + + Disabled + ../../include;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_WARNINGS;_DEBUG;WIN32;_LIB;HAVE_LRINTF;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0413 + + + + "$(SolutionDir)..\..\utils\win32\ac2ver.exe" "faad2" "$(SolutionDir)..\..\configure.ac" > "$(SolutionDir)..\..\libfaad\win32_ver.h" + + + Retrieving package version... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/project/msvc/libfaad.vcxproj.filters b/project/msvc/libfaad.vcxproj.filters new file mode 100644 index 0000000..51f4cc7 --- /dev/null +++ b/project/msvc/libfaad.vcxproj.filters @@ -0,0 +1,299 @@ + + + + + {619aded3-55ea-4189-9fe0-5214a4d91e93} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {6f786fdd-858d-47ce-9a6e-e09b46c63fbb} + h;hpp;hxx;hm;inl + + + {8cc5d783-4bb8-4e95-9da0-67901052651a} + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files\codebook + + + Header Files\codebook + + + Header Files\codebook + + + Header Files\codebook + + + Header Files\codebook + + + Header Files\codebook + + + Header Files\codebook + + + Header Files\codebook + + + Header Files\codebook + + + Header Files\codebook + + + Header Files\codebook + + + Header Files\codebook + + + \ No newline at end of file diff --git a/project/msvc/libfaad2.def b/project/msvc/libfaad2.def new file mode 100644 index 0000000..9d7d52d --- /dev/null +++ b/project/msvc/libfaad2.def @@ -0,0 +1,15 @@ +EXPORTS +; +; libfaad2 exports +; +NeAACDecOpen @1 +NeAACDecGetCurrentConfiguration @2 +NeAACDecSetConfiguration @3 +NeAACDecInit @4 +NeAACDecInit2 @5 +NeAACDecDecode @6 +NeAACDecClose @7 +NeAACDecGetErrorMessage @8 +NeAACDecAudioSpecificConfig @9 +NeAACDecPostSeekReset @10 +NeAACDecDecode2 @11 diff --git a/project/msvc/libfaad2_dll.vcxproj b/project/msvc/libfaad2_dll.vcxproj new file mode 100644 index 0000000..0c7b455 --- /dev/null +++ b/project/msvc/libfaad2_dll.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {482DA264-EE88-4575-B208-87C4CB80CD08} + 8.1 + + + + DynamicLibrary + v141 + + + DynamicLibrary + v141 + + + + + + + + + + + + + <_ProjectFileVersion>15.0.26730.12 + + + .\bin\$(Configuration)\ + .\intermediate\$(Configuration)\$(ProjectName)\ + true + MinimumRecommendedRules.ruleset + + + + + .\bin\$(Configuration)\ + .\intermediate\$(Configuration)\$(ProjectName)\ + false + MinimumRecommendedRules.ruleset + + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\DebugDLL/libfaad2_dll.tlb + + + Disabled + ../../include;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;HAVE_LRINTF;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + + Level3 + true + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0407 + + + .\libfaad2.def + true + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\ReleaseDLL/libfaad2_dll.tlb + + + OnlyExplicitInline + true + Speed + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_LRINTF;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + Level3 + true + ../../include;%(AdditionalIncludeDirectories) + + + NDEBUG;%(PreprocessorDefinitions) + 0x0407 + + + .\libfaad2.def + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/project/msvc/libfaad2_dll.vcxproj.filters b/project/msvc/libfaad2_dll.vcxproj.filters new file mode 100644 index 0000000..f89e02c --- /dev/null +++ b/project/msvc/libfaad2_dll.vcxproj.filters @@ -0,0 +1,204 @@ + + + + + {49a4bc70-d8e3-49e8-89e3-a91112cd9fd2} + + + {05b5a1d9-6070-414e-9fa5-21734fddfce8} + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + + \ No newline at end of file diff --git a/utils/win32/ac2ver.c b/utils/win32/ac2ver.c new file mode 100644 index 0000000..171d6dd --- /dev/null +++ b/utils/win32/ac2ver.c @@ -0,0 +1,103 @@ +/* +** AC2VER - extract version number from AC_INIT macro (configure.ac) +** Copyright (C) 2017 LoRd_MuldeR +** +** This software is released under the CC0 1.0 Universal [CC0 1.0] licence! +** https://creativecommons.org/publicdomain/zero/1.0/legalcode +**/ + +#define BUFF_SIZE 4096 +#define _CRT_SECURE_NO_WARNINGS 1 + +#include +#include +#include +#include + +static int clean_string(char *const str) +{ + size_t i = 0, j = 0; + while(str[i]) + { + if(isalnum(str[i]) || strchr("._-", str[i])) + { + if(i != j) + { + str[j] = str[i]; + } + ++j; + } + ++i; + } + str[j] = '\0'; + return !!j; +} + +static int parse_version(FILE *const input, const char *const format, char *const version) +{ + char buffer[BUFF_SIZE]; + + while(!(feof(input) || ferror(input))) + { + const char *line = fgets(buffer, BUFF_SIZE, input); + if(line) + { + while((*line) && (isspace(*line))) + { + ++line; /*skip space*/ + } + if(sscanf(line, format, version) == 1) + { + if(clean_string(version)) + { + return 1; /*found!*/ + } + } + } + } + + version[0] = '\0'; + return 0; +} + +static int get_version(const wchar_t *const lib_name, const wchar_t *const file_name) +{ + char format[128], version[BUFF_SIZE]; + + FILE *const input = _wfopen(file_name, L"r"); + if(!input) + { + fprintf(stderr, "Error: Failed to open input file!\n%S\n\n", file_name); + return 0; + } + + _snprintf(format, 128, "AC_INIT ( %S , %%s", lib_name); + //printf("<%s>\n", format); + + if(parse_version(input, format, version)) + { + printf("#define PACKAGE_VERSION \"%s\"\n", version); + fclose(input); + return 1; + } + else + { + fprintf(stderr, "Error: Version string could not be found!\n\n"); + fclose(input); + return 0; + } +} + +int wmain(int argc, wchar_t* argv[]) +{ + if((argc != 3) || (!argv[1][0]) || (!argv[2][0])) + { + wchar_t file_name[_MAX_FNAME], file_ext[_MAX_EXT]; + _wsplitpath(argv[0], NULL, NULL, file_name, file_ext); + fprintf(stderr, "AC2VER [%s]\n\n", __DATE__); + fprintf(stderr, "Usage: %S%S \n\n", file_name, file_ext); + return EXIT_FAILURE; + } + + return get_version(argv[1], argv[2]) ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/utils/win32/ac2ver.exe b/utils/win32/ac2ver.exe new file mode 100644 index 0000000..73861ab Binary files /dev/null and b/utils/win32/ac2ver.exe differ