[Devel] lv2_descriptor() considered harmful
Stefano D'Angelo
zanga.mail at gmail.com
Thu Oct 20 15:47:17 PDT 2011
2011/10/20 David Robillard <d at drobilla.net>:
> On Sun, 2011-10-09 at 20:23 -0400, David Robillard wrote:
>> Hi all,
>>
>> The discovery mechanism we inherited from LADSPA has some problems, and
>> I think it should be replaced in the next core release.
> [...]
>
> On second thought, a simpler way with less breakage would be to simply
> add an lv2_init function as a separate symbol to the library, and
> continue to use the existing lv2_descriptor function.
>
> This is less implementation burden, and avoids having two discovery
> functions, but loses the nice explicitness and the eliminated need for
> non-portable shared library constructor/destructor hackery.
>
> Something like:
>
> /**
> Initialization function for a plugin library. Hosts SHOULD call this
> function once upon loading the library, before calling
> lv2_descriptor() to access the contained plugins.
> */
> int lv2_init(const char* bundle_path,
> const LV2_Feature *const * features);
>
> /**
> Type of the lv2_init() function in a plugin library.
> */
> typedef int (*LV2_Init_Function)(const char* bundle_path,
> const LV2_Feature *const * features);
>
> Thoughts?
One word: cleanup!
> P.S. On the topic of initialisation, are there any considerations for
> static builds we should consider?
You mean static linking against plugins?
More information about the Devel
mailing list