preview_off.c
上传用户:aoeyumen
上传日期:2007-01-06
资源大小:3329k
文件大小:1k
- /* very simple app to set the tv frequency */
- #include <sys/time.h>
- #include <fcntl.h>
- #include <sys/ioctl.h>
- #include <unistd.h>
- #include <stdio.h>
- #include <errno.h>
- #include <linux/fs.h>
- #include <linux/videodev2.h>
- int main(int argc,char **argv) {
- int vfd = 0;
- int arg = 0;
- char *devname = "/dev/video";
- if( argc != 1 ) {
- puts("Usage: preview_offn");
- exit(1);
- }
- vfd = open(devname,O_RDWR|O_NONCAP);
- if (vfd <= 0) {
- fprintf(stderr,"sorry, no such device %sn",devname);
- exit(1);
- }
- if (ioctl(vfd,VIDIOC_PREVIEW,&arg) < 0)
- perror("setting frequency"),exit(1);
- close(vfd);
- return 0;
- }