|
@@ -10,7 +10,7 @@ namespace Ryujinx.Graphics.Nvdec.FFmpeg.Native
|
|
|
public const string AvCodecLibraryName = "avcodec";
|
|
public const string AvCodecLibraryName = "avcodec";
|
|
|
public const string AvUtilLibraryName = "avutil";
|
|
public const string AvUtilLibraryName = "avutil";
|
|
|
|
|
|
|
|
- private static readonly Dictionary<string, (int, int)> _librariesWhitelist = new Dictionary<string, (int, int)>
|
|
|
|
|
|
|
+ private static readonly Dictionary<string, (int, int)> _librariesWhitelist = new()
|
|
|
{
|
|
{
|
|
|
{ AvCodecLibraryName, (58, 59) },
|
|
{ AvCodecLibraryName, (58, 59) },
|
|
|
{ AvUtilLibraryName, (56, 57) }
|
|
{ AvUtilLibraryName, (56, 57) }
|
|
@@ -61,9 +61,8 @@ namespace Ryujinx.Graphics.Nvdec.FFmpeg.Native
|
|
|
{
|
|
{
|
|
|
NativeLibrary.SetDllImportResolver(typeof(FFmpegApi).Assembly, (name, assembly, path) =>
|
|
NativeLibrary.SetDllImportResolver(typeof(FFmpegApi).Assembly, (name, assembly, path) =>
|
|
|
{
|
|
{
|
|
|
- IntPtr handle;
|
|
|
|
|
|
|
|
|
|
- if (name == AvUtilLibraryName && TryLoadWhitelistedLibrary(AvUtilLibraryName, assembly, path, out handle))
|
|
|
|
|
|
|
+ if (name == AvUtilLibraryName && TryLoadWhitelistedLibrary(AvUtilLibraryName, assembly, path, out nint handle))
|
|
|
{
|
|
{
|
|
|
return handle;
|
|
return handle;
|
|
|
}
|
|
}
|
|
@@ -106,7 +105,7 @@ namespace Ryujinx.Graphics.Nvdec.FFmpeg.Native
|
|
|
internal static unsafe partial AVCodecContext* avcodec_alloc_context3(AVCodec* codec);
|
|
internal static unsafe partial AVCodecContext* avcodec_alloc_context3(AVCodec* codec);
|
|
|
|
|
|
|
|
[LibraryImport(AvCodecLibraryName)]
|
|
[LibraryImport(AvCodecLibraryName)]
|
|
|
- internal static unsafe partial int avcodec_open2(AVCodecContext* avctx, AVCodec* codec, void **options);
|
|
|
|
|
|
|
+ internal static unsafe partial int avcodec_open2(AVCodecContext* avctx, AVCodec* codec, void** options);
|
|
|
|
|
|
|
|
[LibraryImport(AvCodecLibraryName)]
|
|
[LibraryImport(AvCodecLibraryName)]
|
|
|
internal static unsafe partial int avcodec_close(AVCodecContext* avctx);
|
|
internal static unsafe partial int avcodec_close(AVCodecContext* avctx);
|