forked from homuler/MediaPipeUnityPlugin
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtimestamp.cc
More file actions
112 lines (91 loc) · 3.84 KB
/
Copy pathtimestamp.cc
File metadata and controls
112 lines (91 loc) · 3.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// Copyright (c) 2021 homuler
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
#include "mediapipe_api/framework/timestamp.h"
MpReturnCode mp_Timestamp__l(int64 timestamp, mediapipe::Timestamp** timestamp_out) {
TRY
*timestamp_out = new mediapipe::Timestamp(timestamp);
RETURN_CODE(MpReturnCode::Success);
CATCH_EXCEPTION
}
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_CODE(MpReturnCode::Success);
CATCH_EXCEPTION
}
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_CODE(MpReturnCode::Success);
CATCH_EXCEPTION
}
MpReturnCode mp_Timestamp__PreviousAllowedInStream(mediapipe::Timestamp* timestamp, mediapipe::Timestamp** timestamp_out) {
TRY
*timestamp_out = new mediapipe::Timestamp{timestamp->PreviousAllowedInStream()};
RETURN_CODE(MpReturnCode::Success);
CATCH_EXCEPTION
}
MpReturnCode mp_Timestamp_FromSeconds__d(double seconds, mediapipe::Timestamp** timestamp_out) {
TRY
*timestamp_out = new mediapipe::Timestamp{mediapipe::Timestamp::FromSeconds(seconds)};
RETURN_CODE(MpReturnCode::Success);
CATCH_EXCEPTION
}
MpReturnCode mp_Timestamp_Unset(mediapipe::Timestamp** timestamp_out) {
TRY
*timestamp_out = new mediapipe::Timestamp{mediapipe::Timestamp::Unset()};
RETURN_CODE(MpReturnCode::Success);
CATCH_EXCEPTION
}
MpReturnCode mp_Timestamp_Unstarted(mediapipe::Timestamp** timestamp_out) {
TRY
*timestamp_out = new mediapipe::Timestamp{mediapipe::Timestamp::Unstarted()};
RETURN_CODE(MpReturnCode::Success);
CATCH_EXCEPTION
}
MpReturnCode mp_Timestamp_PreStream(mediapipe::Timestamp** timestamp_out) {
TRY
*timestamp_out = new mediapipe::Timestamp{mediapipe::Timestamp::PreStream()};
RETURN_CODE(MpReturnCode::Success);
CATCH_EXCEPTION
}
MpReturnCode mp_Timestamp_Min(mediapipe::Timestamp** timestamp_out) {
TRY
*timestamp_out = new mediapipe::Timestamp{mediapipe::Timestamp::Min()};
RETURN_CODE(MpReturnCode::Success);
CATCH_EXCEPTION
}
MpReturnCode mp_Timestamp_Max(mediapipe::Timestamp** timestamp_out) {
TRY
*timestamp_out = new mediapipe::Timestamp{mediapipe::Timestamp::Max()};
RETURN_CODE(MpReturnCode::Success);
CATCH_EXCEPTION
}
MpReturnCode mp_Timestamp_PostStream(mediapipe::Timestamp** timestamp_out) {
TRY
*timestamp_out = new mediapipe::Timestamp{mediapipe::Timestamp::PostStream()};
RETURN_CODE(MpReturnCode::Success);
CATCH_EXCEPTION
}
MpReturnCode mp_Timestamp_OneOverPostStream(mediapipe::Timestamp** timestamp_out) {
TRY
*timestamp_out = new mediapipe::Timestamp{mediapipe::Timestamp::OneOverPostStream()};
RETURN_CODE(MpReturnCode::Success);
CATCH_EXCEPTION
}
MpReturnCode mp_Timestamp_Done(mediapipe::Timestamp** timestamp_out) {
TRY
*timestamp_out = new mediapipe::Timestamp{mediapipe::Timestamp::Done()};
RETURN_CODE(MpReturnCode::Success);
CATCH_EXCEPTION
}