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

Subject: v4l2-ctl: add support V4L2_EVENT_SOURCE_CHANGE
Author:  Hans Verkuil <[email protected]>
Date:    Sun May 25 16:06:31 2014 +0200

This new event was added, add support for it to v4l2-ctl.

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

 utils/v4l2-ctl/v4l2-ctl-misc.cpp |    3 ++-
 utils/v4l2-ctl/v4l2-ctl.cpp      |   10 ++++++++++
 2 files changed, 12 insertions(+), 1 deletions(-)

---

http://git.linuxtv.org/v4l-utils.git?a=commitdiff;h=5b5dbc626536f1a14d51fd3d53f2958534370460

diff --git a/utils/v4l2-ctl/v4l2-ctl-misc.cpp b/utils/v4l2-ctl/v4l2-ctl-misc.cpp
index b418e15..6af10ed 100644
--- a/utils/v4l2-ctl/v4l2-ctl-misc.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-misc.cpp
@@ -29,8 +29,9 @@ void misc_usage(void)
               "  --wait-for-event=<event>\n"
               "                     wait for an event [VIDIOC_DQEVENT]\n"
               "                     <event> is the event number or one of:\n"
-              "                     eos, vsync, ctrl=<id>, frame_sync\n"
+              "                     eos, vsync, ctrl=<id>, frame_sync, 
source_change=<pad>\n"
               "                     where <id> is the name of the control\n"
+              "                     and where <pad> is the index of the pad or 
input\n"
               "  --poll-for-event=<event>\n"
               "                     poll for an event [VIDIOC_DQEVENT]\n"
               "                     see --wait-for-event for possible events\n"
diff --git a/utils/v4l2-ctl/v4l2-ctl.cpp b/utils/v4l2-ctl/v4l2-ctl.cpp
index fb1c69e..8d0cfbc 100644
--- a/utils/v4l2-ctl/v4l2-ctl.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl.cpp
@@ -780,6 +780,9 @@ static void print_event(const struct v4l2_event *ev)
        case V4L2_EVENT_FRAME_SYNC:
                printf("frame_sync %d\n", ev->u.frame_sync.frame_sequence);
                break;
+       case V4L2_EVENT_SOURCE_CHANGE:
+               printf("source_change: pad/input=%d changes: %x\n", ev->id, 
ev->u.src_change.changes);
+               break;
        default:
                if (ev->type >= V4L2_EVENT_PRIVATE_START)
                        printf("unknown private event (%08x)\n", ev->type);
@@ -805,6 +808,9 @@ static __u32 parse_event(const char *e, const char **name)
        else if (!strncmp(e, "ctrl=", 5)) {
                event = V4L2_EVENT_CTRL;
                *name = e + 5;
+       } else if (!strncmp(e, "source_change=", 14)) {
+               event = V4L2_EVENT_SOURCE_CHANGE;
+               *name = e + 14;
        }
 
        if (event == 0) {
@@ -1146,6 +1152,8 @@ int main(int argc, char **argv)
                sub.type = wait_for_event;
                if (wait_for_event == V4L2_EVENT_CTRL)
                        sub.id = common_find_ctrl_id(wait_event_id);
+               else if (wait_for_event == V4L2_EVENT_SOURCE_CHANGE)
+                       sub.id = strtoul(wait_event_id, 0L, 0);
                if (!doioctl(fd, VIDIOC_SUBSCRIBE_EVENT, &sub))
                        if (!doioctl(fd, VIDIOC_DQEVENT, &ev))
                                print_event(&ev);
@@ -1160,6 +1168,8 @@ int main(int argc, char **argv)
                sub.type = poll_for_event;
                if (poll_for_event == V4L2_EVENT_CTRL)
                        sub.id = common_find_ctrl_id(poll_event_id);
+               else if (poll_for_event == V4L2_EVENT_SOURCE_CHANGE)
+                       sub.id = strtoul(poll_event_id, 0L, 0);
                if (!doioctl(fd, VIDIOC_SUBSCRIBE_EVENT, &sub)) {
                        fd_set fds;
                        __u32 seq = 0;

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

Reply via email to