支持通过网页增加、删除、修改摄像头配置信息
支持摄像头配置信息中句柄的设置,并实测有效
This commit is contained in:
@@ -7,6 +7,36 @@
|
||||
/// </summary>
|
||||
public class FrameRequirement
|
||||
{
|
||||
public FrameRequirement()
|
||||
{
|
||||
}
|
||||
|
||||
public FrameRequirement(SubscriptionDto dto)
|
||||
{
|
||||
// 1. 核心标识
|
||||
this.AppId = dto.AppId;
|
||||
this.Type = dto.Type;
|
||||
|
||||
// 2. 流控参数
|
||||
this.TargetFps = dto.DisplayFps;
|
||||
|
||||
// 3. 业务动态参数
|
||||
this.Memo = dto.Memo;
|
||||
this.Handle = dto.Handle;
|
||||
this.RecordDuration = dto.RecordDuration;
|
||||
this.SavePath = dto.SavePath;
|
||||
|
||||
// 4. 网络转发相关参数 (补全)
|
||||
this.Protocol = dto.Protocol;
|
||||
this.TargetIp = dto.TargetIp;
|
||||
this.TargetPort = dto.TargetPort;
|
||||
|
||||
// 5. 初始化内部统计状态
|
||||
this.LastCaptureTick = Environment.TickCount64;
|
||||
this._lastFpsCalcTick = Environment.TickCount64;
|
||||
this.IsActive = true;
|
||||
}
|
||||
|
||||
#region --- 订阅者核心标识 (Subscriber Core Identification) ---
|
||||
|
||||
/// <summary> 订阅者唯一ID(如 "Client_A"、"AI_Service"、"WPF_Display_Main") </summary>
|
||||
@@ -81,16 +111,20 @@ public class FrameRequirement
|
||||
/// <remarks> 每当成功分发一帧后调用,内部自动按秒计算 RealFps </remarks>
|
||||
public void UpdateRealFps()
|
||||
{
|
||||
_frameCount++;
|
||||
long currentTick = Environment.TickCount64;
|
||||
long elapsed = currentTick - _lastFpsCalcTick;
|
||||
|
||||
if (elapsed >= 1000) // 达到 1 秒周期
|
||||
try
|
||||
{
|
||||
RealFps = Math.Round(_frameCount / (elapsed / 1000.0), 1);
|
||||
_frameCount = 0;
|
||||
_lastFpsCalcTick = currentTick;
|
||||
_frameCount++;
|
||||
long currentTick = Environment.TickCount64;
|
||||
long elapsed = currentTick - _lastFpsCalcTick;
|
||||
|
||||
if (elapsed >= 1000) // 达到 1 秒周期
|
||||
{
|
||||
RealFps = Math.Round(_frameCount / (elapsed / 1000.0), 1);
|
||||
_frameCount = 0;
|
||||
_lastFpsCalcTick = currentTick;
|
||||
}
|
||||
}
|
||||
catch{ }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user