Hi everybody,
I am trying to learn fundamentals of v4l2 and capturing. I have looked
at sample capture code in V4L2 API specifications' appendix. But there was
an error while doing VIDIOC_S_FMT ioctl. The error was "invalid argument".
What is the problem at this ioctl command? Is this error just for pwc
driver? Thanks for your attention.
capture.c : http://v4l2spec.bytesex.org/v4l2spec/capture.c
k...@debian:~/usb-pwc/mytest$ ./capture
VIDIOC_S_FMT error 22, Invalid argument
/* VIDIOC_S_FMT ioctl code block is below */
CLEAR (fmt);
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
fmt.fmt.pix.width = 640;
fmt.fmt.pix.height = 480;
fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;
fmt.fmt.pix.field = V4L2_FIELD_INTERLACED;
if (-1 == xioctl (fd, VIDIOC_S_FMT, &fmt))
errno_exit ("VIDIOC_S_FMT");
/* Note VIDIOC_S_FMT may change width and height. */
/* Buggy driver paranoia. */
min = fmt.fmt.pix.width * 2;
if (fmt.fmt.pix.bytesperline < min)
fmt.fmt.pix.bytesperline = min;
min = fmt.fmt.pix.bytesperline * fmt.fmt.pix.height;
if (fmt.fmt.pix.sizeimage < min)
fmt.fmt.pix.sizeimage = min;
Regards,
Mahmut
_______________________________________________
pwc mailing list
[email protected]
http://lists.saillard.org/mailman/listinfo/pwc