demuxer: Fix demuxer assert logic and refactor FindFFmpeg#186
Open
crmurillo wants to merge 2 commits intoKhronosGroup:mainfrom
Open
demuxer: Fix demuxer assert logic and refactor FindFFmpeg#186crmurillo wants to merge 2 commits intoKhronosGroup:mainfrom
crmurillo wants to merge 2 commits intoKhronosGroup:mainfrom
Conversation
…ions The module searched for FFmpeg libraries twice (once via a macro, once via pkg-config + find_library) and used "FFMPEG" as the pkg-config prefix, which meant pkg-config wrote over the module's own output variables like FFMPEG_FOUND and FFMPEG_LIBRARIES. The following changes were made: - Replace with a single search pass using PC_FFMPEG as the pkg-config prefix. - Remove avdevice/x264/x265 since nothing links against them. - Drop the outdated Win32 stdint.h check. - Make swscale optional.
When FFmpeg is not found and no codec is explicitly passed, codecType defaults to VK_VIDEO_CODEC_OPERATION_NONE_KHR). In release builds, the asserts validating this are stripped, causing the demuxer to silently proceed with invalid parameters and ultimately fail with a misleading "Video decode queue family not supported by hardware/driver" error. Replace asserts with explicit validation that returns VK_ERROR_FORMAT_NOT_SUPPORTED with descriptive error messages. Also print a hint when FFmpeg demuxer support is not available, since this is the most common cause of the failure.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR addresses two issues:
When FFmpeg is not found at build time and no codec is explicitly passed at runtime, codecType defaults to VK_VIDEO_CODEC_OPERATION_NONE_KHR. The assert() calls validating this are stripped in release builds, so the demuxer silently proceeds with invalid parameters and fails with a misleading "Video decode queue family not supported" error. See linked issue for more details.
The FindFFmpeg.cmake module had two separate search passes for FFmpeg libraries: one via a custom FFMPEG_FIND macro and another via pkg_check_modules + find_library. It used FFMPEG as the pkg-config prefix, which caused pkg-config to overwrite the module's own output variables
Type of change
bug fix
Issue (optional)
Fixes #185.
Tests
NVIDIA GeForce RTX 4060 Ti / NVIDIA 595.44.00 / Ubuntu 24.04.4 LTS
Total Tests: 73
Passed: 62
Crashed: 0
Failed: 0
Not Supported: 9
Skipped: 2 (in skip list)
Success Rate: 100.0%
AMD Radeon RX 7600 (RADV NAVI33) / radv Mesa 26.1.0-devel (git-055aec542e) / Ubuntu 24.04.4 LTS
Total Tests: 73
Passed: 63
Crashed: 0
Failed: 0
Not Supported: 6
Skipped: 4 (in skip list)
Success Rate: 100.0%
Intel(R) UHD Graphics 770 (ADL-S GT1) / Intel open-source Mesa driver Mesa 26.1.0-devel (git-055aec542e) / Ubuntu 24.04.4 LTS
Total Tests: 73
Passed: 54
Crashed: 0
Failed: 0
Not Supported: 14
Skipped: 5 (in skip list)
Success Rate: 100.0%