Skip to content

Commit d08ded8

Browse files
author
ccharlesren
committed
Revert "Video 双向音视频断网重连:WIFI-WIFI切网拉流/推流成功率"
This reverts commit 4b8d855. Reason for revert: <暂时撤回> Change-Id: Ifacb6319401c95e34323ddafc2ba96f56fd09dc3
1 parent 4b8d855 commit d08ded8

File tree

2 files changed

+13
-39
lines changed

2 files changed

+13
-39
lines changed

Source/LinkApp/Classes/Module/EquipmentPanel/Controller/TIoTAVP2PPlayCaptureVC.m

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -704,28 +704,15 @@ - (void)hangupTapped { //挂断
704704

705705
//刷新播放器
706706
- (void)refreshPlayer {
707-
708-
if (self.player != nil) {
709-
_is_init_alert = NO;
710-
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
711-
[self preparePlayer];
712-
});
713-
714-
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
715-
self.resolutionRatio = [[TIoTP2PCommunicateUIManage sharedManager] getP2pCommunicateResolutionRatio];
716-
self.samplingRate = [[TIoTP2PCommunicateUIManage sharedManager] getP2pCommunicateSamplingRate];
717-
[self startAVCapture];
718-
});
719-
}
720-
// if (self.player != nil) {
721-
// _is_init_alert = NO;
722-
// [self preparePlayer];
723-
//
724-
// self.resolutionRatio = [[TIoTP2PCommunicateUIManage sharedManager] getP2pCommunicateResolutionRatio];
725-
// self.samplingRate = [[TIoTP2PCommunicateUIManage sharedManager] getP2pCommunicateSamplingRate];
726-
//
727-
// [self startAVCapture];
728-
// }
707+
if (self.player != nil) {
708+
_is_init_alert = NO;
709+
[self preparePlayer];
710+
711+
self.resolutionRatio = [[TIoTP2PCommunicateUIManage sharedManager] getP2pCommunicateResolutionRatio];
712+
self.samplingRate = [[TIoTP2PCommunicateUIManage sharedManager] getP2pCommunicateSamplingRate];
713+
714+
[self startAVCapture];
715+
}
729716
}
730717

731718
//是否在通话页面中

Source/LinkApp/Classes/Module/EquipmentPanel/Controller/TIoTPanelVC.m

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -927,11 +927,7 @@ - (void)starP2PServer {
927927
}
928928
}
929929
NSLog(@"_sys_xp2p_info xp2pValue : %@",xp2pValue);
930-
__block int errorcode = 0;
931-
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
932-
errorcode = [[TIoTCoreXP2PBridge sharedInstance] startAppWith:@"" sec_key:@"" pro_id:self.productId?:@"" dev_name:self.deviceName?:@"" xp2pinfo:xp2pValue];
933-
});
934-
// int errorcode = [[TIoTCoreXP2PBridge sharedInstance] startAppWith:@"" sec_key:@"" pro_id:self.productId?:@"" dev_name:self.deviceName?:@"" xp2pinfo:xp2pValue];
930+
int errorcode = [[TIoTCoreXP2PBridge sharedInstance] startAppWith:@"" sec_key:@"" pro_id:self.productId?:@"" dev_name:self.deviceName?:@"" xp2pinfo:xp2pValue];
935931

936932
if (errorcode == XP2P_ERR_VERSION) {
937933
UIAlertController *alertC = [UIAlertController alertControllerWithTitle:@"APP SDK 版本与设备端 SDK 版本号不匹配,版本号需前两位保持一致" message:nil preferredStyle:(UIAlertControllerStyleAlert)];
@@ -4010,10 +4006,7 @@ - (void)refushVideo:(NSNotification *)notify {
40104006
self.p2pReady = YES;
40114007

40124008
//APP侧断网刚重连p2p成功后 重新拉流/推流
4013-
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
4014-
[self refreshP2PPlayerAndStartCapture];
4015-
});
4016-
// [self refreshP2PPlayerAndStartCapture];
4009+
[self refreshP2PPlayerAndStartCapture];
40174010

40184011
// [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(startHungupAction) object:nil];
40194012
}
@@ -4163,10 +4156,7 @@ - (void)reconnectNetworkActioin {
41634156
//更新objectModel里的p2pinfo 重起p2p服务
41644157
//先stopService 防止 WIFI 4G互切问题
41654158
[[TIoTCoreXP2PBridge sharedInstance] stopService:self.deviceName?:@""];
4166-
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
4167-
[self restartP2PServer];
4168-
});
4169-
4159+
[self restartP2PServer];
41704160

41714161
}
41724162
// }
@@ -4234,10 +4224,7 @@ - (void)refreshP2PPlayerAndStartCapture {
42344224
[self getDeviceStatusWithType:action_voice qualityType:quality_standard completion:^(BOOL finished) {
42354225
if (finished) {
42364226
//当前如果还在通话页面,重连后刷新播放器
4237-
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
4238-
[[TIoTP2PCommunicateUIManage sharedManager] refreshP2PVideoPlayer];
4239-
// });
4240-
// [[TIoTP2PCommunicateUIManage sharedManager] refreshP2PVideoPlayer];
4227+
[[TIoTP2PCommunicateUIManage sharedManager] refreshP2PVideoPlayer];
42414228
}else {
42424229
[MBProgressHUD showMessage:NSLocalizedString(@"reconnectFail_check_device_status", @"重连失败,请检查设备状态") icon:@""];
42434230
}

0 commit comments

Comments
 (0)