Project import generated by Copybara.

PiperOrigin-RevId: 263889205
This commit is contained in:
MediaPipe Team
2019-08-16 18:56:48 -07:00
committed by jqtang
parent dc40414468
commit 294687295d
443 changed files with 33160 additions and 2011 deletions
@@ -61,9 +61,9 @@ ImmediateInputStreamHandler::ImmediateInputStreamHandler(
timestamp_bounds_(std::move(tag_map)) {}
NodeReadiness ImmediateInputStreamHandler::GetNodeReadiness(
Timestamp* input_timestamp) {
Timestamp min_stream_timestamp = Timestamp::Done();
*input_timestamp = Timestamp::Done();
Timestamp* min_stream_timestamp) {
*min_stream_timestamp = Timestamp::Done();
Timestamp input_timestamp = Timestamp::Done();
bool stream_became_done = false;
for (CollectionItemId i = input_stream_managers_.BeginId();
@@ -72,9 +72,9 @@ NodeReadiness ImmediateInputStreamHandler::GetNodeReadiness(
bool empty;
Timestamp stream_timestamp = stream->MinTimestampOrBound(&empty);
if (!empty) {
*input_timestamp = std::min(*input_timestamp, stream_timestamp);
input_timestamp = std::min(input_timestamp, stream_timestamp);
}
min_stream_timestamp = std::min(min_stream_timestamp, stream_timestamp);
*min_stream_timestamp = std::min(*min_stream_timestamp, stream_timestamp);
if (stream_timestamp != timestamp_bounds_.Get(i)) {
if (stream_timestamp == Timestamp::Done()) {
stream_became_done = true;
@@ -83,16 +83,17 @@ NodeReadiness ImmediateInputStreamHandler::GetNodeReadiness(
}
}
if (min_stream_timestamp == Timestamp::Done()) {
if (*min_stream_timestamp == Timestamp::Done()) {
return NodeReadiness::kReadyForClose;
}
if (*input_timestamp < Timestamp::Done()) {
if (input_timestamp < Timestamp::Done()) {
// On kReadyForProcess, the input_timestamp is returned.
*min_stream_timestamp = input_timestamp;
return NodeReadiness::kReadyForProcess;
}
if (stream_became_done) {
*input_timestamp = min_stream_timestamp;
return NodeReadiness::kReadyForProcess;
}
@@ -1,3 +1,17 @@
// Copyright 2019 The MediaPipe Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <vector>
#include "mediapipe/framework/calculator_framework.h"