using ytLive.Models; namespace ytLive.Services.Encoder; /// /// The live encoder seam (TASK 4 ship step 3): start an FFmpeg subprocess that /// encodes raw BGRA frames from stdin and pushes FLV to an RTMP ingestion URL, /// raising parsed health stats from stderr. The frame producer (compositor → /// capture managers, TASK 4 ship step 5) feeds at /// capture rate; this service serializes writes, parses progress, and tears the /// process down gracefully. Constructor-injected + /// process factory keep it hermetic (tests fake both). /// public interface IFfmpegEncoder : IDisposable { /// Fires on each parsed ffmpeg -stats progress line (~2 Hz). event EventHandler? HealthUpdated; /// Fires when the subprocess dies unexpectedly (non-zero exit while live). event EventHandler? ProcessFailed; Task StartAsync(EncoderOptions options, CancellationToken cancellationToken = default); Task SubmitFrameAsync(VideoFrame frame, CancellationToken cancellationToken = default); Task StopAsync(CancellationToken cancellationToken = default); }