Files
eden/src/video_core/host1x/nvdec.h
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

59 lines
1.3 KiB
C++
Raw Normal View History

// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
2025-07-30 21:08:43 +02:00
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
2020-10-26 23:07:36 -04:00
#pragma once
2020-10-27 02:09:17 -04:00
#include <memory>
2020-10-26 23:07:36 -04:00
#include <vector>
#include <variant>
2024-04-05 01:58:29 +02:00
2020-10-26 23:07:36 -04:00
#include "common/common_types.h"
2024-04-05 01:58:29 +02:00
#include "video_core/cdma_pusher.h"
#include "video_core/host1x/codecs/decoder.h"
#include "video_core/host1x/codecs/h264.h"
#include "video_core/host1x/codecs/vp8.h"
#include "video_core/host1x/codecs/vp9.h"
2020-10-26 23:07:36 -04:00
namespace Tegra {
2022-01-30 10:31:13 +01:00
namespace Host1x {
2022-01-30 22:26:01 +01:00
class Host1x;
2024-04-05 01:58:29 +02:00
class FrameQueue;
2022-01-30 22:26:01 +01:00
2024-04-05 01:58:29 +02:00
class Nvdec final : public CDmaPusher {
2020-10-26 23:07:36 -04:00
public:
explicit Nvdec(Host1x& host1x, s32 id, u32 syncpt);
2020-10-26 23:07:36 -04:00
~Nvdec();
/// Writes the method into the state, Invoke Execute() if encountered
2024-04-05 01:58:29 +02:00
void ProcessMethod(u32 method, u32 arg) override;
u32 GetSyncpoint() const {
return syncpoint;
}
2020-10-26 23:07:36 -04:00
private:
2024-04-05 01:58:29 +02:00
/// Create the decoder when the codec id is set
void CreateDecoder(NvdecCommon::VideoCodec codec);
2020-10-26 23:07:36 -04:00
/// Invoke codec to decode a frame
void Execute();
NvdecCommon::NvdecRegisters regs{};
std::variant<
Decoders::H264,
Decoders::VP8,
Decoders::VP9,
std::monostate
> decoder = std::monostate{};
2024-04-05 01:58:29 +02:00
s32 id;
u32 syncpoint;
2020-10-26 23:07:36 -04:00
};
2022-01-30 10:31:13 +01:00
} // namespace Host1x
2020-10-26 23:07:36 -04:00
} // namespace Tegra