mirror of
https://github.com/cosyneco/MediaPipe.NET.git
synced 2025-08-25 01:00:27 +08:00

* Remove this bool marshal
* Literally remove all bool marshals
* Remove CharSet.Unicode warning
* Remove most FunctionPtr marshals
* Remove `[return: MarshalAs(...)]`
* Replace all `IntPtr`s with `void*`s
* Replace all `void*.Zero`s with `null`s
* Make native method classes unsafe
* U N S A F E
* Replace `PtrToStructure` with pointer arithmetic
* Run `dotnet format`
* Temp ugly Activator fix
* Remove `.ToPointer()`
* Use `byte` to return a `bool`
* Backwards compatibility with `Activator`
Yeah that sucks :(
* Replace `Marshal.Copy` by pointer arithmetic
* Replace `PtrToStringAnsi()` with `new string()`
* Remove unnecessary usings
* Explicitly type string pointers as `sbyte*`
* It actually doesn't hang?
* `MediaPipeException` -> `MediapipeException`
* Simplify `for` loops
* Remove unnecessary `float*` cast
* Some more explicit types for `ImageFrame`
* Remove unnecessary cast
* Looks like we forgor a `using` 💀
* Create `SafeArrayCopy` helper method
* Document `SafeArrayCopy`
21 lines
710 B
C#
21 lines
710 B
C#
// Copyright (c) homuler and Vignette
|
|
// This file is part of MediaPipe.NET.
|
|
// MediaPipe.NET is licensed under the MIT License. See LICENSE for details.
|
|
|
|
using System.Runtime.InteropServices;
|
|
using Mediapipe.Net.Util;
|
|
|
|
namespace Mediapipe.Net.Native
|
|
{
|
|
internal unsafe partial class SafeNativeMethods : NativeMethods
|
|
{
|
|
[DllImport(MEDIAPIPE_LIBRARY, ExactSpelling = true)]
|
|
public static extern void mp__SetCustomGlobalResourceProvider__P(
|
|
ResourceManager.ResourceProvider provider);
|
|
|
|
[DllImport(MEDIAPIPE_LIBRARY, ExactSpelling = true)]
|
|
public static extern void mp__SetCustomGlobalPathResolver__P(
|
|
ResourceManager.PathResolver resolver);
|
|
}
|
|
}
|