nvdec.h 734 B

123456789101112131415161718192021222324252627282930313233
  1. // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include <memory>
  5. #include <vector>
  6. #include "common/common_types.h"
  7. #include "video_core/command_classes/codecs/codec.h"
  8. namespace Tegra {
  9. class GPU;
  10. class Nvdec {
  11. public:
  12. explicit Nvdec(GPU& gpu);
  13. ~Nvdec();
  14. /// Writes the method into the state, Invoke Execute() if encountered
  15. void ProcessMethod(u32 method, u32 argument);
  16. /// Return most recently decoded frame
  17. [[nodiscard]] AVFramePtr GetFrame();
  18. private:
  19. /// Invoke codec to decode a frame
  20. void Execute();
  21. GPU& gpu;
  22. NvdecCommon::NvdecRegisters state;
  23. std::unique_ptr<Codec> codec;
  24. };
  25. } // namespace Tegra