Merge branch 'main' of http://hk.ayaygo.cn:21108/root/Ayay
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -377,6 +377,8 @@ public class HikVideoSource : BaseVideoSource,
|
||||
Cv2.CvtColor(rawYuvWrapper, smartFrame.InternalMat, ColorConversionCodes.YUV2BGR_YV12);
|
||||
}
|
||||
|
||||
smartFrame.SubscriberIds.AddRange(decision.TargetAppIds);
|
||||
|
||||
// =========================================================================
|
||||
// 【新增】插入这一行!
|
||||
// 此时 smartFrame.InternalMat 已经有了图像数据
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
/// </summary>
|
||||
public class VideoPayload
|
||||
{
|
||||
public List<string> SubscriberIds { get; } = new List<string>(16);
|
||||
|
||||
// ==========================================
|
||||
// 1. 基础元数据 (将被序列化到 JSON)
|
||||
// ==========================================
|
||||
@@ -65,6 +68,7 @@ namespace SHH.Contracts
|
||||
OriginalHeight,
|
||||
TargetWidth,
|
||||
TargetHeight,
|
||||
SubscriberIds,
|
||||
// 标记一下是否有目标图,方便接收端判断要不要读第3帧
|
||||
HasTargetImage = (TargetImageBytes != null && TargetImageBytes.Length > 0)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user