修正帧数统计错误,流量统计错误的问题
确认显示帧数策略有效
This commit is contained in:
@@ -197,6 +197,7 @@ public class CameraManager : IDisposable, IAsyncDisposable
|
||||
Status = cam.Status.ToString(),
|
||||
IsOnline = cam.IsOnline,
|
||||
Fps = cam.RealFps,
|
||||
Bitrate = cam.RealBitrate, // [新增] 映射基类属性
|
||||
TotalFrames = cam.TotalFrames,
|
||||
HealthScore = healthScore,
|
||||
LastErrorMessage = cam.Status == VideoSourceStatus.Faulted ? "设备故障或网络中断" : null,
|
||||
|
||||
@@ -95,4 +95,19 @@ public class FrameController
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// [新增] 获取当前所有活跃的订阅需求快照
|
||||
/// </summary>
|
||||
public List<dynamic> GetCurrentRequirements()
|
||||
{
|
||||
// 将 ConcurrentDictionary 转换为列表返回
|
||||
return _requirements.Values.Select(r => new
|
||||
{
|
||||
r.AppId,
|
||||
r.TargetFps,
|
||||
// 还可以计算一个预计带宽占用,或者上次取帧时间
|
||||
LastActive = r.LastCaptureTick
|
||||
}).ToList<dynamic>();
|
||||
}
|
||||
}
|
||||
@@ -41,6 +41,9 @@ public class CameraTelemetryInfo
|
||||
/// <summary> 累计接收帧数(相机启动后接收的总帧数,用于统计数据完整性) </summary>
|
||||
public long TotalFrames { get; set; }
|
||||
|
||||
/// <summary> 实时码率 (Mbps) </summary>
|
||||
public double Bitrate { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region --- 健康度与统计 (Health & Statistics) ---
|
||||
|
||||
Reference in New Issue
Block a user