Skip to content

Commit

Permalink
Add compilation flag for V4L2 feature
Browse files Browse the repository at this point in the history
This allows to disable V4L2 support on Linux to build without
libavdevice.
  • Loading branch information
rom1v committed Feb 12, 2022
1 parent d0ab8c0 commit cc27771
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion app/src/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ option('prebuilt_server', type: 'string', description: 'Path of the prebuilt ser
option('portable', type: 'boolean', value: false, description: 'Use scrcpy-server from the same directory as the scrcpy executable')
option('server_debugger', type: 'boolean', value: false, description: 'Run a server debugger and wait for a client to be attached')
option('server_debugger_method', type: 'combo', choices: ['old', 'new'], value: 'new', description: 'Select the debugger method (Android < 9: "old", Android >= 9: "new")')
option('v4l2', type: 'boolean', value: true, description: 'Enable V4L2 feature when supported')

0 comments on commit cc27771

Please sign in to comment.