Hello all, here is a first modification to provide the v4l2_extension module that does the clone device for a device driver. It does nearly nothing in fact, just creates a new device that clones the real device. - The first problem I encounter is in the video_open function, to call the open function of the base video driver. How to simulate the file opening for the base driver? This is mandatory to make the kernel create the private data for the base driver and use it in further calls.
In a second patch I will show you how a driver should use this extension for usbvision as an example, but can be easily be done for other drivers. - A good idea would be to have this registering procedure be done in videodev but as it is coded it is impossible (cyclic dependency between v4l2_extension and videodev).
Well, I am on vacation next week so I will not be able to respond to comments... be patient again :)
Cheers, Thierry --
Hello,
responding to myself, I succeeded in simulating the opening and use of the base driver. In that state, I am able to open /dev/video1 instead of /dev/video0, I get exactly the same capabilities. Please feel free to comment and tell the priorities. Now I reached the first step of the realization, I will do the second step: control the hardware. This step involves the helper daemon to show extended capabilities. I will submit an internal interface (driver<->helper daemon), interesting things will start :)
Note: I committed all the patches in order to save them in a chronological order and to see the final product.
Cheers, Thierry
Patch: v4l2_extension module: enable the base driver access using a fake file structure Signed-off-by: Thierry Merle thierry.merle@free.fr