Reformatted using the clang formatter.

This commit is contained in:
Prianka Liz Kariat 2023-01-06 14:30:29 +05:30
parent 5f41d4591c
commit 95f5ea7203

View File

@ -21,31 +21,31 @@ NS_ASSUME_NONNULL_BEGIN
/** /**
* This class is used to create and call appropriate methods on the C++ Task Runner to initialize, * This class is used to create and call appropriate methods on the C++ Task Runner to initialize,
* execute and terminate any MediaPipe task. * execute and terminate any MediaPipe task.
* *
* An instance of the newly created C++ task runner will be stored until this class is destroyed. * An instance of the newly created C++ task runner will be stored until this class is destroyed.
* When methods are called for processing (performing inference), closing etc., on this class, * When methods are called for processing (performing inference), closing etc., on this class,
* internally the appropriate methods will be called on the C++ task runner instance to execute * internally the appropriate methods will be called on the C++ task runner instance to execute the
* the appropriate actions. For each type of task, a subclass of this class must be defined to add * appropriate actions. For each type of task, a subclass of this class must be defined to add any
* any additional functionality. For eg:, vision tasks must create an `MPPVisionTaskRunner` and * additional functionality. For eg:, vision tasks must create an `MPPVisionTaskRunner` and provide
* provide additional functionality. An instance of `MPPVisionTaskRunner` can in turn be used by * additional functionality. An instance of `MPPVisionTaskRunner` can in turn be used by the each
* the each vision task for creation and execution of the task. Please see the documentation for * vision task for creation and execution of the task. Please see the documentation for the C++ Task
* the C++ Task Runner for more details on how the taks runner operates. * Runner for more details on how the taks runner operates.
**/ **/
@interface MPPTaskRunner : NSObject @interface MPPTaskRunner : NSObject
/** /**
* Initializes a new `MPPTaskRunner` with the MediaPipe calculator configuration proto and an optional * Initializes a new `MPPTaskRunner` with the MediaPipe calculator configuration proto and an
* C++ packets callback. * optional C++ packets callback.
* *
* You can pass `nullptr` for `packetsCallback` in case the mode of operation * You can pass `nullptr` for `packetsCallback` in case the mode of operation requested by the user
* requested by the user is synchronous. * is synchronous.
* *
* If the task is operating in asynchronous mode, any iOS MediaPipe task that uses the `MPPTaskRunner` * If the task is operating in asynchronous mode, any iOS MediaPipe task that uses the
* must define a C++ callback function to obtain the results of inference asynchronously and deliver * `MPPTaskRunner` must define a C++ callback function to obtain the results of inference
* the results to the user. To accomplish this, callback function will in turn invoke the block * asynchronously and deliver the results to the user. To accomplish this, callback function will in
* provided by the user in the task options supplied to create the task. * turn invoke the block provided by the user in the task options supplied to create the task.
* Please see the documentation of the C++ Task Runner for more information on the synchronous and * Please see the documentation of the C++ Task Runner for more information on the synchronous and
* asynchronous modes of operation. * asynchronous modes of operation.
* *
* @param graphConfig A mediapipe task graph config proto. * @param graphConfig A mediapipe task graph config proto.
@ -61,22 +61,23 @@ NS_ASSUME_NONNULL_BEGIN
(mediapipe::tasks::core::PacketsCallback)packetsCallback (mediapipe::tasks::core::PacketsCallback)packetsCallback
error:(NSError **)error NS_DESIGNATED_INITIALIZER; error:(NSError **)error NS_DESIGNATED_INITIALIZER;
/** A synchronous method for processing batch data or offline streaming data. This method is /**
* designed for processing either batch data such as unrelated images and texts or offline streaming * A synchronous method for processing batch data or offline streaming data. This method is designed
* data such as the decoded frames from a video file and an audio file. The call blocks the current * for processing either batch data such as unrelated images and texts or offline streaming data
* thread until a failure status or a successful result is returned. If the input packets have no * such as the decoded frames from a video file and an audio file. The call blocks the current
* timestamp, an internal timestamp will be assigend per invocation. Otherwise, when the timestamp is * thread until a failure status or a successful result is returned. If the input packets have no
* set in the input packets, the caller must ensure that the input packet timestamps are greater than * timestamp, an internal timestamp will be assigend per invocation. Otherwise, when the timestamp
* the timestamps of the previous invocation. This method is thread-unsafe and it is the caller's * is set in the input packets, the caller must ensure that the input packet timestamps are greater
* responsibility to synchronize access to this method across multiple threads and to ensure that the * than the timestamps of the previous invocation. This method is thread-unsafe and it is the
* input packet timestamps are in order. * 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: - (absl::StatusOr<mediapipe::tasks::core::PacketMap>)process:
(const mediapipe::tasks::core::PacketMap &)packetMap; (const mediapipe::tasks::core::PacketMap &)packetMap;
/** /**
* Shuts down the C++ task runner. After the runner is closed, any calls that send input data to * Shuts down the C++ task runner. After the runner is closed, any calls that send input data to the
* the runner are illegal and will receive errors. * runner are illegal and will receive errors.
**/ **/
- (absl::Status)close; - (absl::Status)close;