lxy il y a 2 ans
Parent
commit
3d34cbdb34

BIN
Demo.xcworkspace/xcuserdata/lr.xcuserdatad/UserInterfaceState.xcuserstate


+ 307 - 3
Demo.xcworkspace/xcuserdata/lr.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -23,18 +23,322 @@
       <BreakpointProxy
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
          <BreakpointContent
-            uuid = "1047B561-1CED-489C-A390-177994F793DA"
+            uuid = "6FDE5B30-A6B2-43F4-8D2D-0FA38FD54B3B"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/PCSBaseViewController/PCSBaseViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "2347"
+            endingLineNumber = "2347"
+            landmarkName = "-captureOutput:didOutputSampleBuffer:fromConnection:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "68F14F3B-E00C-43E7-9EEB-A7D61BE57134"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/DB/LenzDataManager.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "23"
+            endingLineNumber = "23"
+            landmarkName = "+saveImageWith:mode:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "8BA7BA7B-BBE8-45A7-8C48-1F424D95B8FF"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/DB/LenzDataManager.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "210"
+            endingLineNumber = "210"
+            landmarkName = "+createPanoramsDir"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "10355FA3-C50D-40CA-9A56-4BF1B56307B1"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/DB/LenzDataManager.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "194"
+            endingLineNumber = "194"
+            landmarkName = "+createMovieDir"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "AC0A3F14-E395-4EFB-A3BD-F3F69B825DDD"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/DB/LenzDataManager.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "177"
+            endingLineNumber = "177"
+            landmarkName = "+creatContinuousDir"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "4ED7C033-1913-4016-9C1F-EC5FF4B923E7"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/DB/LenzDataManager.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "157"
+            endingLineNumber = "157"
+            landmarkName = "+createSingleDir"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "31FB62A9-096B-46A9-B098-CC164906ACE3"
             shouldBeEnabled = "Yes"
             shouldBeEnabled = "Yes"
             ignoreCount = "0"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             continueAfterRunningActions = "No"
             filePath = "Demo/ViewController.m"
             filePath = "Demo/ViewController.m"
             startingColumnNumber = "9223372036854775807"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "91"
-            endingLineNumber = "91"
+            startingLineNumber = "79"
+            endingLineNumber = "79"
             landmarkName = "-photoAction"
             landmarkName = "-photoAction"
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
       </BreakpointProxy>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "12892A04-8C2B-41FE-8C72-FA79EAFE0236"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/PCSBaseViewController/PCSBaseViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "2345"
+            endingLineNumber = "2345"
+            landmarkName = "-captureOutput:didOutputSampleBuffer:fromConnection:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "5930A00A-AF8F-465A-904F-735ACA2CBB80"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/PCSBaseViewController/PCSBaseViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "2337"
+            endingLineNumber = "2337"
+            landmarkName = "-captureOutput:didOutputSampleBuffer:fromConnection:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "EBF2B7F6-54EE-4376-B1FA-A477BE141143"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/PCSBaseViewController/PCSBaseViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1896"
+            endingLineNumber = "1896"
+            landmarkName = "-updateNumberLabel"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "83EA6547-36D7-4729-A34F-FDC49D9E1BAE"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/DB/LenzDataManager.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "26"
+            endingLineNumber = "26"
+            landmarkName = "+saveImageWith:mode:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "F5586E22-AEF4-4F69-81A5-A951ABC85162"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/PCSBaseViewController/PCSBaseViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "2326"
+            endingLineNumber = "2326"
+            landmarkName = "-captureOutput:didOutputSampleBuffer:fromConnection:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "73D2E691-4043-4205-8F97-12AA2A1EF7D1"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/PCSBaseViewController/PCSBaseViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1657"
+            endingLineNumber = "1657"
+            landmarkName = "-takePhotoButtonTouchUpInside:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "BC8CC650-FE24-470B-B5B3-2E57F23C203C"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/DB/LenzDataManager.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "39"
+            endingLineNumber = "39"
+            landmarkName = "+saveImageWith:mode:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "43EFC218-C981-4134-A6AA-2BB435385625"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/PCSBaseViewController/PCSBaseViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1919"
+            endingLineNumber = "1919"
+            landmarkName = "-updateNumberLabel"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "F5D40C0F-AF30-4454-924A-D0A9B57044B9"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/OperationNode/OperationNodeVideoBase.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "188"
+            endingLineNumber = "188"
+            landmarkName = "-updateTakePhotoButtonStatus"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "61BF7AFF-5F37-4366-BE15-73FA5E1C1D86"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/OperationNode/OperationNodeVideoBase.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "85"
+            endingLineNumber = "85"
+            landmarkName = "-takePhotoButtonTouched"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "1DEBBB3B-7B74-461A-ADCB-5574A540E0ED"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/PCSBaseViewController/PCSPreviewViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "60"
+            endingLineNumber = "60"
+            landmarkName = "-setIsPlayer:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "32AECE4B-65E8-4910-9BC7-BB6AA9406E20"
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/PCSBaseViewController/PCSPreviewViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "282"
+            endingLineNumber = "282"
+            landmarkName = "-collectionView:cellForItemAtIndexPath:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "DB57B21A-AC4E-4484-9F9F-57A14DDF8EE3"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/PCSBaseViewController/PCSPreviewViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "316"
+            endingLineNumber = "316"
+            landmarkName = "-scrollViewDidEndDecelerating:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
    </Breakpoints>
 </Bucket>
 </Bucket>

+ 7 - 11
Demo/ViewController.m

@@ -73,22 +73,18 @@
     dict[@"type"] = @"back";
     dict[@"type"] = @"back";
     dict[@"videoQuality"] = @(720);
     dict[@"videoQuality"] = @(720);
     dict[@"recTime"] = @(10);
     dict[@"recTime"] = @(10);
+    dict[@"keyframe"] = @(1);
     PCSBaseViewController *vc = [PCSBaseViewController initWithParams:dict complete:^(NSDictionary * _Nonnull dict) {
     PCSBaseViewController *vc = [PCSBaseViewController initWithParams:dict complete:^(NSDictionary * _Nonnull dict) {
         NSError *error;
         NSError *error;
-        if (@available(iOS 11.0, *)) {
-            NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dict
-                                                               options:NSJSONWritingSortedKeys
+        NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dict
+                                                               options:NSJSONWritingFragmentsAllowed
                                                                  error:&error];
                                                                  error:&error];
-            NSString *jsonString;
-            if (!jsonData) {
-                NSLog(@"%@",error);
-            } else {
-                jsonString = [[NSString alloc]initWithData:jsonData encoding:NSUTF8StringEncoding];
-            }
+        NSString *jsonString;
+        if (!jsonData) {
+            NSLog(@"%@",error);
         } else {
         } else {
-            // Fallback on earlier versions
+            jsonString = [[NSString alloc]initWithData:jsonData encoding:NSUTF8StringEncoding];
         }
         }
-        self.textView.text = jsonString;
     
     
     }];
     }];
     [self presentViewController:vc animated:YES completion:nil];
     [self presentViewController:vc animated:YES completion:nil];

+ 1 - 1
SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/VideoStitch/LenStitcher.mm

@@ -9,7 +9,7 @@
 #import "LenStitcher.h"
 #import "LenStitcher.h"
 
 
 
 
-NSString *const LenFileDirectoryVideoPath = @"/Len_VideoStitch_Resources/";
+NSString *const LenFileDirectoryVideoPath = @"/Len_VideoStitch_Temp/";
 
 
 dispatch_queue_t queue(void) {
 dispatch_queue_t queue(void) {
     static dispatch_queue_t queue = nil;
     static dispatch_queue_t queue = nil;

+ 1 - 0
SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/headers/SDKParameters.h

@@ -20,6 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 
 @property (nonatomic, assign) SDKFlashModeIndex flashMode;
 @property (nonatomic, assign) SDKFlashModeIndex flashMode;
 @property (nonatomic) NSString *flashModeString;
 @property (nonatomic) NSString *flashModeString;
+@property (nonatomic) NSNumber *keyFrame;
 
 
 @property (nonatomic, assign) SDKCaptureModeIndex modeIndex;
 @property (nonatomic, assign) SDKCaptureModeIndex modeIndex;
 @property (nonatomic) NSString *modeIndexString;
 @property (nonatomic) NSString *modeIndexString;

+ 1 - 0
SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/DB/DBModels/LenzCachedResourceModel.h

@@ -26,6 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic) BOOL isRemake;
 @property (nonatomic) BOOL isRemake;
 @property (nonatomic) SDKCaptureModeIndex mode;
 @property (nonatomic) SDKCaptureModeIndex mode;
 @property (nonatomic) UIImage *image;
 @property (nonatomic) UIImage *image;
+@property (nonatomic) NSMutableArray *keyFrame;
 
 
 @end
 @end
 
 

+ 6 - 1
SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/DB/DBModels/LenzCachedResourceModel.m

@@ -28,7 +28,12 @@
 
 
 @implementation LenzResourceItemModel
 @implementation LenzResourceItemModel
 
 
-
+- (instancetype)init {
+    if (self = [super init]) {
+        self.keyFrame = [NSMutableArray array];
+    }
+    return self;
+}
 - (NSString *)cameraMode {
 - (NSString *)cameraMode {
     switch (self.mode) {
     switch (self.mode) {
         case SDK_CAPTURE_MODE_CONTINUOUS:
         case SDK_CAPTURE_MODE_CONTINUOUS:

+ 13 - 13
SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/DB/LenzDataManager.m

@@ -23,21 +23,21 @@ NSString *const LenFileDirectoryAiPanoramaPath = @"/aiPanorama/";
     switch (mode) {
     switch (mode) {
         case SDK_CAPTURE_MODE_CONTINUOUS: {
         case SDK_CAPTURE_MODE_CONTINUOUS: {
             NSString *path = [self continuousPath];
             NSString *path = [self continuousPath];
-            if ([data writeToFile:path atomically:YES]) {
+            if ([data writeToFile:path atomically:NO]) {
                 return path;
                 return path;
             }
             }
         }
         }
             break;
             break;
         case SDK_CAPTURE_MODE_SINGLE: {
         case SDK_CAPTURE_MODE_SINGLE: {
             NSString *path = [self singlePath];
             NSString *path = [self singlePath];
-            if ([data writeToFile:path atomically:YES]) {
+            if ([data writeToFile:path atomically:NO]) {
                 return path;
                 return path;
             }
             }
         }
         }
             break;
             break;
         case SDK_CAPTURE_MODE_PANORAMA:{
         case SDK_CAPTURE_MODE_PANORAMA:{
             NSString *path = [self panoramPath];
             NSString *path = [self panoramPath];
-            if ([data writeToFile:path atomically:YES]) {
+            if ([data writeToFile:path atomically:NO]) {
                 return path;
                 return path;
             }
             }
         }
         }
@@ -45,7 +45,7 @@ NSString *const LenFileDirectoryAiPanoramaPath = @"/aiPanorama/";
             break;
             break;
         case SDK_CAPTURE_MODE_INTELLEGENCE_PANORAMA:{
         case SDK_CAPTURE_MODE_INTELLEGENCE_PANORAMA:{
             NSString *path = [self aiPanoramPath];
             NSString *path = [self aiPanoramPath];
-            if ([data writeToFile:path atomically:YES]) {
+            if ([data writeToFile:path atomically:NO]) {
                 return path;
                 return path;
             }
             }
         }
         }
@@ -76,31 +76,31 @@ NSString *const LenFileDirectoryAiPanoramaPath = @"/aiPanorama/";
 
 
 + (NSString *)singlePath {
 + (NSString *)singlePath {
     NSTimeInterval timeInterval = [[NSDate date] timeIntervalSince1970];
     NSTimeInterval timeInterval = [[NSDate date] timeIntervalSince1970];
-    NSString *key = [NSString stringWithFormat:@"%f", timeInterval];
-    return [[LenzDataManager singleDirectory] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.jpeg",key]];
+    NSString *key = [NSString stringWithFormat:@"%.0f", timeInterval];
+    return [[LenzDataManager singleDirectory] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.jpg",key]];
 }
 }
 
 
 + (NSString *)continuousPath {
 + (NSString *)continuousPath {
     NSTimeInterval timeInterval = [[NSDate date] timeIntervalSince1970];
     NSTimeInterval timeInterval = [[NSDate date] timeIntervalSince1970];
-    NSString *key = [NSString stringWithFormat:@"%f", timeInterval];
-    return [[LenzDataManager continuousDirectory] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.jpeg",key]];
+    NSString *key = [NSString stringWithFormat:@"%.0f", timeInterval];
+    return [[LenzDataManager continuousDirectory] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.jpg",key]];
 }
 }
 
 
 + (NSString *)panoramPath {
 + (NSString *)panoramPath {
     NSTimeInterval timeInterval = [[NSDate date] timeIntervalSince1970];
     NSTimeInterval timeInterval = [[NSDate date] timeIntervalSince1970];
-    NSString *key = [NSString stringWithFormat:@"%f", timeInterval];
-    return [[LenzDataManager panoramsDirectory] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.jpeg",key]];
+    NSString *key = [NSString stringWithFormat:@"%.0f", timeInterval];
+    return [[LenzDataManager panoramsDirectory] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.jpg",key]];
 }
 }
 
 
 + (NSString *)aiPanoramPath {
 + (NSString *)aiPanoramPath {
     NSTimeInterval timeInterval = [[NSDate date] timeIntervalSince1970];
     NSTimeInterval timeInterval = [[NSDate date] timeIntervalSince1970];
-    NSString *key = [NSString stringWithFormat:@"%f", timeInterval];
-    return [[LenzDataManager aiPanoramsDirectory] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.jpeg",key]];
+    NSString *key = [NSString stringWithFormat:@"%.0f", timeInterval];
+    return [[LenzDataManager aiPanoramsDirectory] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.jpg",key]];
 }
 }
 
 
 + (NSString *)moviePath {
 + (NSString *)moviePath {
     NSTimeInterval timeInterval = [[NSDate date] timeIntervalSince1970];
     NSTimeInterval timeInterval = [[NSDate date] timeIntervalSince1970];
-    NSString *key = [NSString stringWithFormat:@"%f", timeInterval];
+    NSString *key = [NSString stringWithFormat:@"%.0f", timeInterval];
     return [[LenzDataManager movieDirectory] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.mov",key]];
     return [[LenzDataManager movieDirectory] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.mov",key]];
 }
 }
 
 

+ 1 - 1
SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/OperationNode/OperationNodeAIPanorama.m

@@ -28,7 +28,7 @@
 
 
 - (void)updateUI{
 - (void)updateUI{
 //    self.controller.numberOfImagesLabel.hidden = NO;
 //    self.controller.numberOfImagesLabel.hidden = NO;
-    self.controller.numberOfImagesLabel.text = [[NSString alloc] initWithString:LOCALIZATION_STRING_KEY_TIP_FOR_AI_PANORAMA];
+//    self.controller.numberOfImagesLabel.text = [[NSString alloc] initWithString:LOCALIZATION_STRING_KEY_TIP_FOR_AI_PANORAMA];
 }
 }
 
 
 - (nonnull instancetype)initWithController:(nonnull PCSBaseViewController *)controller {
 - (nonnull instancetype)initWithController:(nonnull PCSBaseViewController *)controller {

+ 4 - 0
SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/OperationNode/OperationNodeVideoBase.m

@@ -166,6 +166,7 @@
             
             
             self.controller.timerLabel.hidden = YES;
             self.controller.timerLabel.hidden = YES;
             self.controller.modeLabel.hidden = NO;
             self.controller.modeLabel.hidden = NO;
+//            self.controller.numberOfImagesLabel.hidden = NO;
         });
         });
 //    }
 //    }
 }
 }
@@ -205,6 +206,8 @@
         }
         }
         self.controller.modeList.hidden = NO;
         self.controller.modeList.hidden = NO;
         self.controller.ablumImageView.hidden = NO;
         self.controller.ablumImageView.hidden = NO;
+        
+//        self.controller.numberOfImagesLabel.hidden = NO;
 
 
     } else {
     } else {
         self.controller.flashButton.hidden = YES;
         self.controller.flashButton.hidden = YES;
@@ -214,6 +217,7 @@
         self.controller.backButton.hidden = YES;
         self.controller.backButton.hidden = YES;
         self.controller.modeList.hidden = YES;
         self.controller.modeList.hidden = YES;
         self.controller.ablumImageView.hidden = YES;
         self.controller.ablumImageView.hidden = YES;
+        self.controller.numberOfImagesLabel.hidden = YES;
 
 
     }
     }
 }
 }

+ 72 - 49
SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/PCSBaseViewController/PCSBaseViewController.m

@@ -117,7 +117,7 @@
 @property (nonatomic) BOOL isStitchBigImage;
 @property (nonatomic) BOOL isStitchBigImage;
 @property (nonatomic) CGFloat brightnessValue;
 @property (nonatomic) CGFloat brightnessValue;
 @property (nonatomic) CMMotionManager *motionManager;
 @property (nonatomic) CMMotionManager *motionManager;
-
+@property (nonatomic) BOOL isTakePhoto;
 
 
 @end
 @end
 
 
@@ -153,7 +153,7 @@
 
 
     self.resourceModel = [[LenzCachedResourceModel alloc]init];
     self.resourceModel = [[LenzCachedResourceModel alloc]init];
     self.motionManager = [[CMMotionManager alloc]init];
     self.motionManager = [[CMMotionManager alloc]init];
-    self.motionManager.deviceMotionUpdateInterval = 1/30.0;
+    self.motionManager.deviceMotionUpdateInterval = 1/5.0;
 
 
 //    self.resultDict = [NSMutableDictionary dictionary];
 //    self.resultDict = [NSMutableDictionary dictionary];
     
     
@@ -651,6 +651,8 @@
     sdkParams.limitRecordTime = [recTime integerValue];
     sdkParams.limitRecordTime = [recTime integerValue];
   }
   }
   
   
+    sdkParams.keyFrame = params[@"keyframe"];
+    
   NSString* flashMode = params[@"flashMode"];
   NSString* flashMode = params[@"flashMode"];
   if(flashMode != nil){
   if(flashMode != nil){
       sdkParams.flashModeString = flashMode;
       sdkParams.flashModeString = flashMode;
@@ -1149,6 +1151,8 @@
         [Renderer shared].cameraPass.texture = nil;
         [Renderer shared].cameraPass.texture = nil;
     });
     });
     [self stopMotion];
     [self stopMotion];
+    [self.panoramaGuideView showImageWith:nil dir:self.panoramOrientationGuideView.selectedItemIndex];
+
 }
 }
 - (void)updateViewStatusWhenStitchSave:(BOOL)isSaveIng {
 - (void)updateViewStatusWhenStitchSave:(BOOL)isSaveIng {
     dispatch_async(dispatch_get_main_queue(), ^{
     dispatch_async(dispatch_get_main_queue(), ^{
@@ -1638,17 +1642,31 @@
 
 
 - (void)takePhotoButtonTouchUpInside:(id)sender{
 - (void)takePhotoButtonTouchUpInside:(id)sender{
     self.takePhotoButton.enabled = NO;
     self.takePhotoButton.enabled = NO;
-    dispatch_async(dispatch_get_main_queue(), ^{
-        self.takePhotoButton.enabled = YES;
-    });
+    if (self.outputSettings.flashMode == AVCaptureFlashModeOn && (self.mode == SDK_CAPTURE_MODE_SINGLE || self.mode == SDK_CAPTURE_MODE_CONTINUOUS || self.mode == SDK_CAPTURE_MODE_INTELLEGENCE_PANORAMA)) {
+        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+            self.takePhotoButton.enabled = YES;
+        });
+    } else {
+        dispatch_async(dispatch_get_main_queue(), ^{
+            self.takePhotoButton.enabled = YES;
+        });
+    }
     if(![self.currentOperationNode respondsToSelector:@selector(enable)] || self.currentOperationNode.enable){
     if(![self.currentOperationNode respondsToSelector:@selector(enable)] || self.currentOperationNode.enable){
-        if (self.mode == SDK_CAPTURE_MODE_PANORAMA) {
+        [self.currentOperationNode takePhotoButtonTouched];
+
+        if (self.mode == SDK_CAPTURE_MODE_PANORAMA && !self.isVideoStitchStopedWhenRecording) {
             [LenStitcher videoResetPath];
             [LenStitcher videoResetPath];
+            LenzResourceItemModel *itemModel = [[LenzResourceItemModel alloc]init];
+            [self.resourceModel.panoramArray addObject:itemModel];
             [self startMotion];
             [self startMotion];
+
 //            self.videoStitchSemaphore = dispatch_semaphore_create(1);
 //            self.videoStitchSemaphore = dispatch_semaphore_create(1);
         } 
         } 
-        if (self.mode == SDK_CAPTURE_MODE_INTELLEGENCE_PANORAMA) {
-
+        if (self.mode == SDK_CAPTURE_MODE_INTELLEGENCE_PANORAMA && !self.isVideoStitchStopedWhenRecording) {
+            [LenStitcher videoResetPath];
+            LenzResourceItemModel *itemModel = [[LenzResourceItemModel alloc]init];
+            [self.resourceModel.panoramArray addObject:itemModel];
+            
             OperationNodeAIPanorama *aiPan = nil;
             OperationNodeAIPanorama *aiPan = nil;
             if ([self.currentOperationNode isKindOfClass:[OperationNodeAIPanorama class]]) {
             if ([self.currentOperationNode isKindOfClass:[OperationNodeAIPanorama class]]) {
                 aiPan = self.currentOperationNode;
                 aiPan = self.currentOperationNode;
@@ -1657,7 +1675,6 @@
             [self startMotion];
             [self startMotion];
 
 
         }
         }
-        [self.currentOperationNode takePhotoButtonTouched];
     }
     }
 
 
 }
 }
@@ -1878,7 +1895,7 @@
 - (void)updateNumberLabel {
 - (void)updateNumberLabel {
     switch (self.mode) {
     switch (self.mode) {
         case SDK_CAPTURE_MODE_CONTINUOUS: {
         case SDK_CAPTURE_MODE_CONTINUOUS: {
-            if (self.resourceModel.continousArray.count) {
+            if (self.resourceModel.continousArray.count > 0) {
                 self.numberOfImagesLabel.hidden = NO;
                 self.numberOfImagesLabel.hidden = NO;
                 self.numberOfImagesLabel.text = [NSString stringWithFormat:@"已连拍%ld张", self.resourceModel.continousArray.count];
                 self.numberOfImagesLabel.text = [NSString stringWithFormat:@"已连拍%ld张", self.resourceModel.continousArray.count];
             } else {
             } else {
@@ -1888,7 +1905,7 @@
             
             
             break;
             break;
         case SDK_CAPTURE_MODE_MOVIE:{
         case SDK_CAPTURE_MODE_MOVIE:{
-            if (self.resourceModel.movieArray.count) {
+            if (self.resourceModel.movieArray.count > 0) {
                 self.numberOfImagesLabel.hidden = NO;
                 self.numberOfImagesLabel.hidden = NO;
                 self.numberOfImagesLabel.text = [NSString stringWithFormat:@"已拍视频%ld条", self.resourceModel.movieArray.count];
                 self.numberOfImagesLabel.text = [NSString stringWithFormat:@"已拍视频%ld条", self.resourceModel.movieArray.count];
             } else {
             } else {
@@ -1899,7 +1916,7 @@
             break;
             break;
         case SDK_CAPTURE_MODE_PANORAMA:
         case SDK_CAPTURE_MODE_PANORAMA:
         {
         {
-            if (self.resourceModel.panoramArray.count) {
+            if (self.resourceModel.panoramArray.count > 0) {
                 self.numberOfImagesLabel.hidden = NO;
                 self.numberOfImagesLabel.hidden = NO;
                 self.numberOfImagesLabel.text = [NSString stringWithFormat:@"已拼接%ld张", self.resourceModel.panoramArray.count];
                 self.numberOfImagesLabel.text = [NSString stringWithFormat:@"已拼接%ld张", self.resourceModel.panoramArray.count];
             } else {
             } else {
@@ -1910,7 +1927,7 @@
             break;
             break;
         case SDK_CAPTURE_MODE_INTELLEGENCE_PANORAMA:
         case SDK_CAPTURE_MODE_INTELLEGENCE_PANORAMA:
         {
         {
-            if (self.resourceModel.aiPanoramArray.count) {
+            if (self.resourceModel.aiPanoramArray.count > 0) {
                 self.numberOfImagesLabel.hidden = NO;
                 self.numberOfImagesLabel.hidden = NO;
                 self.numberOfImagesLabel.text = [NSString stringWithFormat:@"已拼接%ld张", self.resourceModel.aiPanoramArray.count];
                 self.numberOfImagesLabel.text = [NSString stringWithFormat:@"已拼接%ld张", self.resourceModel.aiPanoramArray.count];
             } else {
             } else {
@@ -2294,60 +2311,66 @@
                                   isStop:self.isVideoStitchStopedWhenRecording
                                   isStop:self.isVideoStitchStopedWhenRecording
                                 complete:^(LenVideoStitchResult result, LenVideoStitchNeedSave needSave) {
                                 complete:^(LenVideoStitchResult result, LenVideoStitchNeedSave needSave) {
                 self.isVideoStitchStopedWhenRecording = NO;
                 self.isVideoStitchStopedWhenRecording = NO;
+                UIImage *image = [LenStitcher getCurrentPanoramaShowImage];
+                LenzResourceItemModel *model = nil;
+                if (self.mode == SDK_CAPTURE_MODE_PANORAMA) {
+                    model = self.resourceModel.panoramArray.lastObject;
+                } else if (self.mode == SDK_CAPTURE_MODE_INTELLEGENCE_PANORAMA) {
+                    model = self.resourceModel.aiPanoramArray.lastObject;
+                }
+                if (!image || !model) {
+                    return;
+                }
+
+                
                 if (result == LenVideoStitchResultSuccess) {
                 if (result == LenVideoStitchResultSuccess) {
                     dispatch_async(dispatch_get_main_queue(), ^{
                     dispatch_async(dispatch_get_main_queue(), ^{
                         
                         
-                        UIImage *image = [LenStitcher getCurrentPanoramaShowImage];
-                        
-                        LenzResourceItemModel *itemModel = [[LenzResourceItemModel alloc]init];
-                        
                         if (self.isStitchBigImage) {
                         if (self.isStitchBigImage) {
                             //保存大图拼接路径
                             //保存大图拼接路径
-                            itemModel.path = [LenStitcher getCurrentPanoramaShow];
+                            model.cameraType = [SDKParameters shared].cameraPositionString;
+                            model.mode = self.mode;
+                            model.image = image;
+                            model.path = [LenStitcher getCurrentPanoramaShow];
                             [self updateViewStatusWhenStitchSave:NO];
                             [self updateViewStatusWhenStitchSave:NO];
                             self.isStitchBigImage = NO;
                             self.isStitchBigImage = NO;
                             [self.panoramaGuideView clearImage];
                             [self.panoramaGuideView clearImage];
+                            [self updateViewStatus];
                             [self.panoramaGuideView showImageWith:nil dir:self.panoramOrientationGuideView.selectedItemIndex];
                             [self.panoramaGuideView showImageWith:nil dir:self.panoramOrientationGuideView.selectedItemIndex];
                         } else {
                         } else {
                             if (base.isRecording) {
                             if (base.isRecording) {
-                                if (needSave) {
-                                    NSString *path = [LenzDataManager saveImageWith:UIImageJPEGRepresentation(image, 1) mode:self.mode];
-                                    itemModel.path = path;
+                                if (needSave && [SDKParameters shared].keyFrame.boolValue) {
+                                    NSString *path = [LenzDataManager saveImageWith:UIImageJPEGRepresentation(image, .6) mode:self.mode];
+//                                    itemModel.path = path;
+                                    if (path) {
+                                        [model.keyFrame addObject:path];
+                                    }
+                                }
+                                if (self.panoramOrientationGuideView.selectedItemIndex != PanoramaOrientationViewAny) {
+                                    [self.panoramaGuideView showImageWith:image dir:self.panoramOrientationGuideView.selectedItemIndex];
+                                } else {
+                                    self.ablumImageView.hidden = NO;
+                                    self.ablumImageView.image = image;
                                 }
                                 }
-                                [self.panoramaGuideView showImageWith:image dir:self.panoramOrientationGuideView.selectedItemIndex];
                             }
                             }
 
 
                         }
                         }
-                        itemModel.cameraType = [SDKParameters shared].cameraPositionString;
-                        itemModel.mode = self.mode;
-                        itemModel.image = image;
-                        
-    //                    [self.resourceModel.lastShowArray addObject:image];
-                        switch (self.mode) {
-                            case SDK_CAPTURE_MODE_PANORAMA: {
-                                [self.resourceModel.panoramArray addObject:itemModel];
-                            }
-                                
-                                break;
-                            case SDK_CAPTURE_MODE_INTELLEGENCE_PANORAMA: {
-                                [self.resourceModel.aiPanoramArray addObject:itemModel];
-                            }
-                                break;
-                                
-                            default:
-                                break;
-                        }
                         self.resourceModel.lastIndex = self.mode;
                         self.resourceModel.lastIndex = self.mode;
-
-//                        if (!NSThread.isMainThread) {
-//                            dispatch_async(dispatch_get_main_queue(), ^{
-
-//                            });
-//                        }
                     });
                     });
-
+                } else {
+                    if (self.isStitchBigImage) {
+                        //保存大图拼接路径
+                        model.cameraType = [SDKParameters shared].cameraPositionString;
+                        model.mode = self.mode;
+                        model.image = image;
+                        model.path = [LenStitcher getCurrentPanoramaShow];
+                        [self updateViewStatusWhenStitchSave:NO];
+                        self.isStitchBigImage = NO;
+                        [self.panoramaGuideView clearImage];
+                        [self updateViewStatus];
+                        [self.panoramaGuideView showImageWith:nil dir:self.panoramOrientationGuideView.selectedItemIndex];
+                    }
                 }
                 }
-                NSLog(@"2222");
 //                dispatch_semaphore_signal(self.videoStitchSemaphore);
 //                dispatch_semaphore_signal(self.videoStitchSemaphore);
             }];
             }];
             
             

+ 3 - 0
SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/PCSBaseViewController/PCSPreviewViewController.m

@@ -313,14 +313,17 @@
 
 
 // 监听UIScrollView的滑动停止
 // 监听UIScrollView的滑动停止
 - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
 - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
+    self.playerIndexPath = nil;
      NSArray *indexPaths = [self.collectionView indexPathsForVisibleItems];
      NSArray *indexPaths = [self.collectionView indexPathsForVisibleItems];
      NSIndexPath *currentIndexPath = indexPaths.firstObject;
      NSIndexPath *currentIndexPath = indexPaths.firstObject;
      self.currentIndexPath = currentIndexPath;
      self.currentIndexPath = currentIndexPath;
     [self changeLabelStatusWith:currentIndexPath.section + 1];
     [self changeLabelStatusWith:currentIndexPath.section + 1];
     [self updateCountLabelWith:currentIndexPath];
     [self updateCountLabelWith:currentIndexPath];
+    [self.collectionView reloadData];
 }
 }
 
 
 - (void)updateViewWhenDelete {
 - (void)updateViewWhenDelete {
+    self.playerIndexPath = nil;
     NSArray *indexPaths = [self.collectionView indexPathsForVisibleItems];
     NSArray *indexPaths = [self.collectionView indexPathsForVisibleItems];
     NSIndexPath *currentIndexPath = indexPaths.firstObject;
     NSIndexPath *currentIndexPath = indexPaths.firstObject;
     self.currentIndexPath = currentIndexPath;
     self.currentIndexPath = currentIndexPath;

+ 12 - 11
SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/en.lproj/Localizable.strings

@@ -6,14 +6,15 @@
   
   
 */
 */
 
 
-"btn-title-confirm" = "Confirm";
-"btn-title-cancel" = "Cancel";
-"delete-image-alert-text" = "The operation cant be undone, r u sure to delete?";
-"number-of-movies" = "number of movies: %@";
-"number-of-photos" = "number of photos: %@";
-"mode-title-multiple" = "continuous";
-"mode-title-single" = "single";
-"mode-title-movie" = "movie";
-"mode-title-panoramic" = "panoramic";
-"mode-title-ai-panoramic" = "ai-panoramic";
-"tip-for-ai-panorama" = "long press to record, tap to take photo";
+
+"btn-title-confirm" = "确定";
+"btn-title-cancel" = "取消";
+"delete-image-alert-text" = "图片删除后无法恢复,请确认!";
+"number-of-photos" = "已连拍%@张";
+"mode-title-multiple" = "连拍模式";
+"mode-title-single" = "单拍模式";
+"mode-title-movie" = "视频模式";
+"number-of-movies" = "已拍视频%@条";
+"mode-title-panoramic" = "全景模式";
+"mode-title-ai-panoramic" = "智能全景模式";
+"tip-for-ai-panorama" = "单击拍照,长按全景";