From 39b7c3aaa034f89c68e57e528a6f8d1b401c6ce6 Mon Sep 17 00:00:00 2001 From: Derk-Jan Hartman Date: Fri, 17 Nov 2006 23:34:45 +0000 Subject: [PATCH] * Fix ffmpeg include's --- configure.ac | 15 ++++++++++++++- modules/codec/ffmpeg/demux.c | 2 +- modules/codec/ffmpeg/mux.c | 2 +- modules/codec/ffmpeg/scale.c | 2 +- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 983fc12153..6186e9e5e4 100644 --- a/configure.ac +++ b/configure.ac @@ -2739,6 +2739,12 @@ dnl Those options have to be here because the .pc can be bogus for ffmpeg previo VLC_ADD_LDFLAGS([ffmpeg],[-L${real_ffmpeg_tree}/libavformat ${real_ffmpeg_tree}/libavformat/libavformat.a]) VLC_ADD_CPPFLAGS([ffmpeg stream_out_switcher],[-I${real_ffmpeg_tree}/libavformat]) fi + + if test -f "${real_ffmpeg_tree}/libswscale/libswscale.a"; then + AC_DEFINE(HAVE_LIBSWSCALE_TREE, 1, [Define if you have ffmpeg's libswscale.]) + VLC_ADD_LDFLAGS([ffmpeg],[-L${real_ffmpeg_tree}/libswscale ${real_ffmpeg_tree}/libswscale/libswscale.a]) + VLC_ADD_CPPFLAGS([ffmpeg stream_out_switcher],[-I${real_ffmpeg_tree}/libswscale]) + fi else dnl Look for a ffmpeg-config (we are on debian ) @@ -2753,7 +2759,7 @@ dnl Look for a ffmpeg-config (we are on debian ) AC_PATH_PROG(FFMPEG_CONFIG, ffmpeg-config, no, ${FFMPEG_PATH}) if test "${FFMPEG_CONFIG}" != "no" then - AC_CHECK_HEADERS(ffmpeg/avcodec.h, [], [AC_MSG_ERROR([Missing header file ffmpeg/avcodec.h.])] ) + AC_CHECK_HEADERS(ffmpeg/avcodec.h, [], [AC_MSG_ERROR([Missing header file ffmpeg/avcodec.h.])] ) AC_CHECK_HEADERS(ffmpeg/avformat.h) AC_CHECK_HEADERS(ffmpeg/avutil.h) AC_CHECK_HEADERS(postproc/postprocess.h, [], [AC_MSG_ERROR([Missing header file postproc/postprocess.h.])] ) @@ -2772,6 +2778,7 @@ dnl Trying with pkg-config AC_CHECK_HEADERS(ffmpeg/avcodec.h, [], [AC_MSG_ERROR([Missing header file ffmpeg/avcodec.h.])] ) AC_CHECK_HEADERS(ffmpeg/avformat.h) AC_CHECK_HEADERS(ffmpeg/avutil.h) + AC_CHECK_HEADERS(ffmpeg/swscale.h) AC_CHECK_HEADERS(postproc/postprocess.h, [], [AC_MSG_ERROR([Missing header file postproc/postprocess.h.])] ) if test "${SYS}" = "darwin"; then VLC_ADD_BUILTINS([ffmpeg]) @@ -2806,6 +2813,7 @@ dnl Trying with pkg-config LDFLAGS="${LDFLAGS_save} ${LDFLAGS_ffmpeg}" AC_CHECK_HEADERS(ffmpeg/avcodec.h, [], [AC_MSG_ERROR([Missing header file ffmpeg/avcodec.h.])] ) AC_CHECK_HEADERS(ffmpeg/avformat.h) + AC_CHECK_HEADERS(ffmpeg/swscale.h) AC_CHECK_HEADERS(ffmpeg/avutil.h) AC_CHECK_HEADERS(postproc/postprocess.h, [], [AC_MSG_ERROR([Missing header file postproc/postprocess.h.])] ) @@ -2831,6 +2839,11 @@ dnl Trying with pkg-config VLC_ADD_LDFLAGS([ffmpeg],[-lavformat -lz]) ], [], [-lavcodec -lz $LDAVUTIL]) LDFLAGS="${LDFLAGS_save}" CPPFLAGS="${CPPFLAGS_save}" + + AC_CHECK_LIB(swscale, sws_getContext, [ + VLC_ADD_LDFLAGS([ffmpeg],[-lswscale]) ], [], [-lavcodec $LDAVUTIL]) + LDFLAGS="${LDFLAGS_save}" + CPPFLAGS="${CPPFLAGS_save}" ]) fi fi diff --git a/modules/codec/ffmpeg/demux.c b/modules/codec/ffmpeg/demux.c index 42c03c1c1e..fb35b9a7a1 100644 --- a/modules/codec/ffmpeg/demux.c +++ b/modules/codec/ffmpeg/demux.c @@ -34,7 +34,7 @@ /* ffmpeg header */ #ifdef HAVE_FFMPEG_AVFORMAT_H # include -#else +#elif defined(HAVE_LIBAVFORMAT_TREE) # include #endif diff --git a/modules/codec/ffmpeg/mux.c b/modules/codec/ffmpeg/mux.c index 9ed07f1eea..c15bca4b7c 100644 --- a/modules/codec/ffmpeg/mux.c +++ b/modules/codec/ffmpeg/mux.c @@ -33,7 +33,7 @@ /* ffmpeg header */ #ifdef HAVE_FFMPEG_AVFORMAT_H # include -#else +#elif defined(HAVE_LIBAVFORMAT_TREE) # include #endif diff --git a/modules/codec/ffmpeg/scale.c b/modules/codec/ffmpeg/scale.c index 692253f865..7ad1bc5fe4 100644 --- a/modules/codec/ffmpeg/scale.c +++ b/modules/codec/ffmpeg/scale.c @@ -37,7 +37,7 @@ #ifdef HAVE_FFMPEG_SWSCALE_H # include -#else +#elif defined(HAVE_LIBSWSCALE_TREE) # include #endif -- 2.39.2