namespace DeviceAgent.Models;
///
/// 流质量档位
///
public enum StreamQualityLevel
{
///
/// 低质量 - 用于监控墙总览
///
Low,
///
/// 高质量 - 用于单机放大查看
///
High
}
///
/// 流质量配置
///
public class StreamQualityProfile
{
public StreamQualityLevel Level { get; set; }
public int Width { get; set; }
public int Height { get; set; }
public int Fps { get; set; }
public int Bitrate { get; set; }
///
/// 低质量档位 - 监控墙模式
/// 320x180, 3fps, 100kbps
///
public static StreamQualityProfile Low => new()
{
Level = StreamQualityLevel.Low,
Width = 320,
Height = 180,
Fps = 3,
Bitrate = 100_000 // 100 kbps
};
///
/// 高质量档位 - 单机放大模式
/// 1280x720, 15fps, 1Mbps
///
public static StreamQualityProfile High => new()
{
Level = StreamQualityLevel.High,
Width = 1280,
Height = 720,
Fps = 15,
Bitrate = 1_000_000 // 1 Mbps
};
public override string ToString()
{
return $"{Level}: {Width}x{Height} @ {Fps}fps, {Bitrate / 1000}kbps";
}
}