For audio decoders as binary add-ons. This class implements a way to handle special types of audio files.
The add-on handles loading of the source file and outputting the audio stream for consumption by the player.
The addon.xml defines the capabilities of this add-on.
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="audiodecoder.myspecialnamefor"
version="1.0.0"
name="My special audio decoder addon"
provider-name="Your Name">
<requires>@ADDON_DEPENDS@</requires>
<extension
point="kodi.audiodecoder"
name="2sf"
tags="true"
library_@PLATFORM@="@LIBRARY_FILENAME@">
<support>
<extension name=".2sf">
<description>30100</description>
<icon>resources/file_format_music_sound.png</icon>
</extension>
<extension name=".mini2sf"/>
</support>
</extension>
<extension point="xbmc.addon.metadata">
<summary lang="en_GB">My audio decoder addon addon</summary>
<description lang="en_GB">My audio decoder addon description</description>
<platform>@PLATFORM@</platform>
</extension>
</addon>
Name | Description |
point | Addon type specification
At all addon types and for this kind always "kodi.audiodecoder". |
library_@PLATFORM@ | Sets the used library name, which is automatically set by cmake at addon build. |
name | The name of the decoder used in Kodi for display. |
tags | Boolean to point out that addon can bring own information to replayed file, if false only the file name is used as info.
If true , CInstanceAudioDecoder::ReadTag is used and must be implemented. |
tracks | Boolean to in inform one file can contains several different streams. |
<support><extension name="..." /></support> | The file extensions / styles supported by this addon.\nOptional can be with <description> and <icon> additional info added where used for list views in Kodi. |
<support><mimetype name="..." /></support> | A stream URL mimetype where can be used to force to this addon.\nOptional can be with `<description> and <icon> additional info added where used for list views in Kodi. |
{
public:
std::vector<AudioEngineChannel>& channellist) override;
};
{
...
}
bool CMyAudioDecoder::Init(
const std::string& filename,
unsigned int filecache,
std::vector<AudioEngineChannel>& channellist)
{
...
return true;
}
{
...
}
{
public:
CMyAddon() = default;
};
{
{
}
else if (...)
{
...
}
}
unsigned __int8 uint8_t
Definition DirectXGraphics.h:130
void * KODI_ADDON_INSTANCE_HDL
Definition addon_base.h:121
KODI_ADDON_HDL * hdl
Definition addon_base.h:344
const char unsigned int filecache
Definition addons/kodi-dev-kit/include/kodi/c-api/addon-instance/AudioDecoder.h:107
uint8_t size_t size_t * actualsize
Definition addons/kodi-dev-kit/include/kodi/c-api/addon-instance/AudioDecoder.h:116
const char unsigned int int int int int64_t * totaltime
Definition addons/kodi-dev-kit/include/kodi/c-api/addon-instance/AudioDecoder.h:111
const char unsigned int int int int * bitspersample
Definition addons/kodi-dev-kit/include/kodi/c-api/addon-instance/AudioDecoder.h:110
const char unsigned int int int int int64_t int * bitrate
Definition addons/kodi-dev-kit/include/kodi/c-api/addon-instance/AudioDecoder.h:112
uint8_t * buffer
Definition addons/kodi-dev-kit/include/kodi/c-api/addon-instance/AudioDecoder.h:116
uint8_t size_t size
Definition addons/kodi-dev-kit/include/kodi/c-api/addon-instance/AudioDecoder.h:116
const char unsigned int int int * samplerate
Definition addons/kodi-dev-kit/include/kodi/c-api/addon-instance/AudioDecoder.h:109
typedef int64_t(ATTR_APIENTRYP PFN_KODI_ADDON_AUDIODECODER_SEEK_V1)(const KODI_ADDON_AUDIODECODER_HDL hdl
const char unsigned int int int int int64_t int enum AudioEngineDataFormat * format
Definition addons/kodi-dev-kit/include/kodi/c-api/addon-instance/AudioDecoder.h:113
const char unsigned int int * channels
Definition addons/kodi-dev-kit/include/kodi/c-api/addon-instance/AudioDecoder.h:108
Definition kodi-dev-kit/include/kodi/AddonBase.h:775
Definition addons/kodi-dev-kit/include/kodi/addon-instance/AudioDecoder.h:431
Definition kodi-dev-kit/include/kodi/AddonBase.h:498
@ ADDON_LOG_INFO
1 : To include information messages in the log file.
Definition addon_base.h:187
ADDON_STATUS
Definition addon_base.h:138
@ 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_AUDIODECODER
Audio decoder instance, see kodi::addon::CInstanceAudioDecoder.
Definition versions.h:219
virtual ADDON_STATUS CreateInstance(const kodi::addon::IInstanceInfo &instance, KODI_ADDON_INSTANCE_HDL &hdl)
Instance created.
Definition kodi-dev-kit/include/kodi/AddonBase.h:924
@ AUDIODECODER_READ_SUCCESS
On success.
Definition addons/kodi-dev-kit/include/kodi/c-api/addon-instance/AudioDecoder.h:69
virtual bool Init(const std::string &filename, unsigned int filecache, int &channels, int &samplerate, int &bitspersample, int64_t &totaltime, int &bitrate, AudioEngineDataFormat &format, std::vector< AudioEngineChannel > &channellist)=0
Initialize a decoder.
virtual int ReadPCM(uint8_t *buffer, size_t size, size_t &actualsize)=0
Produce some noise.
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