diff --git a/Ayay.Solution.sln b/Ayay.Solution.sln index 0bedb48..022ac93 100644 --- a/Ayay.Solution.sln +++ b/Ayay.Solution.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 18 -VisualStudioVersion = 18.1.11304.174 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36623.8 d17.14 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SHH.CameraSdk", "SHH.CameraSdk\SHH.CameraSdk.csproj", "{21B70A94-43FC-4D17-AB83-9E4B5178397E}" EndProject diff --git a/SHH.CameraSdk/Controllers/CamerasController.cs b/SHH.CameraSdk/Controllers/CamerasController.cs index 22c0c98..739e774 100644 --- a/SHH.CameraSdk/Controllers/CamerasController.cs +++ b/SHH.CameraSdk/Controllers/CamerasController.cs @@ -32,11 +32,23 @@ public class CamerasController : ControllerBase var devices = _manager.GetAllDevices().Select(d => new { d.Id, - d.Config.IpAddress, d.Config.Name, + d.Config.RenderHandle, + d.Config.StreamType, + d.Config.IpAddress, + Brand = d.Config.Brand.ToString(), Status = d.Status.ToString(), d.RealFps, - d.TotalFrames + d.TotalFrames, + d.IsPhysicalOnline, + d.IsOnline, + d.IsRunning, + d.Width, + d.Height, + d.PreprocessSettings.AllowEnlarge, + d.PreprocessSettings.AllowShrink, + ScalingWidth = d.PreprocessSettings.Width, + ScalingHeight = d.PreprocessSettings.Height, }); return Ok(devices); } diff --git a/SHH.CameraSdk/Drivers/HikVision/HikVideoSource.cs b/SHH.CameraSdk/Drivers/HikVision/HikVideoSource.cs index 58fd251..ca5322a 100644 --- a/SHH.CameraSdk/Drivers/HikVision/HikVideoSource.cs +++ b/SHH.CameraSdk/Drivers/HikVision/HikVideoSource.cs @@ -377,6 +377,8 @@ public class HikVideoSource : BaseVideoSource, Cv2.CvtColor(rawYuvWrapper, smartFrame.InternalMat, ColorConversionCodes.YUV2BGR_YV12); } + smartFrame.SubscriberIds.AddRange(decision.TargetAppIds); + // ========================================================================= // 【新增】插入这一行! // 此时 smartFrame.InternalMat 已经有了图像数据 diff --git a/SHH.CameraService/ZeroMqBridgeService.cs b/SHH.CameraService/ZeroMqBridgeService.cs index cfcd903..99ab7de 100644 --- a/SHH.CameraService/ZeroMqBridgeService.cs +++ b/SHH.CameraService/ZeroMqBridgeService.cs @@ -52,8 +52,9 @@ namespace SHH.CameraSdk DispatchTime = DateTime.Now, OriginalWidth = safeMat.Width, OriginalHeight = safeMat.Height, - OriginalImageBytes = jpgBytes + OriginalImageBytes = jpgBytes, }; + payload.SubscriberIds.AddRange(frame.SubscriberIds); // 4. 发射 _distributor.Broadcast(payload); diff --git a/SHH.Contracts/VideoPayload.cs b/SHH.Contracts/VideoPayload.cs index 3c80b17..5613880 100644 --- a/SHH.Contracts/VideoPayload.cs +++ b/SHH.Contracts/VideoPayload.cs @@ -1,5 +1,6 @@ -using System; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; namespace SHH.Contracts { @@ -8,6 +9,8 @@ namespace SHH.Contracts /// public class VideoPayload { + public List SubscriberIds { get; } = new List(16); + // ========================================== // 1. 基础元数据 (将被序列化到 JSON) // ========================================== @@ -65,6 +68,7 @@ namespace SHH.Contracts OriginalHeight, TargetWidth, TargetHeight, + SubscriberIds, // 标记一下是否有目标图,方便接收端判断要不要读第3帧 HasTargetImage = (TargetImageBytes != null && TargetImageBytes.Length > 0) };