v4l2-ctl: add support for the frame_sync event.
authorHans Verkuil <hans.verkuil@cisco.com>
Fri, 7 Oct 2011 06:37:11 +0000 (08:37 +0200)
committerHans Verkuil <hans.verkuil@cisco.com>
Fri, 7 Oct 2011 06:37:11 +0000 (08:37 +0200)
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
utils/v4l2-ctl/v4l2-ctl.cpp

index f624fb2..e9250b7 100644 (file)
@@ -531,7 +531,7 @@ static void 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>\n"
+              "                     eos, vsync, ctrl=<id>, frame_sync\n"
               "                     where <id> is the name of the control\n"
               "  --poll-for-event=<event>\n"
               "                     poll for an event [VIDIOC_DQEVENT]\n"
@@ -1920,6 +1920,9 @@ static void print_event(const struct v4l2_event *ev)
                if (ctrl->changes & V4L2_EVENT_CTRL_CH_FLAGS)
                        printf("\tflags: %s\n", ctrlflags2s(ctrl->flags).c_str());
                break;
+       case V4L2_EVENT_FRAME_SYNC:
+               printf("frame_sync %d\n", ev->u.frame_sync.frame_sequence);
+               break;
        default:
                if (ev->type >= V4L2_EVENT_PRIVATE_START)
                        printf("unknown private event (%08x)\n", ev->type);
@@ -1944,6 +1947,8 @@ static __u32 parse_event(const char *e, const char **name)
                event = V4L2_EVENT_CTRL;
                *name = e + 5;
        }
+       else if (!strcmp(e, "frame_sync"))
+               event = V4L2_EVENT_FRAME_SYNC;
 
        if (event == 0) {
                fprintf(stderr, "Unknown event\n");