Browse Source

rien n'est simple, mais il faut avancer

master
phyto 3 years ago
parent
commit
9c845b5d04
  1. 16
      v4l2/t.c
  2. 2
      v4l2/v4l2_pr_structs.c

16
v4l2/t.c

@ -22,8 +22,9 @@ int verbosity; @@ -22,8 +22,9 @@ int verbosity;
/* --------------------------------------------------------------------- */
int essai(char *dev, int k)
{
int vfd, foo;
struct v4l2_format fmt;
int vfd, foo;
struct v4l2_format fmt;
struct v4l2_requestbuffers reqbuf;
fprintf(stderr, ">>> %s ( '%s' %d )\n", __func__, dev, k);
@ -43,11 +44,17 @@ pr_v4l2_format("before ioctl", &fmt); @@ -43,11 +44,17 @@ pr_v4l2_format("before ioctl", &fmt);
foo = ioctl(vfd, VIDIOC_S_FMT, &fmt);
fprintf(stderr, "ioctl -> %d\n", foo);
if (foo < 0)) perror("ioctl S_FMT");
if (foo < 0) {
perror("ioctl S_FMT");
exit(1);
}
pr_v4l2_format("after ioctl", &fmt);
/* todo V4L2_BUF_TYPE_VIDEO_CAPTURE */
memset(&reqbuf, 0, sizeof(reqbuf));
pr_v4l2_requestbuffers("after 0", &reqbuf);
return k;
}
@ -66,6 +73,9 @@ puts("\t-d\tselect the video device"); @@ -66,6 +73,9 @@ puts("\t-d\tselect the video device");
puts("\t-K\tset the K parameter");
puts("\t-l\tlist video devices");
puts("\t-v\tincrease verbosity");
if (verbosity) { puts(""); fimg_print_version(1); }
exit(0);
}
/* --------------------------------------------------------------------- */

2
v4l2/v4l2_pr_structs.c

@ -52,7 +52,7 @@ return 0; @@ -52,7 +52,7 @@ return 0;
/* --------------------------------------------------------------------- */
int pr_v4l2_requestbuffers(char *txt, struct v4l2_requestbuffers *ptr)
{
fprintf(FP, "-- v4l2_requestbuffers, at %p\n", ptr);
fprintf(FP, "-- v4l2_requestbuffers, %s %p\n", txt, ptr);
fprintf(FP, " type %d\n", ptr->type); /* enum v4l2_buf_type */

Loading…
Cancel
Save