diff mbox series

[v4l-utils,3/6] v4l2-ctl: test the excpetion fds first in streaming_set_m2m

Message ID 20190120111520.114305-4-dafna3@gmail.com (mailing list archive)
State New, archived
Headers show
Series Support for source change in m2m decoder | expand

Commit Message

Dafna Hirschfeld Jan. 20, 2019, 11:15 a.m. UTC
test the excpetion fds first in the select loop
in streaming_set_m2m. This is needed in the next patch
in order to dequeue a source change event before its
coresponding last buffer.

Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
---
 utils/v4l2-ctl/v4l2-ctl-streaming.cpp | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

Comments

Hans Verkuil Jan. 21, 2019, 9:34 a.m. UTC | #1
On 01/20/2019 12:15 PM, Dafna Hirschfeld wrote:
> test the excpetion fds first in the select loop

excpetion -> exception

> in streaming_set_m2m. This is needed in the next patch
> in order to dequeue a source change event before its
> coresponding last buffer.

coresponding -> corresponding

But besides those typos, I don't think this patch is needed at
all. See my comments for patch 5/6 for more info.

Regards,

	Hans

> 
> Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com>
> ---
>  utils/v4l2-ctl/v4l2-ctl-streaming.cpp | 26 +++++++++++++-------------
>  1 file changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
> index 3e81fdfc..fc204304 100644
> --- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
> +++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
> @@ -1953,6 +1953,19 @@ static void streaming_set_m2m(cv4l_fd &fd)
>  			goto done;
>  		}
>  
> +		if (ex_fds && FD_ISSET(fd.g_fd(), ex_fds)) {
> +			struct v4l2_event ev;
> +
> +			while (!fd.dqevent(ev)) {
> +				if (ev.type != V4L2_EVENT_EOS)
> +					continue;
> +				wr_fds = NULL;
> +				fprintf(stderr, "EOS");
> +				fflush(stderr);
> +				break;
> +			}
> +		}
> +
>  		if (rd_fds && FD_ISSET(fd.g_fd(), rd_fds)) {
>  			r = do_handle_cap(fd, in, file[CAP], NULL,
>  					  count[CAP], fps_ts[CAP]);
> @@ -1990,19 +2003,6 @@ static void streaming_set_m2m(cv4l_fd &fd)
>  				}
>  			}
>  		}
> -
> -		if (ex_fds && FD_ISSET(fd.g_fd(), ex_fds)) {
> -			struct v4l2_event ev;
> -
> -			while (!fd.dqevent(ev)) {
> -				if (ev.type != V4L2_EVENT_EOS)
> -					continue;
> -				wr_fds = NULL;
> -				fprintf(stderr, "EOS");
> -				fflush(stderr);
> -				break;
> -			}
> -		}
>  	}
>  
>  	fcntl(fd.g_fd(), F_SETFL, fd_flags);
>
diff mbox series

Patch

diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
index 3e81fdfc..fc204304 100644
--- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
@@ -1953,6 +1953,19 @@  static void streaming_set_m2m(cv4l_fd &fd)
 			goto done;
 		}
 
+		if (ex_fds && FD_ISSET(fd.g_fd(), ex_fds)) {
+			struct v4l2_event ev;
+
+			while (!fd.dqevent(ev)) {
+				if (ev.type != V4L2_EVENT_EOS)
+					continue;
+				wr_fds = NULL;
+				fprintf(stderr, "EOS");
+				fflush(stderr);
+				break;
+			}
+		}
+
 		if (rd_fds && FD_ISSET(fd.g_fd(), rd_fds)) {
 			r = do_handle_cap(fd, in, file[CAP], NULL,
 					  count[CAP], fps_ts[CAP]);
@@ -1990,19 +2003,6 @@  static void streaming_set_m2m(cv4l_fd &fd)
 				}
 			}
 		}
-
-		if (ex_fds && FD_ISSET(fd.g_fd(), ex_fds)) {
-			struct v4l2_event ev;
-
-			while (!fd.dqevent(ev)) {
-				if (ev.type != V4L2_EVENT_EOS)
-					continue;
-				wr_fds = NULL;
-				fprintf(stderr, "EOS");
-				fflush(stderr);
-				break;
-			}
-		}
 	}
 
 	fcntl(fd.g_fd(), F_SETFL, fd_flags);