2021-09-28 15:43:40 -07:00
|
|
|
using System;
|
|
|
|
|
|
|
|
namespace Ryujinx.Graphics.Nvdec
|
|
|
|
{
|
|
|
|
class NvdecDecoderContext : IDisposable
|
|
|
|
{
|
2021-10-12 13:55:57 -07:00
|
|
|
private FFmpeg.H264.Decoder _h264Decoder;
|
|
|
|
private FFmpeg.Vp8.Decoder _vp8Decoder;
|
2021-09-28 15:43:40 -07:00
|
|
|
|
2021-10-12 13:55:57 -07:00
|
|
|
public FFmpeg.H264.Decoder GetH264Decoder()
|
2021-09-28 15:43:40 -07:00
|
|
|
{
|
2021-10-12 13:55:57 -07:00
|
|
|
return _h264Decoder ??= new FFmpeg.H264.Decoder();
|
|
|
|
}
|
|
|
|
|
|
|
|
public FFmpeg.Vp8.Decoder GetVp8Decoder()
|
|
|
|
{
|
|
|
|
return _vp8Decoder ??= new FFmpeg.Vp8.Decoder();
|
2021-09-28 15:43:40 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
public void Dispose()
|
|
|
|
{
|
2021-10-12 13:55:57 -07:00
|
|
|
_h264Decoder?.Dispose();
|
|
|
|
_h264Decoder = null;
|
|
|
|
|
|
|
|
_vp8Decoder?.Dispose();
|
|
|
|
_vp8Decoder = null;
|
2021-09-28 15:43:40 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|