修复由于流控导致的帧率降低,由于摄像头过来的帧不是平均的 40ms 一帧,所以需要容错

This commit is contained in:
2025-12-26 13:38:28 +08:00
parent 365e63c21a
commit 93782bcdf1
3 changed files with 73 additions and 64 deletions

View File

@@ -114,6 +114,9 @@ public abstract class BaseVideoSource : IVideoSource, IAsyncDisposable
/// <summary> 上次 FPS 计算的 Tick 时间 </summary>
private long _lastFpsCalcTick = 0;
// 提供一个最近一秒的输入帧率参考值
public int NominalInputFps => (int)Math.Round(RealFps);
/// <summary> 实时 FPS每秒更新一次 </summary>
public double RealFps { get; private set; } = 0.0;