支持通过网页增加、删除、修改摄像头配置信息

支持摄像头配置信息中句柄的设置,并实测有效
This commit is contained in:
2025-12-28 08:07:55 +08:00
parent 3718465463
commit 2ee25a4f7c
25 changed files with 2298 additions and 75 deletions

View File

@@ -18,6 +18,13 @@ public abstract class BaseVideoSource : IVideoSource, IAsyncDisposable, IDeviceC
private volatile bool _isPhysicalOnline;
public bool IsPhysicalOnline => _isPhysicalOnline;
/// <summary>
/// 图像预处理配置(缩放、增量等)
/// 放置在基类中确保所有接入协议HIK/DH/RTSP均可共享处理逻辑
/// </summary>
public PreprocessConfig PreprocessSettings { get; set; }
= new PreprocessConfig();
string IDeviceConnectivity.IpAddress => _config.IpAddress;
// 允许哨兵从外部更新 _isOnline 字段
@@ -240,6 +247,10 @@ public abstract class BaseVideoSource : IVideoSource, IAsyncDisposable, IDeviceC
StreamType = source.StreamType,
Transport = source.Transport,
ConnectionTimeoutMs = source.ConnectionTimeoutMs,
MainboardIp = source.MainboardIp,
MainboardPort = source.MainboardPort,
RtspPath = source.RtspPath,
RenderHandle = source.RenderHandle,
// Dictionary 深拷贝:防止外部修改影响内部
VendorArguments = source.VendorArguments != null
? new Dictionary<string, string>(source.VendorArguments)

View File

@@ -228,7 +228,7 @@ public class HikVideoSource : BaseVideoSource
{
var previewInfo = new HikNativeMethods.NET_DVR_PREVIEWINFO
{
hPlayWnd = IntPtr.Zero,
hPlayWnd = (IntPtr)_config.RenderHandle,
lChannel = _config.ChannelIndex,
dwStreamType = (uint)_config.StreamType,
bBlocked = false