public Camera(IServiceProvider serviceProvider, IHttpClientFactory httpClientFactory, ILogger <Camera> logger, Configuration config, HealthChecker healthChecker, CameraConfig cameraConfig) { _httpClientFactory = httpClientFactory; _logger = logger; _healthChecker = healthChecker; _config = cameraConfig; _retrySleep = config.RetrySleep ?? 30; _kasaStreamReader = new KasaStreamReader(serviceProvider.GetService <ILogger <KasaStreamReader> >(), _config, _httpClientFactory.CreateClient("KasaHttpClient")); _ffmpeg = new Ffmpeg(serviceProvider.GetService <ILogger <Ffmpeg> >(), cameraConfig); // Subscribe to health checker events _healthChecker.UnhealthyResult += RestartCamera; }
public Ffmpeg(ILogger <Ffmpeg> logger, Data.CameraConfig cameraConfig) { _logger = logger; _cameraConfig = cameraConfig; }