This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:

Subject: v4l2-ctl: let capture_setup return the updated format
Author:  Hans Verkuil <[email protected]>
Date:    Wed Jul 10 14:14:55 2019 +0200

Just getting the new format after a source change event isn't
enough in the case that -v option was specified by the user.

Instead let capture_setup optionally return the new format after
any '-v' changes are applied.

Signed-off-by: Hans Verkuil <[email protected]>
Reported-by: Dafna Hirschfeld <[email protected]>

 utils/v4l2-ctl/v4l2-ctl-streaming.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=1b961f5e82b0805faea0ba68bfa8037213a02351
diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp 
b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
index 28b2b3b92603..470fa7662715 100644
--- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
@@ -2146,7 +2146,7 @@ enum stream_type {
        OUT,
 };
 
-static int capture_setup(cv4l_fd &fd, cv4l_queue &in, cv4l_fd *exp_fd)
+static int capture_setup(cv4l_fd &fd, cv4l_queue &in, cv4l_fd *exp_fd, 
cv4l_fmt *new_fmt = NULL)
 {
        if (fd.streamoff(in.g_type())) {
                fprintf(stderr, "%s: fd.streamoff error\n", __func__);
@@ -2168,6 +2168,10 @@ static int capture_setup(cv4l_fd &fd, cv4l_queue &in, 
cv4l_fd *exp_fd)
                        return -1;
                }
                fd.s_fmt(fmt, in.g_type());
+               if (new_fmt)
+                       *new_fmt = fmt;
+       } else if (new_fmt) {
+               fd.g_fmt(*new_fmt, in.g_type());
        }
        get_cap_compose_rect(fd);
 
@@ -2367,8 +2371,7 @@ static void stateful_m2m(cv4l_fd &fd, cv4l_queue &in, 
cv4l_queue &out,
                        if (in_source_change_event) {
                                in_source_change_event = false;
                                last_buffer = false;
-                               fd.g_fmt(fmt_in, in.g_type());
-                               if (capture_setup(fd, in, exp_fd_p))
+                               if (capture_setup(fd, in, exp_fd_p, &fmt_in))
                                        return;
                                fps_ts[CAP].reset();
                                fps_ts[OUT].reset();

_______________________________________________
linuxtv-commits mailing list
[email protected]
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to