Is it possible to implement a vfs as an add-on?
#1
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.
Reply
#2
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.
Reply
#3
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?
Reply
#4
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.
Reply
#5
Are there any news on this?
Reply
#6
Am I understand right that what is needed is plugin infrastructure to implement kodi::vfs interface for new vfs's?
Reply
#7
(2015-05-21, 09:36)ironic_monkey Wrote: 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).
does it mean it's possible already to implement vfs-addon on python?
Reply
#8
https://github.com/xbmc/xbmc/pull/8966
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#9
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).
Reply
#10
Thank you for the discussion, guys. I need the same answer.
Reply
#11
Thanks ironic_monkey, hope your patches will find their way to the master Wink
Reply

Logout Mark Read Team Forum Stats Members Help
Is it possible to implement a vfs as an add-on?1