Re: [GnomeMeeting-devel-list] Towards a new video driver support in pwlib



Le lun 28/07/2003 à 17:09, PUYDT Julien a écrit :

> 
> I had another idea: if the manager is called for whatever reason and its
> list of plugins is empty, it loads them. That would be something like:
> if (plugin_list == NULL) load_all_plugins();
> at the beginning of each function... (or at least some of them)
> 

Loading the plugins can be done in the constructor, but problem, you can
not load all plugins at the same time, only one at a time. You have one
API and several implementations. The problem is that to detect the
devices you have to load each of the plugins and see if they are able to
use the device or not.

> That were the tricks that bothered me; found this:
> http://www.tldp.org/HOWTO/C++-dlopen/thesolution.html
> 
> Now, let's get into more details:
> * the plugin should stuff pointers to the functions that it is supposed
> to provide (ie: members of PVideoInputDevice) in a struct;

I'm not sure it is required...

> * in the same struct: put the plugin name "BAR";
> * it will provide as extern C a function that gives a pointer to this
> struct, so the manager can do plugin_struct->open(...); that will allow
> to get everything needed with only a dlsym;
> 



> The PVideoPluginInputDevice inherits PVideoInputDevices, and adds:
> * a selected plugin;
> * private(or is it called protected?) functions to load/unload plugins;
> 
> Things I should worry about:
> * the list of plugins should be common to all members of the
> PVideoPluginInputDevice class; probably a static something outside of
> the class declaration;
> * the selected plugin should be member-specific, so a program that would
> like to open several videodevices could do so!
> 
> This looks like perhaps I won't have that much to code to turn existing
> drivers into plugins...
> 
> Is there some problem I overlooked?
> 

Perhaps what I told above, but I'm not sure...


> Snark
> 
> _______________________________________________
> Gnomemeeting-devel-list mailing list
> Gnomemeeting-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gnomemeeting-devel-list
-- 
 _	Damien Sandras
(o-	GnomeMeeting: http://www.gnomemeeting.org/
//\	FOSDEM 2003:  http://www.fosdem.org
v_/_	H.323 phone:  callto://ils.seconix.com/dsandras seconix com




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