2021-09-28 23:43:40 +01:00
|
|
|
using System;
|
|
|
|
|
|
|
|
namespace Ryujinx.Graphics.Nvdec
|
|
|
|
{
|
|
|
|
class NvdecDecoderContext : IDisposable
|
|
|
|
{
|
2021-10-12 21:55:57 +01:00
|
|
|
private FFmpeg.H264.Decoder _h264Decoder;
|
|
|
|
private FFmpeg.Vp8.Decoder _vp8Decoder;
|
2021-09-28 23:43:40 +01:00
|
|
|
|
2021-10-12 21:55:57 +01:00
|
|
|
public FFmpeg.H264.Decoder GetH264Decoder()
|
2021-09-28 23:43:40 +01:00
|
|
|
{
|
2021-10-12 21:55:57 +01:00
|
|
|
return _h264Decoder ??= new FFmpeg.H264.Decoder();
|
|
|
|
}
|
|
|
|
|
|
|
|
public FFmpeg.Vp8.Decoder GetVp8Decoder()
|
|
|
|
{
|
|
|
|
return _vp8Decoder ??= new FFmpeg.Vp8.Decoder();
|
2021-09-28 23:43:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public void Dispose()
|
|
|
|
{
|
2021-10-12 21:55:57 +01:00
|
|
|
_h264Decoder?.Dispose();
|
|
|
|
_h264Decoder = null;
|
|
|
|
|
|
|
|
_vp8Decoder?.Dispose();
|
|
|
|
_vp8Decoder = null;
|
2021-09-28 23:43:40 +01:00
|
|
|
}
|
|
|
|
}
|
2023-06-25 20:44:42 +01:00
|
|
|
}
|