beurk...
This commit is contained in:
parent
379bd1b7de
commit
312f892576
14
v4l2/t.c
14
v4l2/t.c
@ -20,9 +20,9 @@
|
|||||||
int verbosity;
|
int verbosity;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
int essai(char *dev, int k)
|
int essai_get_fmt(char *dev, int k)
|
||||||
{
|
{
|
||||||
int vfd, foo;
|
int vfd, idx, foo;
|
||||||
struct v4l2_format fmt;
|
struct v4l2_format fmt;
|
||||||
struct v4l2_requestbuffers reqbuf;
|
struct v4l2_requestbuffers reqbuf;
|
||||||
|
|
||||||
@ -33,18 +33,20 @@ if (verbosity) fprintf(stderr, "\topen %s -> %d\n", dev, vfd);
|
|||||||
|
|
||||||
memset(&fmt, 0, sizeof(fmt));
|
memset(&fmt, 0, sizeof(fmt));
|
||||||
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||||
|
|
||||||
foo = ioctl(vfd, VIDIOC_G_FMT, &fmt);
|
foo = ioctl(vfd, VIDIOC_G_FMT, &fmt);
|
||||||
fprintf(stderr, "ioctl -> %d\n", foo);
|
fprintf(stderr, "%s : ioctl -> %d\n", __func__, foo);
|
||||||
if (0 != foo) {
|
if (0 != foo) {
|
||||||
perror("ioctl G_FMT");
|
perror("ioctl G_FMT");
|
||||||
exit(1);
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
pr_v4l2_format("after ioctl VIDIOC_G_FMT", &fmt);
|
pr_v4l2_format("after ioctl VIDIOC_G_FMT", &fmt);
|
||||||
|
|
||||||
/* this function is bugged */
|
/* this function is bugged */
|
||||||
|
|
||||||
|
close(vfd);
|
||||||
|
|
||||||
|
|
||||||
return k;
|
return k;
|
||||||
}
|
}
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
@ -79,7 +81,7 @@ while ((opt = getopt(argc, argv, "d:hK:v")) != -1) {
|
|||||||
|
|
||||||
if (verbosity) fimg_print_version(0);
|
if (verbosity) fimg_print_version(0);
|
||||||
|
|
||||||
foo = essai(device, K);
|
foo = essai_get_fmt(device, K);
|
||||||
fprintf(stderr, "\tessai -> %d\n", foo);
|
fprintf(stderr, "\tessai -> %d\n", foo);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user