Project import generated by Copybara.

GitOrigin-RevId: 50714fe28298d7b707eff7304547d89d6ec34a54
This commit is contained in:
MediaPipe Team
2019-11-21 13:20:47 -08:00
committed by mgyong
parent 9437483827
commit 48bcbb115f
60 changed files with 1662 additions and 111 deletions
+15 -5
View File
@@ -123,13 +123,23 @@ std::string TimestampDiff::DebugString() const {
Timestamp Timestamp::NextAllowedInStream() const {
CHECK(IsAllowedInStream()) << "Timestamp is: " << DebugString();
if (IsRangeValue() && *this != Max()) {
return *this + 1;
} else {
// Returning this value effectively means no futher timestamps may
// occur (however, the stream is not yet closed).
if (*this >= Max() || *this == PreStream()) {
// Indicates that no further timestamps may occur.
return OneOverPostStream();
} else if (*this < Min()) {
return Min();
}
return *this + 1;
}
Timestamp Timestamp::PreviousAllowedInStream() const {
if (*this <= Min() || *this == PostStream()) {
// Indicates that no previous timestamps may occur.
return Unstarted();
} else if (*this > Max()) {
return Max();
}
return *this - 1;
}
std::ostream& operator<<(std::ostream& os, Timestamp arg) {