Skip to content

Commit 343e610

Browse files
committed
合并ipc双向音视频需求
Change-Id: Ib6dc9a9d0b24dd6d93875770c6504934920c3f43
2 parents e374bfb + 0a316f8 commit 343e610

File tree

14 files changed

+1517
-9
lines changed

14 files changed

+1517
-9
lines changed

Source/LinkSDKDemo/Video/DeviceHomeList/Controller/TIoTDemoHomeViewController.m

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#import "TIoTDemoNVRSubDeviceVC.h"
2525
#import "TIoTDemoPlaybackVC.h"
2626
#import "TIoTDemoPreviewMJPEGVC.h"
27+
#import "TIoTDemoVideoCallVC.h"
28+
#import "TIoTDemoVideoPushVC.h"
2729

2830
static NSInteger const maxLimitDeviceNumber = 4;
2931
static NSString *const kVideoDeviceListCellID = @"kVideoDeviceListCellID";
@@ -230,7 +232,7 @@ - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collection
230232

231233
TIoTDemoCustomSheetView *customActionSheet = [[TIoTDemoCustomSheetView alloc]init];
232234
cell.moreActionBlock = ^{
233-
NSArray *actionTitleArray = @[@"预览",@"回放",@"图片流(mjpeg)",@"取消"];
235+
NSArray *actionTitleArray = @[@"预览", @"IPC双向通话", @"IPC双向通话-只推流", @"回放",@"图片流(mjpeg)",@"取消"];
234236

235237
ChooseFunctionBlock previewVideoBlock = ^(TIoTDemoCustomSheetView *view){
236238
DDLogVerbose(@"预览");
@@ -243,6 +245,29 @@ - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collection
243245
[customActionSheet removeFromSuperview];
244246
};
245247

248+
ChooseFunctionBlock videoCallBlock = ^(TIoTDemoCustomSheetView *view){
249+
DDLogVerbose(@"IPC双向通话");
250+
251+
TIoTDemoVideoCallVC *previewDeviceVC = [[TIoTDemoVideoCallVC alloc]init];
252+
previewDeviceVC.selectedModel = model;
253+
previewDeviceVC.isNVR = NO;
254+
[weakSelf.navigationController pushViewController:previewDeviceVC animated:YES];
255+
[weakSelf resetDeviceListStatus];
256+
[customActionSheet removeFromSuperview];
257+
};
258+
259+
ChooseFunctionBlock videoPushBlock = ^(TIoTDemoCustomSheetView *view){
260+
DDLogVerbose(@"IPC双向通话");
261+
262+
TIoTDemoVideoPushVC *previewDeviceVC = [[TIoTDemoVideoPushVC alloc]init];
263+
previewDeviceVC.selectedModel = model;
264+
previewDeviceVC.isNVR = NO;
265+
[weakSelf.navigationController pushViewController:previewDeviceVC animated:YES];
266+
[weakSelf resetDeviceListStatus];
267+
[customActionSheet removeFromSuperview];
268+
};
269+
270+
246271
ChooseFunctionBlock playbackVideoBlock = ^(TIoTDemoCustomSheetView *view){
247272
DDLogVerbose(@"回放");
248273
TIoTExploreOrVideoDeviceModel *model = weakSelf.dataArray[indexPath.row];
@@ -278,7 +303,7 @@ - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collection
278303
DDLogVerbose(@"取消");
279304
[view removeFromSuperview];
280305
};
281-
NSArray *actionBlockArray = @[previewVideoBlock,playbackVideoBlock,mjpegVideoBlock,cancelBlock];
306+
NSArray *actionBlockArray = @[previewVideoBlock, videoCallBlock, videoPushBlock, playbackVideoBlock,mjpegVideoBlock,cancelBlock];
282307

283308

284309
[customActionSheet sheetViewTopTitleArray:actionTitleArray withMatchBlocks:actionBlockArray];

Source/LinkSDKDemo/Video/P2P/Controller/TIoTDemoPreviewDeviceVC.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,13 +1137,13 @@ -(void)installMovieNotificationObservers
11371137
if (self.isNVR == NO) {
11381138
[[NSNotificationCenter defaultCenter] addObserver:self
11391139
selector:@selector(refushVideo:)
1140-
name:@"xp2preconnect"
1140+
name:TIoTCoreXP2PBridgeNotificationReady
11411141
object:nil];
11421142

11431143
}
11441144
[[NSNotificationCenter defaultCenter] addObserver:self
11451145
selector:@selector(responseP2PdisConnect:)
1146-
name:@"xp2disconnect"
1146+
name:TIoTCoreXP2PBridgeNotificationDisconnect
11471147
object:nil];
11481148
}
11491149

@@ -1170,7 +1170,7 @@ - (void)refushVideo:(NSNotification *)notify {
11701170
return;
11711171
}
11721172

1173-
[MBProgressHUD show:[NSString stringWithFormat:@"%@ 通道建立成功",selectedName] icon:@"" view:self.view];
1173+
[MBProgressHUD show:[NSString stringWithFormat:@"%@ 本地服务已ready,可发起拉流或推流",selectedName] icon:@"" view:self.view];
11741174

11751175
//计算IPC打洞时间
11761176
self.endIpcP2P = CACurrentMediaTime();
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//
2+
// TIoTDemoVideoCallVC.h
3+
// LinkSDKDemo
4+
//
5+
// Created by eagleychen on 2023/4/7.
6+
// Copyright © 2023 Tencent. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
#import "TIoTExploreOrVideoDeviceModel.h"
11+
12+
NS_ASSUME_NONNULL_BEGIN
13+
14+
@interface TIoTDemoVideoCallVC : UIViewController
15+
@property (nonatomic, strong) TIoTExploreOrVideoDeviceModel *selectedModel; //选择设备的model
16+
@property (nonatomic, assign) BOOL isNVR; //区分是NVR、IPC
17+
@property (nonatomic, strong) NSString *deviceNameNVR;
18+
@end
19+
20+
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)