Posts: 2
Joined: May 2015
Reputation:
0
Hi,
I would like to implement Usenet streaming in Kodi. I already have a library that allows me to read the media files as binary streams directly from Usenet. The library is written in C++ and works on various platforms. Is it possible to implement a virtual file system as an add-on to allow Kodi to read the data? Should the plug-in be written in Python or can it be a shared library / dll written in C++?
I appreciate any references.
Posts: 1,506
Joined: Nov 2013
if you stick with what's in mainline, you have to use python, i.e. write a python plugin wrapper and use something like ctypes to call your lib (which probably means you have to write a C wrapper).
in my fork,
https://github.com/notspiff/kodi-cmake i support c++ vfs addons.
see e.g.
https://github.com/notspiff/vfs.sacd for an implementation and more repositories at
https://github.com/notspiff for semi-working implementations.
Posts: 2
Joined: May 2015
Reputation:
0
Thank you for your reply.
Do you know if there are any plans to merge your changes into mainline?
If python is the preferred way for implementing plug-ins then an alternative approach is to make the VFS framework (IFile and IDirectory) available in python through some sort of generic adaptor. Do you know if this has been suggested?
Posts: 1,506
Joined: Nov 2013
there have been talks but i wouldn't hold my breath.
long term i had planned to use the code generator to generate bindings for python. that way, the same interface can be used from C or python. i just haven't gotten around to it.
Posts: 187
Joined: Dec 2011
Reputation:
1
bam80
Senior Member
Posts: 187
Are there any news on this?
Posts: 1,506
Joined: Nov 2013
bam80; yes, all 'plugin' type add-ons are vfs entries. but they are quite limited in what they can do; you cannot provide your own url handler and such so you cannot add support for new protocols that doesn't boil down to something already existing once you are at the 'file' level. the abstraction fits well to the usage area 'present streams from some source in the kodi ui', but it does not fit what i suspect you are after ('posix-io style' fread fopen fwrite).
Posts: 4
Joined: Jul 2016
Reputation:
0
2016-10-25, 14:00
(This post was last modified: 2016-10-25, 14:00 by Nibbio.)
Thank you for the discussion, guys. I need the same answer.