Move FFmpeg hwaccel checks to CMake, eliminate #pragma messages #645
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.
This PR renames the
HAVE_HW_ACCEL
preprocessor symbol toUSE_HW_ACCEL
, and adds a new CMake build option of the same name (defaultON
). This allows hardware acceleration to be disabled even when building with FFmpeg 3.4+ (by adding-DUSE_HW_ACCEL=0
to the CMake command line).In addition, the
#pragma
messages about hardware acceleration are removed fromFFmpeg{Reader,Writer}.cpp
and replaced with a CMake FeatureSummary message that accounts for both the value ofUSE_HW_ACCEL
, and whether the FFmpeg version in question supports acceleration.Normal output (with FFmpeg 3.4+)
Manually disabled
As a fallback, if
USE_HW_ACCEL
is not defined in the generated compile commands at all (which it will not be, ifUSE_HWACCEL
isTRUE
, but the FFmpeg version cannot be confirmed to support acceleration), thenFFmpegUtilities.h
will setUSE_HW_ACCEL
using the previous version-detection code.