Re: [Basic Glib Questions/Help] Unable to create GSource



On Tue, Dec 23, 2003 at 02:49:20PM -0800, ZHOU DX wrote:
GLib contains various sources that you can look at
the source of ...
timeouts, idles, IO watches.
A question about IO watches. 

I am developing a Linux USB2 camera driver.
 My Gtk app opens it simply by:
camera_fd=open("/dev/video1").

Is that possible to watch this "camera_fd" in the Gtk
main loop just like what we usually do on socket or
file?  (Say, I want to register a callback that is
called after camera data is ready.)
What kind of interface the camera driver should
provide  to support that?


The "standard" interface for video capture devices in Linux is V4L2.
A driver can support mmap, read (potentially zero-copy), and poll.
You should look here for further information: http://bytesex.org/v4l/

--jkl



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]