From 37e4a928ca78bad9ea5e7ec07c0561c511de8ac9 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Thu, 22 Dec 2011 01:07:12 +0200 Subject: configure, build: require at least Libav 0.7 Require versions of the Libav libraries corresponding to Libav release 0.7. These are: libavutil 51.7.0 libavcodec 53.5.0 libavformat 53.2.0 libswscale 2.0.0 libpostproc 52.0.0 Also disable the fallback to simple header check if these libraries could not be found with pkg-config; now compiling without pkg-config support for these always requires explicitly setting --enable-libav and any needed compiler/linker flags. The simple check would have let compilation proceed even if a version mismatch was detected. --- Makefile | 6 ++---- configure | 16 ++++------------ ffmpeg_files/taglists.c | 8 -------- fmt-conversion.c | 8 -------- libmpcodecs/vd_ffmpeg.c | 7 +------ libmpcodecs/vf.c | 2 -- libmpdemux/demux_lavf.c | 22 ---------------------- libmpdemux/demuxer.c | 2 -- libmpdemux/mp_taglists.c | 6 ------ stream/http.c | 3 --- stream/realrtsp/real.c | 3 --- sub/av_sub.c | 2 -- 12 files changed, 7 insertions(+), 78 deletions(-) diff --git a/Makefile b/Makefile index 8cb43cb50a..c92079d9e4 100644 --- a/Makefile +++ b/Makefile @@ -60,10 +60,6 @@ SRCS_COMMON-$(DVDREAD_INTERNAL) += libdvdread4/bitreader.c \ SRCS_COMMON-$(FAAD) += libmpcodecs/ad_faad.c SRCS_COMMON-$(FASTMEMCPY) += libvo/aclib.c -# Requires a new enough libavutil that installs eval.h -SRCS_COMMON-$(FFMPEG_EVAL_API) += libmpcodecs/vf_geq.c \ - libmpcodecs/vf_qp.c \ - # These filters use private headers and do not work with shared libavcodec. SRCS_COMMON-$(FFMPEG_INTERNALS) += libmpcodecs/vf_fspp.c \ libmpcodecs/vf_mcdeint.c \ @@ -316,6 +312,7 @@ SRCS_COMMON = asxparser.c \ libmpcodecs/vf_flip.c \ libmpcodecs/vf_format.c \ libmpcodecs/vf_framestep.c \ + libmpcodecs/vf_geq.c \ libmpcodecs/vf_gradfun.c \ libmpcodecs/vf_halfpack.c \ libmpcodecs/vf_harddup.c \ @@ -337,6 +334,7 @@ SRCS_COMMON = asxparser.c \ libmpcodecs/vf_pp.c \ libmpcodecs/vf_pp7.c \ libmpcodecs/vf_pullup.c \ + libmpcodecs/vf_qp.c \ libmpcodecs/vf_rectangle.c \ libmpcodecs/vf_remove_logo.c \ libmpcodecs/vf_rgbtest.c \ diff --git a/configure b/configure index e46650fdb7..83782c9349 100755 --- a/configure +++ b/configure @@ -6003,27 +6003,21 @@ echores "$_live" -all_libav_libs="libavutil libavcodec libavformat libswscale libpostproc" +all_libav_libs="libavutil >= 51.7.0:libavcodec >= 53.5.0:libavformat >= 53.2.0:libswscale >= 2.0.0:libpostproc >= 52.0.0" echocheck "Libav ($all_libav_libs)" if test "$ffmpeg" = auto ; then + IFS=":" # shell should not be used for programming if $_pkg_config --exists --print-errors $all_libav_libs ; then inc_ffmpeg=$($_pkg_config --cflags $all_libav_libs) _ld_tmp=$($_pkg_config --libs $all_libav_libs) extra_ldflags="$extra_ldflags $_ld_tmp" extra_cflags="$extra_cflags $inc_ffmpeg" - elif header_check libavutil/avutil.h -lpostproc -lswscale -lavformat -lavcodec -lavutil $_ld_lm ; then - extra_ldflags="$extra_ldflags -lpostproc -lswscale -lavformat -lavcodec -lavutil" + unset IFS else die "Unable to find development files for some of the required Libav libraries above. Aborting." fi fi - -ffmpeg_eval_api=no -def_ffmpeg_eval_api="#undef CONFIG_FFMPEG_EVAL_API" -if $_pkg_config --atleast-version=50.33.0 libavutil ; then - ffmpeg_eval_api=yes - def_ffmpeg_eval_api="#define CONFIG_FFMPEG_EVAL_API 1" -fi +echores "yes" def_ffmpeg_internals="#undef CONFIG_FFMPEG_INTERNALS" if ! test -z "$_ffmpeg_source" ; then @@ -6790,7 +6784,6 @@ XVR100 = $_xvr100 YUV4MPEG = $_yuv4mpeg # FFmpeg -FFMPEG_EVAL_API = $ffmpeg_eval_api FFMPEG_INTERNALS = $ffmpeg_internals FFMPEG_SOURCE_PATH = $_ffmpeg_source @@ -7143,7 +7136,6 @@ $def_yuv4mpeg /* FFmpeg */ -$def_ffmpeg_eval_api $def_ffmpeg_internals $def_arpa_inet_h diff --git a/ffmpeg_files/taglists.c b/ffmpeg_files/taglists.c index 1596110907..ec414a35c1 100644 --- a/ffmpeg_files/taglists.c +++ b/ffmpeg_files/taglists.c @@ -181,9 +181,7 @@ const struct mp_AVCodecTag mp_ff_codec_bmp_tags[] = { { CODEC_ID_RAWVIDEO, MKTAG('Y', 'U', 'V', '9') }, { CODEC_ID_RAWVIDEO, MKTAG('Y', 'V', 'U', '9') }, { CODEC_ID_FRWU, MKTAG('F', 'R', 'W', 'U') }, -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 89, 0) { CODEC_ID_R10K, MKTAG('R', '1', '0', 'k') }, -#endif { CODEC_ID_R210, MKTAG('r', '2', '1', '0') }, { CODEC_ID_V210, MKTAG('v', '2', '1', '0') }, { CODEC_ID_INDEO3, MKTAG('I', 'V', '3', '1') }, @@ -260,9 +258,7 @@ const struct mp_AVCodecTag mp_ff_codec_bmp_tags[] = { { CODEC_ID_AURA2, MKTAG('A', 'U', 'R', '2') }, { CODEC_ID_DPX, MKTAG('d', 'p', 'x', ' ') }, { CODEC_ID_KGV1, MKTAG('K', 'G', 'V', '1') }, -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 108, 0) { CODEC_ID_LAGARITH, MKTAG('L', 'A', 'G', 'S') }, -#endif { CODEC_ID_NONE, 0 } }; @@ -299,15 +295,11 @@ const struct mp_AVCodecTag mp_ff_codec_wav_tags[] = { { CODEC_ID_WMALOSSLESS, 0x0163 }, { CODEC_ID_ADPCM_CT, 0x0200 }, { CODEC_ID_ATRAC3, 0x0270 }, -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 88, 0) { CODEC_ID_ADPCM_G722, 0x028F }, -#endif { CODEC_ID_IMC, 0x0401 }, { CODEC_ID_GSM_MS, 0x1500 }, { CODEC_ID_TRUESPEECH, 0x1501 }, -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 94, 0) { CODEC_ID_AAC_LATM, 0x1602 }, -#endif { CODEC_ID_AC3, 0x2000 }, { CODEC_ID_DTS, 0x2001 }, { CODEC_ID_SONIC, 0x2048 }, diff --git a/fmt-conversion.c b/fmt-conversion.c index 2adc115a4e..6ab6a4b82f 100644 --- a/fmt-conversion.c +++ b/fmt-conversion.c @@ -75,20 +75,16 @@ static const struct { {IMGFMT_420P16_LE, PIX_FMT_YUV420P16LE}, {IMGFMT_420P16_BE, PIX_FMT_YUV420P16BE}, -#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51, 2, 0) {IMGFMT_420P9_LE, PIX_FMT_YUV420P9LE}, {IMGFMT_420P9_BE, PIX_FMT_YUV420P9BE}, {IMGFMT_420P10_LE, PIX_FMT_YUV420P10LE}, {IMGFMT_420P10_BE, PIX_FMT_YUV420P10BE}, {IMGFMT_422P10_LE, PIX_FMT_YUV422P10LE}, {IMGFMT_422P10_BE, PIX_FMT_YUV422P10BE}, -#endif -#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51, 7, 0) {IMGFMT_444P9_BE , PIX_FMT_YUV444P9BE}, {IMGFMT_444P9_LE , PIX_FMT_YUV444P9LE}, {IMGFMT_444P10_BE, PIX_FMT_YUV444P10BE}, {IMGFMT_444P10_LE, PIX_FMT_YUV444P10LE}, -#endif {IMGFMT_422P16_LE, PIX_FMT_YUV422P16LE}, {IMGFMT_422P16_BE, PIX_FMT_YUV422P16BE}, {IMGFMT_444P16_LE, PIX_FMT_YUV444P16LE}, @@ -134,13 +130,9 @@ int pixfmt2imgfmt(enum PixelFormat pix_fmt) break; int fmt = conversion_map[i].fmt; if (!fmt) { -#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51, 2, 0) const char *fmtname = av_get_pix_fmt_name(pix_fmt); mp_msg(MSGT_GLOBAL, MSGL_ERR, "Unsupported PixelFormat %s (%d)\n", fmtname ? fmtname : "INVALID", pix_fmt); -#else - mp_msg(MSGT_GLOBAL, MSGL_ERR, "Unsupported PixelFormat %i\n", pix_fmt); -#endif } return fmt; } diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index b7f189ec5f..8fc17f1a41 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -147,10 +147,7 @@ static int init(sh_video_t *sh) && lavc_codec->id != CODEC_ID_H264 && lavc_codec->id != CODEC_ID_INTERPLAY_VIDEO && lavc_codec->id != CODEC_ID_ROQ && lavc_codec->id != CODEC_ID_VP8 -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 108, 0) - && lavc_codec->id != CODEC_ID_LAGARITH -#endif - ) + && lavc_codec->id != CODEC_ID_LAGARITH) ctx->do_dr1 = 1; ctx->b_age = ctx->ip_age[0] = ctx->ip_age[1] = 256 * 256 * 256 * 64; ctx->ip_count = ctx->b_count = 0; @@ -663,12 +660,10 @@ static struct mp_image *decode(struct sh_video *sh, struct demux_packet *packet, pkt.size = len; // HACK: make PNGs decode normally instead of as CorePNG delta frames pkt.flags = AV_PKT_FLAG_KEY; -#if LIBAVCODEC_VERSION_MAJOR >= 53 if (packet && packet->avpacket) { pkt.side_data = packet->avpacket->side_data; pkt.side_data_elems = packet->avpacket->side_data_elems; } -#endif // The avcodec opaque field stupidly supports only int64_t type union pts { int64_t i; double d; }; avctx->reordered_opaque = (union pts){.d = *reordered_pts}.i; diff --git a/libmpcodecs/vf.c b/libmpcodecs/vf.c index 34790e3d62..e9ce26da0f 100644 --- a/libmpcodecs/vf.c +++ b/libmpcodecs/vf.c @@ -185,10 +185,8 @@ static const vf_info_t *const filter_list[] = { &vf_info_fspp, &vf_info_mcdeint, #endif -#ifdef CONFIG_FFMPEG_EVAL_API &vf_info_geq, &vf_info_qp, -#endif &vf_info_yuvcsp, &vf_info_kerndeint, &vf_info_rgbtest, diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c index d25ceb8b95..74948fb68d 100644 --- a/libmpdemux/demux_lavf.c +++ b/libmpdemux/demux_lavf.c @@ -242,12 +242,6 @@ static const char * const preferred_internal[] = { /* lavf Matroska demuxer doesn't support ordered chapters and fails * for more files */ "matroska", -#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52, 99, 0) - /* Seeking doesn't work with lavf FLAC demuxer in FFmpeg versions - * without a FLAC parser. In principle this could use a runtime check to - * switch if a shared library is updated. */ - "flac", -#endif /* lavf gives neither pts nor dts for some video frames in .rm */ "rm", NULL @@ -712,23 +706,7 @@ static void check_internet_radio_hack(struct demuxer *demuxer) if (!priv->internet_radio_hack) { mp_msg(MSGT_DEMUX, MSGL_V, "[lavf] enabling internet ogg radio hack\n"); -#if LIBAVFORMAT_VERSION_MAJOR < 53 - mp_tmsg(MSGT_DEMUX, MSGL_WARN, "[lavf] This looks like an " - "internet radio ogg stream with track changes.\n" - "Playback will likely fail after %d track changes " - "due to libavformat limitations.\n" - "You may be able to work around that limitation by " - "using -demuxer ogg.\n", MAX_STREAMS); -#endif } -#if LIBAVFORMAT_VERSION_MAJOR < 53 - if (avfc->nb_streams == MAX_STREAMS) { - mp_tmsg(MSGT_DEMUX, MSGL_WARN, "[lavf] This is the %dth " - "track.\nPlayback will likely fail at the next change.\n" - "You may be able to work around this limitation by " - "using -demuxer ogg.\n", MAX_STREAMS); - } -#endif priv->internet_radio_hack = true; // use new per-track metadata as global metadata AVMetadataTag *t = NULL; diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c index 8afeedac8c..199558c2ae 100644 --- a/libmpdemux/demuxer.c +++ b/libmpdemux/demuxer.c @@ -501,11 +501,9 @@ static void allocate_parser(AVCodecContext **avctx, AVCodecParserContext **parse enum CodecID codec_id = CODEC_ID_NONE; switch (format) { -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 94, 0) case MKTAG('M', 'P', '4', 'L'): codec_id = CODEC_ID_AAC_LATM; break; -#endif case 0x2000: case 0x332D6361: case 0x332D4341: diff --git a/libmpdemux/mp_taglists.c b/libmpdemux/mp_taglists.c index 336d60bd9c..c04c700f8a 100644 --- a/libmpdemux/mp_taglists.c +++ b/libmpdemux/mp_taglists.c @@ -44,9 +44,7 @@ static const struct mp_AVCodecTag mp_wav_tags[] = { { CODEC_ID_MUSEPACK7, MKTAG('M', 'P', 'C', ' ')}, { CODEC_ID_MUSEPACK8, MKTAG('M', 'P', 'C', '8')}, { CODEC_ID_NELLYMOSER, MKTAG('N', 'E', 'L', 'L')}, -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 92, 0) { CODEC_ID_PCM_LXF, MKTAG('P', 'L', 'X', 'F')}, -#endif { CODEC_ID_QCELP, MKTAG('Q', 'c', 'l', 'p')}, { CODEC_ID_QDM2, MKTAG('Q', 'D', 'M', '2')}, { CODEC_ID_RA_144, MKTAG('1', '4', '_', '4')}, @@ -66,9 +64,7 @@ const struct mp_AVCodecTag * const mp_wav_taglists[] = {mp_ff_codec_wav_tags, mp static const struct mp_AVCodecTag mp_codecid_override_tags[] = { { CODEC_ID_AAC, MKTAG('M', 'P', '4', 'A')}, -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 94, 0) { CODEC_ID_AAC_LATM, MKTAG('M', 'P', '4', 'L')}, -#endif { CODEC_ID_AC3, 0x2000}, { CODEC_ID_ADPCM_IMA_AMV, MKTAG('A', 'M', 'V', 'A')}, { CODEC_ID_BINKAUDIO_DCT, MKTAG('B', 'A', 'U', '1')}, @@ -109,9 +105,7 @@ static const struct mp_AVCodecTag mp_bmp_tags[] = { { CODEC_ID_FLIC, MKTAG('F', 'L', 'I', 'C')}, { CODEC_ID_IDCIN, MKTAG('I', 'D', 'C', 'I')}, { CODEC_ID_INTERPLAY_VIDEO, MKTAG('I', 'N', 'P', 'V')}, -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 114, 0) { CODEC_ID_JV, MKTAG('F', 'F', 'J', 'V')}, -#endif { CODEC_ID_MDEC, MKTAG('M', 'D', 'E', 'C')}, { CODEC_ID_MOTIONPIXELS, MKTAG('M', 'V', 'I', '1')}, { CODEC_ID_NUV, MKTAG('N', 'U', 'V', '1')}, diff --git a/stream/http.c b/stream/http.c index 9372cb1262..349a6c483d 100644 --- a/stream/http.c +++ b/stream/http.c @@ -44,9 +44,6 @@ #include "libavutil/base64.h" #include -#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(50, 17, 0) -#define AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1) -#endif extern int stream_cache_size; extern int network_bandwidth; diff --git a/stream/realrtsp/real.c b/stream/realrtsp/real.c index f7bd0cc5ba..3d06b4d667 100644 --- a/stream/realrtsp/real.c +++ b/stream/realrtsp/real.c @@ -42,9 +42,6 @@ #include "libavutil/base64.h" #include -#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(50, 17, 0) -#define AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1) -#endif #include "stream/http.h" #include "mp_msg.h" diff --git a/sub/av_sub.c b/sub/av_sub.c index fdef2a57f5..0d8c14db60 100644 --- a/sub/av_sub.c +++ b/sub/av_sub.c @@ -110,9 +110,7 @@ int decode_avsub(struct sh_sub *sh, uint8_t *data, int size, break; } } -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 82, 0) if (got_sub) avsubtitle_free(&sub); -#endif return res; } -- cgit v1.2.3