This is an addon instance class to add an additional video decoder to Kodi using addon.
This means that either a new type of decoding can be introduced to an input stream add-on that requires special types of decoding.
#include <kodi/addon-instance/Inputstream.h>
#include <kodi/addon-instance/VideoCodec.h>
{
public:
CMyVideoCodec(KODI_HANDLE instance, CMyInputstream* inputstream);
...
private:
CMyInputstream* m_inputstream;
};
CMyVideoCodec::CMyVideoCodec(KODI_HANDLE instance,
const std::string& version,
CMyInputstream* inputstream)
: kodi::addon::CInstanceVideoCodec(instance, version),
m_inputstream(inputstream)
{
...
}
...
{
public:
CMyInputstream(KODI_HANDLE instance, const std::string& kodiVersion);
std::string instanceID,
KODI_HANDLE instance,
const std::string& version,
KODI_HANDLE& addonInstance) override;
...
};
CMyInputstream::CMyInputstream(KODI_HANDLE instance, const std::string& kodiVersion)
: kodi::addon::CInstanceInputStream(instance, kodiVersion)
{
...
}
ADDON_STATUS CMyInputstream::CreateInstance(
int instanceType,
std::string instanceID,
KODI_HANDLE instance,
const std::string& version,
KODI_HANDLE& addonInstance)
{
{
addonInstance = new CMyVideoCodec(instance, version, this);
}
return ADDON_STATUS_NOT_IMPLEMENTED;
}
...
{
public:
CMyAddon() { }
std::string instanceID,
KODI_HANDLE instance,
const std::string& version,
KODI_HANDLE& addonInstance) override;
};
std::string instanceID,
KODI_HANDLE instance,
const std::string& version,
KODI_HANDLE& addonInstance)
{
{
kodi::Log(ADDON_LOG_NOTICE,
"Creating my Inputstream");
addonInstance = new CMyInputstream(instance, version);
}
else if (...)
{
...
}
}
ADDONCREATOR(CMyAddon)
Definition: AddonBase.h:322
Definition: VideoCodec.h:260
ADDON_STATUS
Definition: addon_base.h:128
@ ADDON_STATUS_OK
For everything OK and no error.
Definition: addon_base.h:130
@ ADDON_STATUS_UNKNOWN
Unknown and incomprehensible error.
Definition: addon_base.h:142
@ ADDON_INSTANCE_INPUTSTREAM
Input stream instance, see kodi::addon::CInstanceInputStream.
Definition: versions.h:226
@ ADDON_INSTANCE_VIDEOCODEC
Video Decoder instance, see kodi::addon::CInstanceVideoCodec.
Definition: versions.h:247
void ATTRIBUTE_HIDDEN Log(const AddonLog loglevel, const char *format,...)
Add a message to Kodi's log.
Definition: AddonBase.h:749