From febca359a61a8e4b8e9e87236d884e1238d00bee Mon Sep 17 00:00:00 2001 From: Prianka Liz Kariat Date: Wed, 21 Dec 2022 01:07:31 +0530 Subject: [PATCH] Updated packet creator class name --- mediapipe/tasks/ios/core/BUILD | 6 +++--- .../{MPPPacketCreator.h => MPPTextPacketCreator.h} | 11 ++++------- .../{MPPPacketCreator.mm => MPPTextPacketCreator.mm} | 4 ++-- 3 files changed, 9 insertions(+), 12 deletions(-) rename mediapipe/tasks/ios/core/sources/{MPPPacketCreator.h => MPPTextPacketCreator.h} (72%) rename mediapipe/tasks/ios/core/sources/{MPPPacketCreator.mm => MPPTextPacketCreator.mm} (89%) diff --git a/mediapipe/tasks/ios/core/BUILD b/mediapipe/tasks/ios/core/BUILD index 666b0e6e1..58f7389ac 100644 --- a/mediapipe/tasks/ios/core/BUILD +++ b/mediapipe/tasks/ios/core/BUILD @@ -50,9 +50,9 @@ objc_library( ) objc_library( - name = "MPPPacketCreator", - srcs = ["sources/MPPPacketCreator.mm"], - hdrs = ["sources/MPPPacketCreator.h"], + name = "MPPTextPacketCreator", + srcs = ["sources/MPPTextPacketCreator.mm"], + hdrs = ["sources/MPPTextPacketCreator.h"], copts = [ "-ObjC++", "-std=c++17", diff --git a/mediapipe/tasks/ios/core/sources/MPPPacketCreator.h b/mediapipe/tasks/ios/core/sources/MPPTextPacketCreator.h similarity index 72% rename from mediapipe/tasks/ios/core/sources/MPPPacketCreator.h rename to mediapipe/tasks/ios/core/sources/MPPTextPacketCreator.h index ecd0c5bfd..03f946dd0 100644 --- a/mediapipe/tasks/ios/core/sources/MPPPacketCreator.h +++ b/mediapipe/tasks/ios/core/sources/MPPTextPacketCreator.h @@ -14,15 +14,12 @@ #import -#ifndef __cplusplus -#error This header can only be included by an Objective-C++ file. -#endif - #include "mediapipe/framework/packet.h" -/// This class is an Objective-C wrapper around a MediaPipe graph object, and -/// helps interface it with iOS technologies such as AVFoundation. -@interface MPPPacketCreator : NSObject +/* This class is an Objective-C wrapper around a MediaPipe graph object, and + * helps interface it with iOS technologies such as AVFoundation. + */ +@interface MPPTextPacketCreator : NSObject + (mediapipe::Packet)createWithText:(NSString *)text; diff --git a/mediapipe/tasks/ios/core/sources/MPPPacketCreator.mm b/mediapipe/tasks/ios/core/sources/MPPTextPacketCreator.mm similarity index 89% rename from mediapipe/tasks/ios/core/sources/MPPPacketCreator.mm rename to mediapipe/tasks/ios/core/sources/MPPTextPacketCreator.mm index 6ce5a5139..ca86e7a0b 100644 --- a/mediapipe/tasks/ios/core/sources/MPPPacketCreator.mm +++ b/mediapipe/tasks/ios/core/sources/MPPTextPacketCreator.mm @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#import "mediapipe/tasks/ios/core/sources/MPPPacketCreator.h" +#import "mediapipe/tasks/ios/core/sources/MPPTextPacketCreator.h" #import "mediapipe/tasks/ios/common/utils/sources/NSString+Helpers.h" namespace { @@ -20,7 +20,7 @@ using ::mediapipe::MakePacket; using ::mediapipe::Packet; } // namespace -@implementation MPPPacketCreator +@implementation MPPTextPacketCreator + (Packet)createWithText:(NSString *)text { return MakePacket(text.cppString);