aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorHans Verkuil <hansverk@cisco.com>2018-09-13 13:31:32 +0200
committerHans Verkuil <hansverk@cisco.com>2018-09-13 13:31:32 +0200
commit72e6d7e7064c756baa1c53f1c80e50712c1f7af5 (patch)
tree0452424c6387745d2626f0b5c671b31cb01f7167 /utils
parentd26e4941419b05fcb2b6708ee32aef367c2ec4af (diff)
v4l2-ctl: cut out more code if NO_STREAM_TO is defined
If NO_STREAM_TO is defined, then the code that streams the video to a file or network is disabled. Until now only the options were disabled, but now also remove the code that does the actual writing to file/network as an additional safeguard. Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Diffstat (limited to 'utils')
-rw-r--r--utils/v4l2-ctl/v4l2-ctl-streaming.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
index 914bdf08..8a02e52a 100644
--- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
@@ -53,7 +53,10 @@ static unsigned reqbufs_count_out = 4;
static char *file_to;
static bool to_with_hdr;
static char *host_to;
+#ifndef NO_STREAM_TO
static unsigned host_port_to = V4L_STREAM_PORT;
+static unsigned bpl_cap[VIDEO_MAX_PLANES];
+#endif
static bool host_lossless;
static int host_fd_to = -1;
static unsigned comp_perc;
@@ -66,7 +69,6 @@ static int host_fd_from = -1;
static struct tpg_data tpg;
static unsigned output_field = V4L2_FIELD_NONE;
static bool output_field_alt;
-static unsigned bpl_cap[VIDEO_MAX_PLANES];
static unsigned bpl_out[VIDEO_MAX_PLANES];
static bool last_buffer = false;
static codec_ctx *ctx;
@@ -928,6 +930,7 @@ static int do_handle_cap(cv4l_fd &fd, cv4l_queue &q, FILE *fout, int *index,
double ts_secs = buf.g_timestamp().tv_sec + buf.g_timestamp().tv_usec / 1000000.0;
fps_ts.add_ts(ts_secs, buf.g_sequence(), buf.g_field());
+#ifndef NO_STREAM_TO
if (fout && (!stream_skip || ignore_count_skip) &&
buf.g_bytesused(0) && !(buf.g_flags() & V4L2_BUF_FLAG_ERROR)) {
unsigned comp_size[VIDEO_MAX_PLANES];
@@ -995,6 +998,7 @@ static int do_handle_cap(cv4l_fd &fd, cv4l_queue &q, FILE *fout, int *index,
if (host_fd_to >= 0)
fflush(fout);
}
+#endif
if (buf.g_flags() & V4L2_BUF_FLAG_KEYFRAME)
ch = 'K';
else if (buf.g_flags() & V4L2_BUF_FLAG_PFRAME)
@@ -1207,6 +1211,7 @@ recover:
}
}
+#ifndef NO_STREAM_TO
if (file_to) {
if (!strcmp(file_to, "-"))
fout = stdout;
@@ -1281,6 +1286,7 @@ recover:
cfmt.g_ycbcr_enc(), cfmt.g_quantization());
fflush(fout);
}
+#endif
if (q.reqbufs(&fd, reqbufs_count_cap))
goto done;

Privacy Policy