27 lines
873 B
C#
27 lines
873 B
C#
using System.Diagnostics;
|
|
using System.IO;
|
|
|
|
namespace ytLive.Services.Encoder;
|
|
|
|
/// <summary>
|
|
/// Seam around a spawned subprocess (the encoder's ffmpeg and the encoder probe).
|
|
/// Exposes the redirected stdin (binary frames), stdout (probe listing) and stderr
|
|
/// (progress lines) plus exit control, so the encoder logic never touches
|
|
/// <c>System.Diagnostics.Process</c> directly and tests can fake the whole thing.
|
|
/// </summary>
|
|
public interface IEncoderProcess : IDisposable
|
|
{
|
|
void Start(ProcessStartInfo startInfo);
|
|
|
|
/// <summary>Raw binary stdin — the encoder writes BGRA frames here.</summary>
|
|
Stream StandardInput { get; }
|
|
|
|
TextReader StandardOutput { get; }
|
|
TextReader StandardError { get; }
|
|
|
|
bool HasExited { get; }
|
|
int ExitCode { get; }
|
|
void Kill();
|
|
Task WaitForExitAsync(CancellationToken cancellationToken = default);
|
|
}
|