lxy 1 year ago
parent
commit
827a0d33f6

+ 3 - 3
Example/LenzCameraNativeModuleForRN.xcodeproj/project.pbxproj

@@ -229,7 +229,7 @@
 				ORGANIZATIONNAME = "76930516@qq.com";
 				TargetAttributes = {
 					6003F589195388D20070C39A = {
-						DevelopmentTeam = 75H2833F9T;
+						DevelopmentTeam = 67B22KAY34;
 					};
 					6003F5AD195388D20070C39A = {
 						TestTargetID = 6003F589195388D20070C39A;
@@ -458,7 +458,7 @@
 			baseConfigurationReference = 81A8808FD3706FAD151017C8 /* Pods-LenzCameraNativeModuleForRN_Example.debug.xcconfig */;
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
-				DEVELOPMENT_TEAM = 75H2833F9T;
+				DEVELOPMENT_TEAM = 67B22KAY34;
 				ENABLE_BITCODE = NO;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = "LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN-Prefix.pch";
@@ -478,7 +478,7 @@
 			baseConfigurationReference = 47F785DCE1254FC6EEB075B7 /* Pods-LenzCameraNativeModuleForRN_Example.release.xcconfig */;
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
-				DEVELOPMENT_TEAM = 75H2833F9T;
+				DEVELOPMENT_TEAM = 67B22KAY34;
 				ENABLE_BITCODE = NO;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = "LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN-Prefix.pch";

+ 38 - 21
LenzCameraNativeModuleForRN/Classes/inner/PCSBaseViewController/PCSBaseViewController.m

@@ -130,6 +130,9 @@
 @property (nonatomic) UILabel *aiPanPromtLabel;
 
 @property (nonatomic) PCSAutherView *authView;
+
+@property (nonatomic) dispatch_queue_t videoQueue;
+
 @end
 
 @implementation PCSBaseViewController
@@ -155,7 +158,11 @@
     [SVProgressHUD setMaximumDismissTimeInterval:3];
     [SVProgressHUD setFont:[UIFont systemFontOfSize:14]];
     self.tensorFlow = [[LenzTensorFlow alloc]initWithFileName:@"moire_mobilenetv2_79"];
-
+    if(@available(iOS 14, *)){
+        self.videoQueue = dispatch_queue_create("com.lenzSDK.videoQueue", NULL);
+    } else {
+        self.videoQueue = dispatch_get_main_queue();
+    }
     self.stitchkLock = [[NSLock alloc]init];
     
     self.totalArray = [[NSMutableArray alloc]init];
@@ -324,14 +331,14 @@
     self.mode = [SDKParameters shared].modeIndex;
     [self modeDidChange:[SDKParameters shared].modeIndex oldIndex:0lu];
     
-    UIVisualEffectView* effectView = [[UIVisualEffectView alloc] initWithEffect: [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]];
-    effectView.alpha = 0.8;
-    effectView.effect = nil;
-    self.effectView = effectView;
-    [self.view insertSubview:self.effectView belowSubview:self.backButton];
-    [self.effectView mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.edges.equalTo(self.view);
-    }];
+//    UIVisualEffectView* effectView = [[UIVisualEffectView alloc] initWithEffect: [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]];
+//    effectView.alpha = 0.8;
+//    effectView.effect = nil;
+//    self.effectView = effectView;
+//    [self.view insertSubview:self.effectView belowSubview:self.backButton];
+//    [self.effectView mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.edges.equalTo(self.view);
+//    }];
     
     if(!self.cameraPrepared){
         [self prepareCamera];
@@ -1584,6 +1591,8 @@
         default:
             break;
     }
+    [self.view setNeedsDisplay];
+    [self.view layoutIfNeeded];
 }
 
 
@@ -1603,11 +1612,11 @@
         return;
     }
     
-    if(self.effectView.superview != nil){
-        [UIView animateWithDuration:0.5 animations:^{
-            self.effectView.effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
-        }];
-    }
+//    if(self.effectView.superview != nil){
+//        [UIView animateWithDuration:0.5 animations:^{
+//            self.effectView.effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
+//        }];
+//    }
     if(newIndex != SDK_CAPTURE_MODE_MOVIE){
         [[SDKParameters shared].items enumerateObjectsUsingBlock:^(SDKParametersItem * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
             if (obj.model == self.mode) {
@@ -1627,7 +1636,7 @@
 
     }
         
-    self.effectView.effect = nil;
+//    self.effectView.effect = nil;
     [self updateUIByMode];
     [self switchDevicePositionBack];
     [self updateNumberLabel];
@@ -1722,7 +1731,9 @@
 }
 
 - (void)stopAllSensors{
-    [self.captureSession stopRunning];
+    dispatch_async(self.videoQueue, ^{
+        [self.captureSession stopRunning];
+    });
     [[PCSMotionManager shared] stopAccelerometerUpdates];
 }
 
@@ -1743,7 +1754,9 @@
     [self turnTorchOff];
     
     if (self.captureSession.isRunning) {
-        [self.captureSession stopRunning];
+        dispatch_async(self.videoQueue, ^{
+            [self.captureSession stopRunning];
+        });
     }
 }
 
@@ -1753,9 +1766,12 @@
     }
     
     if (self.cameraPrepared && (!self.captureSession.isRunning)) {
-        dispatch_async(dispatch_get_global_queue(0, 0), ^{
-            [self.captureSession startRunning];
-        });
+//        dispatch_async(dispatch_get_global_queue(0, 0), ^{
+        dispatch_async(self.videoQueue, ^{
+               [self.captureSession startRunning];
+           });
+//            [self.captureSession startRunning];
+//        });
     }
 }
 
@@ -1959,6 +1975,8 @@
             [alertController dismissViewControllerAnimated:NO completion:^{}];
         } rightButtonCallBack:^(QuitMultipleModeAlertViewController * _Nonnull alertController) {
             [self updateViewStatusWhenStitchSave:NO];
+            [self.panoramaGuideView clearImage];
+            [self.panoramaGuideView showImageWith:nil dir:self.panoramOrientationGuideView.selectedItemIndex];
             [alertController dismissViewControllerAnimated:NO completion:^{
             }];
         }];
@@ -2071,7 +2089,6 @@
         [self.resourceModel.movieArray removeAllObjects];
         [self.resourceModel.panoramArray removeAllObjects];
         [self.resourceModel.aiPanoramArray removeAllObjects];
-//        [self updateViewStatus];
         [alertController dismissViewControllerAnimated:NO completion:^{
             [self dismissViewControllerAnimated:YES completion:^{}];
         }];

+ 1 - 1
LenzSDK.podspec

@@ -8,7 +8,7 @@
 
 Pod::Spec.new do |s|
   s.name             = 'LenzSDK'
-  s.version          = '2.0.3'
+  s.version          = '2.0.4'
   s.summary          = 'A short description of LenzSDK.'
 
 # This description is used to generate tags and improve search results.