diff options
author | yuzubot <[email protected]> | 2024-03-04 00:57:21 +0000 |
---|---|---|
committer | yuzubot <[email protected]> | 2024-03-04 00:57:21 +0000 |
commit | 276ceb26d0c58a00a0e65e3bf4d9c4371428f82d (patch) | |
tree | 587c6b5415501f1b1a1795ddd6df8d3403252cb4 /src/video_core/host1x/nvdec.h | |
parent | 15e6e48bef0216480661444a8d8b348c1cca47bb (diff) | |
download | yuzu-android-276ceb26d0c58a00a0e65e3bf4d9c4371428f82d.tar.gz yuzu-android-276ceb26d0c58a00a0e65e3bf4d9c4371428f82d.zip |
Merge yuzu-emu#12461
Diffstat (limited to 'src/video_core/host1x/nvdec.h')
-rw-r--r-- | src/video_core/host1x/nvdec.h | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/src/video_core/host1x/nvdec.h b/src/video_core/host1x/nvdec.h index ddddb8d28..565c65f66 100644 --- a/src/video_core/host1x/nvdec.h +++ b/src/video_core/host1x/nvdec.h @@ -5,33 +5,47 @@ #include <memory> #include <vector> + #include "common/common_types.h" -#include "video_core/host1x/codecs/codec.h" +#include "video_core/cdma_pusher.h" +#include "video_core/host1x/codecs/decoder.h" namespace Tegra { namespace Host1x { - class Host1x; +class FrameQueue; -class Nvdec { +class Nvdec final : public CDmaPusher { public: - explicit Nvdec(Host1x& host1x); + explicit Nvdec(Host1x& host1x, s32 id, u32 syncpt, FrameQueue& frame_queue_); ~Nvdec(); /// Writes the method into the state, Invoke Execute() if encountered - void ProcessMethod(u32 method, u32 argument); + void ProcessMethod(u32 method, u32 arg) override; + + u32 GetSyncpoint() const { + return syncpoint; + } - /// Return most recently decoded frame - [[nodiscard]] std::unique_ptr<FFmpeg::Frame> GetFrame(); + void SetWait() { + wait_needed = true; + } private: + /// Create the decoder when the codec id is set + void CreateDecoder(NvdecCommon::VideoCodec codec); + /// Invoke codec to decode a frame void Execute(); - Host1x& host1x; - NvdecCommon::NvdecRegisters state; - std::unique_ptr<Codec> codec; + s32 id; + u32 syncpoint; + FrameQueue& frame_queue; + + NvdecCommon::NvdecRegisters regs{}; + std::unique_ptr<Decoder> decoder; + bool wait_needed{false}; }; } // namespace Host1x |