From cee712105850ac3385cd0091a923438167433f9f Mon Sep 17 00:00:00 2001 From: TSR Berry <20988865+TSRBerry@users.noreply.github.com> Date: Sat, 8 Apr 2023 01:22:00 +0200 Subject: Move solution and projects to src --- src/Ryujinx.Graphics.Nvdec/NvdecDecoderContext.cs | 29 +++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/Ryujinx.Graphics.Nvdec/NvdecDecoderContext.cs (limited to 'src/Ryujinx.Graphics.Nvdec/NvdecDecoderContext.cs') diff --git a/src/Ryujinx.Graphics.Nvdec/NvdecDecoderContext.cs b/src/Ryujinx.Graphics.Nvdec/NvdecDecoderContext.cs new file mode 100644 index 00000000..54934bc5 --- /dev/null +++ b/src/Ryujinx.Graphics.Nvdec/NvdecDecoderContext.cs @@ -0,0 +1,29 @@ +using System; + +namespace Ryujinx.Graphics.Nvdec +{ + class NvdecDecoderContext : IDisposable + { + private FFmpeg.H264.Decoder _h264Decoder; + private FFmpeg.Vp8.Decoder _vp8Decoder; + + public FFmpeg.H264.Decoder GetH264Decoder() + { + return _h264Decoder ??= new FFmpeg.H264.Decoder(); + } + + public FFmpeg.Vp8.Decoder GetVp8Decoder() + { + return _vp8Decoder ??= new FFmpeg.Vp8.Decoder(); + } + + public void Dispose() + { + _h264Decoder?.Dispose(); + _h264Decoder = null; + + _vp8Decoder?.Dispose(); + _vp8Decoder = null; + } + } +} \ No newline at end of file -- cgit v1.2.3