fix: 修复摄像头无法正常启动,以及关闭摄像头会导致后端崩溃的问题
This commit is contained in:
@@ -6,6 +6,8 @@ public sealed class MsgBus
|
||||
{
|
||||
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
||||
|
||||
// private static RtspStreamService _rtspStreamService = new RtspStreamService(new UsbCameraCapture());
|
||||
|
||||
private static readonly UDPServer udpServer = new UDPServer(1234, 12);
|
||||
/// <summary>
|
||||
/// 获取UDP服务器
|
||||
@@ -49,7 +51,7 @@ public sealed class MsgBus
|
||||
/// 通信总线初始化
|
||||
/// </summary>
|
||||
/// <returns>无</returns>
|
||||
public static void Init()
|
||||
public static async void Init()
|
||||
{
|
||||
if (!ArpClient.IsAdministrator())
|
||||
{
|
||||
@@ -57,6 +59,10 @@ public sealed class MsgBus
|
||||
// throw new Exception($"非管理员运行,ARP无法更新,请用管理员权限运行");
|
||||
}
|
||||
udpServer.Start();
|
||||
|
||||
// _rtspStreamService.ConfigureVideo(1920, 1080, 30);
|
||||
// await _rtspStreamService.StartAsync();
|
||||
|
||||
isRunning = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user