From 17ff493a9d3cfb80349d41e59790810e84a5f2e7 Mon Sep 17 00:00:00 2001 From: Prianka Liz Kariat Date: Tue, 14 Feb 2023 20:39:25 +0530 Subject: [PATCH] Updated formatting --- .../ios/vision/core/sources/MPPRunningMode.h | 8 ++-- .../vision/core/sources/MPPVisionTaskRunner.h | 11 +++--- .../core/sources/MPPVisionTaskRunner.mm | 39 ++++++++----------- 3 files changed, 27 insertions(+), 31 deletions(-) diff --git a/mediapipe/tasks/ios/vision/core/sources/MPPRunningMode.h b/mediapipe/tasks/ios/vision/core/sources/MPPRunningMode.h index fb64c20e0..a5a2cc3d0 100644 --- a/mediapipe/tasks/ios/vision/core/sources/MPPRunningMode.h +++ b/mediapipe/tasks/ios/vision/core/sources/MPPRunningMode.h @@ -27,12 +27,12 @@ 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, } NS_SWIFT_NAME(RunningMode); diff --git a/mediapipe/tasks/ios/vision/core/sources/MPPVisionTaskRunner.h b/mediapipe/tasks/ios/vision/core/sources/MPPVisionTaskRunner.h index d8545bb64..b7f4af7d9 100644 --- a/mediapipe/tasks/ios/vision/core/sources/MPPVisionTaskRunner.h +++ b/mediapipe/tasks/ios/vision/core/sources/MPPVisionTaskRunner.h @@ -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. @@ -40,10 +41,10 @@ NS_ASSUME_NONNULL_BEGIN * proto, running mode and packets callback. */ - (nullable instancetype)initWithCalculatorGraphConfig:(mediapipe::CalculatorGraphConfig)graphConfig - runningMode:(MPPRunningMode)runningMode - packetsCallback: - (mediapipe::tasks::core::PacketsCallback)packetsCallback - error:(NSError **)error; + runningMode:(MPPRunningMode)runningMode + packetsCallback: + (mediapipe::tasks::core::PacketsCallback)packetsCallback + error:(NSError **)error; - (instancetype)init NS_UNAVAILABLE; diff --git a/mediapipe/tasks/ios/vision/core/sources/MPPVisionTaskRunner.mm b/mediapipe/tasks/ios/vision/core/sources/MPPVisionTaskRunner.mm index 1b14f2179..fddad964b 100644 --- a/mediapipe/tasks/ios/vision/core/sources/MPPVisionTaskRunner.mm +++ b/mediapipe/tasks/ios/vision/core/sources/MPPVisionTaskRunner.mm @@ -29,45 +29,40 @@ using ::mediapipe::CalculatorGraphConfig; @implementation MPPVisionTaskRunner - (nullable instancetype)initWithCalculatorGraphConfig:(mediapipe::CalculatorGraphConfig)graphConfig - runningMode:(MPPRunningMode)runningMode - packetsCallback: - (mediapipe::tasks::core::PacketsCallback)packetsCallback - error:(NSError **)error { - + runningMode:(MPPRunningMode)runningMode + packetsCallback: + (mediapipe::tasks::core::PacketsCallback)packetsCallback + error:(NSError **)error { switch (runningMode) { case MPPRunningModeImage: case MPPRunningModeVideo: { if (packetsCallback) { - [MPPCommonUtils - createCustomError:error - withCode:MPPTasksErrorCodeInvalidArgumentError - description: - @"The vision task is in image or video mode, a user-defined result callback should not be provided."]; + [MPPCommonUtils createCustomError:error + withCode:MPPTasksErrorCodeInvalidArgumentError + 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 - withCode:MPPTasksErrorCodeInvalidArgumentError - description: - @"The vision task is in live stream mode, a user-defined result callback must be provided."]; + [MPPCommonUtils createCustomError:error + withCode:MPPTasksErrorCodeInvalidArgumentError + description:@"The vision task is in live stream mode, a user-defined " + @"result callback must be provided."]; return nil; } break; } default: { - [MPPCommonUtils - createCustomError:error - withCode:MPPTasksErrorCodeInvalidArgumentError - description: - @"Unrecognized running mode"]; - return nil; + [MPPCommonUtils createCustomError:error + withCode:MPPTasksErrorCodeInvalidArgumentError + description:@"Unrecognized running mode"]; + return nil; } } - + _runningMode = runningMode; self = [super initWithCalculatorGraphConfig:graphConfig packetsCallback:packetsCallback