Class: kodi::addon::CInstanceVideoCodec
Video codec add-on instance
More...
Class: kodi::addon::CInstanceVideoCodec
Video codec add-on instance
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.
When using the inputstream addon, class InputstreamInfo to cpp_kodi_addon_inputstream_Defs_Info is used to declare that the decoder stored in the addon is used.
- Note
- At the moment this can only be used together with input stream addons, independent use as a codec addon is not yet possible.
Include the header #include <kodi/addon-instance/VideoCodec.h> to use this class.
Example: This as an example when used together with kodi::addon::CInstanceInputStream.
{
public:
CMyInputstream* inputstream);
...
private:
CMyInputstream* m_inputstream;
};
CMyInputstream* inputstream)
m_inputstream(inputstream)
{
...
}
...
{
public:
...
};
{
...
}
{
{
{
addonInstance =
new CMyVideoCodec(
instance,
this);
}
}
...
{
public:
CMyAddon() = default;
};
{
{
kodi::Log(ADDON_LOG_NOTICE,
"Creating my Inputstream");
}
else if (...)
{
...
}
}
void * KODI_ADDON_INSTANCE_HDL
Definition addon_base.h:121
KODI_ADDON_HDL * hdl
Definition addon_base.h:344
void * KODI_HANDLE
Standard undefined pointer handle.
Definition addon_base.h:291
Definition kodi-dev-kit/include/kodi/AddonBase.h:775
Definition VideoCodec.h:248
Definition kodi-dev-kit/include/kodi/AddonBase.h:498
ADDON_STATUS
Definition addon_base.h:138
@ ADDON_STATUS_NOT_IMPLEMENTED
Definition addon_base.h:159
@ ADDON_STATUS_OK
For everything OK and no error.
Definition addon_base.h:140
@ ADDON_STATUS_UNKNOWN
Unknown and incomprehensible error.
Definition addon_base.h:152
@ ADDON_INSTANCE_INPUTSTREAM
Input stream instance, see kodi::addon::CInstanceInputStream.
Definition versions.h:228
@ ADDON_INSTANCE_VIDEOCODEC
Video codec instance, see kodi::addon::CInstanceVideoCodec.
Definition versions.h:249
void ATTR_DLL_LOCAL Log(const ADDON_LOG loglevel, const char *format,...)
Add a message to Kodi's log.
Definition kodi-dev-kit/include/kodi/AddonBase.h:1938
#define ADDONCREATOR(AddonClass)
Definition kodi-dev-kit/include/kodi/AddonBase.h:2047
Definition addons/kodi-dev-kit/include/kodi/addon-instance/AudioDecoder.h:21
Definition addon_base.h:268
The destruction of the example class CMyInputstream
is called from Kodi's header. Manually deleting the add-on instance is not required.
◆ AddData()
virtual bool kodi::addon::CInstanceVideoCodec::AddData |
( |
const DEMUX_PACKET & | packet | ) |
|
|
inlinevirtual |
add data, decoder has to consume the entire packet
- Parameters
-
[in] | packet | Data to process for decode |
- Returns
- true if the packet was consumed or if resubmitting it is useless
◆ CInstanceVideoCodec()
kodi::addon::CInstanceVideoCodec::CInstanceVideoCodec |
( |
const IInstanceInfo & | instance | ) |
|
|
inlineexplicit |
Video codec class constructor used to support multiple instance types.
- Parameters
-
[in] | instance | The instance value given to kodi::addon::CAddonBase::CreateInstance(...) , or by a inputstream instance if them declared as parent. |
[in] | kodiVersion | [opt] Version used in Kodi for this instance, to allow compatibility to older Kodi versions. |
◆ GetFrameBuffer()
AddonToKodi interface.
All picture members can be expected to be set correctly except decodedData and pts.
GetFrameBuffer has to set decodedData to a valid memory address and return true.
- Parameters
-
[out] | picture | The buffer, or unmodified if false is returned |
- Returns
- In case buffer allocation fails, it return false.
- Note
- If this returns true, buffer must be freed using ReleaseFrameBuffer().
◆ GetName()
virtual const char * kodi::addon::CInstanceVideoCodec::GetName |
( |
| ) |
|
|
inlinevirtual |
should return codecs name
- Returns
- Codec name
◆ GetPicture()
GetPicture controls decoding.
Player calls it on every cycle it can signal a picture, request a buffer, or return none, if nothing applies the data is valid until the next GetPicture return VC_PICTURE
- Parameters
-
[in,out] | Structure | which contains the necessary data |
- Returns
- The with VIDEOCODEC_RETVAL return values
◆ Open()
Open the decoder, returns true on success.
Decoders not capable of running multiple instances should return false in case there is already a instance open.
- Parameters
-
[in] | initData | Video codec init data |
- Returns
- true if successfully done
The following table contains values that can be set with class VideoCodecInitdata :
◆ Reconfigure()
Reconfigure the decoder, returns true on success.
Decoders not capable of running multiple instances may be capable of reconfiguring the running instance. If Reconfigure returns false, player will close / open the decoder
- Parameters
-
[in] | initData | Video codec reconfigure data |
- Returns
- true if successfully done
◆ ReleaseFrameBuffer()
void kodi::addon::CInstanceVideoCodec::ReleaseFrameBuffer |
( |
void * | buffer | ) |
|
|
inline |
◆ Reset()
virtual void kodi::addon::CInstanceVideoCodec::Reset |
( |
| ) |
|
|
inlinevirtual |
◆ ~CInstanceVideoCodec()
kodi::addon::CInstanceVideoCodec::~CInstanceVideoCodec |
( |
| ) |
|
|
overridedefault |