diff options
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/command_classes/codecs/codec.cpp | 6 | ||||
| -rw-r--r-- | src/video_core/video_core.cpp | 3 |
2 files changed, 7 insertions, 2 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 @@ | |||
| 5 | #include <fstream> | 5 | #include <fstream> |
| 6 | #include <vector> | 6 | #include <vector> |
| 7 | #include "common/assert.h" | 7 | #include "common/assert.h" |
| 8 | #include "common/settings.h" | ||
| 8 | #include "video_core/command_classes/codecs/codec.h" | 9 | #include "video_core/command_classes/codecs/codec.h" |
| 9 | #include "video_core/command_classes/codecs/h264.h" | 10 | #include "video_core/command_classes/codecs/h264.h" |
| 10 | #include "video_core/command_classes/codecs/vp9.h" | 11 | #include "video_core/command_classes/codecs/vp9.h" |
| @@ -142,8 +143,11 @@ void Codec::Initialize() { | |||
| 142 | } | 143 | } |
| 143 | }(); | 144 | }(); |
| 144 | av_codec = avcodec_find_decoder(codec); | 145 | av_codec = avcodec_find_decoder(codec); |
| 146 | |||
| 145 | InitializeAvCodecContext(); | 147 | InitializeAvCodecContext(); |
| 146 | InitializeGpuDecoder(); | 148 | if (Settings::values.nvdec_emulation.GetValue() == Settings::NvdecEmulation::GPU) { |
| 149 | InitializeGpuDecoder(); | ||
| 150 | } | ||
| 147 | if (const int res = avcodec_open2(av_codec_ctx, av_codec, nullptr); res < 0) { | 151 | if (const int res = avcodec_open2(av_codec_ctx, av_codec, nullptr); res < 0) { |
| 148 | LOG_ERROR(Service_NVDRV, "avcodec_open2() Failed with result {}", res); | 152 | LOG_ERROR(Service_NVDRV, "avcodec_open2() Failed with result {}", res); |
| 149 | avcodec_free_context(&av_codec_ctx); | 153 | avcodec_free_context(&av_codec_ctx); |
diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp index 3b575db4d..cae543a51 100644 --- a/src/video_core/video_core.cpp +++ b/src/video_core/video_core.cpp | |||
| @@ -37,7 +37,8 @@ std::unique_ptr<VideoCore::RendererBase> CreateRenderer( | |||
| 37 | namespace VideoCore { | 37 | namespace VideoCore { |
| 38 | 38 | ||
| 39 | std::unique_ptr<Tegra::GPU> CreateGPU(Core::Frontend::EmuWindow& emu_window, Core::System& system) { | 39 | std::unique_ptr<Tegra::GPU> CreateGPU(Core::Frontend::EmuWindow& emu_window, Core::System& system) { |
| 40 | const bool use_nvdec = Settings::values.use_nvdec_emulation.GetValue(); | 40 | const auto nvdec_value = Settings::values.nvdec_emulation.GetValue(); |
| 41 | const bool use_nvdec = nvdec_value != Settings::NvdecEmulation::Off; | ||
| 41 | const bool use_async = Settings::values.use_asynchronous_gpu_emulation.GetValue(); | 42 | const bool use_async = Settings::values.use_asynchronous_gpu_emulation.GetValue(); |
| 42 | auto gpu = std::make_unique<Tegra::GPU>(system, use_async, use_nvdec); | 43 | auto gpu = std::make_unique<Tegra::GPU>(system, use_async, use_nvdec); |
| 43 | auto context = emu_window.CreateSharedContext(); | 44 | auto context = emu_window.CreateSharedContext(); |