namespace ytLive.Services;

/// <summary>
/// A running capture source for one device. Raises normalized BGRA frames from
/// a worker thread; callers must marshal to the UI thread. Seam so CameraManager
/// is testable without WinRT.
/// </summary>
public interface ICameraFrameSource
{
    string DeviceId { get; }

    /// <summary>Normalized BGRA frames from a worker thread; callers marshal to the UI thread.</summary>
    event Action<VideoFrame>? FrameAvailable;

    /// <summary>
    /// Raised when the capture session fails asynchronously after a successful start
    /// (device lost, stream state Failed, media capture failure). Carries the reason.
    /// </summary>
    event Action<string>? SourceFailed;

    Task StartAsync();
    Task StopAsync();
}
