浏览代码

合并代码

huangxiaodong 11 月之前
父节点
当前提交
fdcd164332

+ 2 - 2
创维盒子/双子星云手机.xcodeproj/project.pbxproj

@@ -6214,7 +6214,7 @@
 				CODE_SIGN_ENTITLEMENTS = "隐私保护.entitlements";
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 16;
+				CURRENT_PROJECT_VERSION = 18;
 				DEVELOPMENT_TEAM = 6SV76WTUUR;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -6293,7 +6293,7 @@
 				CODE_SIGN_ENTITLEMENTS = "隐私保护.entitlements";
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 16;
+				CURRENT_PROJECT_VERSION = 18;
 				DEVELOPMENT_TEAM = 6SV76WTUUR;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",

+ 1 - 1
创维盒子/双子星云手机/Class/Set/CustomerWebViewController.m

@@ -283,7 +283,7 @@
     NSString*filename = [[NSString alloc] initWithFormat:@"%@_ios.log",snStr];
     
     [paraDict setValue:filename forKey:@"filename"];
-    [paraDict setValue:@1 forKey:@"days"];
+    [paraDict setValue:@7 forKey:@"days"];
     
     KWeakSelf
     [[netWorkManager shareInstance] doUploadFileToFileServiceWithParams:paraDict data:logData success:^(id  _Nonnull responseObject) {

+ 4 - 4
创维盒子/双子星云手机/CloudPlayer/View/playerSetView.m

@@ -577,14 +577,14 @@
 {
     //网络延迟: [0, 50ms)= 绿色 #22A082 ,[50ms, 100ms= 黄色, [100ms, ∞)= 红色 #FF2855
     
-    if (delayedMS < 50) {
-        _delayedLabel.textColor = [UIColor hwColor:@"22A082"];
+    if (delayedMS >= 100) {
+        _delayedLabel.textColor = [UIColor hwColor:@"#FF2855"];
     }
-    else if (delayedMS < 100){
+    else if (delayedMS >= 50){
         _delayedLabel.textColor = [UIColor yellowColor];
     }
     else{
-        _delayedLabel.textColor = [UIColor hwColor:@"#FF2855"];
+        _delayedLabel.textColor = [UIColor hwColor:@"22A082"];
     }
     
     if(delayedMS >= 1000){

+ 5 - 5
创维盒子/双子星云手机/NAS/nasBackupsManager/nasMixBackupsManager.m

@@ -24,7 +24,7 @@
 
 @implementation nasMixBackupsManager
 + (instancetype)shareManager {
-    static nasMixUploadManager *_instance;
+    static nasMixBackupsManager *_instance;
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
         _instance = [[self alloc] init];
@@ -59,7 +59,7 @@
         
         //1. 排查上传中
         for (customUploadOperation *operationDoing in self.uploadingOperationArr) {
-            if([operationDoing.fileModel.filename isEqualToString:model.filename]){
+            if([operationDoing.fileModel.localIdentifier isEqualToString:model.localIdentifier]){
                 needAddType = NO;
                 break;
             }
@@ -67,7 +67,7 @@
         
         //1. 排查等待下载
         for (uploadFileDataModel *waitModel in self.uploadWaitingUrlArr) {
-            if([waitModel.filename isEqualToString:model.filename]){
+            if([waitModel.localIdentifier isEqualToString:model.localIdentifier]){
                 needAddType = NO;
                 break;
             }
@@ -792,14 +792,14 @@ didReceiveResponse:(NSURLResponse *)response
     HLog(@"取消任务-- %@--%@",fileModel.filename,fileModel.taskId)
     @synchronized (self) {
         for (uploadFileDataModel*waitModel in _uploadWaitingUrlArr) {
-            if([waitModel.filename isEqualToString:fileModel.filename]){
+            if([waitModel.localIdentifier isEqualToString:fileModel.localIdentifier]){
                 [_uploadWaitingUrlArr removeObject:waitModel];
                 return;
             }
         }
         
         for (customUploadOperation*operation in _uploadingOperationArr) {
-            if([operation.fileModel.filename isEqualToString:fileModel.filename]){
+            if([operation.fileModel.localIdentifier isEqualToString:fileModel.localIdentifier]){
                 operation.isCancelType = YES;
                 [operation.dataTask cancel];
                 [_uploadingOperationArr removeObject:operation];

+ 1 - 1
创维盒子/双子星云手机/NAS/nasUploadManager/customUploadOperation.h

@@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface customUploadOperation : NSObject
 
-@property(nonatomic,weak) uploadFileDataModel *fileModel;
+@property(nonatomic,strong) uploadFileDataModel *fileModel;
 @property(nonatomic,copy) NSString *filePath;
 @property(nonatomic,strong)NSFileHandle *fileHandle;
 

+ 118 - 108
创维盒子/双子星云手机/NAS/nasUploadManager/nasMixUploadManager.m

@@ -19,7 +19,6 @@
 //正在下载的上传地址数组
 @property(nonatomic,strong) NSMutableArray *uploadingOperationArr;
 
-@property(nonatomic,strong)NSLock  *arrayLock;//数组遍历是修改会挂掉
 @end
 
 @implementation nasMixUploadManager
@@ -37,7 +36,6 @@
     if (self = [super init]) {
         _maxUploadLoadCount = 2;
         
-        _arrayLock = [NSLock new];
         //[self registeNotification];
     }
     return self;
@@ -53,7 +51,7 @@
         
         //1. 排查上传中
         for (customUploadOperation *operationDoing in self.uploadingOperationArr) {
-            if([operationDoing.fileModel.filename isEqualToString:model.filename]){
+            if([operationDoing.fileModel.localIdentifier isEqualToString:model.localIdentifier]){
                 needAddType = NO;
                 break;
             }
@@ -61,7 +59,7 @@
         
         //1. 排查等待下载
         for (uploadFileDataModel *waitModel in self.uploadWaitingUrlArr) {
-            if([waitModel.filename isEqualToString:model.filename]){
+            if([waitModel.localIdentifier isEqualToString:model.localIdentifier]){
                 needAddType = NO;
                 break;
             }
@@ -106,12 +104,20 @@
     
     if(operation){
         HLog(@"删除完成的上传任务")
-        [_arrayLock lock];
-        if(operation.fileHandle){
-            [operation closeFileHandleFun];
+        
+//        if([operation.fileModel.filename isEqualToString:@"IMG_8876.PNG"]){
+//            HLog(@"uploadWaitingUrlArr -- count:%ld",self.uploadWaitingUrlArr.count)
+//            for(uploadFileDataModel*model in self.uploadWaitingUrlArr){
+//                HLog(@"fileName--%@--%ld",model.filename,model.totalBytes)
+//            }
+//        }
+        
+        @synchronized (self) {
+            if(operation.fileHandle){
+                [operation closeFileHandleFun];
+            }
+            [self.uploadingOperationArr removeObject:operation];
         }
-        [self.uploadingOperationArr removeObject:operation];
-        [_arrayLock unlock];
     }
     
     if(self.uploadingOperationArr.count == _maxUploadLoadCount){
@@ -129,46 +135,48 @@
     //新添加的任务
     NSMutableArray *newTaskArr = [NSMutableArray new];
     
-    [_arrayLock lock];
-    for (int i=0; i<canAddTaskNumber; i++) {
-        
-        if(self.uploadWaitingUrlArr.count >= 1){
-            //创建上传任务
-            uploadFileDataModel *WaitingModel = self.uploadWaitingUrlArr.firstObject;
-            
-            customUploadOperation * operation =  [customUploadOperation new];
-            operation.fileModel = WaitingModel;
-            
-            //等待下载中的任务
-            [self.uploadWaitingUrlArr removeObjectAtIndex:0];
-            
-            HLog(@"添加一个新的上传任务 %@",self.uploadingOperationArr)
-            //添加到下载中数组
-            [self.uploadingOperationArr addObject:operation];
+    @synchronized (self) {
+        for (int i=0; i<canAddTaskNumber; i++) {
             
-            //[self checkFileUploadStateWithOperation:operation];
-            
-            [newTaskArr addObject:operation];
+            if(self.uploadWaitingUrlArr.count >= 1){
+                //创建上传任务
+                uploadFileDataModel *WaitingModel = self.uploadWaitingUrlArr.firstObject;
+                
+                customUploadOperation * operation =  [customUploadOperation new];
+                operation.fileModel = WaitingModel;
+                
+                //等待下载中的任务
+                [self.uploadWaitingUrlArr removeObjectAtIndex:0];
+                
+                HLog(@"添加一个新的上传任务 %@",self.uploadingOperationArr)
+                //添加到下载中数组
+                [self.uploadingOperationArr addObject:operation];
+                
+                //[self checkFileUploadStateWithOperation:operation];
+                
+                [newTaskArr addObject:operation];
+                
+                //[weakSelf handleTaskDidUploadWith:operation withState:state];
+            }
             
-            //[weakSelf handleTaskDidUploadWith:operation withState:state];
         }
         
+        //开始检测新的上传任务
+        for (customUploadOperation * operation  in newTaskArr) {
+            [self checkFileUploadStateWithOperation:operation];
+        }
+        
+        [newTaskArr removeAllObjects];
+        
     }
     
-    //开始检测新的上传任务
-    for (customUploadOperation * operation  in newTaskArr) {
-        [self checkFileUploadStateWithOperation:operation];
-    }
-    
-    [newTaskArr removeAllObjects];
-    
-    [_arrayLock unlock];
-    
 }
 
 #pragma mark 检测文件是否上传过了
 - (void)checkFileUploadStateWithOperation:(customUploadOperation*)operation
 {
+    HLog(@"%@检测文件是否过--%ld",operation.fileModel.filename,operation.fileModel.totalBytes)
+    
     NSMutableDictionary*paraDict = [NSMutableDictionary new];
     
     //operation.fileModel.filename = @"Img_4107.png";// test same name file
@@ -224,6 +232,7 @@
     operation.fileModel.taskId = model.data.fileTaskId;
     
     if(!model.data.exist){//未上传过
+        HLog(@"%@检测到文件未上传过--%ld",operation.fileModel.filename,operation.fileModel.totalBytes)
         [self prepareToUploadFileWithOperation:operation];
     }
     else if(model.data.isComplete){//上传过了 并且文件上传完了
@@ -236,16 +245,22 @@
 //            [self prepareToUploadFileWithOperation:operation];
 //        }
         
+        HLog(@"%@检测到文件上传完成--%ld",operation.fileModel.filename,operation.fileModel.totalBytes)
+        
         //修复同名文件丢失问题
         if(model.data.size == operation.fileModel.totalBytes){//上传完了
+            HLog(@"1111111")
             [self handleFileDidUploadFunWithOperation:operation];
         }
         else{//同名文件 处理
+            HLog(@"2222222")
             [self prepareToUploadFileWithOperation:operation];
         }
         
     }
     else{//上传过了 未上传完成
+        HLog(@"%@检测到文件上传过了 未上传完成--%ld",operation.fileModel.filename,operation.fileModel.totalBytes)
+        
         operation.fileModel.didUploadBytes = model.data.size;
         [self prepareToUploadFileWithOperation:operation];
     }
@@ -364,6 +379,7 @@
             operation.fileModel.imageData = imageData;
         }
         
+        HLog(@"%@开始上传--%ld",operation.fileModel.filename,operation.fileModel.totalBytes)
         
         NSData *curData = operation.fileModel.imageData;
         operation.onceDataLengt = [curData length];
@@ -375,7 +391,7 @@
         [self startUpload:paraDict operation:operation data:curData success:^(id  _Nonnull responseObject) {
             frpUploadModel *model = [[frpUploadModel alloc] initWithDictionary:responseObject error:nil];
             if(model && model.position == operation.fileModel.totalBytes && model.position != 0){
-                HLog(@"%@上传完成 000",operation.fileModel.filename)
+                HLog(@"%@上传完成 000---%ld",operation.fileModel.filename,operation.fileModel.totalBytes)
                 [weakSelf handleUploadDoneOneFileBy:operation];
             }
             else{
@@ -838,39 +854,39 @@ didReceiveResponse:(NSURLResponse *)response
     // 32768 = 32KB
     HLog(@"didSendBodyData: %lld--%lld-%lld", bytesSent, totalBytesSent, totalBytesExpectedToSend);
     
-    [_arrayLock lock];
-    for (customUploadOperation*operation in _uploadingOperationArr) {
-        HLog(@"正在遍历数组 _uploadingOperationArr:%@",_uploadingOperationArr);
-        
-        if(operation.dataTask == task){
-            operation.fileModel.didUploadBytes += bytesSent;
+    @synchronized (self) {
+        for (customUploadOperation*operation in _uploadingOperationArr) {
+            HLog(@"正在遍历数组 _uploadingOperationArr:%@",_uploadingOperationArr);
             
-            //调整下大小 因为上传的数据 除了data 长度 还包含了 参数大小
-            if(totalBytesSent == totalBytesExpectedToSend){
-                operation.fileModel.didUploadBytes -= (totalBytesExpectedToSend - operation.onceDataLengt);
-            }
-            
-            NSTimeInterval curTime = [[NSDate date] timeIntervalSince1970];
-            NSTimeInterval timeDiff = curTime - operation.preNotTimeInterval;
-            
-            //HLog(@"控制刷新时间为1秒:%f",timeDiff);
-            
-            CGFloat RefreshTimer = 0.8;
-            if(operation.fileModel.totalBytes <= 5*1024*1024){//小于5M 事实
-                RefreshTimer = 0.2;
-            }
-            
-            if (operation.preNotTimeInterval <= 0
-                || timeDiff > RefreshTimer ) {
+            if(operation.dataTask == task){
+                operation.fileModel.didUploadBytes += bytesSent;
+                
+                //调整下大小 因为上传的数据 除了data 长度 还包含了 参数大小
+                if(totalBytesSent == totalBytesExpectedToSend){
+                    operation.fileModel.didUploadBytes -= (totalBytesExpectedToSend - operation.onceDataLengt);
+                }
+                
+                NSTimeInterval curTime = [[NSDate date] timeIntervalSince1970];
+                NSTimeInterval timeDiff = curTime - operation.preNotTimeInterval;
                 
-                operation.preNotTimeInterval = curTime;
-                [[NSNotificationCenter defaultCenter] postNotificationName:uploadFileUploadingNotification object:operation.fileModel];
+                //HLog(@"控制刷新时间为1秒:%f",timeDiff);
+                
+                CGFloat RefreshTimer = 0.8;
+                if(operation.fileModel.totalBytes <= 5*1024*1024){//小于5M 事实
+                    RefreshTimer = 0.2;
+                }
+                
+                if (operation.preNotTimeInterval <= 0
+                    || timeDiff > RefreshTimer ) {
+                    
+                    operation.preNotTimeInterval = curTime;
+                    [[NSNotificationCenter defaultCenter] postNotificationName:uploadFileUploadingNotification object:operation.fileModel];
+                }
+                
+                break;
             }
-            
-            break;
         }
     }
-    [_arrayLock unlock];
 }
 
 #pragma mark 取消单个任务
@@ -878,38 +894,32 @@ didReceiveResponse:(NSURLResponse *)response
 {
     HLog(@"取消任务-- %@--%@",fileModel.filename,fileModel.taskId)
     
-    BOOL didUnLockType = NO;
-    [_arrayLock lock];
-    
-    for (customUploadOperation*operation in _uploadingOperationArr) {
-        HLog(@"正在遍历数组 _uploadingOperationArr:%@",_uploadingOperationArr);
-        if([operation.fileModel.filename isEqualToString:fileModel.filename]){
-            operation.isCancelType = YES;
-            [operation.dataTask cancel];
-            
-            if(operation.fileHandle){
-                [operation closeFileHandleFun];
+    @synchronized (self) {
+        
+        for (customUploadOperation*operation in _uploadingOperationArr) {
+            HLog(@"正在遍历数组 _uploadingOperationArr:%@",_uploadingOperationArr);
+            if([operation.fileModel.localIdentifier isEqualToString:fileModel.localIdentifier]){
+                operation.isCancelType = YES;
+                [operation.dataTask cancel];
+                
+                if(operation.fileHandle){
+                    [operation closeFileHandleFun];
+                }
+                
+                [self beginUploadAfterDeleteOperationBy:operation];
+                return;
             }
-            
-            didUnLockType = YES;
-            [_arrayLock unlock];
-            [self beginUploadAfterDeleteOperationBy:operation];
-            return;
         }
-    }
-    
-    for (uploadFileDataModel*waitModel in _uploadWaitingUrlArr) {
-        if([waitModel.filename isEqualToString:fileModel.filename]){
-            [_uploadWaitingUrlArr removeObject:waitModel];
-            didUnLockType = YES;
-            [_arrayLock unlock];
-            [self beginUploadAfterDeleteOperationBy:nil];
-            return;
+        
+        for (uploadFileDataModel*waitModel in _uploadWaitingUrlArr) {
+            if(//[waitModel.filename isEqualToString:fileModel.filename]
+               [waitModel.localIdentifier isEqualToString:fileModel.localIdentifier]){
+                [_uploadWaitingUrlArr removeObject:waitModel];
+                [self beginUploadAfterDeleteOperationBy:nil];
+                return;
+            }
         }
-    }
-    
-    if (!didUnLockType) {
-        [_arrayLock unlock];
+        
     }
 }
 
@@ -917,20 +927,20 @@ didReceiveResponse:(NSURLResponse *)response
 - (void)cancelUploadAllTaskFun
 {
     HLog(@"取消所有任务")
-    [_arrayLock lock];
-    [_uploadWaitingUrlArr removeAllObjects];
-    
-    for (customUploadOperation*operation in _uploadingOperationArr) {
-        HLog(@"正在遍历数组 _uploadingOperationArr:%@",_uploadingOperationArr);
-        operation.isCancelType = YES;
-        [operation.dataTask cancel];
-        if(operation.fileHandle){
-            [operation closeFileHandleFun];
+    @synchronized (self) {
+        [_uploadWaitingUrlArr removeAllObjects];
+        
+        for (customUploadOperation*operation in _uploadingOperationArr) {
+            HLog(@"正在遍历数组 _uploadingOperationArr:%@",_uploadingOperationArr);
+            operation.isCancelType = YES;
+            [operation.dataTask cancel];
+            if(operation.fileHandle){
+                [operation closeFileHandleFun];
+            }
         }
+        
+        [_uploadingOperationArr removeAllObjects];
     }
-    
-    [_uploadingOperationArr removeAllObjects];
-    [_arrayLock unlock];
 }
 
 

+ 2 - 1
创维盒子/双子星云手机/NAS/nasUploadManager/nasUploadFileManager.m

@@ -356,7 +356,8 @@
                 
                 for (uploadFileDataModel*preModel in ingArr) {
                     if(preModel.bg_id.integerValue == model.bg_id.integerValue){
-                        if ([preModel.filename isEqualToString:model.filename]) {
+                        if (//[preModel.filename isEqualToString:model.filename]&&
+                            [preModel.localIdentifier isEqualToString:model.localIdentifier]) {
                             [ingArr removeObject:preModel];
                         }else{
 //                            NSString* logStr22 = [[NSString alloc] initWithFormat:@"filename error %@",preModel.filename];

+ 1 - 1
创维盒子/双子星云手机/netWork/addLog/addLogObject.m

@@ -102,7 +102,7 @@ static addLogObject *addlog_ShareInstance = nil;
     NSString*filename = [[NSString alloc] initWithFormat:@"%@_ios.log",snStr];
     
     [paraDict setValue:filename forKey:@"filename"];
-    [paraDict setValue:@1 forKey:@"days"];
+    [paraDict setValue:@7 forKey:@"days"];
     
     [[netWorkManager shareInstance] doUploadFileToFileServiceWithParams:paraDict data:logData success:^(id  _Nonnull responseObject) {
         HLog(@"%@",responseObject);

+ 1 - 1
创维盒子/双子星云手机/webRtc/WebRTC.framework/Headers/WebRTC.h

@@ -1,5 +1,5 @@
 /*
- *  Copyright 2024 The WebRTC project authors. All Rights Reserved.
+ *  Copyright 2025 The WebRTC project authors. All Rights Reserved.
  *
  *  Use of this source code is governed by a BSD-style license
  *  that can be found in the LICENSE file in the root of the source

二进制
创维盒子/双子星云手机/webRtc/WebRTC.framework/WebRTC


+ 2 - 2
创维盒子/双子星云手机/webRtc/WebRTC.framework/_CodeSignature/CodeResources

@@ -366,7 +366,7 @@
 		</data>
 		<key>Headers/WebRTC.h</key>
 		<data>
-		gz2t1AiUs+38t0gRjj0PJfjedGg=
+		mS/wPCok/B3ne8ZoGIdPmEuWwcQ=
 		</data>
 		<key>Info.plist</key>
 		<data>
@@ -1017,7 +1017,7 @@
 		<dict>
 			<key>hash2</key>
 			<data>
-			fDAOLmh607fqvQg5x4gh4Okj4uU8IRzhYgqfk+U7Dqo=
+			CJ38D+h0rvIP7EeXTDSUn+6bWykSQP4Lh2chAlf3vi8=
 			</data>
 		</dict>
 		<key>Modules/module.modulemap</key>

+ 15 - 2
创维盒子/双子星云手机/webRtc/webRtcPlayerViewController.m

@@ -360,8 +360,8 @@
     [self initPointForControlBtnFun];
     
     _testLostLabel = [[UILabel alloc] init];
-    _testLostLabel.textColor = [UIColor yellowColor];
-    _testLostLabel.textAlignment = NSTextAlignmentCenter;
+    _testLostLabel.textColor = [UIColor greenColor];
+    //_testLostLabel.textAlignment = NSTextAlignmentCenter;
     _testLostLabel.font = [UIFont systemFontOfSize:14.0];
     _testLostLabel.numberOfLines = 0;
     [self.view addSubview:_testLostLabel];
@@ -1342,6 +1342,19 @@
             //FPS
             __block NSString*lostDataStr = [[NSString alloc] initWithFormat:@"总包数:%ld --总丢包数:%ld--3秒接受到包数:%ld---3秒丢包数:%ld---3秒丢包率:%0.2f%%",lasPacketsReceived,lastAlllostData,(NSInteger)NsecondReceivedData,(NSInteger)NsecondLostData,prelostRate];
             
+            webrtcServerModel * webrtcServerMod = ksharedAppDelegate.bestWebrtcServerModel;
+            NSMutableString *signallingUrl = [[NSMutableString alloc] initWithFormat:@"当前使用:%@:%@--\n%@:%@--%.0fms\n\n",webrtcServerMod.signallingIp,webrtcServerMod.signallingPort,webrtcServerMod.turnIp,webrtcServerMod.turnPort,webrtcServerMod.delayedms];
+           
+            for (webrtcServerModel *model in ksharedAppDelegate.DeviceWebRtcMsgMod.data.webrtcServerList) {
+                NSString *curStr = [[NSMutableString alloc] initWithFormat:@"%@:%@--\n%@:%@--%.0fms\n",model.signallingIp,model.signallingPort,model.turnIp,model.turnPort,model.delayedms];
+                
+                [signallingUrl appendString:curStr];
+            }
+            
+            
+            
+            lostDataStr = [[NSString alloc] initWithFormat:@"%@\n%@",lostDataStr,signallingUrl];
+            
             mainBlock(^{
                 self->_testLostLabel.text = lostDataStr;
             });