[mythtv] [PATCH] mythmusic AAC support

Lonnie Hutchinson gdchinacat at comcast.net
Mon Jan 10 22:35:21 EST 2005


This patch adds AAC support to mythmusic. It is a fairly simple port of 
the aacdecoder from mfd. You must enable it when you configure mythmusic 
using either the --enable-aac or --enable-all options.

It relies on FAAD2 from http://www.audiocoding.com. From the mfd/README:

        __NB__: As of March 5, 2004, you can build and install FAAD2 v2.0
        final, but you must manually copy mp4ff_int_types.h from 
faad2/common/mp4ff/
        to your usr/local/include/ directory.

        This is fairly annoying, but not insurmountable.

The commitMetadata(...) method doesn't do anything beyond log an error 
that it is ignoring the request.  This is my next task...to create a 
mataiomp4 class for reading/writing the mp4 metadata.

I haven't spent much time looking at aacdecoder, pretty much just 
whatever was required to get it to work. If you see problems with it, 
please bring them to my attention, I'd like to get this to the quality 
of the rest of MythTV.

Isaac, Please consider this for inclusion in CVS. I've had it running 
continuously for 2 days without a glitch (that I have noticed...I wasn't 
listening to it for 2 days straight...just now and then).  If you'd 
rather wait till the metaiomp4 work is complete I understand, I expect 
to be done with that in the next week or so (depending on work, life, etc).

-------------- next part --------------
? mythmusic/aacdecoder.cpp
? mythmusic/aacdecoder.h
Index: configure
===================================================================
RCS file: /var/lib/mythcvs/mythmusic/configure,v
retrieving revision 1.7
diff -u -d -w -r1.7 configure
--- configure	8 Aug 2003 17:26:09 -0000	1.7
+++ configure	11 Jan 2005 03:10:08 -0000
@@ -7,6 +7,7 @@
 opengl="no"
 fftw_lib="no"
 sdl="no"
+aac="no"
 
 for opt do
   case "$opt" in
@@ -16,7 +17,9 @@
   ;;
   --enable-sdl) sdl="yes"
   ;;
-  --enable-all) sdl="yes"; opengl="yes"; fftw_lib="yes";
+  --enable-aac) aac="yes"
+  ;;
+  --enable-all) sdl="yes"; opengl="yes"; fftw_lib="yes"; aac="yes";
   ;;
   esac
 done
@@ -32,6 +35,7 @@
   --enable-fftw            enable fftw visualizers [default=no]
   --enable-opengl          enable OpenGL visualizers [default=no]
   --enable-sdl             use SDL for the synaesthesia output [default=no]
+  --enable-aac             enable AAC/MP4 audio file decompression [default=no]
   --enable-all             Enable all of the above.
 EOF
 exit 1
@@ -78,9 +82,19 @@
   echo "QMAKE_CXXFLAGS_RELEASE += `sdl-config --cflags`" >> ./mythmusic/config.pro
   echo "QMAKE_CXXFLAGS_DEBUG += `sdl-config --cflags`" >> ./mythmusic/config.pro
 fi
-
 if test "$sdl" = "no" ; then
   echo "        SDL    support will not be included"
 fi
+
+if test "$aac" = "yes" ; then
+  echo "        AAC    support will be included"
+  echo "#define AAC_SUPPORT 1" >> ./mythmusic/config.h
+  echo "LIBS += -lfaad -lmp4ff" >> ./mythmusic/config.pro
+  echo "HEADERS += aacdecoder.h" >> ./mythmusic/config.pro
+  echo "SOURCES += aacdecoder.cpp" >> ./mythmusic/config.pro
+fi
+if test "$aac" = "no" ; then
+  echo "        AAC    support will not be included"
+fi
 echo ""
 
Index: mythmusic/decoder.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythmusic/mythmusic/decoder.cpp,v
retrieving revision 1.10
diff -u -d -w -r1.10 decoder.cpp
--- mythmusic/decoder.cpp	26 Nov 2004 00:13:04 -0000	1.10
+++ mythmusic/decoder.cpp	11 Jan 2005 03:10:08 -0000
@@ -119,6 +119,9 @@
         Decoder::registerFactory(new FlacDecoderFactory);
         Decoder::registerFactory(new CdDecoderFactory);
         Decoder::registerFactory(new avfDecoderFactory);
+#ifdef AAC_SUPPORT
+        Decoder::registerFactory(new aacDecoderFactory);
+#endif
     }
 }
 
Index: mythmusic/decoder.h
===================================================================
RCS file: /var/lib/mythcvs/mythmusic/mythmusic/decoder.h,v
retrieving revision 1.9
diff -u -d -w -r1.9 decoder.h
--- mythmusic/decoder.h	26 Nov 2004 00:13:04 -0000	1.9
+++ mythmusic/decoder.h	11 Jan 2005 03:10:08 -0000
@@ -1,6 +1,7 @@
 #ifndef DECODER_H_
 #define DECODER_H_
 
+#include "config.h"
 #include <qstring.h>
 #include <qevent.h>
 #include <qthread.h>
@@ -166,4 +167,15 @@
     Decoder *create(const QString &, QIODevice *, Output *, bool);
 };
 
+#ifdef AAC_SUPPORT
+class aacDecoderFactory : public DecoderFactory
+{
+public:
+    bool supports(const QString &) const;
+    const QString &extension() const;
+    const QString &description() const;
+    Decoder *create(const QString &, QIODevice *, Output *, bool);
+};
+#endif
+
 #endif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aacdecoder.h
Type: text/x-chdr
Size: 1441 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20050110/a8b5f745/aacdecoder.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aacdecoder.cpp
Type: text/x-c++src
Size: 21992 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20050110/a8b5f745/aacdecoder.cpp


More information about the mythtv-dev mailing list