]> git.sesse.net Git - vlc/commitdiff
* configure.ac.in, modules/codec/ffmpeg/*, modules/encoder/ffmpeg/*, modules/stream_o...
authorGildas Bazin <gbazin@videolan.org>
Sun, 20 Apr 2003 11:57:13 +0000 (11:57 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sun, 20 Apr 2003 11:57:13 +0000 (11:57 +0000)
configure.ac.in
modules/codec/ffmpeg/audio.c
modules/codec/ffmpeg/ffmpeg.c
modules/codec/ffmpeg/video.c
modules/encoder/ffmpeg/audio.c
modules/encoder/ffmpeg/video.c
modules/stream_out/transcode.c

index 96b4424128712e88d233fb41ec86df2c143b1706..0996baa6c5514c7ba60d281dd58dce64dff4ef46 100644 (file)
@@ -1507,41 +1507,59 @@ AC_ARG_ENABLE(ffmpeg,
 if test "x${enable_ffmpeg}" = "xyes"
 then
   AC_ARG_WITH(ffmpeg,
-    [    --with-ffmpeg=PATH    path to ffmpeg installation],[],[])
-  if test "x${with_ffmpeg}" != "xno" -a "x${with_ffmpeg}" != "x"
-  then
+    [    --with-ffmpeg=PATH    path to ffmpeg installation])
+  AC_ARG_WITH(ffmpeg-tree,
+    [    --with-ffmpeg-tree=PATH ffmpeg tree for static linking])
+
+  dnl
+  dnl test for --with-ffmpeg
+  dnl
+  if test "x${with_ffmpeg}" != "xno" -a "x${with_ffmpeg}" != "x"; then
     CPPFLAGS_ffmpeg="${CPPFLAGS_ffmpeg} -I${with_ffmpeg}/include/ffmpeg"
     LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -L${with_ffmpeg}/lib"
 
     CPPFLAGS_stream_out_transcode="${CPPFLAGS_stream_out_transcode} -I${with_ffmpeg}/include/ffmpeg"
     LDFLAGS_stream_out_transcode="${LDFLAGS_stream_out_transcode} -L${with_ffmpeg}/lib"
-
   fi
 
-  dnl Add postprocessing modules
-  PLUGINS="${PLUGINS} postprocessing_c"
-  if test "x${ac_cv_mmx_inline}" != "xno"; then
-    PLUGINS="${PLUGINS} postprocessing_mmx"
+  dnl
+  dnl test for !(--with-ffmpeg) && !(--with-ffmpeg-tree)
+  dnl
+  if test "x${with_ffmpeg_tree}" == "xno" -o "x${with_ffmpeg_tree}" == "x";then
+    if test "x${with_ffmpeg}" == "xno" -o "x${with_ffmpeg}" == "x"; then
+      AC_CHECK_HEADERS(ffmpeg/avcodec.h postproc/postprocess.h)
+    fi
   fi
 
-  if test "x${ac_cv_mmxext_inline}" != "xno"; then
-    PLUGINS="${PLUGINS} postprocessing_mmxext"
+  dnl
+  dnl test for !(--with-ffmpeg-tree)
+  dnl
+  if test "x${with_ffmpeg}" == "xno" -o "x${with_ffmpeg}" == "x"; then
+    CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_ffmpeg}"
+    LDFLAGS="${LDFLAGS_save} ${LDFLAGS_ffmpeg}"
+    AC_CHECK_LIB(avcodec, avcodec_init, [
+      BUILTINS="${BUILTINS} ffmpeg stream_out_transcode"
+      LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -lavcodec"
+      dnl  XXX: we don't link with -lavcodec a 2nd time because the OS X
+      dnl       linker would miserably barf on multiple definitions.
+      LDFLAGS_stream_out_transcode="${LDFLAGS_stream_out_transcode}" ],
+      [ AC_MSG_ERROR([Cannot find libavcodec library...]) ])
+    LDFLAGS="${LDFLAGS_save}"
+    CPPFLAGS="${CPPFLAGS_save}"
   fi
 
-  AC_ARG_WITH(ffmpeg-tree,
-  [    --with-ffmpeg-tree=PATH ffmpeg tree for static linking])
-  if test "x${with_ffmpeg_tree}" != "x"
-  then
+  dnl
+  dnl test for --with-ffmpeg-tree
+  dnl
+  if test "x${with_ffmpeg_tree}" != "xno" -a "x${with_ffmpeg_tree}" != "x";then
     AC_MSG_CHECKING(for libavcodec.a in ${with_ffmpeg_tree})
     real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
-    if test "x${real_ffmpeg_tree}" = x
-    then
+    if test "x${real_ffmpeg_tree}" = x; then
       dnl  The given directory can't be found
       AC_MSG_RESULT(no)
       AC_MSG_ERROR([cannot cd to ${with_ffmpeg_tree}])
     fi
-    if test -f "${real_ffmpeg_tree}/libavcodec/libavcodec.a"
-    then
+    if test -f "${real_ffmpeg_tree}/libavcodec/libavcodec.a"; then
       dnl  Use a custom libffmpeg
       AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodec.a)
       BUILTINS="${BUILTINS} ffmpeg stream_out_transcode"
@@ -1552,24 +1570,21 @@ then
       dnl       linker would miserably barf on multiple definitions.
       LDFLAGS_stream_out_transcode="${LDFLAGS_stream_out_transcode} -L${real_ffmpeg_tree}/libavcodec"
       CPPFLAGS_stream_out_transcode="${CPPFLAGS_stream_out_transcode} -I${real_ffmpeg_tree}/libavcodec"
-
     else
       dnl  The given libavcodec wasn't built
       AC_MSG_RESULT(no)
       AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}])
     fi
-  else
-    CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_ffmpeg}"
-    LDFLAGS="${LDFLAGS_save} ${LDFLAGS_ffmpeg}"
-    AC_CHECK_LIB(avcodec, avcodec_init, [
-      BUILTINS="${BUILTINS} ffmpeg stream_out_transcode"
-      LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -lavcodec" 
-      dnl  XXX: we don't link with -lavcodec a 2nd time because the OS X
-      dnl       linker would miserably barf on multiple definitions.
-      LDFLAGS_stream_out_transcode="${LDFLAGS_stream_out_transcode}" ],
-      [ AC_MSG_ERROR([Cannot find libavcodec library...]) ])
-    LDFLAGS="${LDFLAGS_save}"
-    CPPFLAGS="${CPPFLAGS_save}"
+  fi
+
+  dnl Add postprocessing modules
+  PLUGINS="${PLUGINS} postprocessing_c"
+  if test "x${ac_cv_mmx_inline}" != "xno"; then
+    PLUGINS="${PLUGINS} postprocessing_mmx"
+  fi
+
+  if test "x${ac_cv_mmxext_inline}" != "xno"; then
+    PLUGINS="${PLUGINS} postprocessing_mmxext"
   fi
 fi
 
index 34ef406848b777a30a5f3e4154d896103da18106..d38d06e9dffc9f856be76f532517d5d683dd3b51 100644 (file)
@@ -2,7 +2,7 @@
  * audio.c: audio decoder using ffmpeg library
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: audio.c,v 1.15 2003/04/17 10:58:30 fenrir Exp $
+ * $Id: audio.c,v 1.16 2003/04/20 11:57:13 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
 #include "codecs.h"
 #include "aout_internal.h"
 
-#include "avcodec.h"                                            /* ffmpeg */
+/* ffmpeg header */
+#ifdef HAVE_FFMPEG_AVCODEC_H
+#   include <ffmpeg/avcodec.h>
+#else
+#   include <avcodec.h>
+#endif
 
 //#include "postprocessing/postprocessing.h"
 #include "ffmpeg.h"
index 983802f68345daf44d9d65171524264511cf61e0..b7ff89cba4e00ed75cbb9a17f35eaf60852bbb93 100644 (file)
@@ -2,7 +2,7 @@
  * ffmpeg.c: video decoder using ffmpeg library
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: ffmpeg.c,v 1.30 2003/04/17 10:58:30 fenrir Exp $
+ * $Id: ffmpeg.c,v 1.31 2003/04/20 11:57:13 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
 #   include <sys/times.h>
 #endif
 
-#include "avcodec.h" /* ffmpeg */
+/* ffmpeg header */
+#ifdef HAVE_FFMPEG_AVCODEC_H
+#   include <ffmpeg/avcodec.h>
+#else
+#   include <avcodec.h>
+#endif
 
 #if LIBAVCODEC_BUILD < 4655
 #   error You must have a libavcodec >= 4655 (get CVS)
 #include "ffmpeg.h"
 
 #ifdef LIBAVCODEC_PP
-#   include "libpostproc/postprocess.h"
+#   ifndef HAVE_POSTPROC_POSTPROCESS_H
+#       include <postproc/postprocess.h>
+#   else
+#       include <libpostproc/postprocess.h>
+#   endif
 #else
 #   include "postprocessing/postprocessing.h"
 #endif
index 7df0e832b3c25a01c7b04cf3d91f66b9452c24c3..3f8320c405e09ab64632a911a734998754cf3036 100644 (file)
@@ -2,7 +2,7 @@
  * video.c: video decoder using ffmpeg library
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: video.c,v 1.20 2003/04/17 10:58:30 fenrir Exp $
+ * $Id: video.c,v 1.21 2003/04/20 11:57:13 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin@netcourrier.com>
 #   include <sys/times.h>
 #endif
 
-#include "avcodec.h"                                               /* ffmpeg */
+/* ffmpeg header */
+#ifdef HAVE_FFMPEG_AVCODEC_H
+#   include <ffmpeg/avcodec.h>
+#else
+#   include <avcodec.h>
+#endif
+
 #include "ffmpeg.h"
 
 #ifdef LIBAVCODEC_PP
-#   include "libpostproc/postprocess.h"
+#   ifdef HAVE_POSTPROC_POSTPROCESS_H
+#       include <postproc/postprocess.h>
+#   else
+#       include <libpostproc/postprocess.h>
+#   endif
 #else
 #   include "postprocessing/postprocessing.h"
 #endif
index 5d0fa8a6884009e6378103fbb4b4679eb22648b5..21bc0a2d62b7999f25a764e3ed09df9d32a15599 100644 (file)
@@ -2,7 +2,7 @@
  * audio.c : audio encoder using ffmpeg library
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: audio.c,v 1.1 2003/01/22 10:41:57 fenrir Exp $
+ * $Id: audio.c,v 1.2 2003/04/20 11:57:13 gbazin Exp $
  *
  * Authors: Laurent Aimar
  *
 
 #include "codecs.h"
 
-#include <avcodec.h>
+/* ffmpeg header */
+#ifdef HAVE_FFMPEG_AVCODEC_H
+#   include <ffmpeg/avcodec.h>
+#else
+#   include <avcodec.h>
+#endif
 
 /*****************************************************************************
  * Local prototypes
index 89d36629eb342799d937f4e7ed1d214faa08ade7..f1e34ac28302211b2937cf19a7d2e4c1d295c7bd 100644 (file)
@@ -2,7 +2,7 @@
  * video.c : video encoder using ffmpeg library
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: video.c,v 1.1 2003/01/22 10:41:57 fenrir Exp $
+ * $Id: video.c,v 1.2 2003/04/20 11:57:13 gbazin Exp $
  *
  * Authors: Laurent Aimar
  *
 #include "codecs.h"
 #include "encoder.h"
 
-#include <avcodec.h>
+/* ffmpeg header */
+#ifdef HAVE_FFMPEG_AVCODEC_H
+#   include <ffmpeg/avcodec.h>
+#else
+#   include <avcodec.h>
+#endif
 
 int  E_( OpenEncoderVideo ) ( vlc_object_t * );
 void E_( CloseEncoderVideo )( vlc_object_t * );
index ee5f99af71fbbe902e3d0afcc58033e6770833ab..8b22c2a79163f2a78540ead6f5f92efe86ff1a04 100644 (file)
@@ -2,7 +2,7 @@
  * transcode.c
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: transcode.c,v 1.3 2003/04/16 16:33:35 fenrir Exp $
+ * $Id: transcode.c,v 1.4 2003/04/20 11:57:13 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
 #include <vlc/input.h>
 #include <vlc/sout.h>
 
-#include <avcodec.h>
+/* ffmpeg header */
+#ifdef HAVE_FFMPEG_AVCODEC_H
+#   include <ffmpeg/avcodec.h>
+#else
+#   include <avcodec.h>
+#endif
 
 /*****************************************************************************
  * Exported prototypes