26 lines
1.2 KiB
C#
26 lines
1.2 KiB
C#
using ytLive.Models;
|
|
|
|
namespace ytLive.Services.Encoder;
|
|
|
|
/// <summary>
|
|
/// 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 <see cref="SubmitFrameAsync"/> at
|
|
/// capture rate; this service serializes writes, parses progress, and tears the
|
|
/// process down gracefully. Constructor-injected <see cref="IFfmpegLocator"/> +
|
|
/// process factory keep it hermetic (tests fake both).
|
|
/// </summary>
|
|
public interface IFfmpegEncoder : IDisposable
|
|
{
|
|
/// <summary>Fires on each parsed ffmpeg <c>-stats</c> progress line (~2 Hz).</summary>
|
|
event EventHandler<StreamHealth>? HealthUpdated;
|
|
|
|
/// <summary>Fires when the subprocess dies unexpectedly (non-zero exit while live).</summary>
|
|
event EventHandler<string>? ProcessFailed;
|
|
|
|
Task StartAsync(EncoderOptions options, CancellationToken cancellationToken = default);
|
|
Task SubmitFrameAsync(VideoFrame frame, CancellationToken cancellationToken = default);
|
|
Task StopAsync(CancellationToken cancellationToken = default);
|
|
}
|