Skip to content

Commit b6f4f9e

Browse files
authored
Merge pull request #27 from HeraShowFeng/iOS_v5.0.0
iOS release v5.0.0
2 parents 2492a42 + e1b3b5d commit b6f4f9e

File tree

173 files changed

+158
-10446
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+158
-10446
lines changed

Group-Video/Group-Video-iOS/Group-Video.xcodeproj/project.pbxproj

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 50;
6+
objectVersion = 51;
77
objects = {
88

99
/* Begin PBXBuildFile section */
1010
2B8A448B584670D41EC78EFE /* libPods-Group-Video.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CE872D1AFA3EB9FFF5CEC338 /* libPods-Group-Video.a */; };
11+
AAF5A3BE28619F8B00EBCBB6 /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = AAF5A3BD28619F8B00EBCBB6 /* libiconv.tbd */; };
12+
AAF5A3C028619F9200EBCBB6 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = AAF5A3BF28619F9200EBCBB6 /* libz.tbd */; };
13+
AAF5A3C228619F9D00EBCBB6 /* libbz2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = AAF5A3C128619F9D00EBCBB6 /* libbz2.tbd */; };
1114
C3BD41DE224090AB006EAC1D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C3BD41DD224090AB006EAC1D /* AppDelegate.m */; };
1215
C3BD41E1224090AB006EAC1D /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C3BD41E0224090AB006EAC1D /* ViewController.m */; };
1316
C3BD41E4224090AB006EAC1D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C3BD41E2224090AB006EAC1D /* Main.storyboard */; };
@@ -20,6 +23,9 @@
2023

2124
/* Begin PBXFileReference section */
2225
8FA14B1D56E6549125A95329 /* Pods-Group-Video.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Group-Video.release.xcconfig"; path = "Target Support Files/Pods-Group-Video/Pods-Group-Video.release.xcconfig"; sourceTree = "<group>"; };
26+
AAF5A3BD28619F8B00EBCBB6 /* libiconv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.tbd; path = usr/lib/libiconv.tbd; sourceTree = SDKROOT; };
27+
AAF5A3BF28619F9200EBCBB6 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
28+
AAF5A3C128619F9D00EBCBB6 /* libbz2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libbz2.tbd; path = usr/lib/libbz2.tbd; sourceTree = SDKROOT; };
2329
C3BD41D9224090AB006EAC1D /* Group-Video.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Group-Video.app"; sourceTree = BUILT_PRODUCTS_DIR; };
2430
C3BD41DC224090AB006EAC1D /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
2531
C3BD41DD224090AB006EAC1D /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
@@ -43,6 +49,9 @@
4349
isa = PBXFrameworksBuildPhase;
4450
buildActionMask = 2147483647;
4551
files = (
52+
AAF5A3C228619F9D00EBCBB6 /* libbz2.tbd in Frameworks */,
53+
AAF5A3C028619F9200EBCBB6 /* libz.tbd in Frameworks */,
54+
AAF5A3BE28619F8B00EBCBB6 /* libiconv.tbd in Frameworks */,
4655
2B8A448B584670D41EC78EFE /* libPods-Group-Video.a in Frameworks */,
4756
);
4857
runOnlyForDeploymentPostprocessing = 0;
@@ -100,6 +109,9 @@
100109
F253F524D67D91D54AE36D00 /* Frameworks */ = {
101110
isa = PBXGroup;
102111
children = (
112+
AAF5A3C128619F9D00EBCBB6 /* libbz2.tbd */,
113+
AAF5A3BF28619F9200EBCBB6 /* libz.tbd */,
114+
AAF5A3BD28619F8B00EBCBB6 /* libiconv.tbd */,
103115
CE872D1AFA3EB9FFF5CEC338 /* libPods-Group-Video.a */,
104116
);
105117
name = Frameworks;
4.49 KB
Binary file not shown.

Group-Video/Group-Video-iOS/Group-Video/Info.plist

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<key>NSAppTransportSecurity</key>
6-
<dict>
7-
<key>NSAllowsArbitraryLoads</key>
8-
<true/>
9-
</dict>
10-
<key>NSMicrophoneUsageDescription</key>
11-
<string>请允许访问麦克风权限</string>
12-
<key>NSCameraUsageDescription</key>
13-
<string>请允许访问相机权限</string>
145
<key>CFBundleDevelopmentRegion</key>
156
<string>$(DEVELOPMENT_LANGUAGE)</string>
167
<key>CFBundleExecutable</key>
@@ -29,6 +20,15 @@
2920
<string>1</string>
3021
<key>LSRequiresIPhoneOS</key>
3122
<true/>
23+
<key>NSAppTransportSecurity</key>
24+
<dict>
25+
<key>NSAllowsArbitraryLoads</key>
26+
<true/>
27+
</dict>
28+
<key>NSCameraUsageDescription</key>
29+
<string>请允许访问相机权限</string>
30+
<key>NSMicrophoneUsageDescription</key>
31+
<string>请允许访问麦克风权限</string>
3232
<key>UILaunchStoryboardName</key>
3333
<string>LaunchScreen</string>
3434
<key>UIMainStoryboardFile</key>

Group-Video/Group-Video-iOS/Group-Video/RoomViewController.m

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@
88

99
#import "RoomViewController.h"
1010
#import <QNRTCKit/QNRTCKit.h>
11+
12+
#warning 请到 Podifle 下,重新执行 pod install,确认 Pods/QNRTCKit-iOS/Pod/iphoneos 文件夹下,存在 FFmpeg.framework、QNRTCKit.framework 文件后可运行。
13+
1114
@interface RoomViewController ()
1215
<
1316
QNRTCClientDelegate,
14-
QNMicrophoneAudioTrackDataDelegate,
15-
QNCameraTrackVideoDataDelegate,
16-
QNRemoteTrackVideoDataDelegate,
17-
QNRemoteTrackAudioDataDelegate
17+
QNLocalAudioTrackDelegate,
18+
QNLocalVideoTrackDelegate,
19+
QNRemoteVideoTrackDelegate,
20+
QNRemoteAudioTrackDelegate
1821
>
1922
@property (nonatomic, assign) CGFloat screenWidth;
2023
@property (nonatomic, assign) CGFloat screenHeight;
@@ -32,7 +35,7 @@ @interface RoomViewController ()
3235
@property (nonatomic, strong) QNMicrophoneAudioTrack *audioTrack;
3336
@property (nonatomic, strong) QNCameraVideoTrack *cameraTrack;
3437

35-
@property (nonatomic, strong) QNGLKView *preview;
38+
@property (nonatomic, strong) QNVideoGLView *preview;
3639
@property (nonatomic, strong) UIScrollView *scrollView;
3740
@property (nonatomic, strong) NSMutableArray *viewsArray;
3841
@end
@@ -72,37 +75,38 @@ - (void)viewDidLoad {
7275
#pragma mark - settings
7376

7477
- (NSDictionary *)settingsArrayAtIndex:(NSInteger)index {
75-
NSArray *settingsArray = @[@{@"VideoSize":NSStringFromCGSize(CGSizeMake(288, 352)), @"FrameRate":@15, @"Bitrate":@(300*1000)},
76-
@{@"VideoSize":NSStringFromCGSize(CGSizeMake(480, 640)), @"FrameRate":@15, @"Bitrate":@(400*1000) },
77-
@{@"VideoSize":NSStringFromCGSize(CGSizeMake(544, 960)), @"FrameRate":@15, @"Bitrate":@(700*1000)},
78-
@{@"VideoSize":NSStringFromCGSize(CGSizeMake(720, 1280)), @"FrameRate":@20, @"Bitrate":@(1000*1000)}];
78+
NSArray *settingsArray = @[@{@"VideoSize":NSStringFromCGSize(CGSizeMake(288, 352)), @"FrameRate":@15, @"Bitrate":@(300)},
79+
@{@"VideoSize":NSStringFromCGSize(CGSizeMake(480, 640)), @"FrameRate":@15, @"Bitrate":@(400) },
80+
@{@"VideoSize":NSStringFromCGSize(CGSizeMake(544, 960)), @"FrameRate":@15, @"Bitrate":@(700)},
81+
@{@"VideoSize":NSStringFromCGSize(CGSizeMake(720, 1280)), @"FrameRate":@20, @"Bitrate":@(1000)}];
7982
return settingsArray[index];
8083
}
8184

8285
#pragma mark - QNRTCKit 核心类
8386

8487
- (void)configureRTCEngine {
8588
// QNRTC 初始化
86-
[QNRTC configRTC:[QNRTCConfiguration defaultConfiguration]];
89+
[QNRTC initRTC:[QNRTCConfiguration defaultConfiguration]];
8790

8891
// QNRTCClient 初始化
8992
self.rtcClient = [QNRTC createRTCClient];
9093
self.rtcClient.delegate = self;
9194

9295
// 设置本地预览视图 显示在排列第一个
93-
self.preview = [[QNGLKView alloc] init];
96+
self.preview = [[QNVideoGLView alloc] init];
9497
self.preview.frame = CGRectMake(0, 0, self.screenWidth/2, self.screenHeight/2);
9598
[self.scrollView addSubview:self.preview];
9699

97100
// 视频
98-
QNCameraVideoTrackConfig * cameraConfig = [[QNCameraVideoTrackConfig alloc] initWithSourceTag:@"camera" bitrate:self.kBitrate videoEncodeSize:self.videoEncodeSize];
101+
QNVideoEncoderConfig *videoConfig = [[QNVideoEncoderConfig alloc] initWithBitrate:self.kBitrate videoEncodeSize:self.videoEncodeSize];
102+
QNCameraVideoTrackConfig * cameraConfig = [[QNCameraVideoTrackConfig alloc] initWithSourceTag:@"camera" config:videoConfig];
99103
self.cameraTrack = [QNRTC createCameraVideoTrackWithConfig:cameraConfig];
100104
// 设置本地预览视图
101105
[self.cameraTrack play:self.preview];
102106

103107
// 设置采集视频的帧率
104108
self.cameraTrack.videoFrameRate = [self.settingsDic[@"FrameRate"] integerValue];
105-
self.cameraTrack.videoDelegate = self;
109+
self.cameraTrack.delegate = self;
106110

107111
// 加入房间
108112
[self.rtcClient join:self.token];
@@ -114,7 +118,7 @@ - (void)configureRTCEngine {
114118
房间内状态变化的回调
115119
*/
116120
- (void)RTCClient:(QNRTCClient *)client didConnectionStateChanged:(QNConnectionState)state disconnectedInfo:(QNConnectionDisconnectedInfo *)info {
117-
NSDictionary *connectionStateDictionary = @{@(QNConnectionStateIdle) : @"Idle",
121+
NSDictionary *connectionStateDictionary = @{@(QNConnectionStateDisconnected) : @"Disconnected",
118122
@(QNConnectionStateConnecting) : @"Connecting",
119123
@(QNConnectionStateConnected): @"Connected",
120124
@(QNConnectionStateReconnecting) : @"Reconnecting",
@@ -127,7 +131,7 @@ - (void)RTCClient:(QNRTCClient *)client didConnectionStateChanged:(QNConnectionS
127131
self.microphoneButton.selected = YES;
128132
// 音频
129133
self.audioTrack = [QNRTC createMicrophoneAudioTrack];
130-
self.audioTrack.audioDelegate = self;
134+
self.audioTrack.delegate = self;
131135
// [self.audioTrack setVolume:0.5];
132136

133137
// 发布音视频
@@ -142,7 +146,7 @@ - (void)RTCClient:(QNRTCClient *)client didConnectionStateChanged:(QNConnectionS
142146
NSLog(@"publish error: %@",error);
143147
}
144148
}];
145-
} else if (QNConnectionStateIdle == state) {
149+
} else if (QNConnectionStateDisconnected == state) {
146150
self.videoButton.enabled = NO;
147151
self.videoButton.selected = NO;
148152
} else if (QNConnectionStateReconnecting == state) {
@@ -175,11 +179,11 @@ - (void)RTCClient:(QNRTCClient *)client didSubscribedRemoteVideoTracks:(NSArray<
175179
NSLog(@"didSubscribedRemoteTracks - %d,%d userTd %@", audioTracks.count, videoTracks.count, userID);
176180
dispatch_async(dispatch_get_main_queue(), ^{
177181
for (QNRemoteAudioTrack * audioTrack in audioTracks) {
178-
audioTrack.audioDelegate = self;
182+
audioTrack.delegate = self;
179183
}
180184
for (QNRemoteVideoTrack * videoTrack in videoTracks) {
181185
[videoTrack play:[self remoteUserView:userID]];
182-
videoTrack.videoDelegate = self;
186+
videoTrack.delegate = self;
183187
}
184188
});
185189

@@ -217,25 +221,24 @@ - (void)RTCClient:(QNRTCClient *)client didReconnectedOfUserID:(NSString *)userI
217221
NSLog(@"didReconnectedOfUserID - %@",userID);
218222
}
219223

220-
221-
#pragma mark - QNRemoteTrackVideoDataDelegate
224+
#pragma mark - QNRemoteVideoTrackDelegate
222225
- (void)remoteVideoTrack:(QNRemoteVideoTrack *)remoteVideoTrack didGetPixelBuffer:(CVPixelBufferRef)pixelBuffer {
223226
NSLog(@"remoteVideoTrack: %@ tag: %@ didGetPixelBuffer",remoteVideoTrack.trackID,remoteVideoTrack.tag);
224227
}
225228

226-
#pragma mark - QNRemoteTrackAudioDataDelegate
229+
#pragma mark - QNRemoteAudioTrackDelegate
227230
- (void)remoteAudioTrack:(QNRemoteAudioTrack *)remoteAudioTrack didGetAudioBuffer:(AudioBuffer *)audioBuffer bitsPerSample:(NSUInteger)bitsPerSample sampleRate:(NSUInteger)sampleRate {
228231
NSLog(@"remoteAudioTrack: %@ tag: %@ didGetAudioBuffer",remoteAudioTrack.trackID,remoteAudioTrack.tag);
229232
}
230233

231-
#pragma mark - QNCameraTrackVideoDataDelegate
232-
- (void)cameraVideoTrack:(QNCameraVideoTrack *)cameraVideoTrack didGetPixelBuffer:(CVPixelBufferRef)pixelBuffer {
234+
#pragma mark - QNLocalVideoTrackDelegate
235+
- (void)localVideoTrack:(QNLocalVideoTrack *)localVideoTrack didGetPixelBuffer:(CVPixelBufferRef)pixelBuffer {
233236
// NSLog(@"cameraVideoTrack: %@ tag: %@ didGetPixelBuffer",cameraVideoTrack.trackID,track.tag);
234237

235238
}
236239

237-
#pragma mark - QNMicrophoneAudioTrackDataDelegate
238-
- (void)microphoneAudioTrack:(QNMicrophoneAudioTrack *)microphoneAudioTrack didGetAudioBuffer:(AudioBuffer *)audioBuffer bitsPerSample:(NSUInteger)bitsPerSample sampleRate:(NSUInteger)sampleRate {
240+
#pragma mark - QNLocalAudioTrackDelegate
241+
- (void)localAudioTrack:(QNLocalAudioTrack *)localAudioTrack didGetAudioBuffer:(AudioBuffer *)audioBuffer bitsPerSample:(NSUInteger)bitsPerSample sampleRate:(NSUInteger)sampleRate {
239242
// NSLog(@"microphoneAudioTrack: %@ tag: %@ didGetAudioBuffer",track.trackID,track.tag);
240243
}
241244

@@ -253,9 +256,9 @@ - (void)layoutScrollView {
253256
#pragma mark - 远端用户画面
254257
#warning 考虑多个远端排列显示
255258

256-
- (QNVideoView *)remoteUserView:(NSString *)userId {
259+
- (QNVideoGLView *)remoteUserView:(NSString *)userId {
257260
NSInteger count = self.viewsArray.count + 1;
258-
QNVideoView *remoteView = [[QNVideoView alloc] initWithFrame:CGRectMake(self.screenWidth/2 * (count%2), self.screenWidth/2 * (count/2), self.screenWidth/2, self.screenWidth/2)];
261+
QNVideoGLView *remoteView = [[QNVideoGLView alloc] initWithFrame:CGRectMake(self.screenWidth/2 * (count%2), self.screenWidth/2 * (count/2), self.screenWidth/2, self.screenWidth/2)];
259262
[self.scrollView addSubview:remoteView];
260263

261264
UILabel *nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, self.screenWidth/4 - 30, self.screenWidth/2, 60)];
@@ -281,7 +284,7 @@ - (QNVideoView *)remoteUserView:(NSString *)userId {
281284
- (void)removeRemoteRenderView:(NSString *)userId {
282285
NSInteger index = -1;
283286
for (NSInteger i = 0; i < self.viewsArray.count; i++) {
284-
QNVideoView *remoteView = self.viewsArray[i];
287+
QNVideoGLView *remoteView = self.viewsArray[i];
285288
UILabel *label = remoteView.subviews.lastObject;
286289
if ([label.text isEqualToString:userId]) {
287290
[remoteView removeFromSuperview];
@@ -292,7 +295,7 @@ - (void)removeRemoteRenderView:(NSString *)userId {
292295

293296
// 剔除离开的远端用户画面后,重新调整布局
294297
for (NSInteger i = 0; i < self.viewsArray.count; i++) {
295-
QNVideoView *remoteView = self.viewsArray[i];
298+
QNVideoGLView *remoteView = self.viewsArray[i];
296299
NSInteger count = i + 1;
297300
remoteView.frame = CGRectMake(self.screenWidth/2 * (count%2), self.screenWidth/2 * (count/2), self.screenWidth/2, self.screenWidth/2);
298301
}
@@ -319,12 +322,12 @@ - (void)closePublishAndBack:(UIButton *)button {
319322

320323
- (void)videoButtonAction:(UIButton *)button {
321324
button.selected = !button.isSelected;
322-
[self.cameraTrack updataMute:!button.isSelected];
325+
[self.cameraTrack updateMute:!button.isSelected];
323326
}
324327

325328
- (void)microphoneButtonAction:(UIButton *)button {
326329
button.selected = !button.isSelected;
327-
[self.audioTrack updataMute:!button.isSelected];
330+
[self.audioTrack updateMute:!button.isSelected];
328331
}
329332

330333
- (void)cameraButtonAction:(UIButton *)button {

Group-Video/Group-Video-iOS/Group-Video/ViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ - (void)layoutView {
134134
// 版本 label
135135
UILabel *versionLabel = [[UILabel alloc] initWithFrame:CGRectMake(40, screenHeight - 130, screenWidth - 80, 60)];
136136
NSArray *infoArray = [[QNRTC versionInfo] componentsSeparatedByString:@"-"];
137-
versionLabel.text = [NSString stringWithFormat:@"版本:v%@\n\n更新时间%@-%@-%@", infoArray[0], infoArray[1], infoArray[2], infoArray[3]];
137+
versionLabel.text = [NSString stringWithFormat:@"版本:v%@\n\n更新 id%@", infoArray[0], infoArray[1]];
138138
versionLabel.textColor = [UIColor colorWithRed:155/255.0 green:155/255.0 blue:155/255.0 alpha:1.0];
139139
versionLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:13.0];
140140
versionLabel.textAlignment = NSTextAlignmentRight;

Group-Video/Group-Video-iOS/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ target 'Group-Video' do
77

88
# Pods for Group-Video
99

10-
pod 'QNRTCKit-iOS'
10+
pod 'QNRTCKit-iOS', '= 5.0.0'
1111

1212
end
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
PODS:
2-
- QNRTCKit-iOS (4.0.4):
3-
- QNRTCKit-iOS/Core (= 4.0.4)
4-
- QNRTCKit-iOS/Core (4.0.4)
2+
- QNRTCKit-iOS (5.0.0):
3+
- QNRTCKit-iOS/Core (= 5.0.0)
4+
- QNRTCKit-iOS/Core (5.0.0)
55

66
DEPENDENCIES:
7-
- QNRTCKit-iOS
7+
- QNRTCKit-iOS (= 5.0.0)
88

99
SPEC REPOS:
1010
trunk:
1111
- QNRTCKit-iOS
1212

1313
SPEC CHECKSUMS:
14-
QNRTCKit-iOS: 96d5a8cb090d026059ab860aa8341eeaac88ac10
14+
QNRTCKit-iOS: 02b624c22c604127414152424beae31c1139830c
1515

16-
PODFILE CHECKSUM: 5559821512f68ab61852a15e056ce1df8d3735cf
16+
PODFILE CHECKSUM: e259bd583f92b27a6f12c29756ff08a09d466040
1717

1818
COCOAPODS: 1.11.3

Group-Video/Group-Video-iOS/Pods/Manifest.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)