[libavg-devel] Subsystem Plugins

Nick Hebner hebnern at gmail.com
Sun Nov 9 19:25:00 CET 2008


Hey All,

As I mentioned in an earlier email, I had some interest in writing a plugin
that implemented a new camera subsystem. Well with the new generic plugin
registration code in place and a few more changes, I have been able to do
just that. Attached is a patch adding a SubsystemManager class that can be
used to register and build subsystem instances. Currently the only subsystem
that this class manages is cameras, but I just wanted to get something
working on a basic level before attempting anything too complicated. In
designing this functionality, I made a few assumptions.

1. There are a small number of subsystems that this class will manage (e.g.
DisplayEngine, AudioEngine, Camera, etc).
2. Different subsystem types require wildly different initialization
information.
3. Similar subsystem types require basically the same initialization
information.

Based on these assumptions, I decided that the registration and creation
functions should be per-subsystem-type. I do not see any merit in providing
a single createSubsystem() and having all subsystems implement a Subsystem
interface. They are all handled too differently to do so. Instead, I
envision a register and create function for each subsystem type.

Registration functions will take a subsystem name and builder function. The
builder function will take initialization parameters common to that
subsystem type and return a pointer to an instance of that subsystem.

Create functions will take a subsystem name and the parameters to pass the
registered builder function.

Because the number of subsystems is small and the parameters to a subsystem
are fixed, I do not see a need for the complicated Arg passing mechanisms
that are required by Nodes.

I have updated the Windows build distribution with the example camera
subsystem plugins that I have developed (one using the CMU 1394 driver, the
other using the VideoWrapper library, you will need to download these of
course). This patch does not represent a complete implementation of this
idea, I just wanted to get some thoughts on this. So, what do you think?

Thanks,

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.datenhain.de/pipermail/libavg-devel/attachments/20081109/4aedce11/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: subsystem_plugin.patch
Type: application/octet-stream
Size: 8180 bytes
Desc: not available
Url : http://mail.datenhain.de/pipermail/libavg-devel/attachments/20081109/4aedce11/attachment.obj 


More information about the libavg-devel mailing list