fix(build): remove video args if no video
This commit is contained in:
+12
@@ -30,8 +30,10 @@ static void print_help(int status_code) {
|
|||||||
"[-d] "
|
"[-d] "
|
||||||
"[-ar / -nar] "
|
"[-ar / -nar] "
|
||||||
"[-arc=CYCLES] "
|
"[-arc=CYCLES] "
|
||||||
|
#ifdef VIDEO_IN
|
||||||
"[-vi=FILE] "
|
"[-vi=FILE] "
|
||||||
"[-vs=SIZE] "
|
"[-vs=SIZE] "
|
||||||
|
#endif /* VIDEO_IN */
|
||||||
"[-is=SIZE] "
|
"[-is=SIZE] "
|
||||||
"[-ls / -nls] "
|
"[-ls / -nls] "
|
||||||
"[-ss / -nss] "
|
"[-ss / -nss] "
|
||||||
@@ -57,10 +59,12 @@ static void print_help(int status_code) {
|
|||||||
" -ar, --auto-random randomize state every cycle (4 beats)\n"
|
" -ar, --auto-random randomize state every cycle (4 beats)\n"
|
||||||
" -nar, --no-auto-random do not randomize state (default)\n"
|
" -nar, --no-auto-random do not randomize state (default)\n"
|
||||||
" -arc, --auto-random-cycle auto random cycle length (default: 4)\n"
|
" -arc, --auto-random-cycle auto random cycle length (default: 4)\n"
|
||||||
|
#ifdef VIDEO_IN
|
||||||
" -vi, --video-in path to video capture device (multiple "
|
" -vi, --video-in path to video capture device (multiple "
|
||||||
"allowed)\n"
|
"allowed)\n"
|
||||||
" -vs, --video-size video capture desired height (default: "
|
" -vs, --video-size video capture desired height (default: "
|
||||||
"internal texture height)\n"
|
"internal texture height)\n"
|
||||||
|
#endif /* VIDEO_IN */
|
||||||
" -is, --internal-size internal texture height (default: 720)\n"
|
" -is, --internal-size internal texture height (default: 720)\n"
|
||||||
" -ls, --load-state load saved state (default)\n"
|
" -ls, --load-state load saved state (default)\n"
|
||||||
" -nls, --no-load-state do not load saved state\n"
|
" -nls, --no-load-state do not load saved state\n"
|
||||||
@@ -174,17 +178,25 @@ void args_parse(Parameters *params, int argc, char **argv) {
|
|||||||
invalid_value(arg, value);
|
invalid_value(arg, value);
|
||||||
}
|
}
|
||||||
} else if (is_arg(arg, "-vi") || is_arg(arg, "--video-in")) {
|
} else if (is_arg(arg, "-vi") || is_arg(arg, "--video-in")) {
|
||||||
|
#ifdef VIDEO_IN
|
||||||
if (params->video_in.length == MAX_VIDEO) {
|
if (params->video_in.length == MAX_VIDEO) {
|
||||||
log_error("maximum video input reached");
|
log_error("maximum video input reached");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
strlcpy(params->video_in.values[params->video_in.length++], value,
|
strlcpy(params->video_in.values[params->video_in.length++], value,
|
||||||
STR_LEN);
|
STR_LEN);
|
||||||
|
#else
|
||||||
|
invalid_arg(arg);
|
||||||
|
#endif /* VIDEO_IN */
|
||||||
} else if (is_arg(arg, "-vs") || is_arg(arg, "--video-size")) {
|
} else if (is_arg(arg, "-vs") || is_arg(arg, "--video-size")) {
|
||||||
|
#ifdef VIDEO_IN
|
||||||
params->video_size = parse_uint(arg, value);
|
params->video_size = parse_uint(arg, value);
|
||||||
if (params->video_size == 0) {
|
if (params->video_size == 0) {
|
||||||
invalid_value(arg, value);
|
invalid_value(arg, value);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
invalid_arg(arg);
|
||||||
|
#endif /* VIDEO_IN */
|
||||||
} else if (is_arg(arg, "-is") || is_arg(arg, "--internal-size")) {
|
} else if (is_arg(arg, "-is") || is_arg(arg, "--internal-size")) {
|
||||||
params->internal_size = parse_uint(arg, value);
|
params->internal_size = parse_uint(arg, value);
|
||||||
if (params->internal_size == 0) {
|
if (params->internal_size == 0) {
|
||||||
|
|||||||
+4
-2
@@ -6,8 +6,6 @@
|
|||||||
#include <linmath.h>
|
#include <linmath.h>
|
||||||
#ifdef VIDEO_IN
|
#ifdef VIDEO_IN
|
||||||
#include <linux/videodev2.h>
|
#include <linux/videodev2.h>
|
||||||
#else
|
|
||||||
struct v4l2_buffer {};
|
|
||||||
#endif /* VIDEO_IN */
|
#endif /* VIDEO_IN */
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
@@ -134,6 +132,10 @@ typedef struct ShaderProgram {
|
|||||||
|
|
||||||
// video.c
|
// video.c
|
||||||
|
|
||||||
|
#ifndef VIDEO_IN
|
||||||
|
struct v4l2_buffer {};
|
||||||
|
#endif /* VIDEO_IN */
|
||||||
|
|
||||||
typedef struct VideoCapture {
|
typedef struct VideoCapture {
|
||||||
char name[STR_LEN];
|
char name[STR_LEN];
|
||||||
bool error;
|
bool error;
|
||||||
|
|||||||
Reference in New Issue
Block a user