diff options
| author | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-08-08 16:56:40 -0400 |
|---|---|---|
| committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-08-16 14:40:53 -0400 |
| commit | cd016d3cb5191b9f4f2756e440a6aa67e577c414 (patch) | |
| tree | e96e08167a350f05feb9c081950be305612d9113 /src/video_core/command_classes/codecs/codec.cpp | |
| parent | a832aa699f783f6ae0a6a1468b0aa6bc7d68c5d2 (diff) | |
configure_graphics: Add GPU nvdec decoding as an option
Some system configurations may see visual regressions or lower performance using GPU decoding compared to CPU decoding. This setting provides the option for users to specify their decoding preference.
Co-Authored-By: yzct12345 <87620833+yzct12345@users.noreply.github.com>
Diffstat (limited to 'src/video_core/command_classes/codecs/codec.cpp')
| -rw-r--r-- | src/video_core/command_classes/codecs/codec.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/video_core/command_classes/codecs/codec.cpp b/src/video_core/command_classes/codecs/codec.cpp index 18aa40ca3..61966cbfe 100644 --- a/src/video_core/command_classes/codecs/codec.cpp +++ b/src/video_core/command_classes/codecs/codec.cpp @@ -5,6 +5,7 @@ #include <fstream> #include <vector> #include "common/assert.h" +#include "common/settings.h" #include "video_core/command_classes/codecs/codec.h" #include "video_core/command_classes/codecs/h264.h" #include "video_core/command_classes/codecs/vp9.h" @@ -142,8 +143,11 @@ void Codec::Initialize() { } }(); av_codec = avcodec_find_decoder(codec); + InitializeAvCodecContext(); - InitializeGpuDecoder(); + if (Settings::values.nvdec_emulation.GetValue() == Settings::NvdecEmulation::GPU) { + InitializeGpuDecoder(); + } if (const int res = avcodec_open2(av_codec_ctx, av_codec, nullptr); res < 0) { LOG_ERROR(Service_NVDRV, "avcodec_open2() Failed with result {}", res); avcodec_free_context(&av_codec_ctx); |
