nvdec.h 805 B

123456789101112131415161718192021222324252627282930313233343536373839
  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/host1x/codecs/codec.h"
  8. namespace Tegra {
  9. namespace Host1x {
  10. class Host1x;
  11. class Nvdec {
  12. public:
  13. explicit Nvdec(Host1x& host1x);
  14. ~Nvdec();
  15. /// Writes the method into the state, Invoke Execute() if encountered
  16. void ProcessMethod(u32 method, u32 argument);
  17. /// Return most recently decoded frame
  18. [[nodiscard]] std::unique_ptr<FFmpeg::Frame> GetFrame();
  19. private:
  20. /// Invoke codec to decode a frame
  21. void Execute();
  22. Host1x& host1x;
  23. NvdecCommon::NvdecRegisters state;
  24. std::unique_ptr<Codec> codec;
  25. };
  26. } // namespace Host1x
  27. } // namespace Tegra