serverRoom/device-agent/AgentConfig.cs
lvfengfree ed9d1d7325 feat: 屏幕监控大规模优化 - 支持60台设备同时监控
- Agent端优化:
  * 添加质量档位定义 (Low: 320x180@3fps, High: 1280x720@15fps)
  * H.264编码器支持动态质量切换
  * 屏幕流服务支持按需推流和质量控制
  * 添加SignalR信令客户端连接服务器

- 服务器端优化:
  * 添加StreamSignalingHub处理质量控制信令
  * 支持设备注册/注销和监控状态管理
  * 支持教师端监控控制和设备选中

- 前端组件:
  * 创建H264VideoPlayer组件支持H.264和JPEG模式
  * 更新学生屏幕监控页面使用新组件

- 性能提升:
  * 带宽从120Mbps降至6-7Mbps (降低95%)
  * 监控墙模式: 60台100kbps=6Mbps
  * 单机放大模式: 1台1Mbps+59台100kbps=6.9Mbps
  * 无人观看时停止推流节省带宽
2026-01-23 15:37:37 +08:00

84 lines
2.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

namespace DeviceAgent;
public class AgentConfig
{
/// <summary>
/// 服务器地址
/// </summary>
public string ServerUrl { get; set; } = "http://localhost:5000";
/// <summary>
/// 上报间隔(秒)
/// </summary>
public int ReportIntervalSeconds { get; set; } = 60;
/// <summary>
/// Agent 密钥(用于身份验证)
/// </summary>
public string AgentKey { get; set; } = "";
/// <summary>
/// 是否启用屏幕截图(定时上传)
/// </summary>
public bool ScreenCaptureEnabled { get; set; } = false;
/// <summary>
/// 屏幕截图间隔(秒)
/// </summary>
public int ScreenCaptureIntervalSeconds { get; set; } = 5;
/// <summary>
/// 屏幕截图质量 (1-100)
/// </summary>
public int ScreenCaptureQuality { get; set; } = 50;
/// <summary>
/// 屏幕截图最大宽度(像素)
/// </summary>
public int ScreenCaptureMaxWidth { get; set; } = 800;
// ========== 实时屏幕流配置 ==========
/// <summary>
/// 是否启用实时屏幕流
/// </summary>
public bool ScreenStreamEnabled { get; set; } = true;
/// <summary>
/// 屏幕流 WebSocket 端口
/// </summary>
public int ScreenStreamPort { get; set; } = 9100;
/// <summary>
/// 屏幕流帧率 (FPS)
/// </summary>
public int ScreenStreamFps { get; set; } = 15;
/// <summary>
/// 屏幕流质量 (1-100) - JPEG 模式使用
/// </summary>
public int ScreenStreamQuality { get; set; } = 60;
/// <summary>
/// 屏幕流最大宽度(像素)
/// </summary>
public int ScreenStreamMaxWidth { get; set; } = 1280;
/// <summary>
/// 是否使用 H.264 编码(更高效,需要 Windows 10+
/// </summary>
public bool UseH264Encoding { get; set; } = true;
/// <summary>
/// H.264 编码比特率 (bps)
/// </summary>
public int H264Bitrate { get; set; } = 2000000;
// ========== 远程桌面配置 ==========
/// <summary>
/// 是否在启动时自动开启远程桌面
/// </summary>
public bool EnableRemoteDesktopOnStart { get; set; } = true;
}