summaryrefslogtreecommitdiff
path: root/v4l2-apps/test
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-05-07 07:50:52 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-05-07 07:50:52 -0300
commit2f17fa91b50b3434c341b220b3cb0c5c0d81f8e7 (patch)
treeffdf615dcdbf0d5c69d92912acfc1f0572fbcb50 /v4l2-apps/test
parent76775b7f2ced0c0301ac3ae201aafc3d9b88e091 (diff)
downloadmediapointer-dvb-s2-2f17fa91b50b3434c341b220b3cb0c5c0d81f8e7.tar.gz
mediapointer-dvb-s2-2f17fa91b50b3434c341b220b3cb0c5c0d81f8e7.tar.bz2
Add capability to test VIDIOC_[S|G]_FREQUENCY on driver-test
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l2-apps/test')
-rw-r--r--v4l2-apps/test/driver-test.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/v4l2-apps/test/driver-test.c b/v4l2-apps/test/driver-test.c
index a2ac365a3..e4c16ed54 100644
--- a/v4l2-apps/test/driver-test.c
+++ b/v4l2-apps/test/driver-test.c
@@ -31,12 +31,13 @@ int main(void)
struct v4l2_driver drv;
struct drv_list *cur;
unsigned int count = 10, i;
+ double freq;
if (v4l2_open ("/dev/video0", 1,&drv)<0) {
perror("open /dev/video0");
return -1;
}
- if (v4l2_enum_stds (&drv)) {
+ if (v4l2_enum_stds (&drv)<0) {
perror("enum_stds");
printf("Error! Driver is not reporting supported STD, frames/sec and number of lines!\n Trying to continue anyway...\n");
} else {
@@ -83,6 +84,19 @@ int main(void)
perror("get_parm");
}
+
+ v4l2_getset_freq (&drv,V4L2_GET, &freq);
+
+ freq=0;
+ v4l2_getset_freq (&drv,V4L2_SET, &freq);
+
+ freq=121250000; /* 121.250 MHz */
+ v4l2_getset_freq (&drv,V4L2_SET, &freq);
+
+ printf("Preparing for frames...\n");
+ fflush (stdout);
+ sleep(1);
+
v4l2_mmap_bufs(&drv, 2);
v4l2_start_streaming(&drv);