Skip to content

Commit

Permalink
Merge pull request #62 from HeraShowFeng/v5.0.0_release
Browse files Browse the repository at this point in the history
add v5.0.0 release codes
  • Loading branch information
HeraShowFeng authored Jun 7, 2022
2 parents 5287890 + b5143dd commit d2c5c1a
Show file tree
Hide file tree
Showing 163 changed files with 3,135 additions and 8,360 deletions.
312 changes: 312 additions & 0 deletions APIDiffs/api-diffs-5.0.0.md

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ PODS:
- PLPlayerKit (3.4.1):
- PLPlayerKit/iphoneos (= 3.4.1)
- PLPlayerKit/iphoneos (3.4.1)
- QNRTCKit-iOS (4.0.4):
- QNRTCKit-iOS/Core (= 4.0.4)
- QNRTCKit-iOS/Core (4.0.4)
- QNRTCKit-iOS (5.0.0):
- QNRTCKit-iOS/Core (= 5.0.0)
- QNRTCKit-iOS/Core (5.0.0)

DEPENDENCIES:
- Bugsnag (= 5.15.4)
Expand Down Expand Up @@ -45,8 +45,8 @@ SPEC CHECKSUMS:
Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
MMMaterialDesignSpinner: a548042720c2e5f04212048483085d7942ac3e81
PLPlayerKit: ebec9d70b66a95d1770b2dc5107fe2a469454a28
QNRTCKit-iOS: 96d5a8cb090d026059ab860aa8341eeaac88ac10
QNRTCKit-iOS: 02b624c22c604127414152424beae31c1139830c

PODFILE CHECKSUM: 286ae35cf136752f9369e7b9864afb2e9399464e

COCOAPODS: 1.11.2
COCOAPODS: 1.10.2
10 changes: 2 additions & 8 deletions Example/Pods/Local Podspecs/QNRTCKit-iOS.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Example/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1,444 changes: 722 additions & 722 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions Example/QNRTCKitDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -376,13 +376,11 @@
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-QNRTCKitDemo/Pods-QNRTCKitDemo-frameworks.sh",
"${PODS_ROOT}/PLPlayerKit/Pod/Library/PLPlayerKit.framework",
"${PODS_ROOT}/../../Pod/iphoneos/HappyDNS.framework",
"${PODS_ROOT}/../../Pod/iphoneos/QNRTCKit.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PLPlayerKit.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/HappyDNS.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/QNRTCKit.framework",
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -608,7 +606,7 @@
"$(PROJECT_DIR)/../QNRTCKit/**",
"$(inherited)",
);
MARKETING_VERSION = 4.0.4;
MARKETING_VERSION = 5.0.0;
OTHER_LDFLAGS = (
"$(OTHER_LDFLAGS)",
"-ObjC",
Expand Down Expand Up @@ -648,7 +646,7 @@
"$(PROJECT_DIR)/../QNRTCKit/**",
"$(inherited)",
);
MARKETING_VERSION = 4.0.4;
MARKETING_VERSION = 5.0.0;
OTHER_LDFLAGS = (
"$(OTHER_LDFLAGS)",
"-ObjC",
Expand Down
13 changes: 6 additions & 7 deletions Example/QNRTCKitDemo/QRDBaseViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@
UITableViewDelegate,
UITableViewDataSource,
QNRTCClientDelegate,
QNCameraTrackVideoDataDelegate,
QNMicrophoneAudioTrackDataDelegate,
QNRemoteTrackAudioDataDelegate,
QNRemoteTrackVideoDataDelegate,
QRDUserViewDelegate,
QNRemoteTrackDelegate
QNLocalVideoTrackDelegate,
QNLocalAudioTrackDelegate,
QNRemoteAudioTrackDelegate,
QNRemoteVideoTrackDelegate,
QRDUserViewDelegate
>
@property (nonatomic, strong) UIView *colorView;
@property (nonatomic, readonly) LogTableView *tableView;
Expand All @@ -51,7 +50,7 @@ QNRemoteTrackDelegate
@property (nonatomic, strong) QNCameraVideoTrack *cameraTrack;
@property (nonatomic, strong) QNMicrophoneAudioTrack *audioTrack;

@property (nonatomic, strong) QNGLKView * preview;
@property (nonatomic, strong) QNVideoGLView * preview;

- (void)resetRenderViews;
- (QRDUserView *)createUserViewWithTrackId:(NSString *)trackId userId:(NSString *)userId;
Expand Down
59 changes: 30 additions & 29 deletions Example/QNRTCKitDemo/QRDBaseViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ @interface QRDBaseViewController ()
@implementation QRDBaseViewController

- (void)dealloc {
[QNRTC deinit];
self.tableView.delegate = nil;
self.tableView.dataSource = nil;
NSLog(@"[dealloc]==> %@", self.description);
Expand Down Expand Up @@ -93,11 +92,16 @@ - (void)viewDidLoad {

[self setupLogUI];

self.preview = [[QNGLKView alloc] initWithFrame:self.view.bounds];
self.preview = [[QNVideoGLView alloc] initWithFrame:self.view.bounds];

self.singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(exchangeWindowSize)];
}

- (void)viewDidDisappear:(BOOL)animated {
[QNRTC deinit];
[super viewDidDisappear:animated];
}

- (UIView *)colorView {
if (nil == _colorView) {
_colorView = [[UIView alloc] init];
Expand Down Expand Up @@ -455,19 +459,17 @@ - (void)startGetStatsTimer {
}

- (void)getStatesTimerAction {
if (QNConnectionStateConnected != self.client.roomState && QNConnectionStateReconnected != self.client.roomState) {
if (QNConnectionStateConnected != self.client.connectionState && QNConnectionStateReconnected != self.client.connectionState) {
return;
}

NSDictionary* videoTrackStats = [[NSDictionary alloc] initWithDictionary:[self.client getLocalVideoTrackStats]];
for (NSString * trackID in videoTrackStats.allKeys) {
NSString *str = nil;
NSArray * videoArray = videoTrackStats[trackID];
for (QNLocalVideoTrackStats *videoStats in videoArray ) {
str = [NSString stringWithFormat:@"统计信息回调:trackID:%@\n\n视频码率:%2fbps\n 本地视频丢包率:%f%%\n视频帧率:%d\n本地 rtt:%d\nprofile:%d\n",trackID, videoStats.uplinkBitrate, videoStats.uplinkLostRate, videoStats.uplinkFrameRate, videoStats.uplinkRTT, videoStats.profile];
[self addLogString:str];
}

NSArray *videoTracksArray = videoTrackStats[trackID];
QNLocalVideoTrackStats *videoStats = videoTracksArray[0];
str = [NSString stringWithFormat:@"统计信息回调:trackID:%@\n\n视频码率:%2fbps\n本地视频丢包率:%f%%\n视频帧率:%d\n本地 rtt:%d\nprofile:%d\n",trackID, videoStats.uplinkBitrate, videoStats.uplinkLostRate, videoStats.uplinkFrameRate, videoStats.uplinkRTT, videoStats.profile];
[self addLogString:str];
}

NSDictionary* audioTrackStats = [self.client getLocalAudioTrackStats];
Expand Down Expand Up @@ -538,7 +540,7 @@ - (void)userView:(QRDUserView *)userview longPressWithUserId:(NSString *)userId
- (void)RTCClient:(QNRTCClient *)client didConnectionStateChanged:(QNConnectionState)state disconnectedInfo:(QNConnectionDisconnectedInfo *)info {

NSDictionary *roomStateDictionary = @{
@(QNConnectionStateIdle) : @"Idle",
@(QNConnectionStateDisconnected) : @"Disconnected",
@(QNConnectionStateConnecting) : @"Connecting",
@(QNConnectionStateConnected): @"Connected",
@(QNConnectionStateReconnecting) : @"Reconnecting",
Expand All @@ -551,7 +553,7 @@ - (void)RTCClient:(QNRTCClient *)client didConnectionStateChanged:(QNConnectionS
[self stopGetStatsTimer];
}
[self addLogString:str];
if (QNConnectionStateIdle == state) {
if (QNConnectionStateDisconnected == state) {
switch (info.reason) {
case QNConnectionDisconnectedReasonKickedOut:{
str =[NSString stringWithFormat:@"被远端服务器踢出的回调"];
Expand All @@ -578,9 +580,6 @@ - (void)RTCClient:(QNRTCClient *)client didConnectionStateChanged:(QNConnectionS
case QNRTCErrorTokenExpired:
NSLog(@"roomToken 过期");
break;
case QNRTCErrorReconnectTokenError:
NSLog(@"重新进入房间超时,请务必调用 leave, 重新进入房间");
break;
default:
break;
}
Expand Down Expand Up @@ -642,7 +641,7 @@ - (void)RTCClient:(QNRTCClient *)client didStartLiveStreamingWith:(NSString *)st
}

/**
* 远端用户视频首帧解码后的回调,如果需要渲染,则调用当前 videoTrack.play(QNVideoView*) 方法
* 远端用户视频首帧解码后的回调,如果需要渲染,则调用当前 videoTrack.play(QNVideoGLView*) 方法
*/
- (void)RTCClient:(QNRTCClient *)client firstVideoDidDecodeOfTrack:(QNRemoteVideoTrack *)videoTrack remoteUserID:(NSString *)userID {
NSString *str = [NSString stringWithFormat:@"远端用户: %@ trackID: %@ 视频首帧解码后的回调", userID, videoTrack.trackID];
Expand All @@ -657,7 +656,6 @@ - (void)RTCClient:(QNRTCClient *)client didDetachRenderTrack:(QNRemoteVideoTrack
[self addLogString:str];
}


/**
* 远端用户发生重连
*/
Expand All @@ -674,13 +672,17 @@ - (void)RTCClient:(QNRTCClient *)client didReconnectedOfUserID:(NSString *)userI
[self addLogString:logStr];
}

#pragma mark QNRemoteTrackDelegate
#pragma mark QNRemoteVideoTrackDelegate

/**
* 远端用户 Track 状态变更为 muted 的回调
*/
- (void)remoteTrack:(QNRemoteTrack *)remoteTrack didMutedByRemoteUserID:(NSString *)userID {
NSString *str = [NSString stringWithFormat:@"远端用户: %@ trackId: %@ Track 状态变更为: %d 的回调", userID, remoteTrack.trackID, remoteTrack.muted];
- (void)remoteVideoTrack:(QNRemoteVideoTrack *)remoteVideoTrack didMuteStateChanged:(BOOL)isMuted {
NSString *str = [NSString stringWithFormat:@"远端视频用户: %@ trackId: %@ Track 状态变更为: %d 的回调", remoteVideoTrack.userID, remoteVideoTrack.trackID, remoteVideoTrack.muted];
[self addLogString:str];
}

#pragma mark QNRemoteAudioTrackDelegate

- (void)remoteAudioTrack:(QNRemoteAudioTrack *)remoteAudioTrack didMuteStateChanged:(BOOL)isMuted {
NSString *str = [NSString stringWithFormat:@"远端音频用户: %@ trackId: %@ Track 状态变更为: %d 的回调", remoteAudioTrack.userID, remoteAudioTrack.trackID, remoteAudioTrack.muted];
[self addLogString:str];
}

Expand Down Expand Up @@ -717,30 +719,29 @@ - (void)remoteAudioTrack:(QNRemoteAudioTrack *)remoteAudioTrack didGetAudioBuffe
i ++;
}

#pragma mark QNCameraTrackVideoDataDelegate
#pragma mark QNLocalVideoTrackDelegate

/**
* 获取到摄像头原数据时的回调, 便于开发者做滤镜等处理,需要注意的是这个回调在 camera 数据的输出线程,请不要做过于耗时的操作,否则可能会导致编码帧率下降
*/
- (void)cameraVideoTrack:(QNCameraVideoTrack *)cameraVideoTrack didGetSampleBuffer:(CMSampleBufferRef)sampleBuffer; {
- (void)localVideoTrack:(QNLocalVideoTrack *)localVideoTrack didGetPixelBuffer:(CVPixelBufferRef)pixelBuffer {
static int i = 0;
if (i % 300 == 0) {
CVPixelBufferRef pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer);
NSString *str = [NSString stringWithFormat:@"获取到摄像头原数据时的回调:\nbufferCount: %d, size = %zux%zu", i, CVPixelBufferGetWidth(pixelBuffer), CVPixelBufferGetHeight(pixelBuffer)];
NSString *str = [NSString stringWithFormat:@"获取到本地track: %@ 的原数据时的回调:\nbufferCount: %d, size = %zux%zu",localVideoTrack.trackID, i, CVPixelBufferGetWidth(pixelBuffer), CVPixelBufferGetHeight(pixelBuffer)];
// [self addLogString:str];
}
i ++;
}

#pragma mark QNMicrophoneAudioTrackDataDelegate
#pragma mark QNLocalAudioTrackDelegate

/**
* 获取到麦克风原数据时的回调,需要注意的是这个回调在 AU Remote IO 线程,请不要做过于耗时的操作,否则可能阻塞该线程影响音频输出或其他未知问题
*/
- (void)microphoneAudioTrack:(QNMicrophoneAudioTrack *)microphoneAudioTrack didGetAudioBuffer:(AudioBuffer *)audioBuffer bitsPerSample:(NSUInteger)bitsPerSample sampleRate:(NSUInteger)sampleRate {
- (void)localAudioTrack:(QNLocalAudioTrack *)localAudioTrack didGetAudioBuffer:(AudioBuffer *)audioBuffer bitsPerSample:(NSUInteger)bitsPerSample sampleRate:(NSUInteger)sampleRate {
static int i = 0;
if (i % 500 == 0) {
NSString *str = [NSString stringWithFormat:@"获取到麦克风原数据时的回调:\nbufferCount: %d, dataLen = %u", i, (unsigned int)audioBuffer->mDataByteSize];
NSString *str = [NSString stringWithFormat:@"获取到本地音频 track :%@ 的原数据时的回调:\nbufferCount: %d, dataLen = %u", localAudioTrack.trackID, i, (unsigned int)audioBuffer->mDataByteSize];
// [self addLogString:str];
}
i ++;
Expand Down
20 changes: 0 additions & 20 deletions Example/QNRTCKitDemo/QRDJoinRoomView.h

This file was deleted.

Loading

0 comments on commit d2c5c1a

Please sign in to comment.