summaryrefslogtreecommitdiffstats
path: root/ConfigureChecks.cmake
diff options
context:
space:
mode:
authorliushuyu <liushuyu@aosc.io>2021-08-21 22:18:24 -0600
committerMichele Calgaro <michele.calgaro@yahoo.it>2021-08-28 20:10:05 +0900
commit9655286dc7517726bd80d1ed8ee93d5943971ebd (patch)
tree1d0f4e68205c7cca377f4ebb18e907c4497602dc /ConfigureChecks.cmake
parent3904afa1ff696c64e13cf4c9c2b0b355bab8ec36 (diff)
downloadakode-9655286d.tar.gz
akode-9655286d.zip
plugins/ffmpeg_decoder: migrate to FFmpeg 4.x API
Signed-off-by: Zixing Liu <liushuyu@aosc.io> plugins/ffmpeg_decoder: Add detection whether AVFrame structure has pkt_size and channels members. Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 6dacea6e811ebff1e88fc4a9f717b3e7cbf99378)
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r--ConfigureChecks.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index ea07330..dd50162 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -169,6 +169,23 @@ if( WITH_FFMPEG_DECODER )
tde_message_fatal( "libavcodec >= 50 are required, but not found on your system" )
endif( NOT AVCODEC_FOUND )
+ pkg_search_module( AVUTIL libavutil>=50 )
+ if( NOT AVUTIL_FOUND )
+ tde_message_fatal( "libavutil >= 50 are required, but not found on your system" )
+ endif( NOT AVUTIL_FOUND )
+
+ message( STATUS "Looking for ffmpeg frame.h" )
+ find_file( AVFRAME_H NAMES frame.h avcodec.h
+ PATHS ${AVUTIL_INCLUDE_DIRS} ${AVCODEC_INCLUDE_DIRS}
+ PATH_SUFFIXES libavutil libavcodec
+ )
+ if( NOT AVFRAME_H )
+ tde_message_fatal( "FFMPEG header frame.h cannot be found!" )
+ endif()
+ message( STATUS "Looking for ffmpeg frame.h - found ${AVFRAME_H}" )
+ check_struct_has_member( AVFrame pkt_size ${AVFRAME_H} FFMPEG_AVFRAME_HAVE_PKT_SIZE )
+ check_struct_has_member( AVFrame channels ${AVFRAME_H} FFMPEG_AVFRAME_HAVE_CHANNELS )
+
set( HAVE_FFMPEG 1 )
endif( WITH_FFMPEG_DECODER )