-
Notifications
You must be signed in to change notification settings - Fork 13
demuxer: Fix demuxer assert logic and refactor FindFFmpeg #186
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
Open
crmurillo
wants to merge
4
commits into
KhronosGroup:main
Choose a base branch
from
crmurillo:fix_ffmpeg_cmake
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8cc0f86
cmake: refactor FindFFmpeg to fix duplicate logic and variable collis…
crmurillo 6e9b806
demuxer: replace asserts with proper error handling and add FFmpeg hint
crmurillo 5204e9d
tests: Update skipped list for AMD driver
crmurillo f6e3ebe
cmake: drop unused libswscale dependency from FindFFmpeg
crmurillo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,85 +59,30 @@ if(BUILD_DECODER OR USE_ENCODER_SHADERC) | |
| include(FindShaderc) | ||
| endif() | ||
|
|
||
| ############ VULKAN_FFMPEG_LIB_PATH ###################################### | ||
| if (DEFINED ENV{VULKAN_FFMPEG_LIB_DIR_PATH}) | ||
| MESSAGE(STATUS "VULKAN_FFMPEG_LIB_DIR_PATH ENV VAR is set to $ENV{VULKAN_FFMPEG_LIB_DIR_PATH}") | ||
| set(VULKAN_FFMPEG_LIB_PATH "$ENV{VULKAN_FFMPEG_LIB_DIR_PATH}" CACHE PATH "Path to FFMPEG library directory" FORCE) | ||
| else() | ||
| set(VULKAN_FFMPEG_LIB_PATH "${VULKAN_FFMPEG_LIB_PATH}" CACHE PATH "Path to FFMPEG library directory") | ||
| endif() | ||
|
|
||
| if (EXISTS "${VULKAN_FFMPEG_LIB_PATH}") | ||
| MESSAGE(STATUS "VULKAN_FFMPEG_LIB_PATH is set and valid ${VULKAN_FFMPEG_LIB_PATH}") | ||
| else() | ||
| if(WIN32) | ||
| if ((CMAKE_GENERATOR_PLATFORM MATCHES "^aarch64") OR (CMAKE_GENERATOR_PLATFORM MATCHES "^arm64") OR (CMAKE_GENERATOR_PLATFORM MATCHES "^ARM64")) | ||
| set(VULKAN_FFMPEG_LIB_PATH "${CMAKE_CURRENT_SOURCE_DIR}/vk_video_decoder/bin/libs/ffmpeg/winarm64/lib" CACHE PATH "Path to FFMPEG libs directory" FORCE) | ||
| message(STATUS "FFMPEG Windows ARM64 lib location ${VULKAN_FFMPEG_LIB_PATH}") | ||
| set(FFMPEG_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/vk_video_decoder/bin/libs/ffmpeg/winarm64/include" CACHE PATH "Path to FFMPEG include directory" FORCE) | ||
| message(STATUS "FFMPEG Windows ARM64 include location ${FFMPEG_INCLUDE_DIR}") | ||
| elseif ((CMAKE_GENERATOR_PLATFORM MATCHES "^arm") OR (CMAKE_GENERATOR_PLATFORM MATCHES "^ARM")) | ||
| set(VULKAN_FFMPEG_LIB_PATH "${CMAKE_CURRENT_SOURCE_DIR}/vk_video_decoder/bin/libs/ffmpeg/winarm/lib" CACHE PATH "Path to FFMPEG libs directory" FORCE) | ||
| message(STATUS "FFMPEG Windows ARM64 lib location ${VULKAN_FFMPEG_LIB_PATH}") | ||
| set(FFMPEG_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/vk_video_decoder/bin/libs/ffmpeg/winarm/include" CACHE PATH "Path to FFMPEG include directory" FORCE) | ||
| message(STATUS "FFMPEG Windows ARM64 include location ${FFMPEG_INCLUDE_DIR}") | ||
| else() | ||
| set(VULKAN_FFMPEG_LIB_PATH "${CMAKE_CURRENT_SOURCE_DIR}/vk_video_decoder/bin/libs/ffmpeg/win64/lib" CACHE PATH "Path to FFMPEG libs directory" FORCE) | ||
| message(STATUS "FFMPEG Windows x86_64 lib location ${VULKAN_FFMPEG_LIB_PATH}") | ||
| set(FFMPEG_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/vk_video_decoder/bin/libs/ffmpeg/win64/include" CACHE PATH "Path to FFMPEG include directory" FORCE) | ||
| message(STATUS "FFMPEG Windows x86_64 include location ${FFMPEG_INCLUDE_DIR}") | ||
| endif() | ||
| else() | ||
| message( STATUS "The location of the FFMPEG Lib: ${VULKAN_FFMPEG_LIB_PATH} expected the library to be installed to the regular system libs location" ) | ||
| endif() | ||
| endif() | ||
| ############ VULKAN_FFMPEG_LIB_PATH ###################################### | ||
|
|
||
| # find_package(FFmpeg REQUIRED) | ||
| include(FindFFmpeg) | ||
| find_package(FFmpeg) | ||
| set(FFMPEG_AVAILABLE OFF) | ||
|
|
||
| # FFMPEG_FOUND - system has ffmpeg or libav | ||
| # FFMPEG_INCLUDE_DIR - the ffmpeg include directory | ||
| # FFMPEG_LIBRARIES | ||
| # FFMPEG_LIBAVCODEC | ||
| # FFMPEG_LIBAVFORMAT | ||
| # FFMPEG_LIBAVUTIL | ||
| if(FFMPEG_FOUND) | ||
| message("Found FFMPEG/LibAV libraries") | ||
| include_directories(${FFMPEG_INCLUDE_DIR}) | ||
| message(STATUS " libavcodec: ${FFMPEG_LIBAVCODEC_LIBRARIES}") | ||
| message(STATUS " libavformat: ${FFMPEG_LIBAVFORMAT_LIBRARIES}") | ||
| message(STATUS " libavutil: ${FFMPEG_LIBAVUTIL_LIBRARIES}") | ||
| include_directories(${FFMPEG_INCLUDE_DIRS}) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is project wide maybe better to have it at target level with: target_include_directories |
||
| set(FFMPEG_AVAILABLE ON) | ||
| else() | ||
|
|
||
| # Install Windows FFmpeg DLLs and libs | ||
| if(WIN32) | ||
| find_library(AVCODEC_LIB NAMES avcodec PATHS ${VULKAN_FFMPEG_LIB_PATH}) | ||
| message(STATUS ${AVCODEC_LIB}) | ||
| find_library(AVFORMAT_LIB NAMES avformat PATHS ${VULKAN_FFMPEG_LIB_PATH}) | ||
| message(STATUS ${AVFORMAT_LIB}) | ||
| find_library(AVUTIL_LIB NAMES avutil PATHS ${VULKAN_FFMPEG_LIB_PATH}) | ||
| message(STATUS ${AVUTIL_LIB}) | ||
|
|
||
| if(AVCODEC_LIB AND AVFORMAT_LIB AND AVUTIL_LIB) | ||
| message(STATUS "Found FFMPEG libraries manually") | ||
| set(FFMPEG_AVAILABLE ON) | ||
| include_directories(${FFMPEG_INCLUDE_DIR}) | ||
|
|
||
| install(DIRECTORY "${VULKAN_FFMPEG_LIB_PATH}/../bin/" | ||
| DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" | ||
| PATTERN "*.def" EXCLUDE | ||
| PATTERN "*.a" EXCLUDE) | ||
|
|
||
| install(DIRECTORY "${VULKAN_FFMPEG_LIB_PATH}/" | ||
| DESTINATION "${CMAKE_INSTALL_PREFIX}/lib") | ||
| else() | ||
| message(WARNING "Can't find libavcodec, libavformat, or libavutil on Windows!") | ||
| endif() | ||
| else() | ||
| message(WARNING "Can't find libavcodec, libavformat, or libavutil on Linux!") | ||
| get_filename_component(FFMPEG_BIN_DIR "${FFMPEG_LIB_DIR}/../bin" ABSOLUTE) | ||
|
crmurillo marked this conversation as resolved.
|
||
| install(DIRECTORY "${FFMPEG_BIN_DIR}/" | ||
| DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" | ||
| PATTERN "*.def" EXCLUDE | ||
| PATTERN "*.a" EXCLUDE) | ||
|
|
||
| install(DIRECTORY "${FFMPEG_LIB_DIR}/" | ||
| DESTINATION "${CMAKE_INSTALL_PREFIX}/lib") | ||
| endif() | ||
| endif() | ||
|
|
||
| if (NOT FFMPEG_AVAILABLE) | ||
| message(WARNING "FFMPEG demuxing is not going to be supported.") | ||
| else() | ||
| message(WARNING "Can't find libavcodec, libavformat, or libavutil!\n" | ||
| "FFMPEG demuxing is not going to be supported.") | ||
| endif() | ||
|
|
||
| # Platform specific settings | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use FFMPEG_LIBAVCODEC_LIBRARy