* 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.

This commit is contained in:
Gildas Bazin 2003-04-20 11:57:13 +00:00
parent 50000c8a82
commit 0adb6a63ec
7 changed files with 99 additions and 45 deletions

View 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

View 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>
*
@ -45,7 +45,12 @@
#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"

View 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>
*
@ -38,7 +38,12 @@
# 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)
@ -48,7 +53,11 @@
#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

View 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>
@ -39,11 +39,21 @@
# 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

View 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
*
@ -33,7 +33,12 @@
#include "codecs.h"
#include <avcodec.h>
/* ffmpeg header */
#ifdef HAVE_FFMPEG_AVCODEC_H
# include <ffmpeg/avcodec.h>
#else
# include <avcodec.h>
#endif
/*****************************************************************************
* Local prototypes

View 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
*
@ -34,7 +34,12 @@
#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 * );

View 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>
*
@ -31,7 +31,12 @@
#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