Class: kodi::addon::CInstanceInputStream
This instance type is for using input streams to video and audio, to process and then give them to Kodi.
This usage can be requested under various conditions, for example explicitly by another addon, by a Mimetype protocol defined in addon.xml
or supported file extensions.
In addition, stream files (* .strm) can be linked to an inputstream addon using #KODIPROP:inputstream=<ADDON_NAME>
.
Include the header #include <kodi/addon-instance/Inputstream.h> to use this class.
Here is an example of what the addon.xml.in
would look like for an inputstream addon:
At <extension point="kodi.inputstream" ...>
the basic instance definition is declared, this is intended to identify the addon as an input stream and to see its supported types:
Name | Description |
---|---|
point | The identification of the addon instance to inputstream is mandatory kodi.inputstream . In addition, the instance declared in the first <extension ... /> is also |
extension | A filename extension is an identifier specified as a suffix to the name of a computer file where supported by addon. |
listitemprops | Values that are available to the addon at InputstreamProperty::GetProperties() and that can be passed to CInstanceInputStream::Open() ith the respective values. |
protocols | The streaming protocol is a special protocol supported by the addon for the transmission of streaming media data over a network. |
library_@PLATFORM@ | The runtime library used for the addon. This is usually declared by cmake and correctly displayed in the translated addon.xml . |
addon.xml
, see also https://kodi.wiki/view/Addon.xml.Example:
The destruction of the example class CMyInputstream
is called from Kodi's header. Manually deleting the add-on instance is not required.
Topics | |
Definitions, structures and enumerators | |
Inputstream add-on instance definition values All inputstream functions associated data structures. | |
1. Stream read | |
Functions required to read streams direct and demux inside Kodi. | |
2. Stream demuxing (optional) | |
Read demux streams. | |
3. Time (optional) | |
To get stream position time. | |
4. Times (optional) | |
Another way to get stream position time. | |
5. Position time (optional) | |
Third way get stream position time. | |
6. Chapter (optional) | |
Used to get available chapters. | |
|
inlineexplicit |
Inputstream class constructor used to support multiple instance types.
[in] | instance | The instance value given to kodi::addon::CAddonBase::CreateInstance(...) |
[in] | kodiVersion | [opt] Version used in Kodi for this instance, to allow compatibility to older Kodi versions. |
instance
from the CAddonBase::CreateInstance call.
|
overridedefault |
Destructor.
|
pure virtual |
Get the list of features that this add-on provides.
Called by Kodi to query the add-on's capabilities. Used to check which options should be presented in the UI, which methods to call, etc. All capabilities that the add-on supports should be set to true.
[out] | capabilities | The with cpp_kodi_addon_inputstream_Defs_Capabilities defined add-on's capabilities. |
The following table contains values that can be set with class InputstreamCapabilities :
Name | Type | Set call | Get call |
---|---|---|---|
Capabilities bit mask | uint32_t | SetMask | GetMask |
Example:
|
pure virtual |
Open a stream.
[in] | props | The used properties about the stream |
The following table contains values that can be set with class InputstreamProperty :
Name | Type | Get call |
---|---|---|
Stream URL | std::string | GetURL |
Mime type | std::string | GetMimeType |
Available amount of properties | unsigned int | GetPropertiesAmount |
List of properties | std::map<std::string, std::string> | GetProperties |
Get addon library folder | std::string | GetLibFolder |
Get addon profile/user folder | std::string | GetProfileFolder |
Example:
|
pure virtual |
Close an open stream.
|
inlinevirtual |
Check for real-time streaming.