From cbbc1373bd674a772030df86c05fdb5cadffa95c Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 15 Nov 2006 17:49:14 -0200 Subject: Improved v4l2_driver From: Mauro Carvalho Chehab - Better presentation of version - Make v4l2_enum_fmt generic for all types - Added v4l2_gettryset_fmt_cap to GET/TRY/SET fmt on capture - driver-test now sets a video format Signed-off-by: Mauro Carvalho Chehab --- v4l2-apps/test/driver-test.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'v4l2-apps/test') diff --git a/v4l2-apps/test/driver-test.c b/v4l2-apps/test/driver-test.c index cf3511fc4..53ce6b9d7 100644 --- a/v4l2-apps/test/driver-test.c +++ b/v4l2-apps/test/driver-test.c @@ -51,9 +51,21 @@ int main(void) perror("set_input"); } - if (v4l2_enum_fmt_cap (&drv)<0) { + if (v4l2_enum_fmt (&drv,V4L2_BUF_TYPE_VIDEO_CAPTURE)<0) { perror("enum_fmt_cap"); } + + /* Tries all formats */ + for (cur=drv.fmt_caps;cur!=NULL;cur=cur->next) { + struct v4l2_format fmt; + uint32_t pixelformat=((struct v4l2_fmtdesc *)cur->curr)->pixelformat; + if (cur->curr) { + if (v4l2_gettryset_fmt_cap (&drv,V4L2_SET,&fmt, 640, 480, + pixelformat,V4L2_FIELD_ANY)) + perror("set_input"); + } + } + if (v4l2_get_parm (&drv)<0) { perror("get_parm"); } -- cgit v1.2.3