Writing Add-on in C++ Language
#1
Hey community!
I just want to know about if is possible to write a Kodi Add-On in C++ instead of Python, if there is a way, which library I must do declare in my main program?
Thanks !
Reply
#2
"Addon" is too broad definition. Some types of addons are C/C++ only, like PVR or audio encoders. Other types of addons, like content plugins or program addons are written in Python. However, Python provides Python-C API that allows to write binary Python extension modules in C (not ++). Raw Python-C API is not convenient, but there are a number of convenience tools (Boost.Python, Pybind11 and such) that let you wrap your C++ code into binary Python modules. So technically, even in case of Python addons you can write almost everything in C/C++ except for a launcher script.

However, I need to note that maintaining such addon for all target platforms that run Kodi will be a huge PITA.
Reply
#3
Thank you for your answer Roman.
This topic can be closed right now.
Reply
#4
(2016-12-27, 20:22)Calebe94 Wrote: Hey community!
I just want to know about if is possible to write a Kodi Add-On in C++ instead of Python, if there is a way, which library I must do declare in my main program?
Thanks !
What exact type of addon are you looking into making for Kodi? Or rather what are you trying to achieve?

If you are a truly skilled C++ developer then there should be no reason why you should not be able to extend Kodi's core to also support "content" addons made in C++ as well as the Python "content" addons that it already supports.

Otherwise it is true that other than PVR addons (which could be considered to be one type of content addon too) all "content" addons for Kodi currently need to be made in Python, Kodi does however support quite a few other types of C++ addons other than PVR, and with each release version of Kodi we keep seeing support for new types of C++ addons being added to Kodi's core.

All C++ addons for Kodi are called "binary addons", and they are made as seperate projects written against different C APIs Kodi. Kodi master currently has APIs to support binary addons (C/C++ addons) for PVR clients, game addons, screensavers, visualizations, audio decoders/encoders, image decoders, and input streams. Where the latter three of those types of binary was just recently added to Kodi's core.

Example:
https://github.com/xbmc/repo-binary-addons
https://github.com/kodi-pvr
https://github.com/kodi-game
https://github.com/notspiff?tab=repositories
Reply

Logout Mark Read Team Forum Stats Members Help
Writing Add-on in C++ Language0