From 6ad46d70b8190a8f409cdd62870f51a6e24baa50 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Wed, 24 May 2023 20:39:13 +0200 Subject: [PATCH] Define v4l2_buffer only if HAVE_V4L2 If V4L2 support is disabled, there is no v4l2 buffer option. --- app/src/options.c | 8 ++++---- app/src/options.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/options.c b/app/src/options.c index b021921f..fc3b1790 100644 --- a/app/src/options.c +++ b/app/src/options.c @@ -11,9 +11,6 @@ const struct scrcpy_options scrcpy_options_default = { .audio_codec_options = NULL, .video_encoder = NULL, .audio_encoder = NULL, -#ifdef HAVE_V4L2 - .v4l2_device = NULL, -#endif .log_level = SC_LOG_LEVEL_INFO, .video_codec = SC_CODEC_H264, .audio_codec = SC_CODEC_OPUS, @@ -42,9 +39,12 @@ const struct scrcpy_options scrcpy_options_default = { .window_height = 0, .display_id = 0, .display_buffer = 0, - .v4l2_buffer = 0, .audio_buffer = SC_TICK_FROM_MS(50), .audio_output_buffer = SC_TICK_FROM_MS(5), +#ifdef HAVE_V4L2 + .v4l2_device = NULL, + .v4l2_buffer = 0, +#endif #ifdef HAVE_USB .otg = false, #endif diff --git a/app/src/options.h b/app/src/options.h index 0c886de0..e3cc8064 100644 --- a/app/src/options.h +++ b/app/src/options.h @@ -112,9 +112,6 @@ struct scrcpy_options { const char *audio_codec_options; const char *video_encoder; const char *audio_encoder; -#ifdef HAVE_V4L2 - const char *v4l2_device; -#endif enum sc_log_level log_level; enum sc_codec video_codec; enum sc_codec audio_codec; @@ -137,9 +134,12 @@ struct scrcpy_options { uint16_t window_height; uint32_t display_id; sc_tick display_buffer; - sc_tick v4l2_buffer; sc_tick audio_buffer; sc_tick audio_output_buffer; +#ifdef HAVE_V4L2 + const char *v4l2_device; + sc_tick v4l2_buffer; +#endif #ifdef HAVE_USB bool otg; #endif