From 79020143c73dd5af919f4eddf3675417811aa41f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20M=C3=BCller?= Date: Tue, 29 Oct 2024 10:35:03 +0100 Subject: [PATCH] scale the blank image for NO SIGNAL to the resolution in the options --- src/ustreamer/main.c | 1 + src/ustreamer/stream.c | 5 +++++ src/ustreamer/stream.h | 1 + 3 files changed, 7 insertions(+) diff --git a/src/ustreamer/main.c b/src/ustreamer/main.c index 318921b0..ea69d972 100644 --- a/src/ustreamer/main.c +++ b/src/ustreamer/main.c @@ -90,6 +90,7 @@ int main(int argc, char *argv[]) { _g_server = us_server_init(_g_stream); if ((exit_code = options_parse(options, cap, enc, _g_stream, _g_server)) == 0) { + us_stream_update_blank(cap); # ifdef WITH_GPIO us_gpio_init(); # endif diff --git a/src/ustreamer/stream.c b/src/ustreamer/stream.c index 58e66350..3b257ccc 100644 --- a/src/ustreamer/stream.c +++ b/src/ustreamer/stream.c @@ -129,6 +129,11 @@ us_stream_s *us_stream_init(us_capture_s *cap, us_encoder_s *enc) { return stream; } +void us_stream_update_blank(us_stream_s *stream, us_capture_s *cap) +{ + us_blank_draw(stream->run->blank, "< NO SIGNAL >", cap->width, cap->height); +} + void us_stream_destroy(us_stream_s *stream) { us_fpsi_destroy(stream->run->http->captured_fpsi); US_RING_DELETE_WITH_ITEMS(stream->run->http->jpeg_ring, us_frame_destroy); diff --git a/src/ustreamer/stream.h b/src/ustreamer/stream.h index 3369b726..eca5de66 100644 --- a/src/ustreamer/stream.h +++ b/src/ustreamer/stream.h @@ -96,6 +96,7 @@ typedef struct { us_stream_s *us_stream_init(us_capture_s *cap, us_encoder_s *enc); +void us_stream_update_blank(us_stream_s *stream, us_capture_s *cap); void us_stream_destroy(us_stream_s *stream); void us_stream_loop(us_stream_s *stream);