On Mon, Aug 06, 2007 at 10:24:21AM +0200, Matteo Vit wrote: > Hi all, > I'm working with an embedded system that use directfb for the user gtk > application. I need to display video grabbed from a camera inside the > gtk user interface. I've alreary a basic V4L2 driver for the camera > device. I'm thinking how to implement this and I found two ways: > > 1) use the video provider for V4L: > what type of method (READ, MMAP) is used by the video provider for V4L ?
mmap (v4l1 and v4l2) or overlay (v4l1 only IIRC). However with mmap there is and extra memcpy from the kernel buffer to the surface's buffer. With overlay the capture device will write directly to video RAM, but you lose accurate sync because the v4l API limitations. v4l2 API would allow using user supplied buffers with mmap so you could capture directly to any buffer and have accurate sync. Unfortunately that mode is currently not used because DirectFB's buffer handling isn't quite suited for the job. Hmm, maybe we should expose the v4l kernel supplied buffers as a DirectFB surface (it would eliminate the extra memcpy). > where can I find an example of use of video provider for V4L ? df_video, df_layer, df_window etc. in DirectFB-examples. > 2) modify the V4L driver to support overlay: > inside the V4L driver I grab data from sensor, prepare the new frame > buffer (overlaying with the current frame buffer with gtk application) > and when the LCD controller ends the current frame, swap the frame > buffer with the new one (double buffering) changing the pointer used by > the LCD controller. What happens to directfb if I change the pointer of > the buffer used from the LCD controller to display the buffer ? If you swap the display buffer DirectFB will continue operating on the old buffer (unless you also change the page tables to point to the new buffer). Or do you mean to hide the LCD frame buffer completely and use a sort of shadow frame buffer for DirectFB? That should work, but I'm not sure doing such heavy copy operations in the kernel is a good idea. -- Ville Syrjälä [EMAIL PROTECTED] http://www.sci.fi/~syrjala/ _______________________________________________ directfb-users mailing list [email protected] http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users
