aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDafna Hirschfeld <dafna3@gmail.com>2019-03-06 21:17:49 (GMT)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2019-03-13 13:58:20 (GMT)
commit30c095bbcc4037c40f4bd6848c4c3b17ccb004fb (patch)
tree0a79c7dbdebfc596a112ebfeef7d173eed0ac8ed
parenta956b274557c741cfb326124d515c4af357eb648 (diff)
v4l2-ctl: set the in/out fmt variables in streaming_set_m2m
set the in/out fmt variables in streaming_set_m2m This is needed later to check for stateless fwht pixel format. Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/v4l2-ctl/v4l2-ctl-streaming.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
index c0a9059..245ad58 100644
--- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
@@ -1952,7 +1952,8 @@ static int capture_setup(cv4l_fd &fd, cv4l_queue &in, cv4l_fd *exp_fd)
}
static void stateful_m2m(cv4l_fd &fd, cv4l_queue &in, cv4l_queue &out,
- FILE *fin, FILE *fout, cv4l_fd *exp_fd_p)
+ FILE *fin, FILE *fout, cv4l_fmt &fmt_in,
+ cv4l_fmt &fmt_out, cv4l_fd *exp_fd_p)
{
int fd_flags = fcntl(fd.g_fd(), F_GETFL);
fps_timestamps fps_ts[2];
@@ -1962,10 +1963,6 @@ static void stateful_m2m(cv4l_fd &fd, cv4l_queue &in, cv4l_queue &out,
fd_set *ex_fds = &fds[1]; /* for capture */
fd_set *wr_fds = &fds[2]; /* for output */
bool cap_streaming = false;
- cv4l_fmt fmt[2];
-
- fd.g_fmt(fmt[OUT], out.g_type());
- fd.g_fmt(fmt[CAP], in.g_type());
struct v4l2_event_subscription sub;
@@ -2043,7 +2040,7 @@ static void stateful_m2m(cv4l_fd &fd, cv4l_queue &in, cv4l_queue &out,
if (rd_fds && FD_ISSET(fd.g_fd(), rd_fds)) {
r = do_handle_cap(fd, in, fin, NULL,
- count[CAP], fps_ts[CAP], fmt[CAP]);
+ count[CAP], fps_ts[CAP], fmt_in);
if (r < 0) {
rd_fds = NULL;
if (!have_eos) {
@@ -2055,7 +2052,7 @@ static void stateful_m2m(cv4l_fd &fd, cv4l_queue &in, cv4l_queue &out,
if (wr_fds && FD_ISSET(fd.g_fd(), wr_fds)) {
r = do_handle_out(fd, out, fout, NULL,
- count[OUT], fps_ts[OUT], fmt[OUT]);
+ count[OUT], fps_ts[OUT], fmt_out);
if (r < 0) {
wr_fds = NULL;
@@ -2107,8 +2104,8 @@ static void stateful_m2m(cv4l_fd &fd, cv4l_queue &in, cv4l_queue &out,
last_buffer = false;
if (capture_setup(fd, in, exp_fd_p))
return;
- fd.g_fmt(fmt[OUT], out.g_type());
- fd.g_fmt(fmt[CAP], in.g_type());
+ fd.g_fmt(fmt_out, out.g_type());
+ fd.g_fmt(fmt_in, in.g_type());
cap_streaming = true;
} else {
break;
@@ -2133,6 +2130,10 @@ static void streaming_set_m2m(cv4l_fd &fd, cv4l_fd &exp_fd)
cv4l_queue exp_q(exp_fd.g_type(), V4L2_MEMORY_MMAP);
cv4l_fd *exp_fd_p = NULL;
FILE *file[2] = {NULL, NULL};
+ cv4l_fmt fmt[2];
+
+ fd.g_fmt(fmt[OUT], out.g_type());
+ fd.g_fmt(fmt[CAP], in.g_type());
if (!fd.has_vid_m2m()) {
fprintf(stderr, "unsupported m2m stream type\n");
@@ -2162,7 +2163,7 @@ static void streaming_set_m2m(cv4l_fd &fd, cv4l_fd &exp_fd)
if (out.export_bufs(&exp_fd, exp_fd.g_type()))
goto done;
}
- stateful_m2m(fd, in, out, file[CAP], file[OUT], exp_fd_p);
+ stateful_m2m(fd, in, out, file[CAP], file[OUT], fmt[CAP], fmt[OUT], exp_fd_p);
done:
if (options[OptStreamDmaBuf] || options[OptStreamOutDmaBuf])

Privacy Policy