feat: 现在停止视频流会使摄像头休眠,配置过程会唤醒,配置完后再休眠

This commit is contained in:
alivender
2025-07-15 18:35:14 +08:00
parent 938ee80979
commit a28ae9be97
2 changed files with 17 additions and 22 deletions

View File

@@ -156,6 +156,8 @@ public class HttpVideoStreamService : BackgroundService
throw new Exception("Please config camera first");
}
_cameraEnable = isEnabled;
if (_cameraEnable) await _camera.WakeUp();
else await _camera.Sleep();
await _camera.EnableHardwareTrans(_cameraEnable);
}