Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update FFmpeg to version 5.1 #627

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8753cb6
FFmpeg: copy in merged version 5.1
ulmus-scott Aug 22, 2022
e2a07dd
libmyth/audio: constify pointers to satisfy -fpermissive
ulmus-scott Aug 22, 2022
5e65b7a
mythtv/configure: fix detection of FFmpeg's version numbers
ulmus-scott Aug 22, 2022
23b81a3
libmythtv: constify AVCodec, etc. part 1
ulmus-scott Aug 22, 2022
2573ea1
mythavformatwriter.cpp: #if FF_API_CODER_TYPE
ulmus-scott Aug 22, 2022
e190822
mythavformatwriter.cpp: replace avcodec_encode_video2
ulmus-scott Aug 22, 2022
791fcea
libmythtv: constify part 2
ulmus-scott Aug 22, 2022
81f6072
avformatdecoder.cpp: fix compilation of StreamHasRequiredParameters
ulmus-scott Aug 22, 2022
fccb3db
avformatdecoder.cpp: fix compilation of CloseContext
ulmus-scott Aug 22, 2022
1193b52
avformatdecoder.cpp: disable dts seeking hack
ulmus-scott Aug 22, 2022
5bb9584
avformatdecoder.cpp: AVCodec no longer has a member called decode
ulmus-scott Aug 22, 2022
158dfb3
libmythtv: constify part 3
ulmus-scott Aug 22, 2022
8bee1ef
NuppelVideoRecorder.cpp: make it compile
ulmus-scott Aug 22, 2022
600c560
mythtranscode: constify to statisfy -fpermissive
ulmus-scott Aug 22, 2022
315384f
mythtranscode/mpeg2fix.h: don't reference private member of AVStream
ulmus-scott Aug 22, 2022
980522d
mythplugins: constify to satisfy -fpermissive
ulmus-scott Aug 22, 2022
3838456
FFmpeg/fftools/Makefile: remove reference to libavresample
ulmus-scott Aug 29, 2022
5a988df
configure: remove references to libavresample
ulmus-scott Aug 29, 2022
01ede52
mythtv/configure: add comments to get_version()
ulmus-scott Aug 30, 2022
400a800
replace old FFmpeg channel layout API
ulmus-scott Aug 29, 2022
a1d8515
replace old FFmpeg channel layout API (part 2)
ulmus-scott Sep 3, 2022
e3e1b20
remove dead `#if`ed code related to FFmpeg
ulmus-scott Sep 4, 2022
e08ca14
libavformat/demux.c: fix duration estimates with original FFmpeg mpeg…
ulmus-scott Sep 5, 2022
176a5c6
AvFormatDecoder::DecoderWillDownmix: don't use av_opt_find
ulmus-scott Sep 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
Expand Up @@ -64,7 +64,7 @@ class RemoteAVFormatContext
probe_data.buf_size = m_rf->Read(m_buffer, BUFFER_SIZE);
probe_data.buf = m_buffer;

AVInputFormat *fmt = av_probe_input_format(&probe_data, 1);
const AVInputFormat *fmt = av_probe_input_format(&probe_data, 1);
if (!fmt)
return false;

Expand Down
2 changes: 1 addition & 1 deletion mythplugins/mytharchive/mytharchive/thumbfinder.h
Expand Up @@ -79,7 +79,7 @@ class ThumbFinder : public MythScreenType
RemoteAVFormatContext m_inputFC {nullptr};
AVCodecContext *m_codecCtx {nullptr};
MythCodecMap m_codecMap {};
AVCodec *m_codec {nullptr};
const AVCodec *m_codec {nullptr};
MythAVFrame m_frame;
MythAVCopy m_copy;

Expand Down
Expand Up @@ -1608,7 +1608,7 @@ static int grabThumbnail(const QString& inFile, const QString& thumbList, const
AVCodecContext *codecCtx = codecmap.GetCodecContext(inputFC->streams[videostream]);

// get decoder for video stream
AVCodec * codec = avcodec_find_decoder(codecCtx->codec_id);
const AVCodec * codec = avcodec_find_decoder(codecCtx->codec_id);

if (codec == nullptr)
{
Expand Down
2 changes: 1 addition & 1 deletion mythplugins/mythmusic/mythmusic/avfdecoder.cpp
Expand Up @@ -330,7 +330,7 @@ bool avfDecoder::initialize()

// let FFmpeg finds the best audio stream (should only be one), also catter
// should the file/stream not be an audio one
AVCodec *codec = nullptr;
const AVCodec *codec = nullptr;
int selTrack = av_find_best_stream(m_inputContext->getContext(), AVMEDIA_TYPE_AUDIO,
-1, -1, &codec, 0);

Expand Down
2 changes: 1 addition & 1 deletion mythplugins/mythmusic/mythmusic/avfdecoder.h
Expand Up @@ -51,7 +51,7 @@ class avfDecoder : public QObject, public Decoder

QString m_devicename;

AVInputFormat *m_inputFormat {nullptr};
const AVInputFormat *m_inputFormat {nullptr};
RemoteAVFormatContext *m_inputContext {nullptr};
AVCodecContext *m_audioDec {nullptr};
MythCodecMap m_codecMap {};
Expand Down
2 changes: 1 addition & 1 deletion mythplugins/mythmusic/mythmusic/remoteavformatcontext.h
Expand Up @@ -73,7 +73,7 @@ class RemoteAVFormatContext
probe_data.buf_size = m_rf->Read(m_buffer, BUFFER_SIZE);
probe_data.buf = m_buffer;

AVInputFormat *fmt = av_probe_input_format(&probe_data, 1);
const AVInputFormat *fmt = av_probe_input_format(&probe_data, 1);
if (!fmt)
{
LOG(VB_GENERAL, LOG_ERR, QString("RemoteAVFormatContext::Open: Failed to probe file: %1").arg(filename));
Expand Down
22 changes: 12 additions & 10 deletions mythtv/configure
Expand Up @@ -1434,7 +1434,6 @@ LIBRARY_LIST="
avdevice
avfilter
avformat
avresample
avutil
postproc
swresample
Expand Down Expand Up @@ -2531,7 +2530,6 @@ pp_filter_deps="gpl postproc"
pullup_filter_deps="gpl"
removelogo_filter_deps="avcodec avformat swscale"
repeatfields_filter_deps="gpl"
resample_filter_deps="avresample"
sab_filter_deps="gpl swscale"
scale2ref_filter_deps="swscale"
scale_filter_deps="swscale"
Expand Down Expand Up @@ -2592,7 +2590,6 @@ avdevice_deps="avformat avcodec avutil"
avfilter_deps="avutil"
avformat_deps="avcodec avutil"
avformat_suggest="network"
avresample_deps="avutil"
postproc_deps="avutil gpl"
swresample_deps="avutil"
swscale_deps="avutil"
Expand Down Expand Up @@ -2723,7 +2720,7 @@ intrinsics="none"

# configurable options
enable $PROGRAM_LIST
enable $(filter_out avresample $LIBRARY_LIST)
enable $LIBRARY_LIST
enable stripping

enable asm
Expand Down Expand Up @@ -6287,7 +6284,7 @@ fi

# add some linker flags
check_ldflags -Wl,--warn-common
check_ldflags '-Wl,-rpath-link,\$\${SRC_PATH_BARE}/external/FFmpeg/libpostproc:\$\${SRC_PATH_BARE}/external/FFmpeg/libswresample:\$\${SRC_PATH_BARE}/external/FFmpeg/libswscale:\$\${SRC_PATH_BARE}/external/FFmpeg/libavfilter:\$\${SRC_PATH_BARE}/external/FFmpeg/libavdevice:\$\${SRC_PATH_BARE}/external/FFmpeg/libavformat:\$\${SRC_PATH_BARE}/external/FFmpeg/libavcodec:\$\${SRC_PATH_BARE}/external/FFmpeg/libavutil:\$\${SRC_PATH_BARE}/external/FFmpeg/libavresample'
check_ldflags '-Wl,-rpath-link,\$\${SRC_PATH_BARE}/external/FFmpeg/libpostproc:\$\${SRC_PATH_BARE}/external/FFmpeg/libswresample:\$\${SRC_PATH_BARE}/external/FFmpeg/libswscale:\$\${SRC_PATH_BARE}/external/FFmpeg/libavfilter:\$\${SRC_PATH_BARE}/external/FFmpeg/libavdevice:\$\${SRC_PATH_BARE}/external/FFmpeg/libavformat:\$\${SRC_PATH_BARE}/external/FFmpeg/libavcodec:\$\${SRC_PATH_BARE}/external/FFmpeg/libavutil'
enabled rpath && add_ldexeflags -Wl,-rpath,$libdir
enabled rpath && add_ldlibflags -Wl,-rpath,$libdir
test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
Expand All @@ -6307,8 +6304,7 @@ enabled neon_clobber_test &&
-Wl,--wrap,avcodec_receive_packet \
-Wl,--wrap,avcodec_send_frame \
-Wl,--wrap,avcodec_receive_frame \
-Wl,--wrap,swr_convert \
-Wl,--wrap,avresample_convert ||
-Wl,--wrap,swr_convert ||
disable neon_clobber_test

enabled xmm_clobber_test &&
Expand All @@ -6324,7 +6320,6 @@ enabled xmm_clobber_test &&
-Wl,--wrap,avcodec_send_frame \
-Wl,--wrap,avcodec_receive_frame \
-Wl,--wrap,swr_convert \
-Wl,--wrap,avresample_convert \
-Wl,--wrap,sws_scale ||
disable xmm_clobber_test

Expand Down Expand Up @@ -7166,7 +7161,6 @@ enabled movie_filter && prepend avfilter_deps "avformat avcodec"
enabled pan_filter && prepend avfilter_deps "swresample"
enabled pp_filter && prepend avfilter_deps "postproc"
enabled removelogo_filter && prepend avfilter_deps "avformat avcodec swscale"
enabled resample_filter && prepend avfilter_deps "avresample"
enabled sab_filter && prepend avfilter_deps "swscale"
enabled scale_filter && prepend avfilter_deps "swscale"
enabled scale2ref_filter && prepend avfilter_deps "swscale"
Expand Down Expand Up @@ -7746,11 +7740,19 @@ JAVA_ARCH=$java_arch
JAVA_CODE_VERSION=$java_code_version
EOF

# Parse the FFmpeg version headers for linking to the correct shared object file
get_version(){
lcname=lib${1}
name=$(toupper $lcname)
# FFmpeg split its version.h into version_major.h and version.h.
# Of note, libavutil's version_major.h is empty, so we need to parse both
# version.h AND version_major.h regardless of whether or not we only need
# the major version number.
# So, to keep the prior behavior of parsing the entire version number,
# pass both files to awk, which will test each file line by line.
file=$source_path/external/FFmpeg/$lcname/version.h
eval $(awk "/#define ${name}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file")
file_major=$source_path/external/FFmpeg/$lcname/version_major.h
eval $(awk "/#define ${name}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file_major" "$file")
enabled raise_major && eval ${name}_VERSION_MAJOR=$((${name}_VERSION_MAJOR+100))
eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
eval echo "${lcname}_VERSION=\$${name}_VERSION" >> $TMPMAK
Expand Down
6 changes: 5 additions & 1 deletion mythtv/external/FFmpeg/.gitignore
Expand Up @@ -19,8 +19,12 @@
*.swp
*.ver
*.version
*.metal.air
*.metallib
*.metallib.c
*.ptx
*.ptx.c
*.ptx.gz
*_g
\#*
.\#*
Expand All @@ -31,8 +35,8 @@
/ffprobe
/config.asm
/config.h
/config_components.h
/coverage.info
/avversion.h
/lcov/
/src
/mapfile
Expand Down