diff --git a/Assets/MediaPipe/SDK/Scripts/Framework/Timestamp.cs b/Assets/MediaPipe/SDK/Scripts/Framework/Timestamp.cs new file mode 100644 index 000000000..0a8f5b6ba --- /dev/null +++ b/Assets/MediaPipe/SDK/Scripts/Framework/Timestamp.cs @@ -0,0 +1,121 @@ +using System; +using System.Runtime.InteropServices; + +namespace Mediapipe { + public class Timestamp : MpResourceHandle { + public Timestamp(IntPtr ptr) : base(ptr) {} + + public Timestamp(Int64 value) : base() { + UnsafeNativeMethods.mp_Timestamp__l(value, out var ptr); + this.ptr = ptr; + } + + protected override void DisposeUnmanaged() { + if (OwnsResource()) { + UnsafeNativeMethods.mp_Timestamp__delete(ptr); + } + base.DisposeUnmanaged(); + } + + public Int64 Value() { + return SafeNativeMethods.mp_Timestamp__Value(mpPtr); + } + + public double Seconds() { + return SafeNativeMethods.mp_Timestamp__Seconds(mpPtr); + } + + public Int64 Microseconds() { + return SafeNativeMethods.mp_Timestamp__Microseconds(mpPtr); + } + + public bool IsSpecialValue() { + return SafeNativeMethods.mp_Timestamp__IsSpecialValue(mpPtr); + } + + public bool IsRangeValue() { + return SafeNativeMethods.mp_Timestamp__IsRangeValue(mpPtr); + } + + public bool IsAllowedInStream() { + return SafeNativeMethods.mp_Timestamp__IsAllowedInStream(mpPtr); + } + + public string DebugString() { + UnsafeNativeMethods.mp_Timestamp__DebugString(mpPtr, out var strPtr).Assert(); + var str = Marshal.PtrToStringAnsi(strPtr); + UnsafeNativeMethods.delete_array__PKc(strPtr); + + GC.KeepAlive(this); + return str; + } + + public Timestamp NextAllowedInStream() { + UnsafeNativeMethods.mp_Timestamp__NextAllowedInStream(mpPtr, out var nextPtr).Assert(); + + GC.KeepAlive(this); + return new Timestamp(nextPtr); + } + + public Timestamp PreviousAllowedInStream() { + UnsafeNativeMethods.mp_Timestamp__PreviousAllowedInStream(mpPtr, out var prevPtr).Assert(); + + GC.KeepAlive(this); + return new Timestamp(prevPtr); + } + + public static Timestamp FromSeconds(double seconds) { + UnsafeNativeMethods.mp_Timestamp_FromSeconds__d(seconds, out var ptr).Assert(); + + return new Timestamp(ptr); + } + + public static Timestamp Unset() { + UnsafeNativeMethods.mp_Timestamp_Unset(out var ptr).Assert(); + + return new Timestamp(ptr); + } + + public static Timestamp Unstarted() { + UnsafeNativeMethods.mp_Timestamp_Unstarted(out var ptr).Assert(); + + return new Timestamp(ptr); + } + + public static Timestamp PreStream() { + UnsafeNativeMethods.mp_Timestamp_PreStream(out var ptr).Assert(); + + return new Timestamp(ptr); + } + + public static Timestamp Min() { + UnsafeNativeMethods.mp_Timestamp_Min(out var ptr).Assert(); + + return new Timestamp(ptr); + } + + public static Timestamp Max() { + UnsafeNativeMethods.mp_Timestamp_Max(out var ptr).Assert(); + + return new Timestamp(ptr); + } + + public static Timestamp PostStream() { + UnsafeNativeMethods.mp_Timestamp_PostStream(out var ptr).Assert(); + + return new Timestamp(ptr); + } + + public static Timestamp OneOverPostStream() { + UnsafeNativeMethods.mp_Timestamp_OneOverPostStream(out var ptr).Assert(); + + return new Timestamp(ptr); + } + + public static Timestamp Done() { + UnsafeNativeMethods.mp_Timestamp_Done(out var ptr).Assert(); + + return new Timestamp(ptr); + } + } +} diff --git a/Assets/MediaPipe/SDK/Scripts/Framework/Timestamp.cs.meta b/Assets/MediaPipe/SDK/Scripts/Framework/Timestamp.cs.meta new file mode 100644 index 000000000..ff562d55f --- /dev/null +++ b/Assets/MediaPipe/SDK/Scripts/Framework/Timestamp.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3e33f53c4ae6a087aaf4345cc29d0c1d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipe/SDK/Scripts/PInvoke/NativeMethods/Framework/Timestamp_Safe.cs b/Assets/MediaPipe/SDK/Scripts/PInvoke/NativeMethods/Framework/Timestamp_Safe.cs new file mode 100644 index 000000000..b0e92a20f --- /dev/null +++ b/Assets/MediaPipe/SDK/Scripts/PInvoke/NativeMethods/Framework/Timestamp_Safe.cs @@ -0,0 +1,28 @@ +using System; +using System.Diagnostics.Contracts; +using System.Runtime.InteropServices; + +namespace Mediapipe { + internal static partial class SafeNativeMethods { + [Pure, DllImport (MediaPipeLibrary, ExactSpelling = true)] + public static extern Int64 mp_Timestamp__Value(IntPtr timestamp); + + [Pure, DllImport (MediaPipeLibrary, ExactSpelling = true)] + public static extern double mp_Timestamp__Seconds(IntPtr timestamp); + + [Pure, DllImport (MediaPipeLibrary, ExactSpelling = true)] + public static extern Int64 mp_Timestamp__Microseconds(IntPtr timestamp); + + [Pure, DllImport (MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool mp_Timestamp__IsSpecialValue(IntPtr timestamp); + + [Pure, DllImport (MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool mp_Timestamp__IsRangeValue(IntPtr timestamp); + + [Pure, DllImport (MediaPipeLibrary, ExactSpelling = true)] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool mp_Timestamp__IsAllowedInStream(IntPtr timestamp); + } +} diff --git a/Assets/MediaPipe/SDK/Scripts/PInvoke/NativeMethods/Framework/Timestamp_Safe.cs.meta b/Assets/MediaPipe/SDK/Scripts/PInvoke/NativeMethods/Framework/Timestamp_Safe.cs.meta new file mode 100644 index 000000000..eed5ed5df --- /dev/null +++ b/Assets/MediaPipe/SDK/Scripts/PInvoke/NativeMethods/Framework/Timestamp_Safe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cd82a3be1540e60c9ab398f1d488758c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipe/SDK/Scripts/PInvoke/NativeMethods/Framework/Timestamp_Unsafe.cs b/Assets/MediaPipe/SDK/Scripts/PInvoke/NativeMethods/Framework/Timestamp_Unsafe.cs new file mode 100644 index 000000000..ce78f44c2 --- /dev/null +++ b/Assets/MediaPipe/SDK/Scripts/PInvoke/NativeMethods/Framework/Timestamp_Unsafe.cs @@ -0,0 +1,48 @@ +using System; +using System.Runtime.InteropServices; + +namespace Mediapipe { + internal static partial class UnsafeNativeMethods { + [DllImport (MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Timestamp__l(Int64 value, out IntPtr timestamp); + + [DllImport (MediaPipeLibrary, ExactSpelling = true)] + public static extern void mp_Timestamp__delete(IntPtr timestamp); + + [DllImport (MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Timestamp__DebugString(IntPtr timestamp, out IntPtr str); + + [DllImport (MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Timestamp__NextAllowedInStream(IntPtr timestamp, out IntPtr nextTimestamp); + + [DllImport (MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Timestamp__PreviousAllowedInStream(IntPtr timestamp, out IntPtr prevTimestamp); + + [DllImport (MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Timestamp_FromSeconds__d(double seconds, out IntPtr timestamp); + + [DllImport (MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Timestamp_Unset(out IntPtr timestamp); + + [DllImport (MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Timestamp_Unstarted(out IntPtr timestamp); + + [DllImport (MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Timestamp_PreStream(out IntPtr timestamp); + + [DllImport (MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Timestamp_Min(out IntPtr timestamp); + + [DllImport (MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Timestamp_Max(out IntPtr timestamp); + + [DllImport (MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Timestamp_PostStream(out IntPtr timestamp); + + [DllImport (MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Timestamp_OneOverPostStream(out IntPtr timestamp); + + [DllImport (MediaPipeLibrary, ExactSpelling = true)] + public static extern MpReturnCode mp_Timestamp_Done(out IntPtr timestamp); + } +} diff --git a/Assets/MediaPipe/SDK/Scripts/PInvoke/NativeMethods/Framework/Timestamp_Unsafe.cs.meta b/Assets/MediaPipe/SDK/Scripts/PInvoke/NativeMethods/Framework/Timestamp_Unsafe.cs.meta new file mode 100644 index 000000000..dbc9efaf1 --- /dev/null +++ b/Assets/MediaPipe/SDK/Scripts/PInvoke/NativeMethods/Framework/Timestamp_Unsafe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3552112fccbfde24b80dbe41bf72a806 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MediaPipe/SDK/Tests/Framework/TimestampTest.cs b/Assets/MediaPipe/SDK/Tests/Framework/TimestampTest.cs new file mode 100644 index 000000000..2dc65720e --- /dev/null +++ b/Assets/MediaPipe/SDK/Tests/Framework/TimestampTest.cs @@ -0,0 +1,187 @@ +using Mediapipe; +using NUnit.Framework; + +namespace Tests { + public class TimestampTest { + #region #isDisposed + [Test] + public void isDisposed_ShouldReturnFalse_When_NotDisposedYet() { + var timestamp = new Timestamp(1); + + Assert.False(timestamp.isDisposed); + } + + [Test] + public void isDisposed_ShouldReturnTrue_When_AlreadyDisposed() { + var timestamp = new Timestamp(1); + timestamp.Dispose(); + + Assert.True(timestamp.isDisposed); + } + #endregion + + #region #Value + [Test] + public void Value_ShouldReturnValue() { + var timestamp = new Timestamp(10); + + Assert.AreEqual(timestamp.Value(), 10); + } + #endregion + + #region #Seconds + [Test] + public void Seconds_ShouldReturnValueInSeconds() { + var timestamp = new Timestamp(1_000_000); + + Assert.AreEqual(timestamp.Seconds(), 1d, 1e-9); + } + #endregion + + #region #Microseconds + [Test] + public void Microseconds_ShouldReturnValueInMicroseconds() { + var timestamp = new Timestamp(1_000_000); + + Assert.AreEqual(timestamp.Microseconds(), 1_000_000); + } + #endregion + + #region #IsSpecialValue + [Test] + public void IsSpecialValue_ShouldReturnFalse_When_ValueIsInRange() { + var timestamp = new Timestamp(1); + + Assert.False(timestamp.IsSpecialValue()); + } + + [Test] + public void IsSpecialValue_ShouldReturnTrue_When_TimestampIsUnset() { + var timestamp = Timestamp.Unset(); + + Assert.True(timestamp.IsSpecialValue()); + } + + [Test] + public void IsSpecialValue_ShouldReturnTrue_When_TimestampIsUnstarted() { + var timestamp = Timestamp.Unstarted(); + + Assert.True(timestamp.IsSpecialValue()); + } + #endregion + + #region #IsRangeValue + [Test] + public void IsRangeValue_ShouldReturnTrue_When_ValueIsInRange() { + var timestamp = new Timestamp(1); + + Assert.True(timestamp.IsRangeValue()); + } + + [Test] + public void IsRangeValue_ShouldReturnFalse_When_TimestampIsPreStream() { + var timestamp = Timestamp.PreStream(); + + Assert.False(timestamp.IsRangeValue()); + } + + [Test] + public void IsRangeValue_ShouldReturnFalse_When_TimestampIsPostStream() { + var timestamp = Timestamp.PostStream(); + + Assert.False(timestamp.IsRangeValue()); + } + + [Test] + public void IsRangeValue_ShouldReturnTrue_When_TimestampIsMin() { + var timestamp = Timestamp.Min(); + + Assert.True(timestamp.IsRangeValue()); + } + + [Test] + public void IsRangeValue_ShouldReturnTrue_When_TimestampIsMax() { + var timestamp = Timestamp.Max(); + + Assert.True(timestamp.IsRangeValue()); + } + #endregion + + #region #IsAllowedInStream + [Test] + public void IsAllowedInStream_ShouldReturnTrue_When_ValueIsInRange() { + var timestamp = new Timestamp(1); + + Assert.True(timestamp.IsAllowedInStream()); + } + + [Test] + public void IsAllowedInStream_ShouldReturnFalse_When_TimestampIsOneOverPostStream() { + var timestamp = Timestamp.OneOverPostStream(); + + Assert.False(timestamp.IsAllowedInStream()); + } + + [Test] + public void IsAllowedInStream_ShouldReturnFalse_When_TimestampIsDone() { + var timestamp = Timestamp.Done(); + + Assert.False(timestamp.IsAllowedInStream()); + } + #endregion + + #region #DebugString + [Test] + public void DebugString_ShouldReturnDebugString() { + var timestamp = new Timestamp(1); + + Assert.AreEqual(timestamp.DebugString(), "1"); + } + #endregion + + #region #NextAllowedInStream + [Test] + public void NextAllowedInStream_ShouldReturnNextTimestamp_When_ValueIsInRange() { + var timestamp = new Timestamp(1); + var nextTimestamp = timestamp.NextAllowedInStream(); + + Assert.AreEqual(nextTimestamp.Microseconds(), 2); + } + + [Test] + public void NextAllowedInStream_ShouldReturnOneOverPostStream_When_TimestampIsPostStream() { + var timestamp = Timestamp.PostStream(); + var nextTimestamp = timestamp.NextAllowedInStream(); + + Assert.AreEqual(nextTimestamp.Microseconds(), Timestamp.OneOverPostStream().Microseconds()); + } + #endregion + + #region #PreviousAllowedInStream + [Test] + public void PreviousAllowedInStream_ShouldReturnPreviousTimestamp_When_ValueIsInRange() { + var timestamp = new Timestamp(1); + var nextTimestamp = timestamp.PreviousAllowedInStream(); + + Assert.AreEqual(nextTimestamp.Microseconds(), 0); + } + + [Test] + public void PreviousAllowedInStream_ShouldReturnUnstarted_When_TimestampIsPreStream() { + var timestamp = Timestamp.PreStream(); + var nextTimestamp = timestamp.PreviousAllowedInStream(); + + Assert.AreEqual(nextTimestamp.Microseconds(), Timestamp.Unstarted().Microseconds()); + } + #endregion + + #region #FromSeconds + [Test] + public void FromSeconds_ShouldReturnTimestamp() { + var timestamp = Timestamp.FromSeconds(1d); + + Assert.AreEqual(timestamp.Microseconds(), 1_000_000); + } + #endregion + } +} diff --git a/Assets/MediaPipe/SDK/Tests/Framework/TimestampTest.cs.meta b/Assets/MediaPipe/SDK/Tests/Framework/TimestampTest.cs.meta new file mode 100644 index 000000000..a5dfbdab3 --- /dev/null +++ b/Assets/MediaPipe/SDK/Tests/Framework/TimestampTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4a89b44de17930bf6bcbf5f75f57c100 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/C/mediapipe_api/BUILD b/C/mediapipe_api/BUILD index f001ab702..3eb6f420e 100644 --- a/C/mediapipe_api/BUILD +++ b/C/mediapipe_api/BUILD @@ -9,6 +9,7 @@ cc_library( "//mediapipe_api/external:stdlib", "//mediapipe_api/framework:calculator", "//mediapipe_api/framework:calculator_graph", + "//mediapipe_api/framework:timestamp", "//mediapipe_api/framework/formats:classification", "//mediapipe_api/framework/formats:detection", "//mediapipe_api/framework/formats:image_frame", diff --git a/C/mediapipe_api/framework/BUILD b/C/mediapipe_api/framework/BUILD index bda2bf5ee..7f2bb70de 100644 --- a/C/mediapipe_api/framework/BUILD +++ b/C/mediapipe_api/framework/BUILD @@ -51,3 +51,14 @@ cc_library( ], alwayslink = True, ) + +cc_library( + name = "timestamp", + srcs = ["timestamp.cc"], + hdrs = ["timestamp.h"], + deps = [ + "@com_google_mediapipe//mediapipe/framework:timestamp", + "//mediapipe_api:common", + ], + alwayslink = True, +) diff --git a/C/mediapipe_api/framework/timestamp.cc b/C/mediapipe_api/framework/timestamp.cc new file mode 100644 index 000000000..d244c7d03 --- /dev/null +++ b/C/mediapipe_api/framework/timestamp.cc @@ -0,0 +1,120 @@ +#include "mediapipe_api/framework/timestamp.h" + +MpReturnCode mp_Timestamp__l(int64 timestamp, mediapipe::Timestamp** timestamp_out) { + TRY { + *timestamp_out = new mediapipe::Timestamp(timestamp); + return MpReturnCode::Success; + } CATCH_ALL +} + +void mp_Timestamp__delete(mediapipe::Timestamp* timestamp) { + delete timestamp; +} + +int64 mp_Timestamp__Value(mediapipe::Timestamp* timestamp) { + return timestamp->Value(); +} + +double mp_Timestamp__Seconds(mediapipe::Timestamp* timestamp) { + return timestamp->Seconds(); +} + +int64 mp_Timestamp__Microseconds(mediapipe::Timestamp* timestamp) { + return timestamp->Microseconds(); +} + +MpReturnCode mp_Timestamp__DebugString(mediapipe::Timestamp* timestamp, const char** str_out) { + TRY { + *str_out = strcpy_to_heap(timestamp->DebugString()); + return MpReturnCode::Success; + } CATCH_ALL +} + +bool mp_Timestamp__IsSpecialValue(mediapipe::Timestamp* timestamp) { + return timestamp->IsSpecialValue(); +} + +bool mp_Timestamp__IsRangeValue(mediapipe::Timestamp* timestamp) { + return timestamp->IsRangeValue(); +} + +bool mp_Timestamp__IsAllowedInStream(mediapipe::Timestamp* timestamp) { + return timestamp->IsAllowedInStream(); +} + +MpReturnCode mp_Timestamp__NextAllowedInStream(mediapipe::Timestamp* timestamp, mediapipe::Timestamp** timestamp_out) { + TRY { + *timestamp_out = new mediapipe::Timestamp { timestamp->NextAllowedInStream() }; + return MpReturnCode::Success; + } CATCH_ALL +} + +MpReturnCode mp_Timestamp__PreviousAllowedInStream(mediapipe::Timestamp* timestamp, mediapipe::Timestamp** timestamp_out) { + TRY { + *timestamp_out = new mediapipe::Timestamp { timestamp->PreviousAllowedInStream() }; + return MpReturnCode::Success; + } CATCH_ALL +} + +MpReturnCode mp_Timestamp_FromSeconds__d(double seconds, mediapipe::Timestamp** timestamp_out) { + TRY { + *timestamp_out = new mediapipe::Timestamp { mediapipe::Timestamp::FromSeconds(seconds) }; + return MpReturnCode::Success; + } CATCH_ALL +} + +MpReturnCode mp_Timestamp_Unset(mediapipe::Timestamp** timestamp_out) { + TRY { + *timestamp_out = new mediapipe::Timestamp { mediapipe::Timestamp::Unset() }; + return MpReturnCode::Success; + } CATCH_ALL +} + +MpReturnCode mp_Timestamp_Unstarted(mediapipe::Timestamp** timestamp_out) { + TRY { + *timestamp_out = new mediapipe::Timestamp { mediapipe::Timestamp::Unstarted() }; + return MpReturnCode::Success; + } CATCH_ALL +} + +MpReturnCode mp_Timestamp_PreStream(mediapipe::Timestamp** timestamp_out) { + TRY { + *timestamp_out = new mediapipe::Timestamp { mediapipe::Timestamp::PreStream() }; + return MpReturnCode::Success; + } CATCH_ALL +} + +MpReturnCode mp_Timestamp_Min(mediapipe::Timestamp** timestamp_out) { + TRY { + *timestamp_out = new mediapipe::Timestamp { mediapipe::Timestamp::Min() }; + return MpReturnCode::Success; + } CATCH_ALL +} + +MpReturnCode mp_Timestamp_Max(mediapipe::Timestamp** timestamp_out) { + TRY { + *timestamp_out = new mediapipe::Timestamp { mediapipe::Timestamp::Max() }; + return MpReturnCode::Success; + } CATCH_ALL +} + +MpReturnCode mp_Timestamp_PostStream(mediapipe::Timestamp** timestamp_out) { + TRY { + *timestamp_out = new mediapipe::Timestamp { mediapipe::Timestamp::PostStream() }; + return MpReturnCode::Success; + } CATCH_ALL +} + +MpReturnCode mp_Timestamp_OneOverPostStream(mediapipe::Timestamp** timestamp_out) { + TRY { + *timestamp_out = new mediapipe::Timestamp { mediapipe::Timestamp::OneOverPostStream() }; + return MpReturnCode::Success; + } CATCH_ALL +} + +MpReturnCode mp_Timestamp_Done(mediapipe::Timestamp** timestamp_out) { + TRY { + *timestamp_out = new mediapipe::Timestamp { mediapipe::Timestamp::Done() }; + return MpReturnCode::Success; + } CATCH_ALL +} diff --git a/C/mediapipe_api/framework/timestamp.h b/C/mediapipe_api/framework/timestamp.h new file mode 100644 index 000000000..9424899a2 --- /dev/null +++ b/C/mediapipe_api/framework/timestamp.h @@ -0,0 +1,33 @@ +#ifndef C_MEDIAPIPE_API_FRAMEWORK_TIMESTAMP_H_ +#define C_MEDIAPIPE_API_FRAMEWORK_TIMESTAMP_H_ + +#include "mediapipe/framework/timestamp.h" +#include "mediapipe_api/common.h" + +extern "C" { + +MP_CAPI(MpReturnCode) mp_Timestamp__l(int64 timestamp, mediapipe::Timestamp** timestamp_out); +MP_CAPI(void) mp_Timestamp__delete(mediapipe::Timestamp* timestamp); +MP_CAPI(int64) mp_Timestamp__Value(mediapipe::Timestamp* timestamp); +MP_CAPI(double) mp_Timestamp__Seconds(mediapipe::Timestamp* timestamp); +MP_CAPI(int64) mp_Timestamp__Microseconds(mediapipe::Timestamp* timestamp); +MP_CAPI(MpReturnCode) mp_Timestamp__DebugString(mediapipe::Timestamp* timestamp, const char** str_out); +MP_CAPI(bool) mp_Timestamp__IsSpecialValue(mediapipe::Timestamp* timestamp); +MP_CAPI(bool) mp_Timestamp__IsRangeValue(mediapipe::Timestamp* timestamp); +MP_CAPI(bool) mp_Timestamp__IsAllowedInStream(mediapipe::Timestamp* timestamp); +MP_CAPI(MpReturnCode) mp_Timestamp__NextAllowedInStream(mediapipe::Timestamp* timestamp, mediapipe::Timestamp** timestamp_out); +MP_CAPI(MpReturnCode) mp_Timestamp__PreviousAllowedInStream(mediapipe::Timestamp* timestamp, mediapipe::Timestamp** timestamp_out); + +MP_CAPI(MpReturnCode) mp_Timestamp_FromSeconds__d(double seconds, mediapipe::Timestamp** timestamp_out); +MP_CAPI(MpReturnCode) mp_Timestamp_Unset(mediapipe::Timestamp** timestamp_out); +MP_CAPI(MpReturnCode) mp_Timestamp_Unstarted(mediapipe::Timestamp** timestamp_out); +MP_CAPI(MpReturnCode) mp_Timestamp_PreStream(mediapipe::Timestamp** timestamp_out); +MP_CAPI(MpReturnCode) mp_Timestamp_Min(mediapipe::Timestamp** timestamp_out); +MP_CAPI(MpReturnCode) mp_Timestamp_Max(mediapipe::Timestamp** timestamp_out); +MP_CAPI(MpReturnCode) mp_Timestamp_PostStream(mediapipe::Timestamp** timestamp_out); +MP_CAPI(MpReturnCode) mp_Timestamp_OneOverPostStream(mediapipe::Timestamp** timestamp_out); +MP_CAPI(MpReturnCode) mp_Timestamp_Done(mediapipe::Timestamp** timestamp_out); + +} // extern "C" + +#endif // C_MEDIAPIPE_API_FRAMEWORK_TIMESTAMP_H_