From 0bd1ad8a0e7d2b394d7ea2c4364c224ea1e53134 Mon Sep 17 00:00:00 2001
From: alivender <13898766233@163.com>
Date: Sat, 2 Aug 2025 21:07:08 +0800
Subject: [PATCH] =?UTF-8?q?add:=20=E6=B7=BB=E5=8A=A0=E4=BA=86960*540?=
=?UTF-8?q?=E5=88=86=E8=BE=A8=E7=8E=87?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
server/src/Peripherals/CameraClient.cs | 21 +++++++++++++++++--
server/src/Services/HttpVideoStreamService.cs | 1 +
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/server/src/Peripherals/CameraClient.cs b/server/src/Peripherals/CameraClient.cs
index 1f0e54d..708caae 100644
--- a/server/src/Peripherals/CameraClient.cs
+++ b/server/src/Peripherals/CameraClient.cs
@@ -19,7 +19,7 @@ class Camera
{
private static readonly NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
- readonly int timeout = 2000;
+ readonly int timeout = 500;
readonly int taskID;
readonly int port;
readonly string address;
@@ -43,7 +43,7 @@ class Camera
/// 摄像头设备IP地址
/// 摄像头设备端口
/// 超时时间(毫秒)
- public Camera(string address, int port, int timeout = 2000)
+ public Camera(string address, int port, int timeout = 500)
{
if (timeout < 0)
throw new ArgumentException("Timeout couldn't be negative", nameof(timeout));
@@ -462,6 +462,20 @@ class Camera
);
}
+ ///
+ /// 配置为960x540分辨率
+ ///
+ /// 配置结果
+ public async ValueTask> ConfigureResolution960x540()
+ {
+ return await ConfigureResolution(
+ hStart: 0, vStart: 0,
+ dvpHo: 960, dvpVo: 540,
+ hts: 1700, vts: 1500,
+ hOffset: 16, vOffset: 4
+ );
+ }
+
///
/// 配置为320x240分辨率
///
@@ -543,6 +557,9 @@ class Camera
case "640x480":
result = await ConfigureResolution640x480();
break;
+ case "960x540":
+ result = await ConfigureResolution960x540();
+ break;
case "1280x720":
result = await ConfigureResolution1280x720();
break;
diff --git a/server/src/Services/HttpVideoStreamService.cs b/server/src/Services/HttpVideoStreamService.cs
index f6260af..3fc1b3e 100644
--- a/server/src/Services/HttpVideoStreamService.cs
+++ b/server/src/Services/HttpVideoStreamService.cs
@@ -1109,6 +1109,7 @@ public class HttpVideoStreamService : BackgroundService
return new List<(int, int, string)>
{
(640, 480, "640x480 (VGA)"),
+ (960, 540, "960x540 (qHD)"),
(1280, 720, "1280x720 (HD)"),
(1280, 960, "1280x960 (SXGA)"),
(1920, 1080, "1920x1080 (Full HD)")