summaryrefslogtreecommitdiff
path: root/v4l2-apps/test
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-11-15 17:49:14 -0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-11-15 17:49:14 -0200
commitcbbc1373bd674a772030df86c05fdb5cadffa95c (patch)
tree827743bd5c8a63617c8b307834c83985c439a05f /v4l2-apps/test
parent06700d6b31366059ca963dd4aba34ea2e57aaa05 (diff)
downloadmediapointer-dvb-s2-cbbc1373bd674a772030df86c05fdb5cadffa95c.tar.gz
mediapointer-dvb-s2-cbbc1373bd674a772030df86c05fdb5cadffa95c.tar.bz2
Improved v4l2_driver
From: Mauro Carvalho Chehab <mchehab@infradead.org> - 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 <mchehab@infradead.org>
Diffstat (limited to 'v4l2-apps/test')
-rw-r--r--v4l2-apps/test/driver-test.c14
1 files changed, 13 insertions, 1 deletions
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");
}