Subject: Re: [linux-audio-dev] Mix with plugins
From: Maurizio Umberto Puxeddu (umbpux_AT_tin.it)
Date: to elo 26 1999 - 19:38:48 EDT
reactor/CTPmedia wrote:
>[...snip...]
> and i still can't see how the plugin system could be done through shared
> libraries. could anyone enlight me about the system calls to read/use
> shared libraries' functions?
It's very easy: use dlopen(), dlsym() and dlclose().
You define a plugin as a shared module that defines certain symbols, say
// BOGO HEADER STARTS HERE
int audioplugin_init(void);
int audioplugin_process(sample_t *in, sample_t *out);
int audioplugin_shotdown(void);
int audioplugin_status;
// BOGO HEADER ENDS HERE
Then you open the library (plugin) with dlopen() and ask for the value
of the symbols you have to use.
// BOGO CODE STARTS HERE
plugin = dlopen("Superreverb.so", RTDL_LAZY);
int ( *superreverb_init)(void) = dlsym(plugin, "audioplugin_init");
// etc.
// Then
superreverb_init();
// etc.
// BOGOCODE ENDS HERE
See the their man pages, including the short example that says all, for
additional info.
Ciao!
Maurizio Umberto Puxeddu
This archive was generated by hypermail 2b28 : pe maalis 10 2000 - 07:25:53 EST