Quoting Joe Burks <joe-v4l@xxxxxxxxxxx>: > I have another question: Looking at the usbvideo code, I'm curious what > kinds of things the setupOnOpen callback should set up. While browsing > through the usbvideo_v4l_open I noticed that startDataPump (which calls the > videoStart callback) is called before setupOnOpen callback. It would seem > that the camera would have to be in a sane initialized state before > videoStart was called. Looking at the ibmcam code, I just become more > confused as the videoStart callback (ibmcam_video_start) calls reinit_iso > which calls functions named setup_after_video_if. There is no big difference because Isoc data pump can ask for data at any time; it's just not likely to get any until the camera is initialized... but maybe this should be reordered if it matters for your device; it does not apparently matter for other cameras. Feel free to shuffle if you need it. The setup_after_video_if() is specific to IBM cameras because they want some additional initialization. You may not need that. The point is that I tried to make usbvideo as minidriver-friendly as possible without complicating it too much. ultradrv was supposed to be a skeleton example, but it got more code lately... still, it seems to be simpler than ibmcam (the latter supports many cameras). > When is the appropriate time to send what initialization data, or am I > worrying over nothing because v4l_open is never called? v4l_open will be called when the application issues the open() call. At that time the setup_on_open() gets called and you do your init there. You may mark the camera as "initialized" if you don't want to do it on every open(). You do not initialize the camera in probe() - this is bad because of many reasons. Some devices, however, need to be accessed from within the probe() code to find out the firmware version, capabilities etc. -- Who wants to remember that escape-x-alt-control-left shift-b puts you into super-edit-debug-compile mode? (Discussion in comp.os.linux.misc on the intuitiveness of commands, especially Emacs.)
Attachment:
pgpzFJpYc9rWh.pgp
Description: PGP signature