changeset 31294:754c22e6d43f

Add support for compiling against external libmpeg2.
author diego
date Thu, 10 Jun 2010 11:55:44 +0000
parents a51baa308479
children 7bd1f0f95292
files Changelog configure
diffstat 2 files changed, 35 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/Changelog	Thu Jun 10 09:52:30 2010 +0000
+++ b/Changelog	Thu Jun 10 11:55:44 2010 +0000
@@ -18,6 +18,7 @@
     * internal liba52 copy removed
     * CineForm HD (CFHD) via binary DLL
     * VP8 decoding through libvpx wrapper in FFmpeg
+    * support for external libmpeg2 added
 
     Demuxers:
     * Mostly fixed timing issues with some H.264 (PAFF) samples
--- a/configure	Thu Jun 10 09:52:30 2010 +0000
+++ b/configure	Thu Jun 10 11:55:44 2010 +0000
@@ -339,6 +339,7 @@
   --enable-libdca           enable libdca support [autodetect]
   --disable-mp3lib          disable builtin mp3lib [autodetect]
   --disable-liba52          disable liba52 [autodetect]
+  --disable-libmpeg2        disable libmpeg2 [autodetect]
   --disable-libmpeg2-internal disable builtin libmpeg2 [autodetect]
   --disable-musepack        disable musepack support [autodetect]
   --disable-libopencore_amrnb disable libopencore_amr narrowband [autodetect]
@@ -634,6 +635,7 @@
 _mp3lib=auto
 _liba52=auto
 _libdca=auto
+_libmpeg2=auto
 _libmpeg2_internal=auto
 _faad=auto
 _faad_internal=auto
@@ -1031,8 +1033,10 @@
   --disable-liba52)     _liba52=no      ;;
   --enable-libdca)      _libdca=yes     ;;
   --disable-libdca)     _libdca=no      ;;
-  --enable-libmpeg2_internal)    _libmpeg2_internal=yes   ;;
-  --disable-libmpeg2_internal)   _libmpeg2_internal=no    ;;
+  --enable-libmpeg2)    _libmpeg2=yes   ;;
+  --disable-libmpeg2)   _libmpeg2=no    ;;
+  --enable-libmpeg2-internal)    _libmpeg2_internal=yes   ;;
+  --disable-libmpeg2-internal)   _libmpeg2_internal=no    ;;
   --enable-musepack)    _musepack=yes   ;;
   --disable-musepack)   _musepack=no    ;;
   --enable-faad)        _faad=yes       ;;
@@ -6836,31 +6840,47 @@
 fi
 echores "$_liba52"
 
-echocheck "internal libmpeg2 support"
+
+echocheck "libmpeg2 support"
 if test "$_libmpeg2_internal" = auto ; then
-  _libmpeg2=yes
-  _libmpeg2_internal=yes
   if alpha && test cc_vendor=gnu; then
     case $cc_version in
       2*|3.0*|3.1*) # cannot compile MVI instructions
-        _libmpeg2_=no
         _libmpeg2_internal=no
-        res_comment="broken gcc"
         ;;
     esac
-  fi
-fi
+  else
+    _libmpeg2=yes
+    _libmpeg2_internal=yes
+    res_comment="internal"
+  fi
+fi
+if test "$_libmpeg2" = auto ; then
+  _libmpeg2=no
+  cat > $TMPC << EOF
+#include <stdint.h>
+#include <mpeg2dec/mpeg2.h>
+int main(void) { return 0; }
+EOF
+  cc_check -lmpeg2 && _libmpeg2=yes && extra_ldflags="$extra_ldflags -lmpeg2"
+fi
+
+def_libmpeg2='#undef CONFIG_LIBMPEG2'
+def_libmpeg2_internal='#undef CONFIG_LIBMPEG2_INTERNAL'
 if test "$_libmpeg2" = yes ; then
   def_libmpeg2='#define CONFIG_LIBMPEG2 1'
-  def_libmpeg2_internal='#define CONFIG_LIBMPEG2_INTERNAL 1'
-  codecmodules="libmpeg2(internal) $codecmodules"
-else
-  def_libmpeg2='#undef CONFIG_LIBMPEG2'
-  def_libmpeg2_internal='#undef CONFIG_LIBMPEG2_INTERNAL'
+  if test "$_libmpeg2_internal" = yes ; then
+    def_libmpeg2_internal='#define CONFIG_LIBMPEG2_INTERNAL 1'
+    codecmodules="libmpeg2(internal) $codecmodules"
+  else
+    codecmodules="libmpeg2 $codecmodules"
+  fi
+else
   nocodecmodules="libmpeg2 $nocodecmodules"
 fi
 echores "$_libmpeg2"
 
+
 echocheck "libdca support"
 if test "$_libdca" = auto ; then
   _libdca=no