summaryrefslogtreecommitdiffstats
path: root/src/video_core/host1x/codecs/codec.h
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-11-15 19:45:07 +0100
committerLiam <byteslice@airmail.cc>2023-11-16 23:01:38 +0100
commit4055a476aafb7b915c649363ccde7ba9b8d864d3 (patch)
tree7b0d6d2ebcf4a81ba3eab1829130e529e666c243 /src/video_core/host1x/codecs/codec.h
parentMerge pull request #12043 from t895/disable-pip-default (diff)
downloadyuzu-4055a476aafb7b915c649363ccde7ba9b8d864d3.tar
yuzu-4055a476aafb7b915c649363ccde7ba9b8d864d3.tar.gz
yuzu-4055a476aafb7b915c649363ccde7ba9b8d864d3.tar.bz2
yuzu-4055a476aafb7b915c649363ccde7ba9b8d864d3.tar.lz
yuzu-4055a476aafb7b915c649363ccde7ba9b8d864d3.tar.xz
yuzu-4055a476aafb7b915c649363ccde7ba9b8d864d3.tar.zst
yuzu-4055a476aafb7b915c649363ccde7ba9b8d864d3.zip
Diffstat (limited to 'src/video_core/host1x/codecs/codec.h')
-rw-r--r--src/video_core/host1x/codecs/codec.h39
1 files changed, 5 insertions, 34 deletions
diff --git a/src/video_core/host1x/codecs/codec.h b/src/video_core/host1x/codecs/codec.h
index 06fe00a4b..f700ae129 100644
--- a/src/video_core/host1x/codecs/codec.h
+++ b/src/video_core/host1x/codecs/codec.h
@@ -4,28 +4,15 @@
#pragma once
#include <memory>
+#include <optional>
#include <string_view>
#include <queue>
#include "common/common_types.h"
+#include "video_core/host1x/ffmpeg/ffmpeg.h"
#include "video_core/host1x/nvdec_common.h"
-extern "C" {
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wconversion"
-#endif
-#include <libavcodec/avcodec.h>
-#include <libavfilter/avfilter.h>
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-}
-
namespace Tegra {
-void AVFrameDeleter(AVFrame* ptr);
-using AVFramePtr = std::unique_ptr<AVFrame, decltype(&AVFrameDeleter)>;
-
namespace Decoder {
class H264;
class VP8;
@@ -51,7 +38,7 @@ public:
void Decode();
/// Returns next decoded frame
- [[nodiscard]] AVFramePtr GetCurrentFrame();
+ [[nodiscard]] std::unique_ptr<FFmpeg::Frame> GetCurrentFrame();
/// Returns the value of current_codec
[[nodiscard]] Host1x::NvdecCommon::VideoCodec GetCurrentCodec() const;
@@ -60,25 +47,9 @@ public:
[[nodiscard]] std::string_view GetCurrentCodecName() const;
private:
- void InitializeAvCodecContext();
-
- void InitializeAvFilters(AVFrame* frame);
-
- void InitializeGpuDecoder();
-
- bool CreateGpuAvDevice();
-
bool initialized{};
- bool filters_initialized{};
Host1x::NvdecCommon::VideoCodec current_codec{Host1x::NvdecCommon::VideoCodec::None};
-
- const AVCodec* av_codec{nullptr};
- AVCodecContext* av_codec_ctx{nullptr};
- AVBufferRef* av_gpu_decoder{nullptr};
-
- AVFilterContext* av_filter_src_ctx{nullptr};
- AVFilterContext* av_filter_sink_ctx{nullptr};
- AVFilterGraph* av_filter_graph{nullptr};
+ FFmpeg::DecodeApi decode_api;
Host1x::Host1x& host1x;
const Host1x::NvdecCommon::NvdecRegisters& state;
@@ -86,7 +57,7 @@ private:
std::unique_ptr<Decoder::VP8> vp8_decoder;
std::unique_ptr<Decoder::VP9> vp9_decoder;
- std::queue<AVFramePtr> av_frames{};
+ std::queue<std::unique_ptr<FFmpeg::Frame>> frames{};
};
} // namespace Tegra