summaryrefslogtreecommitdiffstats
path: root/src/video_core/command_classes/nvdec.h
diff options
context:
space:
mode:
authorameerj <aj662@drexel.edu>2020-10-27 04:07:36 +0100
committerameerj <aj662@drexel.edu>2020-10-27 04:07:36 +0100
commiteb67a45ca82bc01ac843c853fd3c17f2a90e0250 (patch)
tree11e78a1b728ef0a608fae43d966b613eb4e6d58a /src/video_core/command_classes/nvdec.h
parentMerge pull request #4827 from lioncash/trunc (diff)
downloadyuzu-eb67a45ca82bc01ac843c853fd3c17f2a90e0250.tar
yuzu-eb67a45ca82bc01ac843c853fd3c17f2a90e0250.tar.gz
yuzu-eb67a45ca82bc01ac843c853fd3c17f2a90e0250.tar.bz2
yuzu-eb67a45ca82bc01ac843c853fd3c17f2a90e0250.tar.lz
yuzu-eb67a45ca82bc01ac843c853fd3c17f2a90e0250.tar.xz
yuzu-eb67a45ca82bc01ac843c853fd3c17f2a90e0250.tar.zst
yuzu-eb67a45ca82bc01ac843c853fd3c17f2a90e0250.zip
Diffstat (limited to 'src/video_core/command_classes/nvdec.h')
-rw-r--r--src/video_core/command_classes/nvdec.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/video_core/command_classes/nvdec.h b/src/video_core/command_classes/nvdec.h
new file mode 100644
index 000000000..c1a9d843e
--- /dev/null
+++ b/src/video_core/command_classes/nvdec.h
@@ -0,0 +1,39 @@
+// Copyright 2020 yuzu Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include <vector>
+#include "common/common_funcs.h"
+#include "common/common_types.h"
+#include "video_core/command_classes/codecs/codec.h"
+
+namespace Tegra {
+class GPU;
+
+class Nvdec {
+public:
+ enum class Method : u32 {
+ SetVideoCodec = 0x80,
+ Execute = 0xc0,
+ };
+
+ explicit Nvdec(GPU& gpu);
+ ~Nvdec();
+
+ /// Writes the method into the state, Invoke Execute() if encountered
+ void ProcessMethod(Nvdec::Method method, const std::vector<u32>& arguments);
+
+ /// Return most recently decoded frame
+ AVFrame* GetFrame();
+ const AVFrame* GetFrame() const;
+
+private:
+ /// Invoke codec to decode a frame
+ void Execute();
+
+ GPU& gpu;
+ std::unique_ptr<Tegra::Codec> codec;
+};
+} // namespace Tegra