pwc
[Top] [All Lists]

[pwc] capture.c fault

To:
Subject: [pwc] capture.c fault
From: mahmut gundes <>
Date: Tue, 5 May 2009 03:22:23 +0300


     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

:~/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

http://lists.saillard.org/mailman/listinfo/pwc
<Prev in Thread] Current Thread [Next in Thread>
  • [pwc] capture.c fault, mahmut gundes <=
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU