summaryrefslogtreecommitdiff
path: root/v4l2-drm-example
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2013-02-24 08:46:52 +0100
committerTomasz Stanislawski <t.stanislaws@samsung.com>2013-03-13 10:49:34 +0100
commitcc8dc11b7516e4810f8d5e8a3b5a85cde72490c8 (patch)
tree55af9c53bc7d66d2915c3375318c11c169e9875d /v4l2-drm-example
parent0c089d3638087b96502dcba7ec977dd87a6cebe1 (diff)
v4l2-drm-example: Use /dev/video0 by default
Use /dev/video0 as the video node when the -i option is missing. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'v4l2-drm-example')
-rw-r--r--v4l2-drm-example/dmabuf-sharing.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/v4l2-drm-example/dmabuf-sharing.c b/v4l2-drm-example/dmabuf-sharing.c
index 35cb38c..d1f93f4 100644
--- a/v4l2-drm-example/dmabuf-sharing.c
+++ b/v4l2-drm-example/dmabuf-sharing.c
@@ -126,7 +126,7 @@ static void usage(char *name)
fprintf(stderr, "usage: %s [-bFfhiMoSst]\n", name);
fprintf(stderr, "\nCapture options:\n\n");
- fprintf(stderr, "\t-i <video-node>\tset video node like /dev/video*\n");
+ fprintf(stderr, "\t-i <video-node>\tset video node (default: /dev/video0)\n");
fprintf(stderr, "\t-f <fourcc>\tset input format using 4cc\n");
fprintf(stderr, "\t-S <width,height>\tset input resolution\n");
fprintf(stderr, "\t-s <width,height>@<left,top>\tset crop area\n");
@@ -158,6 +158,8 @@ static int parse_args(int argc, char *argv[], struct setup *s)
int c, ret;
memset(s, 0, sizeof(*s));
+ strcpy(s->video, "/dev/video0");
+
while ((c = getopt(argc, argv, "b:F:f:hi:M:o:S:s:t:")) != -1) {
switch (c) {
case 'b':
@@ -457,7 +459,6 @@ int main(int argc, char *argv[])
ret = parse_args(argc, argv, &s);
BYE_ON(ret, "failed to parse arguments\n");
BYE_ON(s.module[0] == 0, "DRM module is missing\n");
- BYE_ON(s.video[0] == 0, "video node is missing\n");
memset(&v4l2, 0, sizeof v4l2);
v4l2.devname = s.video;