Port Timestamp

This commit is contained in:
Speykious
2022-01-15 05:40:22 +01:00
parent c15a800ce6
commit e4e2a1af47
2 changed files with 86 additions and 0 deletions

View File

@ -0,0 +1,33 @@
// 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;
using System.Diagnostics.Contracts;
using System.Runtime.InteropServices;
namespace Mediapipe.Net.Native;
internal partial class SafeNativeMethods : NativeMethods
{
[Pure, DllImport(MEDIAPIPE_LIBRARY, ExactSpelling = true)]
public static extern long mp_Timestamp__Value(IntPtr timestamp);
[Pure, DllImport(MEDIAPIPE_LIBRARY, ExactSpelling = true)]
public static extern double mp_Timestamp__Seconds(IntPtr timestamp);
[Pure, DllImport(MEDIAPIPE_LIBRARY, ExactSpelling = true)]
public static extern long mp_Timestamp__Microseconds(IntPtr timestamp);
[Pure, DllImport(MEDIAPIPE_LIBRARY, ExactSpelling = true)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool mp_Timestamp__IsSpecialValue(IntPtr timestamp);
[Pure, DllImport(MEDIAPIPE_LIBRARY, ExactSpelling = true)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool mp_Timestamp__IsRangeValue(IntPtr timestamp);
[Pure, DllImport(MEDIAPIPE_LIBRARY, ExactSpelling = true)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool mp_Timestamp__IsAllowedInStream(IntPtr timestamp);
}

View File

@ -0,0 +1,53 @@
// 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;
using System.Runtime.InteropServices;
namespace Mediapipe.Net.Native;
internal partial class UnsafeNativeMethods : NativeMethods
{
[DllImport(MEDIAPIPE_LIBRARY, ExactSpelling = true)]
public static extern MpReturnCode mp_Timestamp__l(long value, out IntPtr timestamp);
[DllImport(MEDIAPIPE_LIBRARY, ExactSpelling = true)]
public static extern void mp_Timestamp__delete(IntPtr timestamp);
[DllImport(MEDIAPIPE_LIBRARY, ExactSpelling = true)]
public static extern MpReturnCode mp_Timestamp__DebugString(IntPtr timestamp, out IntPtr str);
[DllImport(MEDIAPIPE_LIBRARY, ExactSpelling = true)]
public static extern MpReturnCode mp_Timestamp__NextAllowedInStream(IntPtr timestamp, out IntPtr nextTimestamp);
[DllImport(MEDIAPIPE_LIBRARY, ExactSpelling = true)]
public static extern MpReturnCode mp_Timestamp__PreviousAllowedInStream(IntPtr timestamp, out IntPtr prevTimestamp);
[DllImport(MEDIAPIPE_LIBRARY, ExactSpelling = true)]
public static extern MpReturnCode mp_Timestamp_FromSeconds__d(double seconds, out IntPtr timestamp);
[DllImport(MEDIAPIPE_LIBRARY, ExactSpelling = true)]
public static extern MpReturnCode mp_Timestamp_Unset(out IntPtr timestamp);
[DllImport(MEDIAPIPE_LIBRARY, ExactSpelling = true)]
public static extern MpReturnCode mp_Timestamp_Unstarted(out IntPtr timestamp);
[DllImport(MEDIAPIPE_LIBRARY, ExactSpelling = true)]
public static extern MpReturnCode mp_Timestamp_PreStream(out IntPtr timestamp);
[DllImport(MEDIAPIPE_LIBRARY, ExactSpelling = true)]
public static extern MpReturnCode mp_Timestamp_Min(out IntPtr timestamp);
[DllImport(MEDIAPIPE_LIBRARY, ExactSpelling = true)]
public static extern MpReturnCode mp_Timestamp_Max(out IntPtr timestamp);
[DllImport(MEDIAPIPE_LIBRARY, ExactSpelling = true)]
public static extern MpReturnCode mp_Timestamp_PostStream(out IntPtr timestamp);
[DllImport(MEDIAPIPE_LIBRARY, ExactSpelling = true)]
public static extern MpReturnCode mp_Timestamp_OneOverPostStream(out IntPtr timestamp);
[DllImport(MEDIAPIPE_LIBRARY, ExactSpelling = true)]
public static extern MpReturnCode mp_Timestamp_Done(out IntPtr timestamp);
}