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

[ffmpeg] libavresample is deprecated #1120

Closed
orbea opened this issue Jul 8, 2018 · 7 comments
Closed

[ffmpeg] libavresample is deprecated #1120

orbea opened this issue Jul 8, 2018 · 7 comments

Comments

@orbea
Copy link
Contributor

orbea commented Jul 8, 2018

I'm not sure this is something you want to fix, but I figure its worth pointing out.

Basically when I try to build mgba cmake tells me ffmpeg support is disabled because I'm missing libavresample.

-- Checking for one of the modules 'libedit'
-- Checking for one of the modules 'libavcodec'
-- Checking for one of the modules 'libavformat'
-- Checking for one of the modules 'libavresample'
CMake Warning at CMakeLists.txt:144 (message):
  Requested module libavresample missing for feature USE_FFMPEG.  Feature
  disabled.
Call Stack (most recent call first):
  CMakeLists.txt:441 (find_feature)

However this is because ffmpeg has disabled this module by default upstream, ./configure --help in ffmpeg shows this.

--enable-avresample      enable libavresample build (deprecated) [no]

So far mgba is the only program I use that has failed because libavresample is missing.

@endrift
Copy link
Member

endrift commented Jul 8, 2018

Guess I'll need to fix https://mgba.io/b/123 then.

@endrift endrift closed this as completed in 31e0642 Jul 9, 2018
@orbea
Copy link
Contributor Author

orbea commented Jul 9, 2018

Thanks, but there seems to be a problem, cmake now fails to configure.

-- Checking for one of the modules 'libavcodec'
-- Checking for one of the modules 'libavformat'
-- Checking for one of the modules 'libavutil'
-- Checking for one of the modules 'libswscale'
-- Checking for one of the modules 'minizip'
CMake Warning at CMakeLists.txt:144 (message):
  Requested module minizip missing for feature USE_MINIZIP.  Feature
  disabled.
Call Stack (most recent call first):
  CMakeLists.txt:443 (find_feature)


-- Checking for one of the modules 'libzip'
-- Checking for one of the modules 'MagickWand'
-- Checking for one of the modules 'epoxy'
-- Checking for one of the modules 'sqlite3'
-- Checking for one of the modules 'libelf'
-- Checking for one of the modules 'libavresample'
CMake Warning at CMakeLists.txt:144 (message):
  Requested module libavresample missing for feature USE_LIBAVRESAMPLE.
  Feature disabled.
Call Stack (most recent call first):
  CMakeLists.txt:456 (find_feature)


-- Checking for one of the modules 'libswresample'
CMake Error at CMakeLists.txt:506 (string):
  string sub-command REGEX, mode MATCH needs at least 5 arguments total to
  command.


-- Checking for one of the modules 'sdl2'
-- Build type: Release
-- Platforms:
-- 	Game Boy Advance: ON
-- 	Game Boy: ON
-- Features:
-- 	Debuggers: ON
-- 	CLI debugger: ON
-- 	GDB stub: ON
-- 	Video recording: ON
-- 	GIF recording: ON
-- 	Screenshot/advanced savestate support: ON
-- 	ZIP support: libzip
-- 	7-Zip support: ON
-- 	SQLite3 game database: ON
-- 	ELF loading support: ON
-- 	OpenGL support: libepoxy
-- Frontends:
-- 	Qt: ON
-- 	SDL (2): ON
-- 	Profiling: OFF
-- 	Test harness: OFF
-- 	Test suite: OFF
-- 	Python bindings: OFF
-- 	Examples: OFF
-- Cores:
-- 	Libretro core: ON
-- Libraries:
-- 	Static: OFF
-- 	Shared: ON
-- Configuring incomplete, errors occurred!
See also "/tmp/SBo/mgba/build/CMakeFiles/CMakeOutput.log".
See also "/tmp/SBo/mgba/build/CMakeFiles/CMakeError.log".

@endrift endrift reopened this Jul 9, 2018
@orbea
Copy link
Contributor Author

orbea commented Jul 9, 2018

Something like this seems to work?

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7c2efeb9..3b5b1128 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -503,9 +503,12 @@ if(USE_FFMPEG)
        list(APPEND FEATURE_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/feature/ffmpeg/ffmpeg-encoder.c")
        string(REGEX MATCH "^[0-9]+" LIBAVCODEC_VERSION_MAJOR ${libavcodec_VERSION})
        string(REGEX MATCH "^[0-9]+" LIBAVFORMAT_VERSION_MAJOR ${libavformat_VERSION})
-       string(REGEX MATCH "^[0-9]+" LIBAVRESAMPLE_VERSION_MAJOR ${libavresample_VERSION})
+       if(USE_LIBSWRESAMPLE)
+               string(REGEX MATCH "^[0-9]+" LIBSWRESAMPLE_VERSION_MAJOR ${libswresample_VERSION})
+       else()
+               string(REGEX MATCH "^[0-9]+" LIBAVRESAMPLE_VERSION_MAJOR ${libavresample_VERSION})
+       endif()
        string(REGEX MATCH "^[0-9]+" LIBAVUTIL_VERSION_MAJOR ${libavutil_VERSION})
-       string(REGEX MATCH "^[0-9]+" LIBSWRESAMPLE_VERSION_MAJOR ${libswresample_VERSION})
        string(REGEX MATCH "^[0-9]+" LIBSWSCALE_VERSION_MAJOR ${libswscale_VERSION})
        math(EXPR LIBSWRESAMPLE_VERSION_DEBIAN "${LIBSWRESAMPLE_VERSION_MAJOR} - 1")
        list(APPEND DEPENDENCY_LIB ${LIBAVCODEC_LIBRARIES} ${LIBAVFORMAT_LIBRARIES} ${LIBAVRESAMPLE_LIBRARIES} ${LIBAVUTIL_LIBRARIES} ${LIBSWSCALE_LIBRARIES} ${LIBSWRESAMPLE_LIBRARIES})

@endrift
Copy link
Member

endrift commented Jul 9, 2018

Yup, I just need to commit the patch, which I'm probably not going to do tonight because it's late and I need to sleep.

@orbea
Copy link
Contributor Author

orbea commented Jul 9, 2018

No worries, it can wait till tomorrow. :)

@endrift
Copy link
Member

endrift commented Jul 10, 2018

Should be all set now.

@orbea
Copy link
Contributor Author

orbea commented Jul 10, 2018

Yep, seems good here. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants