aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Nvdec/NvdecDecoderContext.cs
blob: 54934bc5ac1f81477bc0cd28d0f6430a3c996799 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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;
        }
    }
}