Changed return type of process method in MPPTaskRunner
This commit is contained in:
parent
87ba86ace2
commit
6d7f172e9f
|
@ -17,6 +17,8 @@
|
|||
#include "mediapipe/framework/calculator.pb.h"
|
||||
#include "mediapipe/tasks/cc/core/task_runner.h"
|
||||
|
||||
#include <optional>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
|
@ -72,8 +74,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
* caller's responsibility to synchronize access to this method across multiple threads and to
|
||||
* ensure that the input packet timestamps are in order.
|
||||
*/
|
||||
- (absl::StatusOr<mediapipe::tasks::core::PacketMap>)process:
|
||||
(const mediapipe::tasks::core::PacketMap &)packetMap;
|
||||
- (std::optional<mediapipe::tasks::core::PacketMap>)
|
||||
processPacketMap:(const mediapipe::tasks::core::PacketMap &)packetMap
|
||||
error:(NSError **)error;
|
||||
|
|
|
@ -50,8 +50,14 @@ using TaskRunnerCpp = ::mediapipe::tasks::core::TaskRunner;
|
|||
return self;
|
||||
}
|
||||
|
||||
- (absl::StatusOr<PacketMap>)process:(const PacketMap &)packetMap {
|
||||
return _cppTaskRunner->Process(packetMap);
|
||||
- (std::optional<PacketMap>)processPacketMap:(const PacketMap &)packetMap error:(NSError **)error {
|
||||
absl::StatusOr<PacketMap> resultPacketMap = _cppTaskRunner->Process(packetMap);
|
||||
if (![MPPCommonUtils checkCppError:resultPacketMap.status() toError:error]) {
|
||||
return std::nullopt;
|
||||
}
|
||||
return resultPacketMap.value();
|
||||
}
|
||||
|
||||
- (BOOL)sendPacketMap:(const PacketMap &)packetMap error:(NSError **)error {
|
||||
absl::Status sendStatus = _cppTaskRunner->Send(packetMap);
|
||||
return [MPPCommonUtils checkCppError:sendStatus toError:error];
|
||||
|
|
Loading…
Reference in New Issue
Block a user