在 AiVideo 中能看到图像
增加了在线状态同步逻辑
This commit is contained in:
37
SHH.CameraService/Interceptors/ProtocolContext.cs
Normal file
37
SHH.CameraService/Interceptors/ProtocolContext.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
namespace SHH.CameraService;
|
||||
|
||||
/// <summary>
|
||||
/// 协议上下文 (用于在拦截器之间传递数据)
|
||||
/// </summary>
|
||||
public class ProtocolContext
|
||||
{
|
||||
public string Protocol { get; set; }
|
||||
public byte[] Data { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否拦截/终止 (设为 true 则不再继续传递)
|
||||
/// </summary>
|
||||
public bool IsBlocked { get; set; } = false;
|
||||
|
||||
public ProtocolContext(string protocol, byte[] data)
|
||||
{
|
||||
Protocol = protocol;
|
||||
Data = data;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 拦截器接口
|
||||
/// </summary>
|
||||
public interface IProtocolInterceptor
|
||||
{
|
||||
/// <summary>
|
||||
/// 发送前触发 (Outbound)
|
||||
/// </summary>
|
||||
Task OnSendingAsync(ProtocolContext context);
|
||||
|
||||
/// <summary>
|
||||
/// 接收后触发 (Inbound)
|
||||
/// </summary>
|
||||
Task OnReceivedAsync(ProtocolContext context);
|
||||
}
|
||||
Reference in New Issue
Block a user