Updated formatting
This commit is contained in:
parent
4558486459
commit
4401b11c3a
|
@ -91,7 +91,10 @@ static NSString *const kTaskName = @"imageClassifier";
|
||||||
// and cause a retain cycle, after self is set to `nil`.
|
// and cause a retain cycle, after self is set to `nil`.
|
||||||
MPPImageClassifier *__weak weakSelf = self;
|
MPPImageClassifier *__weak weakSelf = self;
|
||||||
|
|
||||||
// Create a private serial dispatch queue in which the deleagte method will be called asynchronously. This is to ensure that if the client performs a long running operation in the delegate method, the queue on which the C++ callbacks is invoked is not blocked and is freed up to continue with its operations.
|
// Create a private serial dispatch queue in which the deleagte method will be called
|
||||||
|
// asynchronously. This is to ensure that if the client performs a long running operation in
|
||||||
|
// the delegate method, the queue on which the C++ callbacks is invoked is not blocked and is
|
||||||
|
// freed up to continue with its operations.
|
||||||
const char *queueName = [MPPVisionTaskRunner uniqueQueueNameWithTaskName:kTaskName];
|
const char *queueName = [MPPVisionTaskRunner uniqueQueueNameWithTaskName:kTaskName];
|
||||||
dispatch_queue_t callbackQueue = dispatch_queue_create(queueName, NULL);
|
dispatch_queue_t callbackQueue = dispatch_queue_create(queueName, NULL);
|
||||||
packetsCallback = [=](absl::StatusOr<PacketMap> status_or_packets) {
|
packetsCallback = [=](absl::StatusOr<PacketMap> status_or_packets) {
|
||||||
|
@ -125,9 +128,8 @@ static NSString *const kTaskName = @"imageClassifier";
|
||||||
[MPPImageClassifierResult imageClassifierResultWithClassificationsPacket:
|
[MPPImageClassifierResult imageClassifierResultWithClassificationsPacket:
|
||||||
outputPacketMap[kClassificationsStreamName.cppString]];
|
outputPacketMap[kClassificationsStreamName.cppString]];
|
||||||
|
|
||||||
NSInteger timeStampInMilliseconds = outputPacketMap[kImageOutStreamName.cppString]
|
NSInteger timeStampInMilliseconds =
|
||||||
.Timestamp()
|
outputPacketMap[kImageOutStreamName.cppString].Timestamp().Value() /
|
||||||
.Value() /
|
|
||||||
kMicroSecondsPerMilliSecond;
|
kMicroSecondsPerMilliSecond;
|
||||||
dispatch_async(callbackQueue, ^{
|
dispatch_async(callbackQueue, ^{
|
||||||
[weakSelf.imageClassifierDelegate imageClassifier:weakSelf
|
[weakSelf.imageClassifierDelegate imageClassifier:weakSelf
|
||||||
|
|
Loading…
Reference in New Issue
Block a user