Project import generated by Copybara.

PiperOrigin-RevId: 267274408
This commit is contained in:
MediaPipe Team
2019-09-04 19:00:29 -07:00
committed by jqtang
parent 731d2b9536
commit af67642055
80 changed files with 3181 additions and 0 deletions
@@ -108,10 +108,25 @@ class FixedSizeInputStreamHandler : public DefaultInputStreamHandler {
}
// Returns the lowest timestamp of a packet ready to process.
<<<<<<< HEAD
Timestamp MinTimestampOrBound() {
Timestamp min_bound = Timestamp::Done();
for (const auto& stream : input_stream_managers_) {
min_bound = std::min(min_bound, stream->MinTimestampOrBound(nullptr));
=======
Timestamp MinTimestampToProcess() {
Timestamp min_bound = Timestamp::Done();
for (const auto& stream : input_stream_managers_) {
bool empty;
Timestamp stream_timestamp = stream->MinTimestampOrBound(&empty);
// If we're using the stream's *bound*, we only want to process up to the
// packet *before* the bound, because a packet may still arrive at that
// time.
if (empty) {
stream_timestamp = PreviousAllowedInStream(stream_timestamp);
}
min_bound = std::min(min_bound, stream_timestamp);
>>>>>>> Project import generated by Copybara.
}
return min_bound;
}
@@ -199,7 +214,11 @@ class FixedSizeInputStreamHandler : public DefaultInputStreamHandler {
}
// input_timestamp is recalculated here to process the most recent packets.
EraseSurplusPackets(true);
<<<<<<< HEAD
input_timestamp = MinTimestampOrBound();
=======
input_timestamp = MinTimestampToProcess();
>>>>>>> Project import generated by Copybara.
DefaultInputStreamHandler::FillInputSet(input_timestamp, input_set);
pending_ = false;
}