SDK 的 Bug 修复
This commit is contained in:
@@ -66,6 +66,8 @@ public class CameraManager : IDisposable, IAsyncDisposable
|
||||
throw new InvalidOperationException($"设备 ID {config.Id} 已存在");
|
||||
}
|
||||
|
||||
_coordinator.Register(device);
|
||||
|
||||
// 动态激活逻辑:引擎已启动时,新设备直接标记为运行状态
|
||||
if (_isEngineStarted)
|
||||
device.IsRunning = true;
|
||||
@@ -211,6 +213,14 @@ public class CameraManager : IDisposable, IAsyncDisposable
|
||||
// 1. 审计
|
||||
_sysLog.Debug($"[Core] 响应设备配置更新请求, ID:{deviceId}.");
|
||||
|
||||
// ============================================================
|
||||
// 【核心修复:手动解除冷冻】
|
||||
// [原因] 用户已干预配置,无论之前是否认证失败,都应立即重置标记
|
||||
// 这样下一次 Coordinator (5秒内) 扫描时,会因为 IsAuthFailed == false
|
||||
// 且经过了 NormalRetryMs (30s) 而立即尝试拉起。
|
||||
// ============================================================
|
||||
device.ResetResilience();
|
||||
|
||||
// 2. 创建副本进行对比
|
||||
var oldConfig = device.Config;
|
||||
var newConfig = oldConfig.DeepCopy();
|
||||
@@ -247,13 +257,14 @@ public class CameraManager : IDisposable, IAsyncDisposable
|
||||
bool wasRunning = device.IsRunning;
|
||||
|
||||
// A. 彻底停止
|
||||
if (device.IsOnline) await device.StopAsync();
|
||||
if (device.IsActived) await device.StopAsync();
|
||||
|
||||
// B. 写入新配置
|
||||
device.UpdateConfig(newConfig);
|
||||
|
||||
// C. 自动重启
|
||||
if (wasRunning) await device.StartAsync();
|
||||
if (wasRunning)
|
||||
await device.StartAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -263,7 +274,7 @@ public class CameraManager : IDisposable, IAsyncDisposable
|
||||
device.UpdateConfig(newConfig);
|
||||
|
||||
// B. 在线应用策略
|
||||
if (device.IsOnline)
|
||||
if (device.IsActived)
|
||||
{
|
||||
var options = new DynamicStreamOptions
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user