From 27d3d74f1d254a48c3e3ece303d14fa44d73d11b Mon Sep 17 00:00:00 2001 From: Kiriti Gowda Date: Tue, 30 Jul 2024 14:31:51 -0700 Subject: [PATCH] Samples: Video batch decode - FFMPEG Multiversion support (#402) --- samples/videoDecodeBatch/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/samples/videoDecodeBatch/CMakeLists.txt b/samples/videoDecodeBatch/CMakeLists.txt index 5faaa5f08d..c7bcd8c2cc 100644 --- a/samples/videoDecodeBatch/CMakeLists.txt +++ b/samples/videoDecodeBatch/CMakeLists.txt @@ -90,6 +90,12 @@ if(HIP_FOUND AND FFMPEG_FOUND AND ROCDECODE_FOUND) add_executable(${PROJECT_NAME} ${SOURCES}) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++17") target_link_libraries(${PROJECT_NAME} ${LINK_LIBRARY_LIST}) + # FFMPEG multi-version support + if(_FFMPEG_AVCODEC_VERSION VERSION_LESS_EQUAL 58.134.100) + target_compile_definitions(${PROJECT_NAME} PUBLIC USE_AVCODEC_GREATER_THAN_58_134=0) + else() + target_compile_definitions(${PROJECT_NAME} PUBLIC USE_AVCODEC_GREATER_THAN_58_134=1) + endif() else() message("-- ERROR!: ${PROJECT_NAME} excluded! please install all the dependencies and try again!") if (NOT HIP_FOUND)