diff options
author | bunnei <bunneidev@gmail.com> | 2020-12-03 00:55:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-03 00:55:15 +0100 |
commit | 9abb23cd2700b57611fc25bce67581eaa6d4d3b7 (patch) | |
tree | 75a2c41fbdfab51ea44e74e84c17204da171b938 /src/video_core/command_classes/codecs/codec.h | |
parent | Merge pull request #4937 from german77/multiUDP (diff) | |
parent | Limit queue size to 10 frames (diff) | |
download | yuzu-9abb23cd2700b57611fc25bce67581eaa6d4d3b7.tar yuzu-9abb23cd2700b57611fc25bce67581eaa6d4d3b7.tar.gz yuzu-9abb23cd2700b57611fc25bce67581eaa6d4d3b7.tar.bz2 yuzu-9abb23cd2700b57611fc25bce67581eaa6d4d3b7.tar.lz yuzu-9abb23cd2700b57611fc25bce67581eaa6d4d3b7.tar.xz yuzu-9abb23cd2700b57611fc25bce67581eaa6d4d3b7.tar.zst yuzu-9abb23cd2700b57611fc25bce67581eaa6d4d3b7.zip |
Diffstat (limited to 'src/video_core/command_classes/codecs/codec.h')
-rw-r--r-- | src/video_core/command_classes/codecs/codec.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/video_core/command_classes/codecs/codec.h b/src/video_core/command_classes/codecs/codec.h index ee5d62540..8a2a6c360 100644 --- a/src/video_core/command_classes/codecs/codec.h +++ b/src/video_core/command_classes/codecs/codec.h @@ -5,6 +5,7 @@ #pragma once #include <memory> +#include <queue> #include "common/common_types.h" #include "video_core/command_classes/nvdec_common.h" @@ -23,6 +24,9 @@ namespace Tegra { class GPU; struct VicRegisters; +void AVFrameDeleter(AVFrame* ptr); +using AVFramePtr = std::unique_ptr<AVFrame, decltype(&AVFrameDeleter)>; + namespace Decoder { class H264; class VP9; @@ -42,9 +46,8 @@ public: /// Call decoders to construct headers, decode AVFrame with ffmpeg void Decode(); - /// Returns most recently decoded frame - [[nodiscard]] AVFrame* GetCurrentFrame(); - [[nodiscard]] const AVFrame* GetCurrentFrame() const; + /// Returns next decoded frame + [[nodiscard]] AVFramePtr GetCurrentFrame(); /// Returns the value of current_codec [[nodiscard]] NvdecCommon::VideoCodec GetCurrentCodec() const; @@ -55,13 +58,13 @@ private: AVCodec* av_codec{nullptr}; AVCodecContext* av_codec_ctx{nullptr}; - AVFrame* av_frame{nullptr}; GPU& gpu; std::unique_ptr<Decoder::H264> h264_decoder; std::unique_ptr<Decoder::VP9> vp9_decoder; NvdecCommon::NvdecRegisters state{}; + std::queue<AVFramePtr> av_frames{}; }; } // namespace Tegra |