增加了通过网络主动上报图像的支持
增加了指令维护通道的支持
This commit is contained in:
@@ -1,14 +1,10 @@
|
||||
using SHH.Contracts;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace SHH.CameraDashboard
|
||||
{
|
||||
public class VideoWallViewModel : ViewModelBase
|
||||
{
|
||||
// 引用推流接收服务
|
||||
private readonly VideoPushServer _pushServer;
|
||||
|
||||
// 视频列表
|
||||
public ObservableCollection<VideoTileViewModel> VideoTiles { get; } = new ObservableCollection<VideoTileViewModel>();
|
||||
|
||||
@@ -27,35 +23,11 @@ namespace SHH.CameraDashboard
|
||||
{
|
||||
SetLayoutCommand = new RelayCommand<string>(ExecuteSetLayout);
|
||||
|
||||
// 1. 初始化并启动接收服务
|
||||
_pushServer = new VideoPushServer();
|
||||
_pushServer.OnFrameReceived += OnGlobalFrameReceived;
|
||||
|
||||
// 2. 启动监听端口 (比如 6000)
|
||||
// 之后你的采集端 ForwarderClient 需要 Connect("tcp://你的IP:6000")
|
||||
_pushServer.Start(6000);
|
||||
|
||||
// 3. 初始化格子 (不再需要传入 IP/Port 去主动连接了)
|
||||
// 我们用 CameraId 或 Name 来作为匹配标识
|
||||
InitVideoTiles();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 全局接收回调:收到任何一路视频都会进这里
|
||||
/// </summary>
|
||||
private void OnGlobalFrameReceived(VideoPayload payload)
|
||||
{
|
||||
// 1. 在 VideoTiles 集合中找到对应的格子
|
||||
// 假设 payload.CameraId 与我们 VideoTileViewModel 中的 ID 对应
|
||||
//var targetTile = VideoTiles.FirstOrDefault(t => t.id == payload.CameraId);
|
||||
|
||||
//if (targetTile != null)
|
||||
//{
|
||||
// // 2. 将数据交给格子去渲染
|
||||
// targetTile.UpdateFrame(payload);
|
||||
//}
|
||||
}
|
||||
|
||||
private void InitVideoTiles()
|
||||
{
|
||||
// 假设我们预设 4 个格子,分别对应不同的摄像头 ID
|
||||
|
||||
Reference in New Issue
Block a user