diff options
author | Ameer J <52414509+ameerj@users.noreply.github.com> | 2021-07-05 22:06:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-05 22:06:09 +0200 |
commit | c770fa9823185fd2878310546311b528d421e31c (patch) | |
tree | 1b2cd25a36cc9b770635174f0a0c38132436f3a2 /src/video_core/command_classes/codecs/codec.h | |
parent | Merge pull request #6561 from german77/analog_fix (diff) | |
parent | Slightly refactor NVDEC and codecs for readability and safety (diff) | |
download | yuzu-c770fa9823185fd2878310546311b528d421e31c.tar yuzu-c770fa9823185fd2878310546311b528d421e31c.tar.gz yuzu-c770fa9823185fd2878310546311b528d421e31c.tar.bz2 yuzu-c770fa9823185fd2878310546311b528d421e31c.tar.lz yuzu-c770fa9823185fd2878310546311b528d421e31c.tar.xz yuzu-c770fa9823185fd2878310546311b528d421e31c.tar.zst yuzu-c770fa9823185fd2878310546311b528d421e31c.zip |
Diffstat (limited to 'src/video_core/command_classes/codecs/codec.h')
-rw-r--r-- | src/video_core/command_classes/codecs/codec.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/video_core/command_classes/codecs/codec.h b/src/video_core/command_classes/codecs/codec.h index 3e135a2a6..f2aef1699 100644 --- a/src/video_core/command_classes/codecs/codec.h +++ b/src/video_core/command_classes/codecs/codec.h @@ -42,15 +42,15 @@ class VP9; class Codec { public: - explicit Codec(GPU& gpu); + explicit Codec(GPU& gpu, const NvdecCommon::NvdecRegisters& regs); ~Codec(); + /// Initialize the codec, returning success or failure + void Initialize(); + /// Sets NVDEC video stream codec void SetTargetCodec(NvdecCommon::VideoCodec codec); - /// Populate NvdecRegisters state with argument value at the provided offset - void StateWrite(u32 offset, u64 arguments); - /// Call decoders to construct headers, decode AVFrame with ffmpeg void Decode(); @@ -59,6 +59,8 @@ public: /// Returns the value of current_codec [[nodiscard]] NvdecCommon::VideoCodec GetCurrentCodec() const; + /// Return name of the current codec + [[nodiscard]] std::string_view GetCurrentCodecName() const; private: bool initialized{}; @@ -68,10 +70,10 @@ private: AVCodecContext* av_codec_ctx{nullptr}; GPU& gpu; + const NvdecCommon::NvdecRegisters& state; std::unique_ptr<Decoder::H264> h264_decoder; std::unique_ptr<Decoder::VP9> vp9_decoder; - NvdecCommon::NvdecRegisters state{}; std::queue<AVFramePtr> av_frames{}; }; |