Adding support for dynamically loaded plugins (so, dll files)?
#1
Hi folks,

currently I am writing for my self a small script inside of XBMC with python. However, there are so much pitfalls when adding functionality to XBMC by python. For example it is really hard to have script running in background and update window content while running. It seems that scripts has most benefit of producing its content only once (static) and not being run always in the background (dynamic). Another problem with python is, it is not that efficient as C/C++ would be Wink

So, I though on adding support for loading dynamic libraries (dll or so). For example one can add a method XBMC.LoadDynamicPlugin(file.dll) to scripts. This will force to load a dll which can then perform any action within XBMC. For example one can write new weather dynamic plugin and remove it completely out of the main XBMC code. When loading Weather.dll it will add its windows directly to the WindowManager and maybe add a new Job to JobManager. This is just an example, how this feature can be used.

I just want to know if somebody would be interested in that? I could imagine that this could improve "Skinnability" further, since really dynamic things would be then possible.
One then need to discuss how the interface of such dynamic/shared libraries would looks like. I could imagine to provide following external methods within such a shared library:

// return true if this plugin is compatible with the XBMC version from which one it was loaded
bool IsCompatibleWith(int majorXBMCVersion, int minorXBMCVersion, int svnRev = -1);

// initialize plugin (here plugin do the main integration part within XBMC)
bool Initialize();

// say to plugin that we would like to stop it, it should release anything it has used
void Remove();

I think changes to the main XBMC code would be not that big. One just need to have some kind of new global DynamicPluginManager class instance.

Any ideas or comments on that?

Regards,
art
Reply
#2
Ok, it seems there is a capability of doing so. At least there is some info on the wiki. I have to check out how it works exactly...
Reply
#3
we do not plan to allow such general-classed plugins. we will be offering specific extension points to implement. one example of such an extension point is screen savers.
Reply
#4
spiff Wrote:we do not plan to allow such general-classed plugins. we will be offering specific extension points to implement. one example of such an extension point is screen savers.

Hmm, ok, I see. What about just a one specific point, additional windows? So a special plugin extension which can add only new windows (derived from CGUIWindow). This would allow to have dynamic window content since plugin get responsible for rendering its content.
Reply
#5
I think you're searching for scripts, not plugins.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#6
while vdrfan probably have misunderstood, he stumbled upon the correct answer. yes, we will allow such a thing at one point i suspect. it would probably share an extension point with scripts. the idea is to allow implementation in different languages, python, C etc transparently.
Reply
#7
Yes, in deed it will be really nice. Python scripts, as I told already before, does not really help me, so that I would really like to write such a "script" in C/C++.
Reply
#8
psyborg Wrote:Yes, in deed it will be really nice. Python scripts, as I told already before, does not really help me, so that I would really like to write such a "script" in C/C++.

Make a simple python script that calls your c/c++ code. Pretty simple.
Reply

Logout Mark Read Team Forum Stats Members Help
Adding support for dynamically loaded plugins (so, dll files)?0