Files
LlamaCasty/Models/StreamConfig.cs
T
gramps e654a16b60 fix(history): file each session under the real encoder, not "unknown"
FfmpegEncoder resolved the encoder name into its OWN StreamHealth instance, while the view
model read CurrentHealth — a different object. So every recorded session was filed as
"unknown", and the rate history's encoder key (evidence about NVENC says nothing about QSV)
had nothing to key on. The name now travels on the encoder interface and the pump forwards
it: IFfmpegEncoder.VideoEncoderName -> FramePump.EncoderName.

Caught while adding it: reading _framePump.EncoderName from RefreshRateProposal throws,
because that call runs at MainViewModel ctor line 354 and the pump is built at line 468.
Eight tests failed with the same NullReferenceException, which took a while to see because
the harness's test output is buffered — the first honest look at per-test logging named it
in one line. Guarded; the history falls back to the last session's encoder for that tier,
which is exactly the pre-first-session case the fallback already existed for.

Tests: FramePumpTests gains the encoder-name assertion (null before start, h264_nvenc
after), and the three fake encoders implement the new member.

675 pass, 0 warnings.
2026-11-12 13:57:03 -08:00

53 lines
1.4 KiB
C#

namespace ytLive.Models;
public enum StreamStatus
{
Offline,
Connecting,
Streaming,
Error
}
public class StreamConfig
{
public string Title { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public string StreamKey { get; set; } = string.Empty;
public string IngestUrl { get; set; } = "rtmp://a.rtmp.youtube.com/live2";
public bool IsLowLatency { get; set; } = true;
public int TargetBitrate { get; set; } = 6000;
public int TargetFps { get; set; } = 60;
public string Resolution { get; set; } = "1920x1080";
}
public class StreamHealth
{
public StreamStatus Status { get; set; }
public double CurrentBitrate { get; set; }
public int DroppedFrames { get; set; }
public double FPS { get; set; }
public TimeSpan StreamDuration { get; set; }
public string? LastError { get; set; }
// YouTube-specific (liveStreams.status)
public string? HealthStatus { get; set; } // "good", "ok", "bad", "noData"
public string? HealthMessage { get; set; }
// Report-by-exception (TASK 5 item 3): configurationIssues[] — the banner
// surfaces only warning/error entries.
public List<StreamConfigurationIssue> ConfigurationIssues { get; } = new();
}
public enum StreamIssueSeverity
{
Info,
Warning,
Error
}
public class StreamConfigurationIssue
{
public StreamIssueSeverity Severity { get; set; }
public string? Type { get; set; }
}