Enable FFmpeg GPU decoding for NVIDIA and AMD graphic cards (#139)

This enables the DXVA2, D3D11VA, D3D11VA2 and NVENC decoders for GPU decoding of H264 and VP9 formats on Windows.

Co-authored-by: MaranBr <maranbr@outlook.com>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/139
This commit is contained in:
MaranBr 2025-05-29 21:20:13 +00:00
parent 7f16f12202
commit 621d1c3d8a
2 changed files with 2 additions and 4 deletions

View file

@ -37,7 +37,6 @@ constexpr std::array PreferredGpuDecoders = {
AV_HWDEVICE_TYPE_VAAPI,
AV_HWDEVICE_TYPE_VDPAU,
#endif
// last resort for Linux Flatpak (w/ NVIDIA)
AV_HWDEVICE_TYPE_VULKAN,
};
@ -108,8 +107,7 @@ bool Decoder::SupportsDecodingOnDevice(AVPixelFormat* out_pix_fmt, AVHWDeviceTyp
av_hwdevice_get_type_name(type));
break;
}
if ((config->methods & AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX) != 0 &&
config->device_type == type) {
if (config->methods & AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX && config->device_type == type) {
LOG_INFO(HW_GPU, "Using {} GPU decoder", av_hwdevice_get_type_name(type));
*out_pix_fmt = config->pix_fmt;
return true;