shithub: aacdec

Download patch

ref: 9c136163859aeccbfaff07e0553eefbf73cca7f6
parent: 064740662b4b78775c62f610a84dc17969a1aabf
author: menno <menno>
date: Thu Nov 6 06:04:14 EST 2003

Linux compilation fixes
mp4ff should compile now
xmmsmp4 should compile now
spec file added for Red Hat (make dist should now work)

--- a/Makefile.am
+++ b/Makefile.am
@@ -1,1 +1,3 @@
 SUBDIRS = libfaad common frontend plugins
+
+EXTRA_DIST = faad2.spec
--- a/common/Makefile.am
+++ b/common/Makefile.am
@@ -1,1 +1,5 @@
-SUBDIRS = mp4v2
+if WITH_MP4V2
+SUBDIRS = mp4v2 mp4ff
+else
+SUBDIRS = mp4ff
+endif
--- /dev/null
+++ b/common/mp4ff/Makefile.am
@@ -1,0 +1,15 @@
+lib_LTLIBRARIES = libmp4ff.la
+
+include_HEADERS = mp4ff.h
+
+libmp4ff_la_SOURCES = atom.c ctts.c dinf.c dref.c edts.c \
+	elst.c esds.c hdlr.c iods.c matrix.c mdat.c mdhd.c \
+	mdia.c minf.c moov.c mp4ff.c mvhd.c smhd.c stbl.c \
+	stco.c stsc.c stsd.c stsdtable.c stss.c stsz.c stts.c \
+	tkhd.c trak.c udta.c util.c vmhd.c \
+	funcprotos.h mp4ff.h private.h
+
+AM_CFLAGS = -O2 -g
+LIBTOOL_DEPS =
+LIBS =
+
--- a/common/mp4ff/mp4ff.h
+++ b/common/mp4ff/mp4ff.h
@@ -5,8 +5,87 @@
 extern "C" {
 #endif
 
+#ifdef _WIN32
+
+ #include <stdio.h>
+ #include <stdlib.h>
+
+#else
+#ifdef HAVE_CONFIG_H
+#  include "../../config.h"
+#endif
+
 #include <stdio.h>
-#include <stdlib.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+#  include <stdint.h>
+# else
+/* we need these... */
+typedef unsigned long long uint64_t;
+typedef unsigned long uint32_t;
+typedef unsigned short uint16_t;
+typedef unsigned char uint8_t;
+typedef long long int64_t;
+typedef long int32_t;
+typedef short int16_t;
+typedef char int8_t;
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#ifndef HAVE_FLOAT32_T
+typedef float float32_t;
+#endif
+
+#if STDC_HEADERS
+# include <string.h>
+#else
+# if !HAVE_STRCHR
+#  define strchr index
+#  define strrchr rindex
+# endif
+char *strchr(), *strrchr();
+# if !HAVE_MEMCPY
+#  define memcpy(d, s, n) bcopy((s), (d), (n))
+#  define memmove(d, s, n) bcopy((s), (d), (n))
+# endif
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#endif
 
 
 #include "private.h"
--- a/configure.in
+++ b/configure.in
@@ -14,12 +14,12 @@
 
 AM_CONFIG_HEADER(config.h)
 
-AC_ARG_WITH( xmms,   [  --with-xmms             compile XMMS plugin],WITHXMMS=$withval, WITHXMMS=no)
+AC_ARG_WITH( xmms,   [  --with-xmms             compile XMMS plugins],WITHXMMS=$withval, WITHXMMS=no)
 
-AC_ARG_WITH( xmmsmp4,[  --with-xmmsmp4          compile XMMS MP4 plugin],WITHXMMSMP4=$withval, WITHXMMSMP4=no)
-
 AC_ARG_WITH( drm,    [  --with-drm              compile libfaad with DRM support],WITHDRM=$withval, WITHDRM=no)
 
+AC_ARG_WITH( mp4v2,  [  --with-mp4v2            compile libmp4v2],WITHMP4V2=$withval, WITHMP4V2=no)
+
 dnl Checks for header files required for mp4.h
 AC_HEADER_STDC
 AC_CHECK_HEADERS(stdint.h inttypes.h)
@@ -32,6 +32,8 @@
 AC_C_INLINE
 AC_C_BIGENDIAN
 
+AC_TYPE_OFF_T
+
 AC_DEFUN(MY_CHECK_TYPEDEF_FROM_INCLUDE,
 [
    AC_MSG_CHECKING([for $1])
@@ -69,31 +71,40 @@
 AC_CHECK_LIB(mp4v2, MP4MetadataDelete, external_mp4v2=no, , -lstdc++)
 AC_CHECK_HEADER(mp4.h, , external_mp4v2=no)
 
+AM_CONDITIONAL(WITH_MP4V2, false)
+
 if test x$external_mp4v2 = xyes; then
   AM_CONDITIONAL(HAVE_MPEG4IP, true)
   MPEG4IP_PLAYER_PLUGIN_DIR=`mpeg4ip-config --player-plugin-dir`  
   AC_SUBST(MPEG4IP_PLAYER_PLUGIN_DIR)
-  AC_CONFIG_FILES(plugins/mpeg4ip/Makefile)
   AC_MSG_NOTICE([*** Building with external mp4v2 ***])
 else
   AM_CONDITIONAL(HAVE_MPEG4IP, false)
-  AC_CONFIG_FILES(common/mp4v2/Makefile)
+  if test x$WITHMP4V2 = xyes; then
+     AM_CONDITIONAL(WITH_MP4V2, true)
+  fi
 fi
 
 if test x$WITHXMMS = xyes; then
-  xmmsplugin=yes
-  AC_CHECK_PROGS(XMMS_CONFIG, xmms-config,"no_found")
-  if test "$XMMS_CONFIG" = "no_found"; then
-   AC_MSG_ERROR("*** xmms-config not found - omitting xmms plugin build")
-   xmmsplugin=no
-   AM_CONDITIONAL(HAVE_XMMS, false)
-  else
-   AM_CONDITIONAL(HAVE_XMMS, true)
-   AC_CONFIG_SUBDIRS(plugins/xmms)
+  AC_CHECK_PROGS(XMMS_CONFIG, xmms-config,"not_found")
+  if test "$XMMS_CONFIG" = "not_found"; then
+    AC_MSG_ERROR("*** xmms-config not found - xmms plugin can't be build")
   fi
+  AC_CHECK_HEADER(pthread.h,,
+           AC_MSG_ERROR(*** pthread headers support not installed or not found))
+  AC_CHECK_HEADER(id3.h,,
+       AC_MSG_ERROR(*** id3lib headers support not installed or not found))
+  AC_CHECK_PROGS(GTK_CONFIG, gtk-config, "not_found")
+  
+  if test x$GTK_CONFIG = xnot_found; then
+    AC_MSG_ERROR("*** gtk-config not found - xmms plugin can't be build")
+  fi
+  
+  AM_CONDITIONAL(HAVE_XMMS, true)  
+  AC_MSG_NOTICE("xmms plugin requires libmp4v2 to be build")
+  AM_CONDITIONAL(WITH_MP4V2, true)
 else
  AM_CONDITIONAL(HAVE_XMMS, false)
- xmmsplugin=no
 fi
 
 if test x$WITHDRM = xyes; then
@@ -100,8 +111,11 @@
   AC_DEFINE(DRM, 1, [Define if you want to use libfaad together with Digital Radio Mondiale (DRM)])
 fi
 
-AC_CONFIG_FILES(libfaad/Makefile frontend/Makefile common/Makefile Makefile plugins/Makefile)
-AC_OUTPUT
+AC_CONFIG_FILES(libfaad/Makefile frontend/Makefile common/Makefile plugins/Makefile Makefile )
 
-dnl AC_CONFIG_SUBDIRS(plugins/xmmsmp4/src)
-dnl AC_OUTPUT(plugins/xmmsmp4/Makefile plugins/xmmsmp4/src/Makefile)
+AC_CONFIG_FILES(plugins/mpeg4ip/Makefile)
+AC_CONFIG_FILES(plugins/xmms/Makefile plugins/xmms/src/Makefile)
+AC_CONFIG_FILES(plugins/xmmsmp4/Makefile plugins/xmmsmp4/src/Makefile)
+
+AC_CONFIG_FILES(common/mp4ff/Makefile common/mp4v2/Makefile)
+AC_OUTPUT
--- /dev/null
+++ b/faad2.spec
@@ -1,0 +1,128 @@
+Summary:	C library and frontend for decoding MPEG2/4 AAC
+Name:		faad2
+Version:	2.0.031105
+Release:	1
+License:	GPL
+Group:		Applications/Multimedia
+Source0:	http://download.sourceforge.net/faad/%{name}-%{version}.tar.gz
+BuildRequires: autoconf, automake, libtool, gcc-c++
+BuildRequires: xmms-devel, id3lib-devel, gtk+-devel
+URL:		http://www.audiocoding.com/
+BuildRoot: 	%{_tmppath}/%{name}-%{version}-%{release}-root
+Packager:	a.kurpiers@nt.tu-darmstadt.de
+
+%description
+FAAD 2 is a LC, MAIN and LTP profile, MPEG2 and MPEG-4 AAC decoder, completely
+written from scratch. FAAD 2 is licensed under the GPL.
+
+%package devel
+Summary: Development libraries the FAAD 2 AAC decoder.
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+Header files and development documentation for libfaad.
+
+%package xmms
+Group: Applications/Multimedia
+Summary: AAC and MP4 input plugin for xmms
+Requires: %{name} = %{version}-%{release}, %{version}-%{release}-libmp4ff, xmms, id3lib
+
+
+%description xmms
+The AAC xmms input plugin for xmms recognizes AAC files by an
+.aac extension.
+This MP4 xmms plugin reads AAC files with and without ID3 tags (version 2.x).
+AAC files are MPEG2 or MPEG4 files that can be found in MPEG4 audio files
+(.mp4). MPEG4 files with AAC inside can be read by RealPlayer or Quicktime.
+
+
+%package libmp4v2
+Summary: C++ library to handle MP4 (Quicktime) content
+Group: Development/Libraries
+
+%description libmp4v2
+C++ library to handle MP4 (Quicktime) content
+
+
+%package libmp4ff
+Summary: Library to handle MP4 (Quicktime)
+Group: Development/Libraries
+
+%description libmp4ff
+This is a Quicktime library for UNIX in a freely redistributable,
+statically linkable library.
+
+%prep
+%setup -n faad2
+%patch -p0
+
+%build
+sh bootstrap
+./configure --with-drm --with-xmms --prefix=/usr
+make
+
+%install
+rm -rf %{buildroot}
+make install DESTDIR=%{buildroot}
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-, root, root)
+%doc AUTHORS COPYING ChangeLog NEWS README TODO
+%{_bindir}/*
+%{_libdir}/libfaad.so*
+
+%files devel
+%defattr(-, root, root)
+%{_libdir}/libfaad.a
+%{_libdir}/libfaad.la
+%{_includedir}/faad.h
+
+%files xmms
+%defattr(-,root,root)
+%doc plugins/xmms/README
+%_libdir/xmms/Input/*
+
+%files libmp4v2
+%defattr(-, root, root)
+%{_libdir}/libmp4v2.*
+%{_includedir}/mp4.h
+%{_includedir}/mpeg4ip.h
+
+%files libmp4ff
+%defattr(-, root, root)
+%{_libdir}/libmp4ff.*
+%{_includedir}/mp4ff.h
+
+%changelog
+* Wed Nov 05 2003 Alexander Kurpiers <a.kurpiers@nt.tu-darmstadt.de>
+- include xmms plugins/libmp4v2/libmp4ff into RPM
+
+* Tue Aug 12 2003 Matthias Saou <matthias.saou@est.une.marmotte.net>
+- Update to 2.0rc1.
+- Introduced LD_LIBRARY_PATH workaround.
+- Removed optional xmms plugin build, it seems mandatory now.
+- Added gtk+ build dep for the xmms plugin.
+
+* Wed May 14 2003 Matthias Saou <matthias.saou@est.une.marmotte.net>
+- Added xmms plugin build.
+
+* Wed Apr  9 2003 Matthias Saou <matthias.saou@est.une.marmotte.net>
+- Spec file cleanup.
+- Now exclude .la file.
+- Update to latest CVS checkout to fix compile problem.
+
+
+* Fri Aug 10 2002 Alexander Kurpiers <a.kurpiers@nt.tu-darmstadt.de>
+- changes to compile v1.1 release
+
+* Tue Jun 18 2002 Alexander Kurpiers <a.kurpiers@nt.tu-darmstadt.de>
+- First RPM.
+
--- a/frontend/Makefile.am
+++ b/frontend/Makefile.am
@@ -4,15 +4,10 @@
    audio.h
 
 AM_CFLAGS = -O2
-if HAVE_MPEG4IP
-einc=
-elib=-lmp4v2
-else
-einc=-I$(top_srcdir)/common/mp4v2
-elib=$(top_builddir)/common/mp4v2/libmp4v2.la
-endif
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/common/faad \
+   -I$(top_srcdir)/common/mp4ff
+LDADD = $(top_builddir)/libfaad/libfaad.la \
+   $(top_builddir)/common/mp4ff/libmp4ff.la
 
-INCLUDES = -I$(top_srcdir)/include $(einc) -I$(top_srcdir)/common/faad
-LDADD = $(top_builddir)/libfaad/libfaad.la $(elib) -lm
 
 CCLD = $(CXX)
--- a/frontend/main.c
+++ b/frontend/main.c
@@ -22,12 +22,13 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
 **
-** $Id: main.c,v 1.57 2003/11/02 20:24:03 menno Exp $
+** $Id: main.c,v 1.58 2003/11/06 11:04:13 menno Exp $
 **/
 
 #ifdef _WIN32
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
+typedef __int64 off_t
 #else
 #include <time.h>
 #endif
@@ -176,14 +177,14 @@
     return 0;
 }
 
-__int64 get_position_callback()
+off_t get_position_callback()
 {
     return ftell(g_mp4File);
 }
 
-__int64 get_length_callback()
+off_t get_length_callback()
 {
-    __int64 oldpos, size = 0;
+    off_t oldpos, size = 0;
     oldpos = ftell(g_mp4File);
     fseek(g_mp4File, 0, SEEK_END);
     size = ftell(g_mp4File);
@@ -191,7 +192,7 @@
     return size;
 }
 
-int seek_callback(__int64 position)
+int seek_callback(off_t position)
 {
     return fseek(g_mp4File, position, SEEK_SET);
 }
--- a/libfaad/Makefile.am
+++ b/libfaad/Makefile.am
@@ -15,7 +15,7 @@
 ssr_win.h specrec.h syntax.h structs.h tns.h \
 sbr_dct.h sbr_dec.h sbr_e_nf.h sbr_fbt.h sbr_hfadj.h sbr_hfgen.h \
 sbr_huff.h sbr_noise.h sbr_qmf.h sbr_syntax.h sbr_tf_grid.h \
-codebook/hcb.h \
+sbr_qmf_c.h codebook/hcb.h \
 codebook/hcb_1.h codebook/hcb_2.h codebook/hcb_3.h codebook/hcb_4.h \
 codebook/hcb_5.h codebook/hcb_6.h codebook/hcb_7.h codebook/hcb_8.h \
 codebook/hcb_9.h codebook/hcb_10.h codebook/hcb_11.h codebook/hcb_sf.h
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -1,12 +1,12 @@
 if HAVE_MPEG4IP
 if HAVE_XMMS
-SUBDIRS = mpeg4ip xmms
+SUBDIRS = mpeg4ip xmms xmmsmp4
 else
 SUBDIRS = mpeg4ip
 endif
 else
 if HAVE_XMMS
-SUBDIRS = xmms
+SUBDIRS = xmms xmmsmp4
 else
 SUBDIRS = 
 endif
--- a/plugins/xmms/src/Makefile.am
+++ b/plugins/xmms/src/Makefile.am
@@ -1,10 +1,13 @@
+libdir = `xmms-config --input-plugin-dir`
 lib_LTLIBRARIES = libaac.la
 
-if USE_STATIC_FAAD2
-  INCLUDES = -I../../../include
-  libaac_la_LDFLAGS = -module -avoid-version `xmms-config --libs` -lpthread -lid3 -lstdc++ -lz
-  libaac_la_LIBADD = ../../../libfaad/libfaad.la
-else
-  libaac_la_LDFLAGS = -module -avoid-version `xmms-config --libs` -lpthread -lfaad -lz -lid3 -lstdc++
-endif
-libaac_la_SOURCES = libaac.c id3.cpp dialog_gtk1.c aac_utils.c
+libaac_la_CFLAGS = `xmms-config --cflags` `$GTK_CONFIG --cflags` -Wall \
+	-I$(top_builddir)/include 
+	
+libaac_la_LIBADD = $(top_builddir)/libfaad/libfaad.la
+
+libaac_la_LDFLAGS = -module -avoid-version `xmms-config --libs` \
+	`$GTK_CONFIG --libs` -lpthread -lz -lid3 -lstdc++
+libaac_la_SOURCES = libaac.c id3.cpp dialog_gtk1.c aac_utils.c \
+	aac_utils.h
+
--- /dev/null
+++ b/plugins/xmmsmp4/Makefile.am
@@ -1,0 +1,2 @@
+SUBDIRS = src
+
--- a/plugins/xmmsmp4/src/Makefile.am
+++ b/plugins/xmmsmp4/src/Makefile.am
@@ -1,10 +1,12 @@
 libdir = `xmms-config --input-plugin-dir`
 
 lib_LTLIBRARIES = libmp4.la
-libmp4_la_CFLAGS = -I../mp4v2 -I../libmp4v2-include -I../libfaad-include `xmms-config --cflags` -DHAVE_GLIB_H=1
+libmp4_la_CFLAGS = -I$(top_builddir)/common/mp4v2 \
+	-I$(top_builddir)/include \
+	`xmms-config --cflags` -DHAVE_GLIB_H=1
 
 libmp4_la_LDFLAGS = -module -avoid-version `xmms-config --libs` -lpthread -lstdc++ 
 
-libmp4_la_LIBADD = $(top_builddir)/libfaad/libfaad.la $(top_builddir)/mp4v2/libmp4v2.la
+libmp4_la_LIBADD = $(top_builddir)/libfaad/libfaad.la $(top_builddir)/common/mp4v2/libmp4v2.la
 
 libmp4_la_SOURCES = libmp4.c libmp4_utils.c libmp4_utils.h