From 53c66e44dbe2ec0a50f289ed2920e35505495f8f Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 20 Dec 2018 13:38:24 -0500 Subject: [PATCH] Implement libswresample in place of libavresample which is deprecated --- CMakeLists.txt | 35 ++++++++++++++++++----------------- zoneminder-config.cmake | 2 ++ 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ef8afc91e..a0d037099 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -607,23 +607,6 @@ if(NOT ZM_NO_FFMPEG) set(optlibsnotfound "${optlibsnotfound} SWScale") endif(SWSCALE_LIBRARIES) - # AVresample (using find_library and find_path) - find_library(AVRESAMPLE_LIBRARIES avresample) - if(AVRESAMPLE_LIBRARIES) - set(HAVE_LIBAVRESAMPLE 1) - list(APPEND ZM_BIN_LIBS "${AVRESAMPLE_LIBRARIES}") - find_path(AVRESAMPLE_INCLUDE_DIR "libavresample/avresample.h" /usr/include/ffmpeg) - if(AVRESAMPLE_INCLUDE_DIR) - include_directories("${AVRESAMPLE_INCLUDE_DIR}") - set(CMAKE_REQUIRED_INCLUDES "${AVRESAMPLE_INCLUDE_DIR}") - endif(AVRESAMPLE_INCLUDE_DIR) - mark_as_advanced(FORCE AVRESAMPLE_LIBRARIES AVRESAMPLE_INCLUDE_DIR) - check_include_file("libavresample/avresample.h" HAVE_LIBAVRESAMPLE_AVRESAMPLE_H) - set(optlibsfound "${optlibsfound} AVResample") - else(AVRESAMPLE_LIBRARIES) - set(optlibsnotfound "${optlibsnotfound} AVResample") - endif(AVRESAMPLE_LIBRARIES) - # SWresample (using find_library and find_path) find_library(SWRESAMPLE_LIBRARIES swresample) if(SWRESAMPLE_LIBRARIES) @@ -639,6 +622,24 @@ if(NOT ZM_NO_FFMPEG) set(optlibsfound "${optlibsfound} SWResample") else(SWRESAMPLE_LIBRARIES) set(optlibsnotfound "${optlibsnotfound} SWResample") + + # AVresample (using find_library and find_path) + find_library(AVRESAMPLE_LIBRARIES avresample) + if(AVRESAMPLE_LIBRARIES) + set(HAVE_LIBAVRESAMPLE 1) + list(APPEND ZM_BIN_LIBS "${AVRESAMPLE_LIBRARIES}") + find_path(AVRESAMPLE_INCLUDE_DIR "libavresample/avresample.h" /usr/include/ffmpeg) + if(AVRESAMPLE_INCLUDE_DIR) + include_directories("${AVRESAMPLE_INCLUDE_DIR}") + set(CMAKE_REQUIRED_INCLUDES "${AVRESAMPLE_INCLUDE_DIR}") + endif(AVRESAMPLE_INCLUDE_DIR) + mark_as_advanced(FORCE AVRESAMPLE_LIBRARIES AVRESAMPLE_INCLUDE_DIR) + check_include_file("libavresample/avresample.h" HAVE_LIBAVRESAMPLE_AVRESAMPLE_H) + set(optlibsfound "${optlibsfound} AVResample") + else(AVRESAMPLE_LIBRARIES) + set(optlibsnotfound "${optlibsnotfound} AVResample") + endif(AVRESAMPLE_LIBRARIES) + endif(SWRESAMPLE_LIBRARIES) # Find the path to the ffmpeg executable diff --git a/zoneminder-config.cmake b/zoneminder-config.cmake index 8641bb4a8..e088e68dc 100644 --- a/zoneminder-config.cmake +++ b/zoneminder-config.cmake @@ -54,6 +54,8 @@ #cmakedefine HAVE_LIBAVUTIL_HWCONTEXT_H 0 #cmakedefine HAVE_LIBSWSCALE 1 #cmakedefine HAVE_LIBSWSCALE_SWSCALE_H 1 +#cmakedefine HAVE_LIBSWRESAMPLE 1 +#cmakedefine HAVE_LIBSWRESAMPLE_SWRESAMPLE_H 1 #cmakedefine HAVE_LIBAVRESAMPLE 1 #cmakedefine HAVE_LIBAVRESAMPLE_AVRESAMPLE_H 1 #cmakedefine HAVE_LIBVLC 1