diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/Protobuf.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/Protobuf.cs index c146096f7..b8c2e4011 100644 --- a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/Protobuf.cs +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/External/Protobuf.cs @@ -1,9 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; - -using pb = global::Google.Protobuf; - namespace Mediapipe { internal static class Protobuf { static Protobuf() { diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/StringPacket.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/StringPacket.cs index e75a46e66..afe247c82 100644 --- a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/StringPacket.cs +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Packet/StringPacket.cs @@ -34,7 +34,7 @@ public override string Get() { } public byte[] GetByteArray() { - UnsafeNativeMethods.mp_Packet__GetByteString(mpPtr, out var strPtr, out int size); + UnsafeNativeMethods.mp_Packet__GetByteString(mpPtr, out var strPtr, out int size).Assert(); GC.KeepAlive(this); var bytes = new byte[size]; diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Timestamp.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Timestamp.cs index a7bc774c4..7051004de 100644 --- a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Timestamp.cs +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Framework/Timestamp.cs @@ -5,7 +5,7 @@ public class Timestamp : MpResourceHandle, IEquatable { public Timestamp(IntPtr ptr) : base(ptr) {} public Timestamp(Int64 value) : base() { - UnsafeNativeMethods.mp_Timestamp__l(value, out var ptr); + UnsafeNativeMethods.mp_Timestamp__l(value, out var ptr).Assert(); this.ptr = ptr; } diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Glog_Unsafe.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Glog_Unsafe.cs index f43ed8295..12f6164d9 100644 --- a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Glog_Unsafe.cs +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/PInvoke/NativeMethods/External/Glog_Unsafe.cs @@ -9,33 +9,33 @@ internal static partial class UnsafeNativeMethods { public static extern MpReturnCode google_ShutdownGoogleLogging(); [DllImport (MediaPipeLibrary, ExactSpelling = true)] - public static extern MpReturnCode glog_FLAGS_logtostderr([MarshalAs(UnmanagedType.I1)] bool value); + public static extern void glog_FLAGS_logtostderr([MarshalAs(UnmanagedType.I1)] bool value); [DllImport (MediaPipeLibrary, ExactSpelling = true)] - public static extern MpReturnCode glog_FLAGS_stderrthreshold(int threshold); + public static extern void glog_FLAGS_stderrthreshold(int threshold); [DllImport (MediaPipeLibrary, ExactSpelling = true)] - public static extern MpReturnCode glog_FLAGS_minloglevel(int level); + public static extern void glog_FLAGS_minloglevel(int level); [DllImport (MediaPipeLibrary, ExactSpelling = true)] - public static extern MpReturnCode glog_FLAGS_log_dir(string dir); + public static extern void glog_FLAGS_log_dir(string dir); [DllImport (MediaPipeLibrary, ExactSpelling = true)] - public static extern MpReturnCode glog_FLAGS_v(int v); + public static extern void glog_FLAGS_v(int v); [DllImport (MediaPipeLibrary, ExactSpelling = true)] - public static extern MpReturnCode glog_LOG_INFO__PKc(string str); + public static extern void glog_LOG_INFO__PKc(string str); [DllImport (MediaPipeLibrary, ExactSpelling = true)] - public static extern MpReturnCode glog_LOG_WARNING__PKc(string str); + public static extern void glog_LOG_WARNING__PKc(string str); [DllImport (MediaPipeLibrary, ExactSpelling = true)] - public static extern MpReturnCode glog_LOG_ERROR__PKc(string str); + public static extern void glog_LOG_ERROR__PKc(string str); [DllImport (MediaPipeLibrary, ExactSpelling = true)] - public static extern MpReturnCode glog_LOG_FATAL__PKc(string str); + public static extern void glog_LOG_FATAL__PKc(string str); [DllImport (MediaPipeLibrary, ExactSpelling = true)] - public static extern MpReturnCode google_FlushLogFiles(Glog.Severity severity); + public static extern void google_FlushLogFiles(Glog.Severity severity); } }