diff --git a/Example/SellyCloudSDK/Play/SCLiveVideoPlayerViewController.m b/Example/SellyCloudSDK/Play/SCLiveVideoPlayerViewController.m index 5ffa04d..57fa2eb 100644 --- a/Example/SellyCloudSDK/Play/SCLiveVideoPlayerViewController.m +++ b/Example/SellyCloudSDK/Play/SCLiveVideoPlayerViewController.m @@ -713,6 +713,21 @@ } } +- (void)player:(SellyLiveVideoPlayer *)player onDebugInfo:(SellyLivePlayerStats *)stats { + NSLog(@"统计信息: 协议=%@, CPU=%ld%%/%ld%%, FPS=%ld, 码率=%ldkbps/%ldkbps, RTT=%ldms ,freezeTime=%ldms, 分辨率=%@, 丢包率=%.2f%% timestampMs=%lld", + stats.protocol, + stats.appCpu, + stats.systemCpu, + stats.fps, + stats.videoBitrate, + stats.audioBitrate, + stats.rtt, + stats.freezeTime, + NSStringFromCGSize(stats.videoSize), + stats.packetLossRate, + stats.timestampMs); +} + #pragma mark - Screenshot - (void)saveCurrentFrameToPhotoAlbum:(UIImage *)image { diff --git a/Example/SubModules/SellyCloudSDK/SellyCloudSDK/sdk/SellyCloudSDK.framework/Headers/SellyCloudSDK-umbrella.h b/Example/SubModules/SellyCloudSDK/SellyCloudSDK/sdk/SellyCloudSDK.framework/Headers/SellyCloudSDK-umbrella.h index 4c59efa..01e116e 100644 --- a/Example/SubModules/SellyCloudSDK/SellyCloudSDK/sdk/SellyCloudSDK.framework/Headers/SellyCloudSDK-umbrella.h +++ b/Example/SubModules/SellyCloudSDK/SellyCloudSDK/sdk/SellyCloudSDK.framework/Headers/SellyCloudSDK-umbrella.h @@ -13,6 +13,7 @@ #import "SellyCloudSDKError.h" #import "SellyLiveAudioConfiguration.h" #import "SellyLivePlayerDelegate.h" +#import "SellyLivePlayerStats.h" #import "SellyLivePusherDelegate.h" #import "SellyLivePusherStats.h" #import "SellyLiveVideoConfiguration.h" diff --git a/Example/SubModules/SellyCloudSDK/SellyCloudSDK/sdk/SellyCloudSDK.framework/Headers/SellyLivePlayerDelegate.h b/Example/SubModules/SellyCloudSDK/SellyCloudSDK/sdk/SellyCloudSDK.framework/Headers/SellyLivePlayerDelegate.h index adafe05..c264f05 100644 --- a/Example/SubModules/SellyCloudSDK/SellyCloudSDK/sdk/SellyCloudSDK.framework/Headers/SellyLivePlayerDelegate.h +++ b/Example/SubModules/SellyCloudSDK/SellyCloudSDK/sdk/SellyCloudSDK.framework/Headers/SellyLivePlayerDelegate.h @@ -9,6 +9,7 @@ #import "SellyPublicDefinition.h" #import "SellyLiveVideoPlayer.h" #import "SellyRTCVideoFrame.h" +#import "SellyLivePlayerStats.h" NS_ASSUME_NONNULL_BEGIN @@ -55,6 +56,14 @@ NS_ASSUME_NONNULL_BEGIN */ - (BOOL)player:(SellyLiveVideoPlayer *)player onRenderVideoFrame:(SellyRTCVideoFrame *)videoFrame; +/** + 播放器调试信息回调 + + @param player 播放器实例 + @param stats 播放器统计信息,包含各种性能指标和调试数据 + */ +- (void)player:(SellyLiveVideoPlayer *)player onDebugInfo:(SellyLivePlayerStats *)stats; + @end NS_ASSUME_NONNULL_END diff --git a/Example/SubModules/SellyCloudSDK/SellyCloudSDK/sdk/SellyCloudSDK.framework/Headers/SellyLivePlayerStats.h b/Example/SubModules/SellyCloudSDK/SellyCloudSDK/sdk/SellyCloudSDK.framework/Headers/SellyLivePlayerStats.h new file mode 100644 index 0000000..48b3b4d --- /dev/null +++ b/Example/SubModules/SellyCloudSDK/SellyCloudSDK/sdk/SellyCloudSDK.framework/Headers/SellyLivePlayerStats.h @@ -0,0 +1,51 @@ +// +// SellyLivePlayerStats.h +// SellyCloudSDK +// +// Created by Caleb on 26/1/13. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface SellyLivePlayerStats : NSObject + +/// 播放协议(RTMP/HLS/WebRTC等) +@property (nonatomic, strong) NSString *protocol; + +/// App / System CPU(%) +@property (nonatomic, assign) NSUInteger appCpu; +@property (nonatomic, assign) NSUInteger systemCpu; + +/// 视频帧率(fps) +@property (nonatomic, assign) NSInteger fps; + +/// 视频 / 音频码率(kbps) +@property (nonatomic, assign) NSInteger videoBitrate; +@property (nonatomic, assign) NSInteger audioBitrate; + +/// 总下行速率(kbps)等于 videoBitrate + audioBitrate +@property (nonatomic, assign) NSInteger netSpeed; + +/// RTT - 往返时延(ms) +@property (nonatomic, assign) NSInteger rtt; + +/// 视频分辨率 +@property (nonatomic, assign) CGSize videoSize; + +/// 快照时间(ms since boot) +@property (nonatomic, assign) uint64_t timestampMs; + +/// 是否正在loading +@property (nonatomic, assign) BOOL isLoading; + +/// 丢包率(%) +@property (nonatomic, assign) CGFloat packetLossRate; + +/// 卡顿时间(ms)- 统计周期内的累积卡顿时长 +@property (nonatomic, assign) NSUInteger freezeTime; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Example/SubModules/SellyCloudSDK/SellyCloudSDK/sdk/SellyCloudSDK.framework/SellyCloudSDK b/Example/SubModules/SellyCloudSDK/SellyCloudSDK/sdk/SellyCloudSDK.framework/SellyCloudSDK index 3b6749d..8e4f0d6 100755 Binary files a/Example/SubModules/SellyCloudSDK/SellyCloudSDK/sdk/SellyCloudSDK.framework/SellyCloudSDK and b/Example/SubModules/SellyCloudSDK/SellyCloudSDK/sdk/SellyCloudSDK.framework/SellyCloudSDK differ