diff options
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance')
10 files changed, 38 insertions, 23 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/AudioDecoder.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/AudioDecoder.h index f56f8ae..ca253ff 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/AudioDecoder.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/AudioDecoder.h | |||
| @@ -83,7 +83,7 @@ namespace addon | |||
| 83 | /// @param[in] instance The from Kodi given instance given be | 83 | /// @param[in] instance The from Kodi given instance given be |
| 84 | /// add-on CreateInstance call with instance | 84 | /// add-on CreateInstance call with instance |
| 85 | /// id ADDON_INSTANCE_AUDIODECODER. | 85 | /// id ADDON_INSTANCE_AUDIODECODER. |
| 86 | CInstanceAudioDecoder(KODI_HANDLE instance) | 86 | explicit CInstanceAudioDecoder(KODI_HANDLE instance) |
| 87 | : IAddonInstance(ADDON_INSTANCE_AUDIODECODER) | 87 | : IAddonInstance(ADDON_INSTANCE_AUDIODECODER) |
| 88 | { | 88 | { |
| 89 | if (CAddonBase::m_interface->globalSingleInstance != nullptr) | 89 | if (CAddonBase::m_interface->globalSingleInstance != nullptr) |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/AudioEncoder.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/AudioEncoder.h index 3d59a99..7d2464d 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/AudioEncoder.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/AudioEncoder.h | |||
| @@ -75,7 +75,7 @@ namespace addon | |||
| 75 | /// @param[in] instance The from Kodi given instance given be | 75 | /// @param[in] instance The from Kodi given instance given be |
| 76 | /// add-on CreateInstance call with instance | 76 | /// add-on CreateInstance call with instance |
| 77 | /// id ADDON_INSTANCE_AUDIOENCODER. | 77 | /// id ADDON_INSTANCE_AUDIOENCODER. |
| 78 | CInstanceAudioEncoder(KODI_HANDLE instance) | 78 | explicit CInstanceAudioEncoder(KODI_HANDLE instance) |
| 79 | : IAddonInstance(ADDON_INSTANCE_AUDIOENCODER) | 79 | : IAddonInstance(ADDON_INSTANCE_AUDIOENCODER) |
| 80 | { | 80 | { |
| 81 | if (CAddonBase::m_interface->globalSingleInstance != nullptr) | 81 | if (CAddonBase::m_interface->globalSingleInstance != nullptr) |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/ImageDecoder.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/ImageDecoder.h index a854711..5ccb859 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/ImageDecoder.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/ImageDecoder.h | |||
| @@ -81,7 +81,7 @@ namespace addon | |||
| 81 | /// @param[in] instance The from Kodi given instance given be | 81 | /// @param[in] instance The from Kodi given instance given be |
| 82 | /// add-on CreateInstance call with instance | 82 | /// add-on CreateInstance call with instance |
| 83 | /// id ADDON_INSTANCE_IMAGEDECODER. | 83 | /// id ADDON_INSTANCE_IMAGEDECODER. |
| 84 | CInstanceImageDecoder(KODI_HANDLE instance) | 84 | explicit CInstanceImageDecoder(KODI_HANDLE instance) |
| 85 | : IAddonInstance(ADDON_INSTANCE_IMAGEDECODER) | 85 | : IAddonInstance(ADDON_INSTANCE_IMAGEDECODER) |
| 86 | { | 86 | { |
| 87 | if (CAddonBase::m_interface->globalSingleInstance != nullptr) | 87 | if (CAddonBase::m_interface->globalSingleInstance != nullptr) |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Inputstream.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Inputstream.h index 76cfe92..8db17c0 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Inputstream.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Inputstream.h | |||
| @@ -109,11 +109,26 @@ extern "C" { | |||
| 109 | TYPE_TELETEXT | 109 | TYPE_TELETEXT |
| 110 | } m_streamType; | 110 | } m_streamType; |
| 111 | 111 | ||
| 112 | enum Codec_FEATURES | 112 | enum Codec_FEATURES : uint32_t |
| 113 | { | 113 | { |
| 114 | FEATURE_DECODE = 1 | 114 | FEATURE_DECODE = 1 |
| 115 | }; | 115 | }; |
| 116 | unsigned int m_features; | 116 | uint32_t m_features; |
| 117 | |||
| 118 | enum STREAM_FLAGS : uint32_t | ||
| 119 | { | ||
| 120 | FLAG_NONE = 0x0000, | ||
| 121 | FLAG_DEFAULT = 0x0001, | ||
| 122 | FLAG_DUB = 0x0002, | ||
| 123 | FLAG_ORIGINAL = 0x0004, | ||
| 124 | FLAG_COMMENT = 0x0008, | ||
| 125 | FLAG_LYRICS = 0x0010, | ||
| 126 | FLAG_KARAOKE = 0x0020, | ||
| 127 | FLAG_FORCED = 0x0040, | ||
| 128 | FLAG_HEARING_IMPAIRED = 0x0080, | ||
| 129 | FLAG_VISUAL_IMPAIRED = 0x0100 | ||
| 130 | }; | ||
| 131 | uint32_t m_flags; | ||
| 117 | 132 | ||
| 118 | char m_codecName[32]; /*!< @brief (required) name of codec according to ffmpeg */ | 133 | char m_codecName[32]; /*!< @brief (required) name of codec according to ffmpeg */ |
| 119 | char m_codecInternalName[32]; /*!< @brief (optional) internal name of codec (selectionstream info) */ | 134 | char m_codecInternalName[32]; /*!< @brief (optional) internal name of codec (selectionstream info) */ |
| @@ -173,7 +188,7 @@ extern "C" { | |||
| 173 | struct INPUTSTREAM_IDS (__cdecl* get_stream_ids)(const AddonInstance_InputStream* instance); | 188 | struct INPUTSTREAM_IDS (__cdecl* get_stream_ids)(const AddonInstance_InputStream* instance); |
| 174 | struct INPUTSTREAM_INFO (__cdecl* get_stream)(const AddonInstance_InputStream* instance, int streamid); | 189 | struct INPUTSTREAM_INFO (__cdecl* get_stream)(const AddonInstance_InputStream* instance, int streamid); |
| 175 | void (__cdecl* enable_stream)(const AddonInstance_InputStream* instance, int streamid, bool enable); | 190 | void (__cdecl* enable_stream)(const AddonInstance_InputStream* instance, int streamid, bool enable); |
| 176 | void(__cdecl* open_stream)(const AddonInstance_InputStream* instance, int streamid); | 191 | bool(__cdecl* open_stream)(const AddonInstance_InputStream* instance, int streamid); |
| 177 | void (__cdecl* demux_reset)(const AddonInstance_InputStream* instance); | 192 | void (__cdecl* demux_reset)(const AddonInstance_InputStream* instance); |
| 178 | void (__cdecl* demux_abort)(const AddonInstance_InputStream* instance); | 193 | void (__cdecl* demux_abort)(const AddonInstance_InputStream* instance); |
| 179 | void (__cdecl* demux_flush)(const AddonInstance_InputStream* instance); | 194 | void (__cdecl* demux_flush)(const AddonInstance_InputStream* instance); |
| @@ -218,7 +233,7 @@ namespace addon | |||
| 218 | class CInstanceInputStream : public IAddonInstance | 233 | class CInstanceInputStream : public IAddonInstance |
| 219 | { | 234 | { |
| 220 | public: | 235 | public: |
| 221 | CInstanceInputStream(KODI_HANDLE instance) | 236 | explicit CInstanceInputStream(KODI_HANDLE instance) |
| 222 | : IAddonInstance(ADDON_INSTANCE_INPUTSTREAM) | 237 | : IAddonInstance(ADDON_INSTANCE_INPUTSTREAM) |
| 223 | { | 238 | { |
| 224 | if (CAddonBase::m_interface->globalSingleInstance != nullptr) | 239 | if (CAddonBase::m_interface->globalSingleInstance != nullptr) |
| @@ -278,7 +293,7 @@ namespace addon | |||
| 278 | * @param streamid unique id of stream | 293 | * @param streamid unique id of stream |
| 279 | * @remarks | 294 | * @remarks |
| 280 | */ | 295 | */ |
| 281 | virtual void OpenStream(int streamid) = 0; | 296 | virtual bool OpenStream(int streamid) = 0; |
| 282 | 297 | ||
| 283 | /*! | 298 | /*! |
| 284 | * Reset the demultiplexer in the add-on. | 299 | * Reset the demultiplexer in the add-on. |
| @@ -513,9 +528,9 @@ namespace addon | |||
| 513 | instance->toAddon.addonInstance->EnableStream(streamid, enable); | 528 | instance->toAddon.addonInstance->EnableStream(streamid, enable); |
| 514 | } | 529 | } |
| 515 | 530 | ||
| 516 | inline static void ADDON_OpenStream(const AddonInstance_InputStream* instance, int streamid) | 531 | inline static bool ADDON_OpenStream(const AddonInstance_InputStream* instance, int streamid) |
| 517 | { | 532 | { |
| 518 | instance->toAddon.addonInstance->OpenStream(streamid); | 533 | return instance->toAddon.addonInstance->OpenStream(streamid); |
| 519 | } | 534 | } |
| 520 | 535 | ||
| 521 | inline static void ADDON_DemuxReset(const AddonInstance_InputStream* instance) | 536 | inline static void ADDON_DemuxReset(const AddonInstance_InputStream* instance) |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Peripheral.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Peripheral.h index 045a925..c1a18e0 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Peripheral.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Peripheral.h | |||
| @@ -319,7 +319,7 @@ namespace addon | |||
| 319 | CAddonBase::m_interface->globalSingleInstance = this; | 319 | CAddonBase::m_interface->globalSingleInstance = this; |
| 320 | } | 320 | } |
| 321 | 321 | ||
| 322 | CInstancePeripheral(KODI_HANDLE instance) | 322 | explicit CInstancePeripheral(KODI_HANDLE instance) |
| 323 | : IAddonInstance(ADDON_INSTANCE_PERIPHERAL) | 323 | : IAddonInstance(ADDON_INSTANCE_PERIPHERAL) |
| 324 | { | 324 | { |
| 325 | if (CAddonBase::m_interface->globalSingleInstance != nullptr) | 325 | if (CAddonBase::m_interface->globalSingleInstance != nullptr) |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/PeripheralUtils.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/PeripheralUtils.h index 721da35..ea70b30 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/PeripheralUtils.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/PeripheralUtils.h | |||
| @@ -104,7 +104,7 @@ namespace addon | |||
| 104 | { | 104 | { |
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | Peripheral(const PERIPHERAL_INFO& info) : | 107 | explicit Peripheral(const PERIPHERAL_INFO& info) : |
| 108 | m_type(info.type), | 108 | m_type(info.type), |
| 109 | m_strName(info.name ? info.name : ""), | 109 | m_strName(info.name ? info.name : ""), |
| 110 | m_vendorId(info.vendor_id), | 110 | m_vendorId(info.vendor_id), |
| @@ -196,7 +196,7 @@ namespace addon | |||
| 196 | SetAxisState(state); | 196 | SetAxisState(state); |
| 197 | } | 197 | } |
| 198 | 198 | ||
| 199 | PeripheralEvent(const PERIPHERAL_EVENT& event) : | 199 | explicit PeripheralEvent(const PERIPHERAL_EVENT& event) : |
| 200 | m_event(event) | 200 | m_event(event) |
| 201 | { | 201 | { |
| 202 | } | 202 | } |
| @@ -259,7 +259,7 @@ namespace addon | |||
| 259 | *this = other; | 259 | *this = other; |
| 260 | } | 260 | } |
| 261 | 261 | ||
| 262 | Joystick(const JOYSTICK_INFO& info) : | 262 | explicit Joystick(const JOYSTICK_INFO& info) : |
| 263 | Peripheral(info.peripheral), | 263 | Peripheral(info.peripheral), |
| 264 | m_provider(info.provider ? info.provider : ""), | 264 | m_provider(info.provider ? info.provider : ""), |
| 265 | m_requestedPort(info.requested_port), | 265 | m_requestedPort(info.requested_port), |
| @@ -445,7 +445,7 @@ namespace addon | |||
| 445 | return DriverPrimitive(JOYSTICK_DRIVER_PRIMITIVE_TYPE_MOTOR, motorIndex); | 445 | return DriverPrimitive(JOYSTICK_DRIVER_PRIMITIVE_TYPE_MOTOR, motorIndex); |
| 446 | } | 446 | } |
| 447 | 447 | ||
| 448 | DriverPrimitive(const JOYSTICK_DRIVER_PRIMITIVE& primitive) : | 448 | explicit DriverPrimitive(const JOYSTICK_DRIVER_PRIMITIVE& primitive) : |
| 449 | m_type(primitive.type), | 449 | m_type(primitive.type), |
| 450 | m_driverIndex(0), | 450 | m_driverIndex(0), |
| 451 | m_hatDirection(JOYSTICK_DRIVER_HAT_UNKNOWN), | 451 | m_hatDirection(JOYSTICK_DRIVER_HAT_UNKNOWN), |
| @@ -604,12 +604,12 @@ namespace addon | |||
| 604 | *this = other; | 604 | *this = other; |
| 605 | } | 605 | } |
| 606 | 606 | ||
| 607 | JoystickFeature(const JOYSTICK_FEATURE& feature) : | 607 | explicit JoystickFeature(const JOYSTICK_FEATURE& feature) : |
| 608 | m_name(feature.name ? feature.name : ""), | 608 | m_name(feature.name ? feature.name : ""), |
| 609 | m_type(feature.type) | 609 | m_type(feature.type) |
| 610 | { | 610 | { |
| 611 | for (unsigned int i = 0; i < JOYSTICK_PRIMITIVE_MAX; i++) | 611 | for (unsigned int i = 0; i < JOYSTICK_PRIMITIVE_MAX; i++) |
| 612 | m_primitives[i] = feature.primitives[i]; | 612 | m_primitives[i] = DriverPrimitive(feature.primitives[i]); |
| 613 | } | 613 | } |
| 614 | 614 | ||
| 615 | JoystickFeature& operator=(const JoystickFeature& rhs) | 615 | JoystickFeature& operator=(const JoystickFeature& rhs) |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Screensaver.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Screensaver.h index 85cd7bc..04821b2 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Screensaver.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Screensaver.h | |||
| @@ -261,7 +261,7 @@ namespace addon | |||
| 261 | /// | 261 | /// |
| 262 | /// @warning Only use `instance` from the CreateInstance call | 262 | /// @warning Only use `instance` from the CreateInstance call |
| 263 | /// | 263 | /// |
| 264 | CInstanceScreensaver(KODI_HANDLE instance) | 264 | explicit CInstanceScreensaver(KODI_HANDLE instance) |
| 265 | : IAddonInstance(ADDON_INSTANCE_SCREENSAVER) | 265 | : IAddonInstance(ADDON_INSTANCE_SCREENSAVER) |
| 266 | { | 266 | { |
| 267 | if (CAddonBase::m_interface->globalSingleInstance != nullptr) | 267 | if (CAddonBase::m_interface->globalSingleInstance != nullptr) |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/VFS.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/VFS.h index 4bb3e69..8e688d7 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/VFS.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/VFS.h | |||
| @@ -119,7 +119,7 @@ namespace addon | |||
| 119 | class CInstanceVFS : public IAddonInstance | 119 | class CInstanceVFS : public IAddonInstance |
| 120 | { | 120 | { |
| 121 | public: | 121 | public: |
| 122 | CInstanceVFS(KODI_HANDLE instance) | 122 | explicit CInstanceVFS(KODI_HANDLE instance) |
| 123 | : IAddonInstance(ADDON_INSTANCE_VFS) | 123 | : IAddonInstance(ADDON_INSTANCE_VFS) |
| 124 | { | 124 | { |
| 125 | if (CAddonBase::m_interface->globalSingleInstance != nullptr) | 125 | if (CAddonBase::m_interface->globalSingleInstance != nullptr) |
| @@ -350,7 +350,7 @@ namespace addon | |||
| 350 | m_cb->require_authentication(m_cb->ctx, url.c_str()); | 350 | m_cb->require_authentication(m_cb->ctx, url.c_str()); |
| 351 | } | 351 | } |
| 352 | 352 | ||
| 353 | CVFSCallbacks(const VFSGetDirectoryCallbacks* cb) : m_cb(cb) { } | 353 | explicit CVFSCallbacks(const VFSGetDirectoryCallbacks* cb) : m_cb(cb) { } |
| 354 | 354 | ||
| 355 | private: | 355 | private: |
| 356 | const VFSGetDirectoryCallbacks* m_cb; | 356 | const VFSGetDirectoryCallbacks* m_cb; |
| @@ -519,7 +519,7 @@ namespace addon | |||
| 519 | VFSGetDirectoryCallbacks* callbacks) | 519 | VFSGetDirectoryCallbacks* callbacks) |
| 520 | { | 520 | { |
| 521 | std::vector<kodi::vfs::CDirEntry> addonEntries; | 521 | std::vector<kodi::vfs::CDirEntry> addonEntries; |
| 522 | bool ret = instance->toAddon.addonInstance->GetDirectory(*url, addonEntries, callbacks); | 522 | bool ret = instance->toAddon.addonInstance->GetDirectory(*url, addonEntries, CVFSCallbacks(callbacks)); |
| 523 | if (ret) | 523 | if (ret) |
| 524 | { | 524 | { |
| 525 | VFSDirEntry* entries = static_cast<VFSDirEntry*>(malloc(sizeof(VFSDirEntry) * addonEntries.size())); | 525 | VFSDirEntry* entries = static_cast<VFSDirEntry*>(malloc(sizeof(VFSDirEntry) * addonEntries.size())); |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/VideoCodec.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/VideoCodec.h index 710fda0..02d39c6 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/VideoCodec.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/VideoCodec.h | |||
| @@ -158,7 +158,7 @@ namespace kodi | |||
| 158 | class CInstanceVideoCodec : public IAddonInstance | 158 | class CInstanceVideoCodec : public IAddonInstance |
| 159 | { | 159 | { |
| 160 | public: | 160 | public: |
| 161 | CInstanceVideoCodec(KODI_HANDLE instance) | 161 | explicit CInstanceVideoCodec(KODI_HANDLE instance) |
| 162 | : IAddonInstance(ADDON_INSTANCE_VIDEOCODEC) | 162 | : IAddonInstance(ADDON_INSTANCE_VIDEOCODEC) |
| 163 | { | 163 | { |
| 164 | if (CAddonBase::m_interface->globalSingleInstance != nullptr) | 164 | if (CAddonBase::m_interface->globalSingleInstance != nullptr) |
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Visualization.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Visualization.h index b1ded64..452085a 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Visualization.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/Visualization.h | |||
| @@ -340,7 +340,7 @@ namespace addon | |||
| 340 | /// | 340 | /// |
| 341 | /// @warning Only use `instance` from the CreateInstance call | 341 | /// @warning Only use `instance` from the CreateInstance call |
| 342 | /// | 342 | /// |
| 343 | CInstanceVisualization(KODI_HANDLE instance) | 343 | explicit CInstanceVisualization(KODI_HANDLE instance) |
| 344 | : IAddonInstance(ADDON_INSTANCE_VISUALIZATION), | 344 | : IAddonInstance(ADDON_INSTANCE_VISUALIZATION), |
| 345 | m_presetLockedByUser(false) | 345 | m_presetLockedByUser(false) |
| 346 | { | 346 | { |
