回调播放器debug info
This commit is contained in:
@@ -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
|
#pragma mark - Screenshot
|
||||||
|
|
||||||
- (void)saveCurrentFrameToPhotoAlbum:(UIImage *)image {
|
- (void)saveCurrentFrameToPhotoAlbum:(UIImage *)image {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#import "SellyCloudSDKError.h"
|
#import "SellyCloudSDKError.h"
|
||||||
#import "SellyLiveAudioConfiguration.h"
|
#import "SellyLiveAudioConfiguration.h"
|
||||||
#import "SellyLivePlayerDelegate.h"
|
#import "SellyLivePlayerDelegate.h"
|
||||||
|
#import "SellyLivePlayerStats.h"
|
||||||
#import "SellyLivePusherDelegate.h"
|
#import "SellyLivePusherDelegate.h"
|
||||||
#import "SellyLivePusherStats.h"
|
#import "SellyLivePusherStats.h"
|
||||||
#import "SellyLiveVideoConfiguration.h"
|
#import "SellyLiveVideoConfiguration.h"
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#import "SellyPublicDefinition.h"
|
#import "SellyPublicDefinition.h"
|
||||||
#import "SellyLiveVideoPlayer.h"
|
#import "SellyLiveVideoPlayer.h"
|
||||||
#import "SellyRTCVideoFrame.h"
|
#import "SellyRTCVideoFrame.h"
|
||||||
|
#import "SellyLivePlayerStats.h"
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@@ -55,6 +56,14 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
*/
|
*/
|
||||||
- (BOOL)player:(SellyLiveVideoPlayer *)player onRenderVideoFrame:(SellyRTCVideoFrame *)videoFrame;
|
- (BOOL)player:(SellyLiveVideoPlayer *)player onRenderVideoFrame:(SellyRTCVideoFrame *)videoFrame;
|
||||||
|
|
||||||
|
/**
|
||||||
|
播放器调试信息回调
|
||||||
|
|
||||||
|
@param player 播放器实例
|
||||||
|
@param stats 播放器统计信息,包含各种性能指标和调试数据
|
||||||
|
*/
|
||||||
|
- (void)player:(SellyLiveVideoPlayer *)player onDebugInfo:(SellyLivePlayerStats *)stats;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
//
|
||||||
|
// SellyLivePlayerStats.h
|
||||||
|
// SellyCloudSDK
|
||||||
|
//
|
||||||
|
// Created by Caleb on 26/1/13.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface SellyLivePlayerStats : NSObject <NSCopying>
|
||||||
|
|
||||||
|
/// 播放协议(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
|
||||||
Binary file not shown.
Reference in New Issue
Block a user