Clarify deprecated GraphStatus usage in Close documentation

PiperOrigin-RevId: 556963967
This commit is contained in:
MediaPipe Team 2023-08-14 17:45:48 -07:00 committed by Copybara-Service
parent dd940707ca
commit 9c5bdd2eb9
2 changed files with 7 additions and 4 deletions

View File

@ -182,8 +182,8 @@ cc_library(
":timestamp",
"//mediapipe/framework/deps:registration",
"//mediapipe/framework/port:logging",
"//mediapipe/framework/port:status",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/status",
],
)

View File

@ -17,14 +17,16 @@
#ifndef MEDIAPIPE_FRAMEWORK_CALCULATOR_BASE_H_
#define MEDIAPIPE_FRAMEWORK_CALCULATOR_BASE_H_
#include <memory>
#include <string>
#include <type_traits>
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "mediapipe/framework/calculator_context.h"
#include "mediapipe/framework/calculator_contract.h"
#include "mediapipe/framework/deps/registration.h"
#include "mediapipe/framework/port.h"
#include "mediapipe/framework/port/status.h"
#include "mediapipe/framework/timestamp.h"
namespace mediapipe {
@ -150,8 +152,9 @@ class CalculatorBase {
// Packets may be output during a call to Close(). However, output packets
// are silently discarded if Close() is called after a graph run has ended.
//
// NOTE: If Close() needs to perform an action only when processing is
// complete, Close() must check if cc->GraphStatus() is OK.
// NOTE: Do not call cc->GraphStatus() in Close() if you need to check if the
// processing is complete. Please, see CalculatorContext::GraphStatus
// documentation for the suggested solution.
virtual absl::Status Close(CalculatorContext* cc) { return absl::OkStatus(); }
// Returns a value according to which the framework selects