Add compilation flag for V4L2 feature

This allows to disable V4L2 support on Linux to build without
libavdevice.
This commit is contained in:
Romain Vimont
2022-02-12 12:33:40 +01:00
parent d0ab8c0e7b
commit cc27771dd1
3 changed files with 4 additions and 2 deletions

View File

@@ -69,7 +69,7 @@ else
endif
endif
v4l2_support = host_machine.system() == 'linux'
v4l2_support = get_option('v4l2') and host_machine.system() == 'linux'
if v4l2_support
src += [ 'src/v4l2_sink.c' ]
endif

View File

@@ -1549,7 +1549,8 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
opts->v4l2_device = optarg;
break;
#else
LOGE("V4L2 (--v4l2-sink) is only available on Linux.");
LOGE("V4L2 (--v4l2-sink) is disabled (or unsupported on this "
"platform).");
return false;
#endif
case OPT_V4L2_BUFFER: