BRTC 提供 onStatistics 回调事件,它会每隔两秒钟一次向应用层上报当前网络质量,其参数包括本地推流和远端拉流质量两个部分:
#pragma mark - >>>>>>>>>>>>>>>>>>>BRTC 回调<<<<<<<<<<<<<<<<<<<<<< - (void)onStatistics:(BRTCStatistics *)statistics { NSMutableString *text = [NSMutableString string]; [text appendFormat:@"RTT: %d ms \n", statistics.rtt]; [text appendFormat:@"up Packet Loss: %u\n",statistics.upLoss]; [text appendFormat:@"down Packet Loss: %u\n",statistics.downLoss]; [text appendFormat:@"cpu usage: %u\n",statistics.cpu]; for (BRTCLocalStatistics *local in statistics) { [text appendFormat:@"Resolution: %d X %d\n",local.width, local.height]; [text appendFormat:@"Video Send Bitrate: %.2u kps \n", local.videoBitrate]; [text appendFormat:@"Audio Send Bitrate: %.2u kps \n", local.audioBitrate]; [text appendFormat:@"Video Send FPS: %.1u fps \n", local.frameRate]; [text appendFormat:@"local streamType: %d \n", local.streamType]; } for (remoteStatistics *remote in statistics) { [text appendFormat:@"Resolution: %d X %d\n", remote.width,remote.height]; [text appendFormat:@"Audio Recv Bitrate: %.2u kps \n", remote.audioBitrate]; [text appendFormat:@"Video Recv Bitrate: %.2u kps \n", remote.videoBitrate]; [text appendFormat:@"Video Recv FPS: %.1u fps \n", remote.frameRate]; [text appendFormat:@"Delay: %d ms \n", remote.jitterBufferDelay]; [text appendFormat:@"remote stream type: %d \n", remote.streamType]; } [self appendLog:[NSString stringWithFormat:@"quality: %@", text]]; }
流类型 BRTCVideoStreamType 定义如下:
通话质量检测
BRTC 提供 onStatistics 回调事件,它会每隔两秒钟一次向应用层上报当前网络质量,其参数包括本地推流和远端拉流质量两个部分:
示例代码
流类型 BRTCVideoStreamType 定义如下: