From 2b1d1915de72480c40e95ba5eb43013d83e19e84 Mon Sep 17 00:00:00 2001 From: Junrou Nishida Date: Mon, 27 Sep 2021 21:44:20 +0900 Subject: [PATCH] fix: Marshal boolean as UnmanagedType.I1 (#31) --- src/Akihabara/Native/Gpu/SafeEglSurfaceHolder.cs | 2 +- src/Akihabara/Native/SafeNativeMethods.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Akihabara/Native/Gpu/SafeEglSurfaceHolder.cs b/src/Akihabara/Native/Gpu/SafeEglSurfaceHolder.cs index b5fe05a..72e764c 100644 --- a/src/Akihabara/Native/Gpu/SafeEglSurfaceHolder.cs +++ b/src/Akihabara/Native/Gpu/SafeEglSurfaceHolder.cs @@ -22,7 +22,7 @@ public partial class SafeNativeMethods : NativeMethods public static extern bool mp_EglSurfaceHolder__flip_y(IntPtr eglSurfaceHolder); [DllImport(MediaPipeLibrary, ExactSpelling = true)] - public static extern void mp_EglSurfaceHolder__SetFlipY__b(IntPtr eglSurfaceHolder, bool flipY); + public static extern void mp_EglSurfaceHolder__SetFlipY__b(IntPtr eglSurfaceHolder, [MarshalAs(UnmanagedType.I1)] bool flipY); [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.I1)] diff --git a/src/Akihabara/Native/SafeNativeMethods.cs b/src/Akihabara/Native/SafeNativeMethods.cs index b8fce91..ebc9835 100644 --- a/src/Akihabara/Native/SafeNativeMethods.cs +++ b/src/Akihabara/Native/SafeNativeMethods.cs @@ -12,6 +12,7 @@ public partial class SafeNativeMethods : NativeMethods #region ABSL [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] public static extern bool absl_Status__ok(IntPtr status); [Pure, DllImport(MediaPipeLibrary, ExactSpelling = true)]