[vlc-commits] [Git][videolan/vlc][master] 10 commits: contrib: ffmpeg: remove libav
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Tue Dec 7 08:21:19 UTC 2021
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
0a707a4f by Marvin Scholz at 2021-12-07T07:12:25+00:00
contrib: ffmpeg: remove libav
- - - - -
778bf19b by Marvin Scholz at 2021-12-07T07:12:25+00:00
package/win32: build.sh: remove USE_FFMPEG
With the libav contrib removed, it is no longer needed.
- - - - -
bec818d0 by Marvin Scholz at 2021-12-07T07:12:25+00:00
package/macosx: env.build.sh: remove USE_FFMPEG
With the libav contrib removed, it is no longer needed.
- - - - -
ba4c3eb6 by Marvin Scholz at 2021-12-07T07:12:25+00:00
package/raspberry: build.sh: remove USE_FFMPEG
With the libav contrib removed, it is no longer needed.
- - - - -
9f7bf69f by Marvin Scholz at 2021-12-07T07:12:25+00:00
configure: remove libav support
- - - - -
18e98b8a by Marvin Scholz at 2021-12-07T07:12:25+00:00
avcommon: remove libav from version check macros
- - - - -
8cf02acd by Marvin Scholz at 2021-12-07T07:12:25+00:00
avcodec: remove LIBAVCODEC_VERSION_MICRO >= 100 checks
This check was used to distinguish FFmpeg and libav, as libav support
is removed now, this is no longer necessary.
- - - - -
dc20caa8 by Marvin Scholz at 2021-12-07T07:12:25+00:00
avutil: remove LIBAVUTIL_VERSION_MICRO >= 100 checks
This check was used to distinguish FFmpeg and libav, as libav support
is removed now, this is no longer necessary.
- - - - -
3bd9d8dc by Marvin Scholz at 2021-12-07T07:12:25+00:00
avformat: remove LIBAVFORMAT_VERSION_MICRO >= 100 checks
This check was used to distinguish FFmpeg and libav, as libav support
is removed now, this is no longer necessary.
- - - - -
378d84f8 by Marvin Scholz at 2021-12-07T07:12:25+00:00
configure: require newer libavutil
The previous libavutil requirement was for libav, change
that to the matching libavutil 55.22.101 for libavcodec 57.37.100
- - - - -
14 changed files:
- configure.ac
- − contrib/src/ffmpeg/libav_gsm.patch
- contrib/src/ffmpeg/rules.mak
- extras/package/macosx/env.build.sh
- extras/package/raspberry/build.sh
- extras/package/win32/build.sh
- modules/codec/avcodec/avcommon.h
- modules/codec/avcodec/avcommon_compat.h
- modules/codec/avcodec/chroma.c
- modules/codec/avcodec/directx_va.c
- modules/codec/avcodec/fourcc.c
- modules/codec/avcodec/video.c
- modules/demux/avformat/demux.c
- modules/demux/avformat/mux.c
Changes:
=====================================
configure.ac
=====================================
@@ -2479,32 +2479,12 @@ AS_HELP_STRING([--enable-merge-ffmpeg], [merge FFmpeg-based plugins (default dis
])
AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
-AC_MSG_CHECKING([for libavutil variant])
-PKG_CHECK_EXISTS([libavutil], [
- libavutil_version="$(${PKG_CONFIG} --modversion libavutil)"
- libavutil_micro="${libavutil_version##*.}"
- AS_IF([test ${libavutil_micro} -le 99], [
- avfork="libav"
- ], [
- avfork="ffmpeg"
- ])
-], [
- avfork="none"
-])
-AC_MSG_RESULT([${avfork}])
-
AC_ARG_ENABLE([avcodec],
AS_HELP_STRING([--enable-avcodec], [libavcodec codec (default enabled)]))
AS_IF([test "${enable_avcodec}" != "no"], [
- dnl We need >=57.16.0 from libav or >=57.37.100 from ffmpeg
- case "${avfork}" in
- libav) av_codec_ver="57.16.0" ;;
- dnl 05f66706d182eb0c36af54d72614bf4c33e957a9 includes libavutil 55.9.0
- ffmpeg) av_codec_ver="57.37.100" ;;
- dnl 7fc329e2dd6226dfecaa4a1d7adf353bf2773726 include libavutil 55.22.101
- *) AC_MSG_ERROR([Missing libav or FFmpeg. Pass --disable-avcodec to ignore this error.])
- esac
- PKG_CHECK_MODULES(AVCODEC,[libavcodec >= ${av_codec_ver} libavutil >= 55.9.0], [
+ dnl We need >=57.37.100 from ffmpeg
+ dnl 7fc329e2dd6226dfecaa4a1d7adf353bf2773726 include libavutil 55.22.101
+ PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 57.37.100 libavutil >= 55.22.101], [
have_avcodec="yes"
],[
AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
@@ -3352,11 +3332,7 @@ AM_CONDITIONAL([HAVE_VDPAU], [test "${have_vdpau}" = "yes"])
have_avcodec_vdpau="no"
AS_IF([test "${have_vdpau}" = "yes" -a "${have_avcodec}" = "yes"], [
- case "${avfork}" in
- libav) av_vdpau_ver="56.10.0" ;;
- ffmpeg) av_vdpau_ver="56.19.100" ;;
- esac
- PKG_CHECK_EXISTS([libavcodec >= ${av_vdpau_ver}], [
+ PKG_CHECK_EXISTS([libavcodec >= 56.19.100], [
have_avcodec_vdpau="yes"
AC_MSG_NOTICE([VDPAU decoding acceleration activated])
], [
=====================================
contrib/src/ffmpeg/libav_gsm.patch deleted
=====================================
@@ -1,72 +0,0 @@
-From d66948bc3960b993da55a7899ced91c38fadeed1 Mon Sep 17 00:00:00 2001
-From: Konstantin Pavlov <thresh at videolan.org>
-Date: Thu, 7 Dec 2017 11:29:55 +0300
-Subject: [PATCH] Revert "build: Remove check for gsm/gsm.h for libgsm"
-
-This reverts commit 8e97a8c69162afce47abea96c8c0914f3550e212.
----
- configure | 5 ++++-
- libavcodec/libgsmdec.c | 5 +++++
- libavcodec/libgsmenc.c | 5 +++++
- 3 files changed, 14 insertions(+), 1 deletion(-)
-
-diff --git a/configure b/configure
-index 7f320fee1..c2bb05c26 100755
---- a/configure
-+++ b/configure
-@@ -1545,6 +1545,7 @@ HEADERS_LIST="
- direct_h
- dxgidebug_h
- dxva_h
-+ gsm_h
- io_h
- machine_ioctl_bt848_h
- machine_ioctl_meteor_h
-@@ -4595,7 +4596,9 @@ enabled libfaac && require libfaac "stdint.h faac.h" faacEncGetVersion
- enabled libfdk_aac && require_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen
- enabled libfontconfig && require_pkg_config libfontconfig fontconfig "fontconfig/fontconfig.h" FcInit
- enabled libfreetype && require_pkg_config libfreetype freetype2 "ft2build.h FT_FREETYPE_H" FT_Init_FreeType
--enabled libgsm && require libgsm gsm.h gsm_create -lgsm
-+enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
-+ check_lib libgsm "${gsm_hdr}" gsm_create -lgsm && break;
-+ done || die "ERROR: libgsm not found"; }
- enabled libhdcd && require_pkg_config libhdcd libhdcd "hdcd/hdcd_simple.h" hdcd_new
- enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
- enabled libkvazaar && require_pkg_config libkvazaar "kvazaar >= 0.8.1" kvazaar.h kvz_api_get
-diff --git a/libavcodec/libgsmdec.c b/libavcodec/libgsmdec.c
-index e06fe5276..4c21ff672 100644
---- a/libavcodec/libgsmdec.c
-+++ b/libavcodec/libgsmdec.c
-@@ -27,7 +27,12 @@
-
- // The idiosyncrasies of GSM-in-WAV are explained at http://kbs.cs.tu-berlin.de/~jutta/toast.html
-
-+#include "config.h"
-+#if HAVE_GSM_H
- #include <gsm.h>
-+#else
-+#include <gsm/gsm.h>
-+#endif
-
- #include "libavutil/channel_layout.h"
- #include "libavutil/common.h"
-diff --git a/libavcodec/libgsmenc.c b/libavcodec/libgsmenc.c
-index 4bb4075b2..8f51321d4 100644
---- a/libavcodec/libgsmenc.c
-+++ b/libavcodec/libgsmenc.c
-@@ -27,7 +27,12 @@
-
- // The idiosyncrasies of GSM-in-WAV are explained at http://kbs.cs.tu-berlin.de/~jutta/toast.html
-
-+#include "config.h"
-+#if HAVE_GSM_H
- #include <gsm.h>
-+#else
-+#include <gsm/gsm.h>
-+#endif
-
- #include "libavutil/common.h"
-
---
-2.11.0 (Apple Git-81)
-
=====================================
contrib/src/ffmpeg/rules.mak
=====================================
@@ -1,21 +1,9 @@
# FFmpeg
-#Uncomment the one you want
-#USE_LIBAV ?= 1
-#USE_FFMPEG ?= 1
-
-ifndef USE_LIBAV
FFMPEG_HASH=dc91b913b6260e85e1304c74ff7bb3c22a8c9fb1
FFMPEG_BRANCH=release/4.4
FFMPEG_GITURL := http://git.videolan.org/git/ffmpeg.git
FFMPEG_LAVC_MIN := 57.37.100
-USE_FFMPEG := 1
-else
-FFMPEG_HASH=e5afa1b556542fd7a52a0a9b409c80f2e6e1e9bb
-FFMPEG_BRANCH=
-FFMPEG_GITURL := git://git.libav.org/libav.git
-FFMPEG_LAVC_MIN := 57.16.0
-endif
FFMPEG_BASENAME := $(subst .,_,$(subst \,_,$(subst /,_,$(FFMPEG_HASH))))
@@ -37,10 +25,7 @@ FFMPEGCONF = \
--disable-bzlib \
--disable-libvpx \
--disable-avresample \
- --enable-bsf=vp9_superframe
-
-ifdef USE_FFMPEG
-FFMPEGCONF += \
+ --enable-bsf=vp9_superframe \
--disable-swresample \
--disable-iconv \
--disable-avisynth \
@@ -50,23 +35,12 @@ ifdef HAVE_DARWIN_OS
FFMPEGCONF += \
--disable-securetransport
endif
-endif
-
-# Disable VDA on macOS with libav
-ifdef USE_LIBAV
-ifdef HAVE_DARWIN_OS
-FFMPEGCONF += \
- --disable-vda
-endif
-endif
DEPS_ffmpeg = zlib gsm
-ifndef USE_LIBAV
FFMPEGCONF += \
--enable-libopenjpeg
DEPS_ffmpeg += openjpeg $(DEPS_openjpeg)
-endif
# Optional dependencies
ifndef BUILD_NETWORK
@@ -144,9 +118,7 @@ endif
# Darwin
ifdef HAVE_DARWIN_OS
FFMPEGCONF += --arch=$(ARCH) --target-os=darwin --extra-cflags="$(CFLAGS)"
-ifdef USE_FFMPEG
FFMPEGCONF += --disable-lzma
-endif
ifeq ($(ARCH),x86_64)
FFMPEGCONF += --cpu=core2
endif
@@ -232,7 +204,6 @@ $(TARBALLS)/ffmpeg-$(FFMPEG_BASENAME).tar.xz:
ffmpeg: ffmpeg-$(FFMPEG_BASENAME).tar.xz .sum-ffmpeg
$(UNPACK)
-ifdef USE_FFMPEG
$(APPLY) $(SRC)/ffmpeg/armv7_fixup.patch
$(APPLY) $(SRC)/ffmpeg/dxva_vc1_crash.patch
$(APPLY) $(SRC)/ffmpeg/h264_early_SAR.patch
@@ -243,10 +214,6 @@ ifdef USE_FFMPEG
$(APPLY) $(SRC)/ffmpeg/0002-avcodec-mpeg12dec-don-t-end-a-slice-without-first_sl.patch
$(APPLY) $(SRC)/ffmpeg/0001-fix-mf_utils-compilation-with-mingw64.patch
$(APPLY) $(SRC)/ffmpeg/0001-avcodec-vp9-Do-not-destroy-uninitialized-mutexes-con.patch
-endif
-ifdef USE_LIBAV
- $(APPLY) $(SRC)/ffmpeg/libav_gsm.patch
-endif
$(APPLY) $(SRC)/ffmpeg/0001-ffmpeg-add-target_os-support-for-emscripten.patch
$(MOVE)
=====================================
extras/package/macosx/env.build.sh
=====================================
@@ -147,9 +147,6 @@ vlcSetContribEnvironment() {
echo "Setting contrib environment with minimum macOS version $MINIMAL_OSX_VERSION and SDK $SDKROOT"
- # Select avcodec flavor to compile contribs with
- export USE_FFMPEG=1
-
# Usually, VLCs contrib libraries do not support partial availability at runtime.
# Forcing those errors has two reasons:
# - Some custom configure scripts include the right header for testing availability.
=====================================
extras/package/raspberry/build.sh
=====================================
@@ -97,8 +97,6 @@ fi
make -j$JOBS --output-sync=recurse
cd ../..
-export USE_FFMPEG=1
-
if [ "$INTERACTIVE" = "yes" ]; then
if [ "x$SHELL" != "x" ]; then
exec $SHELL
=====================================
extras/package/win32/build.sh
=====================================
@@ -205,7 +205,6 @@ if [ ! -z "$BUILD_UCRT" ]; then
fi
fi
-export USE_FFMPEG=1
export PATH="$PWD/contrib/$CONTRIB_PREFIX/bin":"$PATH"
if [ "$INTERACTIVE" = "yes" ]; then
=====================================
modules/codec/avcodec/avcommon.h
=====================================
@@ -117,7 +117,7 @@ static inline void vlc_init_avformat(vlc_object_t *obj)
avformat_network_init();
-#if (LIBAVFORMAT_VERSION_MICRO < 100) || (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 9, 100))
+#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 9, 100))
av_register_all();
#endif
@@ -133,7 +133,7 @@ static inline void vlc_init_avcodec(vlc_object_t *obj)
vlc_init_avutil(obj);
-#if (LIBAVFORMAT_VERSION_MICRO < 100) || (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 10, 100))
+#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 10, 100))
avcodec_register_all();
#endif
@@ -303,12 +303,12 @@ static inline void get_video_color_settings( const AVCodecContext *ctx,
case AVCOL_TRC_BT2020_12:
fmt->transfer = TRANSFER_FUNC_BT2020;
break;
-#if LIBAVUTIL_VERSION_CHECK( 55, 14, 0, 31, 100)
+#if LIBAVUTIL_VERSION_CHECK( 55, 31, 100)
case AVCOL_TRC_ARIB_STD_B67:
fmt->transfer = TRANSFER_FUNC_ARIB_B67;
break;
#endif
-#if LIBAVUTIL_VERSION_CHECK( 55, 17, 0, 37, 100)
+#if LIBAVUTIL_VERSION_CHECK( 55, 37, 100)
case AVCOL_TRC_SMPTE2084:
fmt->transfer = TRANSFER_FUNC_SMPTE_ST2084;
break;
=====================================
modules/codec/avcodec/avcommon_compat.h
=====================================
@@ -28,13 +28,13 @@
#include <libavcodec/avcodec.h>
-/* LIBAVCODEC_VERSION_CHECK checks for the right version of libav and FFmpeg
+/* LIBAVCODEC_VERSION_CHECK checks for the right version of FFmpeg
* a is the major version
- * b and c the minor and micro versions of libav
- * d and e the minor and micro versions of FFmpeg */
-#define LIBAVCODEC_VERSION_CHECK( a, b, c, d, e ) \
- ( (LIBAVCODEC_VERSION_MICRO < 100 && LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( a, b, c ) ) || \
- (LIBAVCODEC_VERSION_MICRO >= 100 && LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( a, d, e ) ) )
+ * b is the minor version
+ * c is the micro version
+ */
+#define LIBAVCODEC_VERSION_CHECK( a, b, c ) \
+ (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( a, b, c ))
#ifndef AV_CODEC_FLAG_OUTPUT_CORRUPT
# define AV_CODEC_FLAG_OUTPUT_CORRUPT CODEC_FLAG_OUTPUT_CORRUPT
@@ -78,20 +78,19 @@
# include <libavutil/avutil.h>
-/* LIBAVUTIL_VERSION_CHECK checks for the right version of libav and FFmpeg
+/* LIBAVUTIL_VERSION_CHECK checks for the right version of FFmpeg
* a is the major version
- * b and c the minor and micro versions of libav
- * d and e the minor and micro versions of FFmpeg */
-#define LIBAVUTIL_VERSION_CHECK( a, b, c, d, e ) \
- ( (LIBAVUTIL_VERSION_MICRO < 100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( a, b, c ) ) || \
- (LIBAVUTIL_VERSION_MICRO >= 100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( a, d, e ) ) )
+ * b is the minor version
+ * c is the micro version
+ */
+#define LIBAVUTIL_VERSION_CHECK( a, b, c ) \
+ (LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( a, b, c ))
#ifdef HAVE_LIBAVFORMAT_AVFORMAT_H
# include <libavformat/avformat.h>
-#define LIBAVFORMAT_VERSION_CHECK( a, b, c, d, e ) \
- ( (LIBAVFORMAT_VERSION_MICRO < 100 && LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT( a, b, c ) ) || \
- (LIBAVFORMAT_VERSION_MICRO >= 100 && LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT( a, d, e ) ) )
+#define LIBAVFORMAT_VERSION_CHECK( a, b, c ) \
+ (LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT( a, b, c ))
#endif
=====================================
modules/codec/avcodec/chroma.c
=====================================
@@ -115,8 +115,8 @@ static const struct
{VLC_CODEC_YUVA_444_10L, AV_PIX_FMT_YUVA444P10LE, 0, 0, 0 },
{VLC_CODEC_YUVA_444_10B, AV_PIX_FMT_YUVA444P10BE, 0, 0, 0 },
- /* FFmpeg only */
-#if LIBAVUTIL_VERSION_MICRO >= 100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(56, 24, 101)
+
+#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(56, 24, 101)
{VLC_CODEC_YUVA_444_12L, AV_PIX_FMT_YUVA444P12LE, 0, 0, 0 },
{VLC_CODEC_YUVA_444_12B, AV_PIX_FMT_YUVA444P12BE, 0, 0, 0 },
#endif
=====================================
modules/codec/avcodec/directx_va.c
=====================================
@@ -253,7 +253,7 @@ static const directx_va_mode_t DXVA_MODES[] = {
/* VPx */
{ "VP8", &DXVA_ModeVP8_VLD, 8, {1, 1}, 0, NULL, 0 },
-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 57, 17, 100 ) && LIBAVCODEC_VERSION_MICRO >= 100
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 57, 17, 100 )
{ "VP9 profile 0", &DXVA_ModeVP9_VLD_Profile0, 8, {1, 1}, AV_CODEC_ID_VP9, PROF_VP9_MAIN, 0 },
{ "VP9 profile 2", &DXVA_ModeVP9_VLD_10bit_Profile2, 10, {1, 1}, AV_CODEC_ID_VP9, PROF_VP9_10, 0 },
#else
@@ -263,7 +263,7 @@ static const directx_va_mode_t DXVA_MODES[] = {
{ "VP9 profile Intel", &DXVA_ModeVP9_VLD_Intel, 8, {1, 1}, 0, NULL, 0 },
/* AV1 */
-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 58, 112, 103 ) && LIBAVCODEC_VERSION_MICRO >= 100
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 58, 112, 103 )
{ "AV1 Main profile 8", &DXVA_ModeAV1_VLD_Profile0, 8, {1, 1}, AV_CODEC_ID_AV1, PROF_AV1_MAIN, 0 },
{ "AV1 Main profile 10", &DXVA_ModeAV1_VLD_Profile0, 10, {1, 1}, AV_CODEC_ID_AV1, PROF_AV1_MAIN, 0 },
{ "AV1 High profile 8", &DXVA_ModeAV1_VLD_Profile1, 8, {1, 1}, AV_CODEC_ID_AV1, PROF_AV1_HIGH, 0 },
=====================================
modules/codec/avcodec/fourcc.c
=====================================
@@ -186,7 +186,7 @@ static const struct vlc_avcodec_fourcc video_codecs[] =
/* AV_CODEC_ID_V210X */
{ VLC_CODEC_TMV, AV_CODEC_ID_TMV },
{ VLC_CODEC_V210, AV_CODEC_ID_V210 },
-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 54, 50, 100 ) && LIBAVCODEC_VERSION_MICRO >= 100
+#if LIBAVCODEC_VERSION_CHECK( 54, 50, 100 )
{ VLC_CODEC_VUYA, AV_CODEC_ID_AYUV },
#endif
/* AV_CODEC_ID_DPX */
@@ -201,7 +201,7 @@ static const struct vlc_avcodec_fourcc video_codecs[] =
/* AV_CODEC_ID_IFF_BYTERUN1 */
{ VLC_CODEC_KGV1, AV_CODEC_ID_KGV1 },
{ VLC_CODEC_YOP, AV_CODEC_ID_YOP },
-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 58, 53, 100 ) && LIBAVCODEC_VERSION_MICRO >= 100
+#if LIBAVCODEC_VERSION_CHECK( 58, 53, 100 )
{ VLC_CODEC_VP4, AV_CODEC_ID_VP4 },
#endif
{ VLC_CODEC_VP8, AV_CODEC_ID_VP8 },
@@ -233,7 +233,7 @@ static const struct vlc_avcodec_fourcc video_codecs[] =
{ VLC_CODEC_CLLC, AV_CODEC_ID_CLLC },
{ VLC_CODEC_MSS2, AV_CODEC_ID_MSS2 },
{ VLC_CODEC_VP9, AV_CODEC_ID_VP9 },
-#if LIBAVCODEC_VERSION_CHECK( 57, 26, 0, 83, 101 )
+#if LIBAVCODEC_VERSION_CHECK( 57, 83, 101 )
{ VLC_CODEC_AV1, AV_CODEC_ID_AV1 },
#endif
{ VLC_CODEC_ICOD, AV_CODEC_ID_AIC },
@@ -274,11 +274,11 @@ static const struct vlc_avcodec_fourcc video_codecs[] =
/* ffmpeg only: AV_CODEC_ID_012V */
/* ffmpeg only: AV_CODEC_ID_AVUI */
/* ffmpeg only: AV_CODEC_ID_TARGA_Y216 */
-#if LIBAVCODEC_VERSION_MICRO >= 100
+
{ VLC_CODEC_V308, AV_CODEC_ID_V308 },
{ VLC_CODEC_V408, AV_CODEC_ID_V408 },
{ VLC_CODEC_YUV4, AV_CODEC_ID_YUV4 },
-#endif
+
/* ffmpeg only: AV_CODEC_ID_SANM */
/* ffmpeg only: AV_CODEC_ID_PAF_VIDEO */
/* ffmpeg only: AV_CODEC_ID_AVRN */
@@ -290,11 +290,10 @@ static const struct vlc_avcodec_fourcc video_codecs[] =
/* ffmpeg only: AV_CODEC_ID_SNOW */
/* ffmpeg only: AV_CODEC_ID_SMVJPEG */
-#if LIBAVCODEC_VERSION_CHECK( 58, 0, 0, 1, 100 )
+#if LIBAVCODEC_VERSION_CHECK( 58, 1, 100 )
{ VLC_CODEC_MAGICYUV, AV_CODEC_ID_MAGICYUV },
#endif
-#if LIBAVCODEC_VERSION_MICRO >= 100 /* FFmpeg only */
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 57, 24, 102 )
{ VLC_CODEC_CINEFORM, AV_CODEC_ID_CFHD },
#endif
@@ -327,7 +326,6 @@ static const struct vlc_avcodec_fourcc video_codecs[] =
{ VLC_CODEC_NOTCHLC, AV_CODEC_ID_NOTCHLC },
#endif
-#endif /* FFmpeg only */
};
/*
@@ -443,7 +441,7 @@ static const struct vlc_avcodec_fourcc audio_codecs[] =
/* AV_CODEC_ID_WESTWOOD_SND1 */
{ VLC_CODEC_GSM, AV_CODEC_ID_GSM },
{ VLC_CODEC_QDM2, AV_CODEC_ID_QDM2 },
-#if (LIBAVCODEC_VERSION_MICRO >= 100) && (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 71, 100))
+#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 71, 100))
{ VLC_CODEC_QDMC, AV_CODEC_ID_QDMC },
#endif
{ VLC_CODEC_COOK, AV_CODEC_ID_COOK },
@@ -494,13 +492,11 @@ static const struct vlc_avcodec_fourcc audio_codecs[] =
/* AV_CODEC_ID_PAF_AUDIO */
{ VLC_CODEC_ON2AVC, AV_CODEC_ID_ON2AVC },
- /* DSD (FFmpeg only) */
-#if LIBAVCODEC_VERSION_MICRO >= 100
+ /* DSD */
{ VLC_CODEC_DSD_LSBF, AV_CODEC_ID_DSD_LSBF },
{ VLC_CODEC_DSD_MSBF, AV_CODEC_ID_DSD_MSBF },
{ VLC_CODEC_DSD_LSBF_PLANAR, AV_CODEC_ID_DSD_LSBF_PLANAR },
{ VLC_CODEC_DSD_MSBF_PLANAR, AV_CODEC_ID_DSD_MSBF_PLANAR },
-#endif
/* ffmpeg only: AV_CODEC_ID_FFWAVESYNTH */
/* ffmpeg only: AV_CODEC_ID_SONIC */
@@ -520,7 +516,7 @@ static const struct vlc_avcodec_fourcc spu_codecs[] =
{ VLC_CODEC_SSA, AV_CODEC_ID_SSA },
{ VLC_CODEC_TX3G, AV_CODEC_ID_MOV_TEXT },
{ VLC_CODEC_BD_PG, AV_CODEC_ID_HDMV_PGS_SUBTITLE },
-#if (LIBAVCODEC_VERSION_MICRO >= 100) && (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 71, 100))
+#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 71, 100))
{ VLC_CODEC_BD_TEXT, AV_CODEC_ID_HDMV_TEXT_SUBTITLE },
#endif
{ VLC_CODEC_TELETEXT, AV_CODEC_ID_DVB_TELETEXT },
=====================================
modules/codec/avcodec/video.c
=====================================
@@ -39,9 +39,7 @@
#include <libavcodec/avcodec.h>
#include <libavutil/mem.h>
#include <libavutil/pixdesc.h>
-#if (LIBAVUTIL_VERSION_MICRO >= 100)
#include <libavutil/mastering_display_metadata.h>
-#endif
#include "avcodec.h"
#include "va.h"
@@ -220,10 +218,6 @@ static int lavc_GetVideoFormat(decoder_t *dec, video_format_t *restrict fmt,
{
fmt->i_frame_rate = ctx->framerate.num;
fmt->i_frame_rate_base = ctx->framerate.den;
-# if LIBAVCODEC_VERSION_MICRO < 100
- // for some reason libav don't thinkg framerate presents actually same thing as in ffmpeg
- fmt->i_frame_rate_base *= __MAX(ctx->ticks_per_frame, 1);
-# endif
}
else if (ctx->time_base.num > 0 && ctx->time_base.den > 0)
{
@@ -735,7 +729,6 @@ static int DecodeSidedata( decoder_t *p_dec, const AVFrame *frame, picture_t *p_
decoder_sys_t *p_sys = p_dec->p_sys;
bool format_changed = false;
-#if (LIBAVUTIL_VERSION_MICRO >= 100)
#define FROM_AVRAT(default_factor, avrat) \
(uint64_t)(default_factor) * (avrat).num / (avrat).den
const AVFrameSideData *metadata =
@@ -789,8 +782,7 @@ static int DecodeSidedata( decoder_t *p_dec, const AVFrame *frame, picture_t *p_
}
#undef FROM_AVRAT
}
-#endif
-#if (LIBAVUTIL_VERSION_MICRO >= 100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( 55, 60, 100 ) )
+#if (LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( 55, 60, 100 ))
const AVFrameSideData *metadata_lt =
av_frame_get_side_data( frame,
AV_FRAME_DATA_CONTENT_LIGHT_LEVEL );
@@ -842,7 +834,7 @@ static int DecodeSidedata( decoder_t *p_dec, const AVFrame *frame, picture_t *p_
p_pic->format.multiview_mode = MULTIVIEW_2D;
break;
}
-#if LIBAVUTIL_VERSION_CHECK( 56, 7, 0, 4, 100 )
+#if LIBAVUTIL_VERSION_CHECK( 56, 4, 100 )
p_pic->format.b_multiview_right_eye_first = stereo_data->flags & AV_STEREO3D_FLAG_INVERT;
p_pic->b_multiview_left_eye = (stereo_data->view == AV_STEREO3D_VIEW_LEFT);
@@ -1080,12 +1072,8 @@ static int DecodeBlock( decoder_t *p_dec, block_t **pp_block )
vlc_mutex_lock(&p_sys->lock);
/* Compute the PTS */
-#if LIBAVCODEC_VERSION_CHECK( 57, 24, 0, 61, 100 )
-# if LIBAVCODEC_VERSION_MICRO >= 100
+#if LIBAVCODEC_VERSION_CHECK( 57, 61, 100 )
int64_t av_pts = frame->best_effort_timestamp;
-# else
- int64_t av_pts = frame->pts;
-# endif
#else
int64_t av_pts = frame->pkt_pts;
#endif
@@ -1634,8 +1622,7 @@ no_reuse:
if (!can_hwaccel)
return swfmt;
-#if (LIBAVCODEC_VERSION_MICRO >= 100) \
- && (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 83, 101))
+#if LIBAVCODEC_VERSION_CHECK(57, 83, 101)
if (p_context->active_thread_type)
{
msg_Warn(p_dec, "thread type %d: disabling hardware acceleration",
=====================================
modules/demux/avformat/demux.c
=====================================
@@ -485,18 +485,7 @@ int avformat_OpenDemux( vlc_object_t *p_this )
psz_type = "video";
AVRational rate;
-#if (LIBAVUTIL_VERSION_MICRO < 100) /* libav */
-# if (LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(55, 20, 0))
- rate.num = s->time_base.num;
- rate.den = s->time_base.den;
-# else
- rate.num = s->codec->time_base.num;
- rate.den = s->codec->time_base.den;
-# endif
- rate.den *= __MAX( s->codec->ticks_per_frame, 1 );
-#else /* ffmpeg */
rate = av_guess_frame_rate( p_sys->ic, s, NULL );
-#endif
if( rate.den && rate.num )
{
es_fmt.video.i_frame_rate = rate.num;
@@ -504,12 +493,7 @@ int avformat_OpenDemux( vlc_object_t *p_this )
}
AVRational ar;
-#if (LIBAVUTIL_VERSION_MICRO < 100) /* libav */
- ar.num = s->sample_aspect_ratio.num;
- ar.den = s->sample_aspect_ratio.den;
-#else
ar = av_guess_sample_aspect_ratio( p_sys->ic, s, NULL );
-#endif
if( ar.num && ar.den )
{
es_fmt.video.i_sar_den = ar.den;
=====================================
modules/demux/avformat/mux.c
=====================================
@@ -61,7 +61,7 @@ typedef struct
bool b_write_header;
bool b_write_keyframe;
bool b_error;
-#if LIBAVFORMAT_VERSION_CHECK( 57, 7, 0, 40, 100 )
+#if LIBAVFORMAT_VERSION_CHECK( 57, 40, 100 )
bool b_header_done;
#endif
} sout_mux_sys_t;
@@ -76,7 +76,7 @@ static int Mux ( sout_mux_t * );
static int IOWrite( void *opaque, uint8_t *buf, int buf_size );
static int64_t IOSeek( void *opaque, int64_t offset, int whence );
-#if LIBAVFORMAT_VERSION_CHECK( 57, 7, 0, 40, 100 )
+#if LIBAVFORMAT_VERSION_CHECK( 57, 40, 100 )
static int IOWriteTyped(void *opaque, uint8_t *buf, int buf_size,
enum AVIODataMarkerType type, int64_t time);
#endif
@@ -90,8 +90,7 @@ int avformat_OpenMux( vlc_object_t *p_this )
sout_mux_t *p_mux = (sout_mux_t*)p_this;
bool dummy = !strcmp( p_mux->p_access->psz_access, "dummy");
-#if ( (LIBAVFORMAT_VERSION_MICRO >= 100) \
- && (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 7, 100)) )
+#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 7, 100))
if( dummy && strlen(p_mux->p_access->psz_path)
>= sizeof (((AVFormatContext *)NULL)->filename) )
return VLC_EGENERIC;
@@ -130,8 +129,7 @@ int avformat_OpenMux( vlc_object_t *p_this )
p_sys->oc->oformat = file_oformat;
/* If we use dummy access, let avformat write output */
if( dummy )
-#if ( (LIBAVFORMAT_VERSION_MICRO >= 100) \
- && (LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(58, 7, 100)) )
+#if (LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(58, 7, 100))
p_sys->oc->url = av_strdup(p_mux->p_access->psz_path);
#else
strcpy( p_sys->oc->filename, p_mux->p_access->psz_path );
@@ -154,7 +152,7 @@ int avformat_OpenMux( vlc_object_t *p_this )
p_sys->b_write_header = true;
p_sys->b_write_keyframe = false;
p_sys->b_error = false;
-#if LIBAVFORMAT_VERSION_CHECK( 57, 7, 0, 40, 100 )
+#if LIBAVFORMAT_VERSION_CHECK( 57, 40, 100 )
p_sys->io->write_data_type = IOWriteTyped;
p_sys->b_header_done = false;
#endif
@@ -423,7 +421,7 @@ static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input )
return VLC_SUCCESS;
}
-#if LIBAVFORMAT_VERSION_CHECK( 57, 7, 0, 40, 100 )
+#if LIBAVFORMAT_VERSION_CHECK( 57, 40, 100 )
int IOWriteTyped(void *opaque, uint8_t *buf, int buf_size,
enum AVIODataMarkerType type, int64_t time)
{
@@ -536,7 +534,7 @@ static int IOWrite( void *opaque, uint8_t *buf, int buf_size )
if( p_sys->b_write_header )
p_buf->i_flags |= BLOCK_FLAG_HEADER;
-#if LIBAVFORMAT_VERSION_CHECK( 57, 7, 0, 40, 100 )
+#if LIBAVFORMAT_VERSION_CHECK( 57, 40, 100 )
if( !p_sys->b_header_done )
p_buf->i_flags |= BLOCK_FLAG_HEADER;
#endif
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/2780aca58e89452543b4a2b965765df70cfdc2aa...378d84f8a528919d0ad4aed7acf529d4ea5c39ae
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/2780aca58e89452543b4a2b965765df70cfdc2aa...378d84f8a528919d0ad4aed7acf529d4ea5c39ae
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list