Commit 0adb6a63 authored by Gildas Bazin's avatar Gildas Bazin

* configure.ac.in, modules/codec/ffmpeg/*, modules/encoder/ffmpeg/*, modules/stream_out/transcode.c: fixed detection of the ffmpeg headers/libs when they are installed in their default location.
parent 50000c8a
...@@ -1507,41 +1507,59 @@ AC_ARG_ENABLE(ffmpeg, ...@@ -1507,41 +1507,59 @@ AC_ARG_ENABLE(ffmpeg,
if test "x${enable_ffmpeg}" = "xyes" if test "x${enable_ffmpeg}" = "xyes"
then then
AC_ARG_WITH(ffmpeg, AC_ARG_WITH(ffmpeg,
[ --with-ffmpeg=PATH path to ffmpeg installation],[],[]) [ --with-ffmpeg=PATH path to ffmpeg installation])
if test "x${with_ffmpeg}" != "xno" -a "x${with_ffmpeg}" != "x" AC_ARG_WITH(ffmpeg-tree,
then [ --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" CPPFLAGS_ffmpeg="${CPPFLAGS_ffmpeg} -I${with_ffmpeg}/include/ffmpeg"
LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -L${with_ffmpeg}/lib" LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -L${with_ffmpeg}/lib"
CPPFLAGS_stream_out_transcode="${CPPFLAGS_stream_out_transcode} -I${with_ffmpeg}/include/ffmpeg" 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" LDFLAGS_stream_out_transcode="${LDFLAGS_stream_out_transcode} -L${with_ffmpeg}/lib"
fi fi
dnl Add postprocessing modules dnl
PLUGINS="${PLUGINS} postprocessing_c" dnl test for !(--with-ffmpeg) && !(--with-ffmpeg-tree)
if test "x${ac_cv_mmx_inline}" != "xno"; then dnl
PLUGINS="${PLUGINS} postprocessing_mmx" 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 fi
if test "x${ac_cv_mmxext_inline}" != "xno"; then dnl
PLUGINS="${PLUGINS} postprocessing_mmxext" 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 fi
AC_ARG_WITH(ffmpeg-tree, dnl
[ --with-ffmpeg-tree=PATH ffmpeg tree for static linking]) dnl test for --with-ffmpeg-tree
if test "x${with_ffmpeg_tree}" != "x" dnl
then if test "x${with_ffmpeg_tree}" != "xno" -a "x${with_ffmpeg_tree}" != "x";then
AC_MSG_CHECKING(for libavcodec.a in ${with_ffmpeg_tree}) AC_MSG_CHECKING(for libavcodec.a in ${with_ffmpeg_tree})
real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`" real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
if test "x${real_ffmpeg_tree}" = x if test "x${real_ffmpeg_tree}" = x; then
then
dnl The given directory can't be found dnl The given directory can't be found
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
AC_MSG_ERROR([cannot cd to ${with_ffmpeg_tree}]) AC_MSG_ERROR([cannot cd to ${with_ffmpeg_tree}])
fi fi
if test -f "${real_ffmpeg_tree}/libavcodec/libavcodec.a" if test -f "${real_ffmpeg_tree}/libavcodec/libavcodec.a"; then
then
dnl Use a custom libffmpeg dnl Use a custom libffmpeg
AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodec.a) AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodec.a)
BUILTINS="${BUILTINS} ffmpeg stream_out_transcode" BUILTINS="${BUILTINS} ffmpeg stream_out_transcode"
...@@ -1552,24 +1570,21 @@ then ...@@ -1552,24 +1570,21 @@ then
dnl linker would miserably barf on multiple definitions. dnl linker would miserably barf on multiple definitions.
LDFLAGS_stream_out_transcode="${LDFLAGS_stream_out_transcode} -L${real_ffmpeg_tree}/libavcodec" 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" CPPFLAGS_stream_out_transcode="${CPPFLAGS_stream_out_transcode} -I${real_ffmpeg_tree}/libavcodec"
else else
dnl The given libavcodec wasn't built dnl The given libavcodec wasn't built
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}]) AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}])
fi fi
else fi
CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_ffmpeg}"
LDFLAGS="${LDFLAGS_save} ${LDFLAGS_ffmpeg}" dnl Add postprocessing modules
AC_CHECK_LIB(avcodec, avcodec_init, [ PLUGINS="${PLUGINS} postprocessing_c"
BUILTINS="${BUILTINS} ffmpeg stream_out_transcode" if test "x${ac_cv_mmx_inline}" != "xno"; then
LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -lavcodec" PLUGINS="${PLUGINS} postprocessing_mmx"
dnl XXX: we don't link with -lavcodec a 2nd time because the OS X fi
dnl linker would miserably barf on multiple definitions.
LDFLAGS_stream_out_transcode="${LDFLAGS_stream_out_transcode}" ], if test "x${ac_cv_mmxext_inline}" != "xno"; then
[ AC_MSG_ERROR([Cannot find libavcodec library...]) ]) PLUGINS="${PLUGINS} postprocessing_mmxext"
LDFLAGS="${LDFLAGS_save}"
CPPFLAGS="${CPPFLAGS_save}"
fi fi
fi fi
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* audio.c: audio decoder using ffmpeg library * audio.c: audio decoder using ffmpeg library
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * 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> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -45,7 +45,12 @@ ...@@ -45,7 +45,12 @@
#include "codecs.h" #include "codecs.h"
#include "aout_internal.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 "postprocessing/postprocessing.h"
#include "ffmpeg.h" #include "ffmpeg.h"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ffmpeg.c: video decoder using ffmpeg library * ffmpeg.c: video decoder using ffmpeg library
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * 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> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -38,7 +38,12 @@ ...@@ -38,7 +38,12 @@
# include <sys/times.h> # include <sys/times.h>
#endif #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 #if LIBAVCODEC_BUILD < 4655
# error You must have a libavcodec >= 4655 (get CVS) # error You must have a libavcodec >= 4655 (get CVS)
...@@ -48,7 +53,11 @@ ...@@ -48,7 +53,11 @@
#include "ffmpeg.h" #include "ffmpeg.h"
#ifdef LIBAVCODEC_PP #ifdef LIBAVCODEC_PP
# include "libpostproc/postprocess.h" # ifndef HAVE_POSTPROC_POSTPROCESS_H
# include <postproc/postprocess.h>
# else
# include <libpostproc/postprocess.h>
# endif
#else #else
# include "postprocessing/postprocessing.h" # include "postprocessing/postprocessing.h"
#endif #endif
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* video.c: video decoder using ffmpeg library * video.c: video decoder using ffmpeg library
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * 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> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com> * Gildas Bazin <gbazin@netcourrier.com>
...@@ -39,11 +39,21 @@ ...@@ -39,11 +39,21 @@
# include <sys/times.h> # include <sys/times.h>
#endif #endif
#include "avcodec.h" /* ffmpeg */ /* ffmpeg header */
#ifdef HAVE_FFMPEG_AVCODEC_H
# include <ffmpeg/avcodec.h>
#else
# include <avcodec.h>
#endif
#include "ffmpeg.h" #include "ffmpeg.h"
#ifdef LIBAVCODEC_PP #ifdef LIBAVCODEC_PP
# include "libpostproc/postprocess.h" # ifdef HAVE_POSTPROC_POSTPROCESS_H
# include <postproc/postprocess.h>
# else
# include <libpostproc/postprocess.h>
# endif
#else #else
# include "postprocessing/postprocessing.h" # include "postprocessing/postprocessing.h"
#endif #endif
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* audio.c : audio encoder using ffmpeg library * audio.c : audio encoder using ffmpeg library
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * 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 * Authors: Laurent Aimar
* *
...@@ -33,7 +33,12 @@ ...@@ -33,7 +33,12 @@
#include "codecs.h" #include "codecs.h"
#include <avcodec.h> /* ffmpeg header */
#ifdef HAVE_FFMPEG_AVCODEC_H
# include <ffmpeg/avcodec.h>
#else
# include <avcodec.h>
#endif
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* video.c : video encoder using ffmpeg library * video.c : video encoder using ffmpeg library
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * 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 * Authors: Laurent Aimar
* *
...@@ -34,7 +34,12 @@ ...@@ -34,7 +34,12 @@
#include "codecs.h" #include "codecs.h"
#include "encoder.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 * ); int E_( OpenEncoderVideo ) ( vlc_object_t * );
void E_( CloseEncoderVideo )( vlc_object_t * ); void E_( CloseEncoderVideo )( vlc_object_t * );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* transcode.c * transcode.c
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * 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> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -31,7 +31,12 @@ ...@@ -31,7 +31,12 @@
#include <vlc/input.h> #include <vlc/input.h>
#include <vlc/sout.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 * Exported prototypes
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment