Updated formatting
This commit is contained in:
parent
b940a19462
commit
17ff493a9d
|
@ -27,11 +27,11 @@ typedef NS_ENUM(NSUInteger, MPPRunningMode) {
|
|||
/** The mode for running a mediapipe vision task on single image inputs. */
|
||||
MPPRunningModeImage,
|
||||
|
||||
/**mThe mode for running a mediapipe vision task on the decoded frames of a video. */
|
||||
/** The mode for running a mediapipe vision task on the decoded frames of a video. */
|
||||
MPPRunningModeVideo,
|
||||
|
||||
/** The mode for running a mediapipe vision task on a live stream of input data,
|
||||
* such as from camera.
|
||||
/** The mode for running a mediapipe vision task on a live stream of input data, such as from
|
||||
* camera.
|
||||
*/
|
||||
MPPRunningModeLiveStream,
|
||||
|
||||
|
|
|
@ -26,7 +26,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
@interface MPPVisionTaskRunner : MPPTaskRunner
|
||||
|
||||
/**
|
||||
* Initializes a new `MPPVisionTaskRunner` with the MediaPipe calculator config protol running mode and packetsCallback.
|
||||
* Initializes a new `MPPVisionTaskRunner` with the MediaPipe calculator config protol running mode
|
||||
* and packetsCallback.
|
||||
*
|
||||
* @param graphConfig A MediaPipe calculator config proto.
|
||||
* @param runningMode MediaPipe vision task running mode.
|
||||
|
|
|
@ -33,37 +33,32 @@ using ::mediapipe::CalculatorGraphConfig;
|
|||
packetsCallback:
|
||||
(mediapipe::tasks::core::PacketsCallback)packetsCallback
|
||||
error:(NSError **)error {
|
||||
|
||||
switch (runningMode) {
|
||||
case MPPRunningModeImage:
|
||||
case MPPRunningModeVideo: {
|
||||
if (packetsCallback) {
|
||||
[MPPCommonUtils
|
||||
createCustomError:error
|
||||
[MPPCommonUtils createCustomError:error
|
||||
withCode:MPPTasksErrorCodeInvalidArgumentError
|
||||
description:
|
||||
@"The vision task is in image or video mode, a user-defined result callback should not be provided."];
|
||||
description:@"The vision task is in image or video mode, a "
|
||||
@"user-defined result callback should not be provided."];
|
||||
return nil;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MPPRunningModeLiveStream: {
|
||||
if (!packetsCallback) {
|
||||
[MPPCommonUtils
|
||||
createCustomError:error
|
||||
[MPPCommonUtils createCustomError:error
|
||||
withCode:MPPTasksErrorCodeInvalidArgumentError
|
||||
description:
|
||||
@"The vision task is in live stream mode, a user-defined result callback must be provided."];
|
||||
description:@"The vision task is in live stream mode, a user-defined "
|
||||
@"result callback must be provided."];
|
||||
return nil;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
[MPPCommonUtils
|
||||
createCustomError:error
|
||||
[MPPCommonUtils createCustomError:error
|
||||
withCode:MPPTasksErrorCodeInvalidArgumentError
|
||||
description:
|
||||
@"Unrecognized running mode"];
|
||||
description:@"Unrecognized running mode"];
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user