huangxiaodong 1 anno fa
parent
commit
604f6d1f49

+ 0 - 14
创维盒子/双子星云手机/AppDelegate/AppDelegate.m

@@ -145,20 +145,6 @@
     
     [self imageLoadingSettings];
     
-    //写WebRct日志到本地
-    NSString *logFilePath = [kSHPath_logs stringByAppendingPathComponent:@"iOSWebRtc.log"];
-      
-    // 创建或打开文件
-    NSFileManager *fileManager = [NSFileManager defaultManager];
-    if (![fileManager fileExistsAtPath:logFilePath]) {
-        // 如果文件不存在,则创建它
-        if (![[NSFileManager defaultManager] createFileAtPath:logFilePath contents:nil attributes:nil]) {
-            HLog(@"Unable to create file: %@", logFilePath);
-        }
-    }
-    
-  
-    //_WebRtcLogger = [[RTC_OBJC_TYPE(RTCFileLogger) alloc] initWithDirPath:logFilePath maxFileSize:10*1024*1024];
     _WebRtcLogger = [[RTCFileLogger alloc] initWithDirPath:kSHPath_logs maxFileSize:10*1024*1024];
     HLog(@"_WebRtcLogger: %@", _WebRtcLogger);
     return YES;

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

@@ -309,7 +309,7 @@
         [self handleDatabaseArrAddObjectInFail:dataModel];
     }
     else{
-        [cachesFileManager writeLogsWithMsg:@"nasUploadFileChangeingOneFileFunBy else"];
+        //[cachesFileManager writeLogsWithMsg:@"nasUploadFileChangeingOneFileFunBy else"];
     }
 
     dataModel.bg_tableName = nasUpLoadFile_tableName;
@@ -317,15 +317,15 @@
         HLog(@"%@ 写入 %@", dataModel.filename, isSuccess ? @"成功":@"失败");
     }];
         
-    if(_databaseArr.count == 3)
-    {
-        NSMutableArray *ingArr = _databaseArr[0];
-       NSMutableArray* doneArr = _databaseArr[1];
-       NSMutableArray* failArr = _databaseArr[2];
-        
-        NSString *logstr = [[NSString alloc] initWithFormat:@"nasUploadFileChangeingOneFileFunBy ing:%ld,done:%ld,fail:%ld---total:%ld",ingArr.count,doneArr.count,failArr.count,ingArr.count + doneArr.count +failArr.count];
-        [cachesFileManager writeLogsWithMsg:logstr];
-    }
+//    if(_databaseArr.count == 3)
+//    {
+//        NSMutableArray *ingArr = _databaseArr[0];
+//       NSMutableArray* doneArr = _databaseArr[1];
+//       NSMutableArray* failArr = _databaseArr[2];
+//        
+//        NSString *logstr = [[NSString alloc] initWithFormat:@"nasUploadFileChangeingOneFileFunBy ing:%ld,done:%ld,fail:%ld---total:%ld",ingArr.count,doneArr.count,failArr.count,ingArr.count + doneArr.count +failArr.count];
+//        [cachesFileManager writeLogsWithMsg:logstr];
+//    }
     
     
     if(!_isSuspendType || dataModel.curUploadStateType != uploadStateSuspend){
@@ -350,24 +350,24 @@
             NSInteger atferDelCount = ingArr.count;
             
             if(count == atferDelCount){
-                NSString* logStr = [[NSString alloc] initWithFormat:@"DeleteObjectInUploading error begin %ld--model:%@--%@",ingArr.count,model,model.filename];
-                HLog(@"%@",logStr)
-                [cachesFileManager writeLogsWithMsg:logStr];
+//                NSString* logStr = [[NSString alloc] initWithFormat:@"DeleteObjectInUploading error begin %ld--model:%@--%@",ingArr.count,model,model.filename];
+//                HLog(@"%@",logStr)
+//                [cachesFileManager writeLogsWithMsg:logStr];
                 
                 for (uploadFileDataModel*preModel in ingArr) {
                     if(preModel.bg_id.integerValue == model.bg_id.integerValue){
                         if ([preModel.filename isEqualToString:model.filename]) {
                             [ingArr removeObject:preModel];
                         }else{
-                            NSString* logStr22 = [[NSString alloc] initWithFormat:@"filename error %@",preModel.filename];
-                            [cachesFileManager writeLogsWithMsg:logStr22];
+//                            NSString* logStr22 = [[NSString alloc] initWithFormat:@"filename error %@",preModel.filename];
+//                            [cachesFileManager writeLogsWithMsg:logStr22];
                         }
                         break;
                     }
                 }
                 NSString* logStr2 = [[NSString alloc] initWithFormat:@"DeleteObjectInUploading error end %ld",ingArr.count];
                 HLog(@"%@",logStr2)
-                [cachesFileManager writeLogsWithMsg:logStr2];
+                //[cachesFileManager writeLogsWithMsg:logStr2];
                 
             }
         }
@@ -705,15 +705,15 @@
 {
     [nasUploadFileManager shareInstance].needToReUploadTaskType = NO;
     HLog(@"reUploadFileFunByNetWork")
-    [cachesFileManager writeLogsWithMsg:@"reUploadFileFunByNetWork"];
+    //[cachesFileManager writeLogsWithMsg:@"reUploadFileFunByNetWork"];
     if(self.uploadingArr.count >0 && _databaseArr.count == 3){
         
-        NSMutableArray* doneArr = _databaseArr[1];
-        NSMutableArray* failArr = _databaseArr[2];
-        
-        NSString *logstr = [[NSString alloc] initWithFormat:@"ing:%ld,done:%ld,fail:%ld",self.uploadingArr.count,doneArr.count,failArr.count];
-        
-        [cachesFileManager writeLogsWithMsg:logstr];
+//        NSMutableArray* doneArr = _databaseArr[1];
+//        NSMutableArray* failArr = _databaseArr[2];
+//        
+//        NSString *logstr = [[NSString alloc] initWithFormat:@"ing:%ld,done:%ld,fail:%ld",self.uploadingArr.count,doneArr.count,failArr.count];
+//        
+//        [cachesFileManager writeLogsWithMsg:logstr];
         
         //1.修改状态从失败改为上传中
 //        for (uploadFileDataModel * model in _netWorkFailSaveArr) {

+ 1 - 0
创维盒子/双子星云手机/cloudPhone/cloudPhoneViewController.m

@@ -509,6 +509,7 @@
     if(vcArrs.count != 1){
         return;
     }
+    [cachesFileManager writeLogsWithMsg:@"webRtcPlayer push webRtcPlayerVC"];
     
     webRtcPlayerViewController *vc = [webRtcPlayerViewController new];
     vc.webRtcMsgMod = webRtcMsgMod;

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

@@ -125,6 +125,8 @@
     
     NSString *roomName = _webRtcMsgMod.data.uniqueIdentifier;
     
+    [cachesFileManager writeLogsWithMsg:@"webrtc channel startUploadChannel"];
+    
     //1.盒子开始写20秒日志
     [_mediaStream setCardLogToFile:@"/sdcard/webrtc_box.log" captureTime:@"20"];
     
@@ -144,6 +146,7 @@
     if(!_isChangeBoxType){
         //客户端停止写日志
         [ksharedAppDelegate.WebRtcLogger stop];
+        [cachesFileManager writeLogsWithMsg:@"webrtc channel relinkWebRtcFun"];
         [self beginToLinkWebRtcFun];
     }
 }
@@ -653,11 +656,11 @@
     
     if ((isBackupsingType || isUploadingType || isDownloadingType ||isNasDownloadingType) && isBackground) {
         HLog(@"后台保活中");
-        [cachesFileManager writeLogsWithMsg:@"Background working"];
+        //[cachesFileManager writeLogsWithMsg:@"Background working"];
     }
     else{
         HLog(@"停止后台保活");
-        [cachesFileManager writeLogsWithMsg:@"stop Background working"];
+        //[cachesFileManager writeLogsWithMsg:@"stop Background working"];
         [[AudioSessionObject shareManager] stopBackgroundActiveFun];
     }
     
@@ -917,6 +920,9 @@
 {
     HLog(@"channel P2P onChangeConnectionStateFromPeerName: state:%ld",state)
     self.ConnectionState = state;
+    
+    [cachesFileManager writeLogsWithMsg:[[NSString alloc] initWithFormat:@"webrtc channel onChangeConnectionStateFromPeerName:%ld",state]];
+    
     switch (state) {
         case RTCIceConnectionStateConnected:{
             //链接成功
@@ -948,6 +954,8 @@
 - (void)dataChannelDidChangeFromPeerName:(NSString*)peerName State:(RTCDataChannelState)state
 {
     HLog(@"webRtc P2P dataChannelDidChangeFromPeerName: state:%ld",state)
+    [cachesFileManager writeLogsWithMsg:[[NSString alloc] initWithFormat:@"webrtc channel dataChannelDidChangeFromPeerName:%ld",state]];
+    
     self.channelState = state;
     switch (state) {
         case RTCDataChannelStateConnecting:

+ 6 - 1
创维盒子/双子星云手机/webRtc/webRtcPlayerViewController+AppDelegate.m

@@ -19,6 +19,8 @@
     //  app进入后台时
     [self pauseStream];
     [self checkLanAndPrivacyModeTypeFun];
+    
+    [cachesFileManager writeLogsWithMsg:@"applicationDidEnterBackground"];
 }
 
 - (void)applicationDidBecomeActive:(NSNotification *)notification
@@ -28,13 +30,16 @@
         //[self resumeStream];
         [self relinkWebRtcFunByBecomeActive];
     }
-
+    
+    [cachesFileManager writeLogsWithMsg:@"applicationDidBecomeActive"];
 }
 
 - (void)applicationWillTerminate:(UIApplication *)application {
     // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
     
     [self.mediaStream disconnect];
+    
+    [cachesFileManager writeLogsWithMsg:@"applicationWillTerminate"];
 }
 
 #pragma mark 云机停止拉流

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

@@ -213,6 +213,8 @@
     //filePathName = /sdcard/webrtc_box.log    captureTime = 30s
     [_mediaStream setCardLogToFile:@"/sdcard/webrtc_box.log" captureTime:@"20"];
 
+    [cachesFileManager writeLogsWithMsg:@"webRtcPlayer start link"];
+    
     //2.客户端开始写日志
     [ksharedAppDelegate.WebRtcLogger start];
     
@@ -253,7 +255,7 @@
     }
     
     HLog(@"发起重连 ......")
-    
+    [cachesFileManager writeLogsWithMsg:@"webRtcPlayer relinkWebRtcFun"];
     KWeakSelf
     mainBlock(^{
         [weakSelf showNewIndicatorWithCanBack:YES canTouch:NO];
@@ -566,6 +568,8 @@
 #pragma mark p2p通道 重启云机
 - (void)needToRebootFun
 {
+    [cachesFileManager writeLogsWithMsg:@"webRtcPlayer click Reboot"];
+    
     [[webRtcManager shareManager] needToRebootFun];
     
     [self startForceStartTimerFun];
@@ -624,7 +628,7 @@
 #pragma mark 退出云机
 - (void)exitCloudPhoneFun
 {
-    
+    [cachesFileManager writeLogsWithMsg:@"webRtcPlayer click exitCloudPhone"];
     //[self setShowImgAndVoiceTypeFun:NO];
     
     if(isLan){//保证竖屏
@@ -726,6 +730,7 @@
     if(logoutAlertVC){
         return;
     }
+    [cachesFileManager writeLogsWithMsg:@"webRtcPlayer LogoutByOtherFun"];
     
     NSString *curOaidStr = [RcGameWQKeyChain getOaidStringFun];
     
@@ -1057,6 +1062,7 @@
 #pragma mark - 宽高变化
 -(void)onFrameResolutionChangedFromPeerName:(NSString*)peerName videoWidth:(int)videoWidth videoHeight:(int)videoHeight rotation:(int)rotation {
     HLog(@"推拉流 onFrameResolutionChangedFromPeerName:%@---%d---%d--%d",peerName,videoWidth,videoHeight,rotation)
+    [cachesFileManager writeLogsWithMsg:[[NSString alloc] initWithFormat:@"webRtcPlayer onFrameResolutionChangedFromPeerName:%@",peerName]];
     
     HLog(@"ok _mediaStream:%@",_mediaStream)
     mainBlock(^{
@@ -1068,12 +1074,18 @@
 -(void)onAuthResultFromPeerName:(NSString*)peerName code:(int)code descriptions:(NSString*)descriptions
 {
     HLog(@"onAuthResultFromPeerName:%@---%d---%@",peerName,code,descriptions)
+    
+    [cachesFileManager writeLogsWithMsg:[[NSString alloc] initWithFormat:@"webRtcPlayer onAuthResultFromPeerName:%d--%@",code,descriptions]];
 }
 
 #pragma mark 链接发生变化
 -(void)onChangeConnectionStateFromPeerName:(NSString*)peerName didChangeIceConnectionState:(RTCIceConnectionState)state
 {
     HLog(@"推拉流 onChangeConnectionStateFromPeerName: state:%ld",state)
+    
+    [cachesFileManager writeLogsWithMsg:[[NSString alloc] initWithFormat:@"webRtcPlayer onChangeConnectionStateFromPeerName:%ld",state]];
+
+    
     _linkState = state;
     switch (state) {
         case RTCIceConnectionStateConnected:{
@@ -1111,6 +1123,7 @@
 - (void)dataChannelDidChangeFromPeerName:(NSString*)peerName State:(RTCDataChannelState)state;
 {
     HLog(@"推拉流 dataChannelDidChangeFromPeerName: state:%ld",state)
+    [cachesFileManager writeLogsWithMsg:[[NSString alloc] initWithFormat:@"webRtcPlayer dataChannelDidChangeFromPeerName:%ld",state]];
     switch (state) {
         case RTCDataChannelStateConnecting:
             {