Re: Unable to initialize camera (via mmap interface)

2007-12-13 Thread Dan Williams
On Wed, 2007-12-12 at 16:03 -0800, Peter Krenesky wrote:
 Hi all,
 
 I'm trying to initialize the camera device and running into some 
 errors.  I'm attempting to use the mmap interface initialized by 
 VIDIOCGMBUF ioctl.  the ioctl is returning -1 and errno is 22. 
 
 Is VIDIOCGMBUF/mmap even supported by the driver/device?   If so, any 
 ideas on what can be going wrong?

What's normally used right now to get video out of the device is
GStreamer.  You can see what GStreamer is doing from the stuff in
v4l2src_calls.c.  Specifically, look at gst_v4l2src_capture_init().  You
probably want to use the QBUF/DQBUF functionality.

Dan

 
 Here is the c++ code that is causing the problem:
 
 video_mbuf  mmap_buf_info;
 if (-1 == ioctl(vidfd, VIDIOCGMBUF, mmap_buf_info))
 {  
 printf (ERROR: %i \n, errno);
 close();
 return(HXR_ENC_NO_VIDEO_CAPTURE);
 }
 
 
 
 thanks,
 
 -peter
 
 
 
 ___
 Devel mailing list
 Devel@lists.laptop.org
 http://lists.laptop.org/listinfo/devel

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Unable to initialize camera (via mmap interface)

2007-12-13 Thread Jonathan Corbet
 I'm trying to initialize the camera device and running into some 
 errors.  I'm attempting to use the mmap interface initialized by 
 VIDIOCGMBUF ioctl.  the ioctl is returning -1 and errno is 22. 

The problem, almost certainly, is that VIDIOCGMBUF is a V4L1 command,
while the camera driver implements the V4L2 API.  Almost everything from
V4L1 can be mapped over, but VIDIOCGMBUF makes assumptions about the
placement of DMA buffers which cannot be guaranteed with V4L2.  In
particular, it wants them all to be contiguous in memory.

Due to the way the cafe_ccic driver works, filling in support for
VIDIOCGMBUF is actually feasible, though not entirely trivial.  Far
better, if at all possible, would be to use the V4L2 API, which (like
high-definition TV and IPv6) is definitely the way of the future.
Someday. 

jon

Jonathan Corbet / LWN.net / [EMAIL PROTECTED]
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel