posetracking solution api obj-c compat

This commit is contained in:
Mautisim Munir 2022-10-17 01:20:37 +05:00
parent fc2bcf67ec
commit c8e64f8720
3 changed files with 8 additions and 6 deletions

View File

@ -2,7 +2,7 @@
"configDefaults" : {
"optionSet" : {
"BazelBuildOptionsDebug" : {
"p" : "--config=debug --strip=never --features=oso_prefix_is_pwd --apple_generate_dsym"
"p" : "--strip=never --features=oso_prefix_is_pwd --apple_generate_dsym"
},
"CLANG_CXX_LANGUAGE_STANDARD" : {
"p" : "c++14"

View File

@ -8,7 +8,6 @@
#import "mediapipe/objc/MPPCameraInputSource.h"
#import "mediapipe/objc/MPPLayerRenderer.h"
#import "mediapipe/objc/MPPPlayerInputSource.h"
#import "mediapipe/objc/MPPTimestampConverter.h"
#import "PoseTrackingOptions.h"
#import "PoseTrackingResults.h"
@interface PoseTracking : NSObject<MPPInputSourceDelegate>
@ -18,8 +17,7 @@
//@property(nonatomic) MPPGraph* mediapipeGraph;
// Helps to convert timestamp.
@property(nonatomic) MPPTimestampConverter* timestampConverter;
// Render frames in a layer.
@property(nonatomic) MPPLayerRenderer* renderer;

View File

@ -1,6 +1,7 @@
#include "PoseTracking.h"
#include "mediapipe/framework/formats/landmark.pb.h"
#import "mediapipe/objc/MPPGraph.h"
#import "mediapipe/objc/MPPTimestampConverter.h"
static const char* kVideoQueueLabel = "com.google.mediapipe.example.videoQueue";
@ -82,11 +83,14 @@ static const char* kLandmarksOutputStream = "pose_landmarks";
@end
@interface PoseTracking(){
// The MediaPipe graph currently in use. Initialized in viewDidLoad, started in
// viewWillAppear: and sent video frames on videoQueue.
MPPGraph* mediapipeGraph;
PoseTrackingGraphDelegate* poseTrackingGraphDelegate;
//// Helps to convert timestamp.
MPPTimestampConverter* timestampConverter;
}
@end
@ -122,7 +126,7 @@ static const char* kLandmarksOutputStream = "pose_landmarks";
self.renderer = [[MPPLayerRenderer alloc] init];
self.renderer.frameScaleMode = MPPFrameScaleModeFillAndCrop;
self.timestampConverter = [[MPPTimestampConverter alloc] init];
self->timestampConverter = [[MPPTimestampConverter alloc] init];
dispatch_queue_attr_t qosAttribute = dispatch_queue_attr_make_with_qos_class(
DISPATCH_QUEUE_SERIAL, QOS_CLASS_USER_INTERACTIVE, /*relative_priority=*/0);
@ -196,7 +200,7 @@ static const char* kLandmarksOutputStream = "pose_landmarks";
[self->mediapipeGraph sendPixelBuffer:imageBuffer
intoStream:self.graphInputStream
packetType:MPPPacketTypePixelBuffer
timestamp:[self.timestampConverter timestampForMediaTime:timestamp]];
timestamp:[self->timestampConverter timestampForMediaTime:timestamp]];
}
#pragma mark - MPPGraphDelegate methods