50 lines
1.9 KiB
Objective-C
50 lines
1.9 KiB
Objective-C
//
|
||
// SellyRTCP2pStats.h
|
||
// SellyCloudSDK
|
||
//
|
||
// Created by Caleb on 10/11/25.
|
||
//
|
||
|
||
#import <Foundation/Foundation.h>
|
||
|
||
NS_ASSUME_NONNULL_BEGIN
|
||
|
||
@interface SellyRTCP2pStats : NSObject
|
||
/// 基本
|
||
|
||
/// 传输(ICE/DTLS)
|
||
@property(nonatomic, assign) double transportRttMs; // candidate-pair.currentRoundTripTime * 1000
|
||
@property(nonatomic, copy, nullable) NSString *relayProtocol; // udp/tcp/tls(TURN时可见)
|
||
@property(nonatomic, copy) NSString *audioCodec;
|
||
@property(nonatomic, copy) NSString *videoCodec;
|
||
|
||
/// 媒体累计字节
|
||
@property(nonatomic, assign) uint64_t txAudioBytes;
|
||
@property(nonatomic, assign) uint64_t txVideoBytes;
|
||
@property(nonatomic, assign) uint64_t rxAudioBytes;
|
||
@property(nonatomic, assign) uint64_t rxVideoBytes;
|
||
@property(nonatomic, assign, readonly) uint64_t txBytes; // 汇总
|
||
@property(nonatomic, assign, readonly) uint64_t rxBytes;
|
||
|
||
/// 视频信息(能拿到就填)
|
||
@property(nonatomic, assign) double sentFps;
|
||
@property(nonatomic, assign) NSInteger sentWidth;
|
||
@property(nonatomic, assign) NSInteger sentHeight;
|
||
@property(nonatomic, assign) double recvFps;
|
||
@property(nonatomic, assign) NSInteger recvWidth;
|
||
@property(nonatomic, assign) NSInteger recvHeight;
|
||
|
||
/// —— 新增:瞬时 Kbps(由 Helper 用“前一帧”差分计算)——
|
||
@property(nonatomic, assign) double txAudioKbps; // 本次 - 上次 bytes / Δt
|
||
@property(nonatomic, assign) double txVideoKbps;
|
||
@property(nonatomic, assign) double rxAudioKbps;
|
||
@property(nonatomic, assign) double rxVideoKbps;
|
||
@property(nonatomic, assign) double txKbps; // = txAudioKbps + txVideoKbps
|
||
@property(nonatomic, assign) double rxKbps; // = rxAudioKbps + rxVideoKbps
|
||
|
||
/// 时间戳(内部用)
|
||
@property(nonatomic, assign) NSTimeInterval intervalMs; // 与上次快照的间隔(毫秒),首帧为 0
|
||
@end
|
||
|
||
NS_ASSUME_NONNULL_END
|