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