From e317daf081a1048904fdf0b548946fa3ba6593a7 Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 29 Apr 2019 12:22:05 +0200 Subject: sync with upstream --- .../kodi-addon-dev-kit/include/kodi/AddonBase.h | 55 +++++++++++-- .../kodi-addon-dev-kit/include/kodi/gui/General.h | 34 +++++++- .../kodi-addon-dev-kit/include/kodi/gui/Window.h | 2 +- .../include/kodi/gui/definitions.h | 1 + .../include/kodi/kodi_game_dll.h | 28 +++++-- .../include/kodi/kodi_game_types.h | 21 +++-- .../kodi-addon-dev-kit/include/kodi/libKODI_game.h | 18 ++--- .../include/kodi/tools/CMakeLists.txt | 3 +- .../kodi-addon-dev-kit/include/kodi/tools/Time.h | 91 ++++++++++++++++++++++ .../kodi-addon-dev-kit/include/kodi/versions.h | 12 +-- .../include/kodi/xbmc_addon_dll.h | 5 ++ .../include/kodi/xbmc_epg_types.h | 1 - .../kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h | 23 +++--- .../include/kodi/xbmc_pvr_types.h | 14 ++-- 14 files changed, 252 insertions(+), 56 deletions(-) create mode 100644 xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/Time.h (limited to 'xbmc/addons/kodi-addon-dev-kit') diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h index 42ce2e7..db39f86 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/AddonBase.h @@ -43,6 +43,20 @@ #define ATTRIBUTE_HIDDEN #endif +#ifdef _MSC_VER + #define ATTRIBUTE_FORCEINLINE __forceinline +#elif defined(__GNUC__) + #define ATTRIBUTE_FORCEINLINE inline __attribute__((__always_inline__)) +#elif defined(__CLANG__) + #if __has_attribute(__always_inline__) + #define ATTRIBUTE_FORCEINLINE inline __attribute__((__always_inline__)) + #else + #define ATTRIBUTE_FORCEINLINE inline + #endif +#else + #define ATTRIBUTE_FORCEINLINE inline +#endif + #include "versions.h" namespace kodi { namespace addon { class CAddonBase; }} @@ -179,6 +193,7 @@ typedef struct KodiToAddonFuncTable_Addon ADDON_STATUS (*create_instance)(int instanceType, const char* instanceID, KODI_HANDLE instance, KODI_HANDLE* addonInstance, KODI_HANDLE parent); void (*destroy_instance)(int instanceType, KODI_HANDLE instance); ADDON_STATUS (*set_setting)(const char *settingName, const void *settingValue); + ADDON_STATUS(*create_instance_ex)(int instanceType, const char* instanceID, KODI_HANDLE instance, KODI_HANDLE* addonInstance, KODI_HANDLE parent, const char* version); } KodiToAddonFuncTable_Addon; /* @@ -237,6 +252,11 @@ public: return ADDON_STATUS_NOT_IMPLEMENTED; } + virtual ADDON_STATUS CreateInstanceEx(int instanceType, std::string instanceID, KODI_HANDLE instance, KODI_HANDLE& addonInstance, const std::string &version) + { + return CreateInstance(instanceType, instanceID, instance, addonInstance); + } + const ADDON_TYPE m_type; }; } /* namespace addon */ @@ -278,6 +298,9 @@ public: CAddonBase::m_interface->toAddon->create_instance = ADDONBASE_CreateInstance; CAddonBase::m_interface->toAddon->destroy_instance = ADDONBASE_DestroyInstance; CAddonBase::m_interface->toAddon->set_setting = ADDONBASE_SetSetting; + // If version is present, we know that kodi has create_instance_ex implemented + if (!CAddonBase::m_strGlobalApiVersion.empty()) + CAddonBase::m_interface->toAddon->create_instance_ex = ADDONBASE_CreateInstanceEx; } virtual ~CAddonBase() = default; @@ -306,8 +329,14 @@ public: return ADDON_STATUS_UNKNOWN; } + virtual ADDON_STATUS CreateInstanceEx(int instanceType, std::string instanceID, KODI_HANDLE instance, KODI_HANDLE& addonInstance, const std::string &version) + { + return CreateInstance(instanceType, instanceID, instance, addonInstance); + } + /* Global variables of class */ static AddonGlobalInterface* m_interface; // Interface function table to hold addresses on add-on and from kodi + static std::string m_strGlobalApiVersion; /*private:*/ /* Needed public as long the old call functions becomes used! */ static inline void ADDONBASE_Destroy() @@ -324,17 +353,22 @@ public: } static inline ADDON_STATUS ADDONBASE_CreateInstance(int instanceType, const char* instanceID, KODI_HANDLE instance, KODI_HANDLE* addonInstance, KODI_HANDLE parent) + { + return ADDONBASE_CreateInstanceEx(instanceType, instanceID, instance, addonInstance, parent, ""); + } + + static inline ADDON_STATUS ADDONBASE_CreateInstanceEx(int instanceType, const char* instanceID, KODI_HANDLE instance, KODI_HANDLE* addonInstance, KODI_HANDLE parent, const char* version) { ADDON_STATUS status = ADDON_STATUS_NOT_IMPLEMENTED; if (parent != nullptr) - status = static_cast(parent)->CreateInstance(instanceType, instanceID, instance, *addonInstance); + status = static_cast(parent)->CreateInstanceEx(instanceType, instanceID, instance, *addonInstance, version); if (status == ADDON_STATUS_NOT_IMPLEMENTED) - status = CAddonBase::m_interface->addonBase->CreateInstance(instanceType, instanceID, instance, *addonInstance); + status = CAddonBase::m_interface->addonBase->CreateInstanceEx(instanceType, instanceID, instance, *addonInstance, version); if (*addonInstance == nullptr) - throw std::logic_error("kodi::addon::CAddonBase CreateInstance returns a empty instance pointer!"); + throw std::logic_error("kodi::addon::CAddonBase CreateInstanceEx returns a empty instance pointer!"); if (static_cast<::kodi::addon::IAddonInstance*>(*addonInstance)->m_type != instanceType) - throw std::logic_error("kodi::addon::CAddonBase CreateInstance with difference on given and returned instance type!"); + throw std::logic_error("kodi::addon::CAddonBase CreateInstanceEx with difference on given and returned instance type!"); return status; } @@ -636,6 +670,11 @@ inline void* GetInterface(const std::string &name, const std::string &version) kodi::addon::CAddonBase::m_interface->addonBase = new AddonClass; \ return kodi::addon::CAddonBase::m_interface->addonBase->Create(); \ } \ + extern "C" __declspec(dllexport) ADDON_STATUS ADDON_CreateEx(KODI_HANDLE addonInterface, const char* globalApiVersion, void *unused) \ + { \ + kodi::addon::CAddonBase::m_strGlobalApiVersion = globalApiVersion; \ + return ADDON_Create(addonInterface, unused); \ + } \ extern "C" __declspec(dllexport) void ADDON_Destroy() \ { \ kodi::addon::CAddonBase::ADDONBASE_Destroy(); \ @@ -652,4 +691,10 @@ inline void* GetInterface(const std::string &name, const std::string &version) { \ return kodi::addon::GetTypeVersion(type); \ } \ - AddonGlobalInterface* kodi::addon::CAddonBase::m_interface = nullptr; + extern "C" __declspec(dllexport) const char* ADDON_GetTypeMinVersion(int type) \ + { \ + return kodi::addon::GetTypeMinVersion(type); \ + } \ + AddonGlobalInterface* kodi::addon::CAddonBase::m_interface = nullptr; \ + std::string kodi::addon::CAddonBase::m_strGlobalApiVersion; + diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/General.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/General.h index 30b6d89..a3b8bcb 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/General.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/General.h @@ -106,7 +106,7 @@ namespace gui /// **Example:** /// ~~~~~~~~~~~~~{.cpp} /// .. - /// int wid = kodi::gui::GetCurrentWindowDialogId() + /// int wid = kodi::gui::GetCurrentWindowDialogId(); /// .. /// ~~~~~~~~~~~~~ /// @@ -130,7 +130,7 @@ namespace gui /// **Example:** /// ~~~~~~~~~~~~~{.cpp} /// .. - /// int wid = kodi::gui::GetCurrentWindowId() + /// int wid = kodi::gui::GetCurrentWindowId(); /// .. /// ~~~~~~~~~~~~~ /// @@ -141,5 +141,35 @@ namespace gui } //-------------------------------------------------------------------------- + //========================================================================== + /// + /// \ingroup cpp_kodi_gui + /// \brief To get hardware specific device context interface + /// + /// \return The currently active device context + /// + /// \warning This function is only be supported under Windows, on all other + /// OS it return `nullptr`! + /// + /// \note Returned Windows class pointer is `ID3D11DeviceContext1`. + /// + /// + ///------------------------------------------------------------------------- + /// + /// **Example:** + /// ~~~~~~~~~~~~~{.cpp} + /// #include + /// .. + /// ID3D11DeviceContext1* context = static_cast(kodi::gui::GetHWContext()); + /// .. + /// ~~~~~~~~~~~~~ + /// + inline void* GetHWContext() + { + using namespace ::kodi::addon; + return CAddonBase::m_interface->toKodi->kodi_gui->general->get_hw_context(CAddonBase::m_interface->toKodi->kodiBase); + } + //-------------------------------------------------------------------------- + } /* namespace gui */ } /* namespace kodi */ diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/Window.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/Window.h index f188f34..e7a8a05 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/Window.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/Window.h @@ -14,7 +14,7 @@ #ifdef BUILD_KODI_ADDON #include "../ActionIDs.h" #else -#include "input/ActionIDs.h" +#include "input/actions/ActionIDs.h" #endif namespace kodi diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/definitions.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/definitions.h index 770a416..b8b4cbf 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/definitions.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/definitions.h @@ -26,6 +26,7 @@ typedef struct AddonToKodiFuncTable_kodi_gui_general int (*get_video_resolution)(void* kodiBase); int (*get_current_window_dialog_id)(void* kodiBase); int (*get_current_window_id)(void* kodiBase); + void* (*get_hw_context)(void* kodiBase); } AddonToKodiFuncTable_kodi_gui_general; typedef struct AddonToKodiFuncTable_kodi_gui_control_button diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_dll.h index 478f81b..4338606 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_dll.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_dll.h @@ -152,32 +152,43 @@ game_input_topology* GetTopology(); */ void FreeTopology(game_input_topology* topology); +/*! + * \brief Set the layouts for known controllers + * + * \param controllers The controller layouts + * \param controller_count The number of items in the array + * + * After loading the input topology, the frontend will call this with + * controller layouts for all controllers discovered in the topology. + */ +void SetControllerLayouts(const game_controller_layout* controllers, unsigned int controller_count); + /*! * \brief Enable/disable keyboard input using the specified controller * * \param enable True to enable input, false otherwise - * \param controller The controller info if enabling, or unused if disabling + * \param controller_id The controller ID if enabling, or unused if disabling * * \return True if keyboard input was enabled, false otherwise */ -bool EnableKeyboard(bool enable, const game_controller* controller); +bool EnableKeyboard(bool enable, const char* controller_id); /*! * \brief Enable/disable mouse input using the specified controller * * \param enable True to enable input, false otherwise - * \param controller The controller info if enabling, or unused if disabling + * \param controller_id The controller ID if enabling, or unused if disabling * * \return True if mouse input was enabled, false otherwise */ -bool EnableMouse(bool enable, const game_controller* controller); +bool EnableMouse(bool enable, const char* controller_id); /*! * \brief Connect/disconnect a controller to a port on the virtual game console * * \param connect True to connect a controller, false to disconnect * \param port_address The address of the port - * \param controller The controller info if connecting, or unused if disconnecting + * \param controller_id The controller ID if connecting, or unused if disconnecting * \return True if the \p controller was (dis-)connected to the port, false otherwise * * The address is a string that allows traversal of the controller topology. @@ -203,17 +214,17 @@ bool EnableMouse(bool enable, const game_controller* controller); * To connect a multitap to the console's first port, the multitap's controller * info is set using the port address: * - * 1 + * /1 * * To connect a SNES controller to the second port of the multitap, the * controller info is next set using the address: * - * 1/game.controller.multitap/2 + * /1/game.controller.multitap/2 * * Any attempts to connect a controller to a port on a disconnected multitap * will return false. */ -bool ConnectController(bool connect, const char* port_address, const game_controller* controller); +bool ConnectController(bool connect, const char* port_address, const char* controller_id); /*! * \brief Notify the add-on of an input event @@ -310,6 +321,7 @@ void __declspec(dllexport) get_addon(void* ptr) pClient->toAddon.HasFeature = HasFeature; pClient->toAddon.GetTopology = GetTopology; pClient->toAddon.FreeTopology = FreeTopology; + pClient->toAddon.SetControllerLayouts = SetControllerLayouts; pClient->toAddon.EnableKeyboard = EnableKeyboard; pClient->toAddon.EnableMouse = EnableMouse; pClient->toAddon.ConnectController = ConnectController; diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_types.h index e3187d2..ec9d472 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_types.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_types.h @@ -446,19 +446,27 @@ typedef enum GAME_PORT_TYPE GAME_PORT_CONTROLLER, } GAME_PORT_TYPE; -typedef struct game_controller +typedef struct game_controller_layout { - const char* controller_id; + char* controller_id; bool provides_input; // False for multitaps + char** digital_buttons; unsigned int digital_button_count; + char** analog_buttons; unsigned int analog_button_count; + char** analog_sticks; unsigned int analog_stick_count; + char** accelerometers; unsigned int accelerometer_count; + char** keys; unsigned int key_count; + char** rel_pointers; unsigned int rel_pointer_count; + char** abs_pointers; unsigned int abs_pointer_count; + char** motors; unsigned int motor_count; -} ATTRIBUTE_PACKED game_controller; +} ATTRIBUTE_PACKED game_controller_layout; struct game_input_port; @@ -680,9 +688,10 @@ typedef struct KodiToAddonFuncTable_Game bool (__cdecl* HasFeature)(const char*, const char*); game_input_topology* (__cdecl* GetTopology)(); void (__cdecl* FreeTopology)(game_input_topology*); - bool (__cdecl* EnableKeyboard)(bool, const game_controller*); - bool (__cdecl* EnableMouse)(bool, const game_controller*); - bool (__cdecl* ConnectController)(bool, const char*, const game_controller*); + void (__cdecl* SetControllerLayouts)(const game_controller_layout*, unsigned int); + bool (__cdecl* EnableKeyboard)(bool, const char*); + bool (__cdecl* EnableMouse)(bool, const char*); + bool (__cdecl* ConnectController)(bool, const char*, const char*); bool (__cdecl* InputEvent)(const game_input_event*); size_t (__cdecl* SerializeSize)(void); GAME_ERROR (__cdecl* Serialize)(uint8_t*, size_t); diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_game.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_game.h index b518c28..2e6459b 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_game.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_game.h @@ -135,15 +135,15 @@ public: // --- Input callbacks ------------------------------------------------------- /*! - * \brief Notify the port of an input event - * - * \param event The input event - * - * Input events can arrive for the following sources: - * - GAME_INPUT_EVENT_MOTOR - * - * \return true if the event was handled, false otherwise - */ + * \brief Notify the port of an input event + * + * \param event The input event + * + * Input events can arrive for the following sources: + * - GAME_INPUT_EVENT_MOTOR + * + * \return true if the event was handled, false otherwise + */ bool InputEvent(const game_input_event& event) { return m_callbacks->toKodi.InputEvent(m_callbacks->toKodi.kodiInstance, &event); diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/CMakeLists.txt b/xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/CMakeLists.txt index 939585c..ef2fa25 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/CMakeLists.txt +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/CMakeLists.txt @@ -1,4 +1,5 @@ -set(HEADERS DllHelper.h ) +set(HEADERS DllHelper.h + Time.h) if(NOT ENABLE_STATIC_LIBS) core_add_library(addons_kodi-addon-dev-kit_include_kodi_tools) diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/Time.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/Time.h new file mode 100644 index 0000000..31c29fd --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/tools/Time.h @@ -0,0 +1,91 @@ +#pragma once +/* + * Copyright (C) 2005-2019 Team Kodi + * Copyright (C) 2011-2012 Pulse-Eight Limited. + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#if defined(TARGET_DARWIN) +#include +#include +#elif defined(TARGET_WINDOWS) +#include +#include +#else +#include +#endif + +namespace kodi +{ +namespace time +{ + +//=============================================================================== +/// @brief Function to get current time in milliseconds +/// +/// @return Current time in milliseconds as a double value +/// +/// +/// ----------------------------------------------------------------------------- +/// +/// **Example:** +/// ~~~~~~~~~~~~~{.cpp} +/// +/// #include +/// +/// ... +/// double time = kodi::time::GetTimeMs(); +/// ... +/// ~~~~~~~~~~~~~ +/// +inline double GetTimeMs() +{ +#if defined(TARGET_DARWIN) + return static_cast(CVGetCurrentHostTime() / static_cast(CVGetHostClockFrequency() * 0.001)); +#elif defined(TARGET_WINDOWS) + LARGE_INTEGER tickPerSecond; + LARGE_INTEGER tick; + if (QueryPerformanceFrequency(&tickPerSecond)) + { + QueryPerformanceCounter(&tick); + return static_cast(tick.QuadPart) / (tickPerSecond.QuadPart / 1000.0); + } + return 0.0; +#else + timespec time; + clock_gettime(CLOCK_MONOTONIC, &time); + return static_cast(time.tv_sec) * 1000.0 + time.tv_nsec / 1000000.0; +#endif +} +//------------------------------------------------------------------------------- + +//=============================================================================== +/// @brief Function to get current time in seconds +/// +/// @return Current time in seconds with the value type defined in the template +/// +/// +/// ----------------------------------------------------------------------------- +/// +/// **Example:** +/// ~~~~~~~~~~~~~{.cpp} +/// +/// #include +/// +/// ... +/// double time = kodi::time::GetTimeSec(); +/// ... +/// ~~~~~~~~~~~~~ +/// +template +inline T GetTimeSec() +{ + return static_cast(GetTimeMs()) / static_cast(1000.0); +} +//------------------------------------------------------------------------------- + +} /* namespace time */ +} /* namespace kodi */ diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/versions.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/versions.h index 5127f7e..a9f1798 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/versions.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/versions.h @@ -30,7 +30,7 @@ * overview. */ -#define ADDON_GLOBAL_VERSION_MAIN "1.0.13" +#define ADDON_GLOBAL_VERSION_MAIN "1.0.14" #define ADDON_GLOBAL_VERSION_MAIN_MIN "1.0.12" #define ADDON_GLOBAL_VERSION_MAIN_XML_ID "kodi.binary.global.main" #define ADDON_GLOBAL_VERSION_MAIN_DEPENDS "AddonBase.h" \ @@ -44,7 +44,7 @@ #define ADDON_GLOBAL_VERSION_GENERAL_XML_ID "kodi.binary.global.general" #define ADDON_GLOBAL_VERSION_GENERAL_DEPENDS "General.h" -#define ADDON_GLOBAL_VERSION_GUI "5.12.0" +#define ADDON_GLOBAL_VERSION_GUI "5.12.1" #define ADDON_GLOBAL_VERSION_GUI_MIN "5.10.0" #define ADDON_GLOBAL_VERSION_GUI_XML_ID "kodi.binary.global.gui" #define ADDON_GLOBAL_VERSION_GUI_DEPENDS "libKODI_guilib.h" \ @@ -75,8 +75,8 @@ #define ADDON_INSTANCE_VERSION_AUDIOENCODER_XML_ID "kodi.binary.instance.audioencoder" #define ADDON_INSTANCE_VERSION_AUDIOENCODER_DEPENDS "addon-instance/AudioEncoder.h" -#define ADDON_INSTANCE_VERSION_GAME "1.0.38" -#define ADDON_INSTANCE_VERSION_GAME_MIN "1.0.38" +#define ADDON_INSTANCE_VERSION_GAME "1.1.0" +#define ADDON_INSTANCE_VERSION_GAME_MIN "1.1.0" #define ADDON_INSTANCE_VERSION_GAME_XML_ID "kodi.binary.instance.game" #define ADDON_INSTANCE_VERSION_GAME_DEPENDS "kodi_game_dll.h" \ "kodi_game_types.h" \ @@ -98,8 +98,8 @@ #define ADDON_INSTANCE_VERSION_PERIPHERAL_DEPENDS "addon-instance/Peripheral.h" \ "addon-instance/PeripheralUtils.h" -#define ADDON_INSTANCE_VERSION_PVR "5.10.3" -#define ADDON_INSTANCE_VERSION_PVR_MIN "5.10.0" +#define ADDON_INSTANCE_VERSION_PVR "6.0.0" +#define ADDON_INSTANCE_VERSION_PVR_MIN "6.0.0" #define ADDON_INSTANCE_VERSION_PVR_XML_ID "kodi.binary.instance.pvr" #define ADDON_INSTANCE_VERSION_PVR_DEPENDS "xbmc_pvr_dll.h" \ "xbmc_pvr_types.h" \ diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h index e9e7d9a..ce2bc98 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h @@ -15,6 +15,7 @@ extern "C" { #endif ADDON_STATUS __declspec(dllexport) ADDON_Create(void *callbacks, void* props); + ADDON_STATUS __declspec(dllexport) ADDON_CreateEx(void *callbacks, const char* globalApiVersion, void* props); void __declspec(dllexport) ADDON_Destroy(); ADDON_STATUS __declspec(dllexport) ADDON_GetStatus(); ADDON_STATUS __declspec(dllexport) ADDON_SetSetting(const char *settingName, const void *settingValue); @@ -22,6 +23,10 @@ extern "C" { { return kodi::addon::GetTypeVersion(type); } + __declspec(dllexport) const char* ADDON_GetTypeMinVersion(int type) + { + return kodi::addon::GetTypeMinVersion(type); + } #ifdef __cplusplus }; diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h index 7b11ed8..30503d5 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h @@ -100,7 +100,6 @@ extern "C" { time_t firstAired; /*!< @brief (optional) first aired in UTC */ int iParentalRating; /*!< @brief (optional) parental rating */ int iStarRating; /*!< @brief (optional) star rating */ - bool bNotify; /*!< @brief (optional) notify the user when this event starts */ int iSeriesNumber; /*!< @brief (optional) series number */ int iEpisodeNumber; /*!< @brief (optional) episode number */ int iEpisodePartNumber; /*!< @brief (optional) episode part number */ diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h index 27fa800..26e9099 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h @@ -78,14 +78,14 @@ extern "C" * Request the EPG for a channel from the backend. * EPG entries are added to Kodi by calling TransferEpgEntry() on the callback. * @param handle Handle to pass to the callback method. - * @param channel The channel to get the EPG table for. + * @param iChannelUid The UID of the channel to get the EPG table for. * @param iStart Get events after this time (UTC). * @param iEnd Get events before this time (UTC). * @return PVR_ERROR_NO_ERROR if the table has been fetched successfully. * @remarks Required if bSupportsEPG is set to true. * Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. */ - PVR_ERROR GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL& channel, time_t iStart, time_t iEnd); + PVR_ERROR GetEPGForChannel(ADDON_HANDLE handle, int iChannelUid, time_t iStart, time_t iEnd); /* * Check if the given EPG tag can be recorded. @@ -413,6 +413,7 @@ extern "C" * @param channel The channel to stream. * @return True if the stream has been opened successfully, false otherwise. * @remarks Required if bHandlesInputStream or bHandlesDemuxing is set to true. + * CloseLiveStream() will always be called by Kodi prior to calling this function. * Return false if this add-on won't provide this function. */ bool OpenLiveStream(const PVR_CHANNEL& channel); @@ -497,7 +498,7 @@ extern "C" * Get the stream properties of the stream that's currently being read. * @param pProperties The properties of the currently playing stream. * @return PVR_ERROR_NO_ERROR if the properties have been fetched successfully. - * @remarks Required if bHandlesInputStream or bHandlesDemuxing is set to true. + * @remarks Required if bHandlesDemuxing is set to true. * Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. */ PVR_ERROR GetStreamProperties(PVR_STREAM_PROPERTIES* pProperties); @@ -523,6 +524,7 @@ extern "C" * @param recording The recording to open. * @return True if the stream has been opened successfully, false otherwise. * @remarks Optional, and only used if bSupportsRecordings is set to true. + * CloseRecordedStream() will always be called by Kodi prior to calling this function. * Return false if this add-on won't provide this function. */ bool OpenRecordedStream(const PVR_RECORDING& recording); @@ -639,16 +641,17 @@ extern "C" void SetSpeed(int speed); /*! - * Get the hostname of the pvr backend server - * @return hostname as ip address or alias. If backend does not utilize a server, return empty string. + * Notify the pvr addon/demuxer that Kodi wishes to fill demux queue + * @param mode The requested filling mode + * @remarks Optional, and only used if addon has its own demuxer. */ - const char* GetBackendHostname(); + void FillBuffer(bool mode); /*! - * Check if timeshift is active - * @return true if timeshift is active + * Get the hostname of the pvr backend server + * @return hostname as ip address or alias. If backend does not utilize a server, return empty string. */ - bool IsTimeshifting(); + const char* GetBackendHostname(); /*! * Check for real-time streaming @@ -751,6 +754,7 @@ extern "C" pClient->toAddon.CanSeekStream = CanSeekStream; pClient->toAddon.SeekTime = SeekTime; pClient->toAddon.SetSpeed = SetSpeed; + pClient->toAddon.FillBuffer = FillBuffer; pClient->toAddon.OpenRecordedStream = OpenRecordedStream; pClient->toAddon.CloseRecordedStream = CloseRecordedStream; @@ -765,7 +769,6 @@ extern "C" pClient->toAddon.GetBackendHostname = GetBackendHostname; - pClient->toAddon.IsTimeshifting = IsTimeshifting; pClient->toAddon.IsRealTimeStream = IsRealTimeStream; pClient->toAddon.SetEPGTimeFrame = SetEPGTimeFrame; diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h index f1562b6..999d3b3 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h @@ -55,8 +55,8 @@ struct DemuxPacket; #define PVR_ADDON_TIMERTYPE_ARRAY_SIZE 32 #define PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE 512 #define PVR_ADDON_TIMERTYPE_VALUES_ARRAY_SIZE_SMALL 128 -#define PVR_ADDON_TIMERTYPE_STRING_LENGTH 64 -#define PVR_ADDON_ATTRIBUTE_DESC_LENGTH 64 +#define PVR_ADDON_TIMERTYPE_STRING_LENGTH 128 +#define PVR_ADDON_ATTRIBUTE_DESC_LENGTH 128 #define PVR_ADDON_ATTRIBUTE_VALUES_ARRAY_SIZE 512 #define PVR_ADDON_DESCRAMBLE_INFO_STRING_LENGTH 64 @@ -154,6 +154,7 @@ extern "C" { const unsigned int PVR_TIMER_TYPE_SUPPORTS_ANY_CHANNEL = 0x01000000; /*!< @brief this type supports 'any channel', for example when defining a timer rule that should match any channel instaed of a particular channel */ const unsigned int PVR_TIMER_TYPE_REQUIRES_EPG_SERIESLINK_ON_CREATE = 0x02000000; /*!< @brief this type should not appear on any create menus which don't provide an associated EPG tag with a series link */ const unsigned int PVR_TIMER_TYPE_SUPPORTS_READONLY_DELETE = 0x04000000; /*!< @brief this type allows deletion of an otherwise read-only timer */ + const unsigned int PVR_TIMER_TYPE_IS_REMINDER = 0x08000000; /*!< @brief timers of this type do trigger a reminder if time is up by calling the Kodi callback 'ReminderNotification'. */ /*! * @brief PVR timer weekdays (PVR_TIMER.iWeekdays values) @@ -310,12 +311,10 @@ extern "C" { bool bSupportsRecordingsRename; /*!< @brief true if the backend supports renaming recordings. */ bool bSupportsRecordingsLifetimeChange; /*!< @brief true if the backend supports changing lifetime for recordings. */ bool bSupportsDescrambleInfo; /*!< @brief true if the backend supports descramble information for playing channels. */ + bool bSupportsAsyncEPGTransfer; /*!< @brief true if this addon-on supports asynchronous transfer of epg events to Kodi using the callback function EpgEventStateChange. */ unsigned int iRecordingsLifetimesSize; /*!< @brief (required) Count of possible values for PVR_RECORDING.iLifetime. 0 means lifetime is not supported for recordings or no own value definition wanted, but to use Kodi defaults of 1..365. */ PVR_ATTRIBUTE_INT_VALUE recordingsLifetimeValues[PVR_ADDON_ATTRIBUTE_VALUES_ARRAY_SIZE]; /*!< @brief (optional) Array containing the possible values for PVR_RECORDING.iLifetime. Must be filled if iLifetimesSize > 0 */ - - // TODO: cleanup: move this member up after the other bools with the next incompatible pvr addon api change. - bool bSupportsAsyncEPGTransfer; /*!< @brief true if this addon-on supports asynchronous transfer of epg events to Kodi using the callback function EpgEventStateChange. */ } ATTRIBUTE_PACKED PVR_ADDON_CAPABILITIES; /*! @@ -402,6 +401,7 @@ extern "C" { unsigned int iEncryptionSystem; /*!< @brief (optional) the encryption ID or CaID of this channel */ char strIconPath[PVR_ADDON_URL_STRING_LENGTH]; /*!< @brief (optional) path to the channel icon (if present) */ bool bIsHidden; /*!< @brief (optional) true if this channel is marked as hidden */ + bool bHasArchive; /*!< @brief (optional) true if this channel has a server-side back buffer */ } ATTRIBUTE_PACKED PVR_CHANNEL; typedef struct PVR_CHANNEL_GROUP @@ -634,7 +634,7 @@ extern "C" { const char* (__cdecl* GetConnectionString)(void); PVR_ERROR (__cdecl* GetDriveSpace)(long long*, long long*); PVR_ERROR (__cdecl* MenuHook)(const PVR_MENUHOOK&, const PVR_MENUHOOK_DATA&); - PVR_ERROR (__cdecl* GetEPGForChannel)(ADDON_HANDLE, const PVR_CHANNEL&, time_t, time_t); + PVR_ERROR (__cdecl* GetEPGForChannel)(ADDON_HANDLE, int, time_t, time_t); PVR_ERROR (__cdecl* IsEPGTagRecordable)(const EPG_TAG*, bool*); PVR_ERROR (__cdecl* IsEPGTagPlayable)(const EPG_TAG*, bool*); PVR_ERROR (__cdecl* GetEPGTagEdl)(const EPG_TAG*, PVR_EDL_ENTRY[], int*); @@ -690,8 +690,8 @@ extern "C" { bool (__cdecl* CanSeekStream)(void); bool (__cdecl* SeekTime)(double, bool, double*); void (__cdecl* SetSpeed)(int); + void (__cdecl* FillBuffer)(bool); const char* (__cdecl* GetBackendHostname)(void); - bool (__cdecl* IsTimeshifting)(void); bool (__cdecl* IsRealTimeStream)(void); PVR_ERROR (__cdecl* SetEPGTimeFrame)(int); void (__cdecl* OnSystemSleep)(void); -- cgit v1.2.3