From 8cdf8dec703d882b46ca50a769fabb95ffc48e2c Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 24 Nov 2016 21:27:41 +0100 Subject: sync with upstream --- xbmc/addons/addon-bindings.mk | 3 + .../include/kodi/kodi_inputstream_dll.h | 16 +- .../include/kodi/kodi_inputstream_types.h | 6 +- .../include/kodi/kodi_peripheral_callbacks.h | 10 ++ .../include/kodi/kodi_peripheral_dll.h | 72 ++++++++- .../include/kodi/kodi_peripheral_types.h | 73 ++++++--- .../include/kodi/kodi_peripheral_utils.hpp | 178 ++++++++++----------- .../kodi-addon-dev-kit/include/kodi/libKODI_adsp.h | 17 +- .../include/kodi/libKODI_audioengine.h | 21 +-- .../include/kodi/libKODI_guilib.h | 17 +- .../include/kodi/libKODI_inputstream.h | 8 +- .../include/kodi/libKODI_peripheral.h | 7 + .../include/kodi/libXBMC_addon.h | 31 ++-- .../include/kodi/libXBMC_codec.h | 17 +- .../kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h | 19 +-- .../include/kodi/xbmc_epg_types.h | 2 +- .../include/kodi/xbmc_pvr_types.h | 2 +- 17 files changed, 262 insertions(+), 237 deletions(-) (limited to 'xbmc/addons') diff --git a/xbmc/addons/addon-bindings.mk b/xbmc/addons/addon-bindings.mk index 71fe609..6bfed36 100644 --- a/xbmc/addons/addon-bindings.mk +++ b/xbmc/addons/addon-bindings.mk @@ -1,3 +1,6 @@ +# Please also update bindings in ../../project/cmake/scripts/linux/Install.cmake +# TODO: Cleanup file after autotools is gone + BINDINGS =xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_cpp_dll.h BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h BINDINGS+=xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_types.h diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h index bb9a2d4..3721971 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h @@ -81,14 +81,6 @@ extern "C" */ void EnableStream(int streamid, bool enable); - /*! - * Enables a stream at the given PTS. - * @param streamId unique id of stream - * @param pts position in stream in microseconds - * @remarks will only be called if CAPABILITIES::m_supportsEnableAtPTS is set to true - */ - void EnableStreamAtPTS(int streamid, uint64_t pts); - /*! * Reset the demultiplexer in the add-on. * @remarks Required if bHandlesDemuxing is set to true. @@ -222,6 +214,12 @@ extern "C" */ bool IsRealTimeStream(); + const char* GetApiVersion() + { + static const char *ApiVersion = INPUTSTREAM_API_VERSION; + return ApiVersion; + } + /*! * Called by XBMC to assign the function pointers of this add-on to pClient. * @param pClient The struct to assign the function pointers to. @@ -232,11 +230,11 @@ extern "C" pClient->Close = Close; pClient->GetPathList = GetPathList; pClient->GetCapabilities = GetCapabilities; + pClient->GetApiVersion = GetApiVersion; pClient->GetStreamIds = GetStreamIds; pClient->GetStream = GetStream; pClient->EnableStream = EnableStream; - pClient->EnableStreamAtPTS = EnableStreamAtPTS; pClient->DemuxReset = DemuxReset; pClient->DemuxAbort = DemuxAbort; pClient->DemuxFlush = DemuxFlush; diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h index 3a2e2da..ad47bb5 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h @@ -30,6 +30,9 @@ #include "cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h" #endif +/* current API version */ +#define INPUTSTREAM_API_VERSION "1.0.5" + extern "C" { // this are properties given to the addon on create @@ -49,7 +52,6 @@ extern "C" { bool m_supportsIDisplayTime; /*!< @brief supports interface IDisplayTime */ bool m_supportsSeek; /*!< @brief supports seek */ bool m_supportsPause; /*!< @brief supports pause */ - bool m_supportsEnableAtPTS; /*!< @brief supports enabling streams at a given PTS time */ } INPUTSTREAM_CAPABILITIES; /*! @@ -128,12 +130,12 @@ extern "C" { void (__cdecl* Close)(void); const char* (__cdecl* GetPathList)(void); struct INPUTSTREAM_CAPABILITIES (__cdecl* GetCapabilities)(void); + const char* (__cdecl* GetApiVersion)(void); // IDemux struct INPUTSTREAM_IDS (__cdecl* GetStreamIds)(); struct INPUTSTREAM_INFO (__cdecl* GetStream)(int); void (__cdecl* EnableStream)(int, bool); - void (__cdecl* EnableStreamAtPTS)(int, uint64_t); void (__cdecl* DemuxReset)(void); void (__cdecl* DemuxAbort)(void); void (__cdecl* DemuxFlush)(void); diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_callbacks.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_callbacks.h index 720c62f..2dfc571 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_callbacks.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_callbacks.h @@ -44,6 +44,16 @@ typedef struct CB_PeripheralLib */ void (*RefreshButtonMaps)(void* addonData, const char* deviceName, const char* controllerId); + /*! + * @brief Return the number of features belonging to the specified controller + * + * @param controllerId The controller ID to enumerate + * @param type[optional] Type to filter by, or JOYSTICK_FEATURE_TYPE_UNKNOWN for all features + * + * @return The number of features matching the request parameters + */ + unsigned int (*FeatureCount)(void* addonData, const char* controllerId, JOYSTICK_FEATURE_TYPE type); + } CB_PeripheralLib; #ifdef __cplusplus diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h index 591afcc..f9d7482 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h @@ -22,7 +22,7 @@ #include "kodi_peripheral_types.h" -#define PERIPHERAL_ADDON_JOYSTICKS // TODO +#define PERIPHERAL_ADDON_JOYSTICKS //! @todo #ifdef __cplusplus extern "C" @@ -100,6 +100,14 @@ extern "C" * @param events The array of allocated events */ void FreeEvents(unsigned int event_count, PERIPHERAL_EVENT* events); + + /*! + * @brief Send an input event to the specified peripheral + * @param peripheralIndex The index of the device receiving the input event + * @param event The input event + * @return true if the event was handled, false otherwise + */ + bool SendEvent(const PERIPHERAL_EVENT* event); ///} /// @name Joystick operations @@ -150,12 +158,57 @@ extern "C" * @brief Add or update joystick features * @param joystick The device's joystick properties; unknown values may be left at their default * @param controller_id The game controller profile being updated - * @param feature_count The number of features int the features array + * @param feature_count The number of features in the features array * @param features The array of features * @return PERIPHERAL_NO_ERROR if successful */ PERIPHERAL_ERROR MapFeatures(const JOYSTICK_INFO* joystick, const char* controller_id, - unsigned int feature_count, JOYSTICK_FEATURE* features); + unsigned int feature_count, const JOYSTICK_FEATURE* features); + + /*! + * @brief Get the driver primitives that should be ignored while mapping the device + * @param joystick The device's joystick properties; unknown values may be left at their default + * @param primitive_count The number of features allocated for the primitives array + * @param primitives The array of allocated driver primitives to be ignored + * @return PERIPHERAL_NO_ERROR if successful; array must be freed using + * FreePrimitives() in this case + */ + PERIPHERAL_ERROR GetIgnoredPrimitives(const JOYSTICK_INFO* joystick, + unsigned int* primitive_count, + JOYSTICK_DRIVER_PRIMITIVE** primitives); + + /*! + * @brief Free the memory allocated in GetIgnoredPrimitives() + * + * Must be called if GetIgnoredPrimitives() returns PERIPHERAL_NO_ERROR. + * + * @param primitive_count The number of driver primitives allocated for the primitives array + * @param primitives The array of allocated driver primitives + */ + void FreePrimitives(unsigned int primitive_count, JOYSTICK_DRIVER_PRIMITIVE* primitives); + + /*! + * @brief Set the list of driver primitives that are ignored for the device + * @param joystick The device's joystick properties; unknown values may be left at their default + * @param primitive_count The number of driver features in the primitives array + * @param primitives The array of driver primitives to ignore + * @return PERIPHERAL_NO_ERROR if successful + */ + PERIPHERAL_ERROR SetIgnoredPrimitives(const JOYSTICK_INFO* joystick, + unsigned int primitive_count, + const JOYSTICK_DRIVER_PRIMITIVE* primitives); + + /*! + * @brief Save the button map for the given joystick + * @param joystick The device's joystick properties + */ + void SaveButtonMap(const JOYSTICK_INFO* joystick); + + /*! + * @brief Revert the button map to the last time it was loaded or committed to disk + * @param joystick The device's joystick properties + */ + void RevertButtonMap(const JOYSTICK_INFO* joystick); /*! * @brief Reset the button map for the given joystick and controller profile ID @@ -163,6 +216,12 @@ extern "C" * @param controller_id The game controller profile being reset */ void ResetButtonMap(const JOYSTICK_INFO* joystick, const char* controller_id); + + /*! + * @brief Powers off the given joystick if supported + * @param index The joystick's driver index + */ + void PowerOffJoystick(unsigned int index); #endif ///} @@ -180,6 +239,7 @@ extern "C" pClient->FreeScanResults = FreeScanResults; pClient->GetEvents = GetEvents; pClient->FreeEvents = FreeEvents; + pClient->SendEvent = SendEvent; #ifdef PERIPHERAL_ADDON_JOYSTICKS pClient->GetJoystickInfo = GetJoystickInfo; @@ -187,7 +247,13 @@ extern "C" pClient->GetFeatures = GetFeatures; pClient->FreeFeatures = FreeFeatures; pClient->MapFeatures = MapFeatures; + pClient->GetIgnoredPrimitives = GetIgnoredPrimitives; + pClient->FreePrimitives = FreePrimitives; + pClient->SetIgnoredPrimitives = SetIgnoredPrimitives; + pClient->SaveButtonMap = SaveButtonMap; + pClient->RevertButtonMap = RevertButtonMap; pClient->ResetButtonMap = ResetButtonMap; + pClient->PowerOffJoystick = PowerOffJoystick; #endif } diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_types.h index 85e2363..2df5622 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_types.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_types.h @@ -1,3 +1,4 @@ + /* * Copyright (C) 2014-2016 Team Kodi * http://kodi.tv @@ -50,10 +51,10 @@ #endif /* current Peripheral API version */ -#define PERIPHERAL_API_VERSION "1.0.17" +#define PERIPHERAL_API_VERSION "1.2.0" /* min. Peripheral API version */ -#define PERIPHERAL_MIN_API_VERSION "1.0.16" +#define PERIPHERAL_MIN_API_VERSION "1.2.0" /* indicates a joystick has no preference for port number */ #define NO_PORT_REQUESTED (-1) @@ -111,6 +112,7 @@ extern "C" typedef struct PERIPHERAL_CAPABILITIES { bool provides_joysticks; /*!< @brief true if the add-on provides joysticks */ + bool provides_buttonmaps; /*!< @brief true if the add-on provides button maps */ } ATTRIBUTE_PACKED PERIPHERAL_CAPABILITIES; ///} @@ -122,6 +124,7 @@ extern "C" PERIPHERAL_EVENT_TYPE_DRIVER_BUTTON, /*!< @brief state changed for joystick driver button */ PERIPHERAL_EVENT_TYPE_DRIVER_HAT, /*!< @brief state changed for joystick driver hat */ PERIPHERAL_EVENT_TYPE_DRIVER_AXIS, /*!< @brief state changed for joystick driver axis */ + PERIPHERAL_EVENT_TYPE_SET_MOTOR, /*!< @brief set the state for joystick rumble motor */ } PERIPHERAL_EVENT_TYPE; typedef enum JOYSTICK_STATE_BUTTON @@ -152,6 +155,8 @@ extern "C" */ typedef float JOYSTICK_STATE_AXIS; + typedef float JOYSTICK_STATE_MOTOR; + typedef struct PERIPHERAL_EVENT { unsigned int peripheral_index; @@ -160,6 +165,7 @@ extern "C" JOYSTICK_STATE_BUTTON driver_button_state; JOYSTICK_STATE_HAT driver_hat_state; JOYSTICK_STATE_AXIS driver_axis_state; + JOYSTICK_STATE_MOTOR motor_state; } ATTRIBUTE_PACKED PERIPHERAL_EVENT; ///} @@ -173,6 +179,8 @@ extern "C" unsigned int button_count; /*!< @brief number of buttons reported by the driver */ unsigned int hat_count; /*!< @brief number of hats reported by the driver */ unsigned int axis_count; /*!< @brief number of axes reported by the driver */ + unsigned int motor_count; /*!< @brief number of motors reported by the driver */ + bool supports_poweroff; /*!< @brief whether the joystick supports being powered off */ } ATTRIBUTE_PACKED JOYSTICK_INFO; typedef enum JOYSTICK_DRIVER_PRIMITIVE_TYPE @@ -181,6 +189,7 @@ extern "C" JOYSTICK_DRIVER_PRIMITIVE_TYPE_BUTTON, JOYSTICK_DRIVER_PRIMITIVE_TYPE_HAT_DIRECTION, JOYSTICK_DRIVER_PRIMITIVE_TYPE_SEMIAXIS, + JOYSTICK_DRIVER_PRIMITIVE_TYPE_MOTOR, } JOYSTICK_DRIVER_PRIMITIVE_TYPE; typedef struct JOYSTICK_DRIVER_BUTTON @@ -216,6 +225,11 @@ extern "C" JOYSTICK_DRIVER_SEMIAXIS_DIRECTION direction; } ATTRIBUTE_PACKED JOYSTICK_DRIVER_SEMIAXIS; + typedef struct JOYSTICK_DRIVER_MOTOR + { + int index; + } ATTRIBUTE_PACKED JOYSTICK_DRIVER_MOTOR; + typedef struct JOYSTICK_DRIVER_PRIMITIVE { JOYSTICK_DRIVER_PRIMITIVE_TYPE type; @@ -224,6 +238,7 @@ extern "C" struct JOYSTICK_DRIVER_BUTTON button; struct JOYSTICK_DRIVER_HAT hat; struct JOYSTICK_DRIVER_SEMIAXIS semiaxis; + struct JOYSTICK_DRIVER_MOTOR motor; }; } ATTRIBUTE_PACKED JOYSTICK_DRIVER_PRIMITIVE; @@ -233,42 +248,41 @@ extern "C" JOYSTICK_FEATURE_TYPE_SCALAR, JOYSTICK_FEATURE_TYPE_ANALOG_STICK, JOYSTICK_FEATURE_TYPE_ACCELEROMETER, + JOYSTICK_FEATURE_TYPE_MOTOR, } JOYSTICK_FEATURE_TYPE; - typedef struct JOYSTICK_FEATURE_SCALAR + typedef enum JOYSTICK_FEATURE_PRIMITIVE { - struct JOYSTICK_DRIVER_PRIMITIVE primitive; - } ATTRIBUTE_PACKED JOYSTICK_FEATURE_SCALAR; + // Scalar feature + JOYSTICK_SCALAR_PRIMITIVE = 0, - typedef struct JOYSTICK_FEATURE_ANALOG_STICK - { - struct JOYSTICK_DRIVER_PRIMITIVE up; - struct JOYSTICK_DRIVER_PRIMITIVE down; - struct JOYSTICK_DRIVER_PRIMITIVE right; - struct JOYSTICK_DRIVER_PRIMITIVE left; - } ATTRIBUTE_PACKED JOYSTICK_FEATURE_ANALOG_STICK; + // Analog stick + JOYSTICK_ANALOG_STICK_UP = 0, + JOYSTICK_ANALOG_STICK_DOWN = 1, + JOYSTICK_ANALOG_STICK_RIGHT = 2, + JOYSTICK_ANALOG_STICK_LEFT = 3, - typedef struct JOYSTICK_FEATURE_ACCELEROMETER - { - struct JOYSTICK_DRIVER_PRIMITIVE positive_x; - struct JOYSTICK_DRIVER_PRIMITIVE positive_y; - struct JOYSTICK_DRIVER_PRIMITIVE positive_z; - } ATTRIBUTE_PACKED JOYSTICK_FEATURE_ACCELEROMETER; + // Accelerometer + JOYSTICK_ACCELEROMETER_POSITIVE_X = 0, + JOYSTICK_ACCELEROMETER_POSITIVE_Y = 1, + JOYSTICK_ACCELEROMETER_POSITIVE_Z = 2, + + // Motor + JOYSTICK_MOTOR_PRIMITIVE = 0, + + // Maximum number of primitives + JOYSTICK_PRIMITIVE_MAX = 4, + } JOYSTICK_FEATURE_PRIMITIVE; typedef struct JOYSTICK_FEATURE { char* name; JOYSTICK_FEATURE_TYPE type; - union - { - struct JOYSTICK_FEATURE_SCALAR scalar; - struct JOYSTICK_FEATURE_ANALOG_STICK analog_stick; - struct JOYSTICK_FEATURE_ACCELEROMETER accelerometer; - }; + struct JOYSTICK_DRIVER_PRIMITIVE primitives[JOYSTICK_PRIMITIVE_MAX]; } ATTRIBUTE_PACKED JOYSTICK_FEATURE; ///} - // TODO: Mouse, light gun, multitouch + //! @todo Mouse, light gun, multitouch /*! * @brief Structure to transfer the methods from kodi_peripheral_dll.h to the frontend @@ -282,6 +296,7 @@ extern "C" void (__cdecl* FreeScanResults)(unsigned int, PERIPHERAL_INFO*); PERIPHERAL_ERROR (__cdecl* GetEvents)(unsigned int*, PERIPHERAL_EVENT**); void (__cdecl* FreeEvents)(unsigned int, PERIPHERAL_EVENT*); + bool (__cdecl* SendEvent)(const PERIPHERAL_EVENT*); /// @name Joystick operations ///{ @@ -289,8 +304,14 @@ extern "C" void (__cdecl* FreeJoystickInfo)(JOYSTICK_INFO*); PERIPHERAL_ERROR (__cdecl* GetFeatures)(const JOYSTICK_INFO*, const char*, unsigned int*, JOYSTICK_FEATURE**); void (__cdecl* FreeFeatures)(unsigned int, JOYSTICK_FEATURE*); - PERIPHERAL_ERROR (__cdecl* MapFeatures)(const JOYSTICK_INFO*, const char*, unsigned int, JOYSTICK_FEATURE*); + PERIPHERAL_ERROR (__cdecl* MapFeatures)(const JOYSTICK_INFO*, const char*, unsigned int, const JOYSTICK_FEATURE*); + PERIPHERAL_ERROR (__cdecl* GetIgnoredPrimitives)(const JOYSTICK_INFO*, unsigned int*, JOYSTICK_DRIVER_PRIMITIVE**); + void (__cdecl* FreePrimitives)(unsigned int, JOYSTICK_DRIVER_PRIMITIVE*); + PERIPHERAL_ERROR (__cdecl* SetIgnoredPrimitives)(const JOYSTICK_INFO*, unsigned int, const JOYSTICK_DRIVER_PRIMITIVE*); + void (__cdecl* SaveButtonMap)(const JOYSTICK_INFO*); + void (__cdecl* RevertButtonMap)(const JOYSTICK_INFO*); void (__cdecl* ResetButtonMap)(const JOYSTICK_INFO*, const char*); + void (__cdecl* PowerOffJoystick)(unsigned int); ///} } PeripheralAddon; diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_utils.hpp b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_utils.hpp index 4423cb4..f01180b 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_utils.hpp +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_utils.hpp @@ -21,6 +21,7 @@ #include "kodi_peripheral_types.h" +#include // Requires c++11 #include #include #include @@ -204,6 +205,7 @@ namespace ADDON JOYSTICK_STATE_BUTTON ButtonState(void) const { return m_event.driver_button_state; } JOYSTICK_STATE_HAT HatState(void) const { return m_event.driver_hat_state; } JOYSTICK_STATE_AXIS AxisState(void) const { return m_event.driver_axis_state; } + JOYSTICK_STATE_MOTOR MotorState(void) const { return m_event.motor_state; } void SetType(PERIPHERAL_EVENT_TYPE type) { m_event.type = type; } void SetPeripheralIndex(unsigned int index) { m_event.peripheral_index = index; } @@ -211,6 +213,7 @@ namespace ADDON void SetButtonState(JOYSTICK_STATE_BUTTON state) { m_event.driver_button_state = state; } void SetHatState(JOYSTICK_STATE_HAT state) { m_event.driver_hat_state = state; } void SetAxisState(JOYSTICK_STATE_AXIS state) { m_event.driver_axis_state = state; } + void SetMotorState(JOYSTICK_STATE_MOTOR state) { m_event.motor_state = state; } void ToStruct(PERIPHERAL_EVENT& event) const { @@ -243,7 +246,9 @@ namespace ADDON m_requestedPort(NO_PORT_REQUESTED), m_buttonCount(0), m_hatCount(0), - m_axisCount(0) + m_axisCount(0), + m_motorCount(0), + m_supportsPowerOff(false) { } @@ -258,7 +263,9 @@ namespace ADDON m_requestedPort(info.requested_port), m_buttonCount(info.button_count), m_hatCount(info.hat_count), - m_axisCount(info.axis_count) + m_axisCount(info.axis_count), + m_motorCount(info.motor_count), + m_supportsPowerOff(info.supports_poweroff) { } @@ -275,6 +282,8 @@ namespace ADDON m_buttonCount = rhs.m_buttonCount; m_hatCount = rhs.m_hatCount; m_axisCount = rhs.m_axisCount; + m_motorCount = rhs.m_motorCount; + m_supportsPowerOff = rhs.m_supportsPowerOff; } return *this; } @@ -284,6 +293,8 @@ namespace ADDON unsigned int ButtonCount(void) const { return m_buttonCount; } unsigned int HatCount(void) const { return m_hatCount; } unsigned int AxisCount(void) const { return m_axisCount; } + unsigned int MotorCount(void) const { return m_motorCount; } + bool SupportsPowerOff(void) const { return m_supportsPowerOff; } // Derived property: Counts are unknown if all are zero bool AreElementCountsKnown(void) const { return m_buttonCount != 0 || m_hatCount != 0 || m_axisCount != 0; } @@ -293,6 +304,8 @@ namespace ADDON void SetButtonCount(unsigned int buttonCount) { m_buttonCount = buttonCount; } void SetHatCount(unsigned int hatCount) { m_hatCount = hatCount; } void SetAxisCount(unsigned int axisCount) { m_axisCount = axisCount; } + void SetMotorCount(unsigned int motorCount) { m_motorCount = motorCount; } + void SetSupportsPowerOff(bool supportsPowerOff) { m_supportsPowerOff = supportsPowerOff; } void ToStruct(JOYSTICK_INFO& info) const { @@ -303,6 +316,8 @@ namespace ADDON info.button_count = m_buttonCount; info.hat_count = m_hatCount; info.axis_count = m_axisCount; + info.motor_count = m_motorCount; + info.supports_poweroff = m_supportsPowerOff; std::strcpy(info.provider, m_provider.c_str()); } @@ -320,6 +335,8 @@ namespace ADDON unsigned int m_buttonCount; unsigned int m_hatCount; unsigned int m_axisCount; + unsigned int m_motorCount; + bool m_supportsPowerOff; }; typedef PeripheralVector Joysticks; @@ -332,6 +349,7 @@ namespace ADDON * 1) a button * 2) a hat direction * 3) a semiaxis (either the positive or negative half of an axis) + * 4) a motor * * The type determines the fields in use: * @@ -345,9 +363,24 @@ namespace ADDON * Semiaxis: * - driver index * - semiaxis direction + * + * Motor: + * - driver index */ - class DriverPrimitive + struct DriverPrimitive { + protected: + /*! + * \brief Construct a driver primitive of the specified type + */ + DriverPrimitive(JOYSTICK_DRIVER_PRIMITIVE_TYPE type, unsigned int driverIndex) : + m_type(type), + m_driverIndex(driverIndex), + m_hatDirection(JOYSTICK_DRIVER_HAT_UNKNOWN), + m_semiAxisDirection(JOYSTICK_DRIVER_SEMIAXIS_UNKNOWN) + { + } + public: /*! * \brief Construct an invalid driver primitive @@ -363,12 +396,9 @@ namespace ADDON /*! * \brief Construct a driver primitive representing a button */ - DriverPrimitive(unsigned int buttonIndex) : - m_type(JOYSTICK_DRIVER_PRIMITIVE_TYPE_BUTTON), - m_driverIndex(buttonIndex), - m_hatDirection(JOYSTICK_DRIVER_HAT_UNKNOWN), - m_semiAxisDirection(JOYSTICK_DRIVER_SEMIAXIS_UNKNOWN) + static DriverPrimitive CreateButton(unsigned int buttonIndex) { + return DriverPrimitive(JOYSTICK_DRIVER_PRIMITIVE_TYPE_BUTTON, buttonIndex); } /*! @@ -395,6 +425,14 @@ namespace ADDON { } + /*! + * \brief Construct a driver primitive representing a motor + */ + static DriverPrimitive CreateMotor(unsigned int motorIndex) + { + return DriverPrimitive(JOYSTICK_DRIVER_PRIMITIVE_TYPE_MOTOR, motorIndex); + } + DriverPrimitive(const JOYSTICK_DRIVER_PRIMITIVE& primitive) : m_type(primitive.type), m_driverIndex(0), @@ -420,6 +458,11 @@ namespace ADDON m_semiAxisDirection = primitive.semiaxis.direction; break; } + case JOYSTICK_DRIVER_PRIMITIVE_TYPE_MOTOR: + { + m_driverIndex = primitive.motor.index; + break; + } default: break; } @@ -437,6 +480,7 @@ namespace ADDON switch (m_type) { case JOYSTICK_DRIVER_PRIMITIVE_TYPE_BUTTON: + case JOYSTICK_DRIVER_PRIMITIVE_TYPE_MOTOR: { return m_driverIndex == other.m_driverIndex; } @@ -479,11 +523,21 @@ namespace ADDON driver_primitive.semiaxis.direction = m_semiAxisDirection; break; } + case JOYSTICK_DRIVER_PRIMITIVE_TYPE_MOTOR: + { + driver_primitive.motor.index = m_driverIndex; + break; + } default: break; } } + static void FreeStruct(JOYSTICK_DRIVER_PRIMITIVE& primitive) + { + (void)primitive; + } + private: JOYSTICK_DRIVER_PRIMITIVE_TYPE m_type; unsigned int m_driverIndex; @@ -491,6 +545,8 @@ namespace ADDON JOYSTICK_DRIVER_SEMIAXIS_DIRECTION m_semiAxisDirection; }; + typedef PeripheralVector DriverPrimitives; + /*! * ADDON::JoystickFeature * @@ -499,44 +555,20 @@ namespace ADDON * 1) scalar[1] * 2) analog stick * 3) accelerometer + * 4) motor * * [1] All three driver primitives (buttons, hats and axes) have a state that * can be represented using a single scalar value. For this reason, * features that map to a single primitive are called "scalar features". - * - * Features can be mapped to a variable number of driver primitives. The names - * of the primitives for each feature are: - * - * Scalar feature: - * - primitive - * - * Analog stick: - * - up - * - down - * - right - * - left - * - * Accelerometer: - * - positive X - * - positive Y - * - positive Z */ class JoystickFeature { public: - const unsigned int MAX_PRIMITIVES = 4; - - JoystickFeature(void) : - m_type(JOYSTICK_FEATURE_TYPE_UNKNOWN) - { - m_primitives.resize(MAX_PRIMITIVES); - } - - JoystickFeature(const std::string& name, JOYSTICK_FEATURE_TYPE type) : + JoystickFeature(const std::string& name = "", JOYSTICK_FEATURE_TYPE type = JOYSTICK_FEATURE_TYPE_UNKNOWN) : m_name(name), - m_type(type) + m_type(type), + m_primitives() { - m_primitives.resize(MAX_PRIMITIVES); } JoystickFeature(const JoystickFeature& other) @@ -548,26 +580,8 @@ namespace ADDON m_name(feature.name ? feature.name : ""), m_type(feature.type) { - m_primitives.resize(MAX_PRIMITIVES); - switch (m_type) - { - case JOYSTICK_FEATURE_TYPE_SCALAR: - SetPrimitive(feature.scalar.primitive); - break; - case JOYSTICK_FEATURE_TYPE_ANALOG_STICK: - SetUp(feature.analog_stick.up); - SetDown(feature.analog_stick.down); - SetRight(feature.analog_stick.right); - SetLeft(feature.analog_stick.left); - break; - case JOYSTICK_FEATURE_TYPE_ACCELEROMETER: - SetPositiveX(feature.accelerometer.positive_x); - SetPositiveY(feature.accelerometer.positive_y); - SetPositiveZ(feature.accelerometer.positive_z); - break; - default: - break; - } + for (unsigned int i = 0; i < JOYSTICK_PRIMITIVE_MAX; i++) + m_primitives[i] = feature.primitives[i]; } JoystickFeature& operator=(const JoystickFeature& rhs) @@ -590,55 +604,25 @@ namespace ADDON const std::string& Name(void) const { return m_name; } JOYSTICK_FEATURE_TYPE Type(void) const { return m_type; } + bool IsValid() const { return m_type != JOYSTICK_FEATURE_TYPE_UNKNOWN; } void SetName(const std::string& name) { m_name = name; } void SetType(JOYSTICK_FEATURE_TYPE type) { m_type = type; } + void SetInvalid(void) { m_type = JOYSTICK_FEATURE_TYPE_UNKNOWN; } + + const DriverPrimitive& Primitive(JOYSTICK_FEATURE_PRIMITIVE which) const { return m_primitives[which]; } + void SetPrimitive(JOYSTICK_FEATURE_PRIMITIVE which, const DriverPrimitive& primitive) { m_primitives[which] = primitive; } - // Scalar methods - const DriverPrimitive& Primitive(void) const { return m_primitives[0]; } - void SetPrimitive(const DriverPrimitive& primitive) { m_primitives[0] = primitive; } - - // Analog stick methods - const DriverPrimitive& Up(void) const { return m_primitives[0]; } - const DriverPrimitive& Down(void) const { return m_primitives[1]; } - const DriverPrimitive& Right(void) const { return m_primitives[2]; } - const DriverPrimitive& Left(void) const { return m_primitives[3]; } - void SetUp(const DriverPrimitive& primitive) { m_primitives[0] = primitive; } - void SetDown(const DriverPrimitive& primitive) { m_primitives[1] = primitive; } - void SetRight(const DriverPrimitive& primitive) { m_primitives[2] = primitive; } - void SetLeft(const DriverPrimitive& primitive) { m_primitives[3] = primitive; } - - // Accelerometer methods - const DriverPrimitive& PositiveX(void) const { return m_primitives[0]; } - const DriverPrimitive& PositiveY(void) const { return m_primitives[1]; } - const DriverPrimitive& PositiveZ(void) const { return m_primitives[2]; } - void SetPositiveX(const DriverPrimitive& primitive) { m_primitives[0] = primitive; } - void SetPositiveY(const DriverPrimitive& primitive) { m_primitives[1] = primitive; } - void SetPositiveZ(const DriverPrimitive& primitive) { m_primitives[2] = primitive; } + std::array& Primitives() { return m_primitives; } + const std::array& Primitives() const { return m_primitives; } void ToStruct(JOYSTICK_FEATURE& feature) const { feature.name = new char[m_name.length() + 1]; feature.type = m_type; - switch (m_type) - { - case JOYSTICK_FEATURE_TYPE_SCALAR: - Primitive().ToStruct(feature.scalar.primitive); - break; - case JOYSTICK_FEATURE_TYPE_ANALOG_STICK: - Up().ToStruct(feature.analog_stick.up); - Down().ToStruct(feature.analog_stick.down); - Right().ToStruct(feature.analog_stick.right); - Left().ToStruct(feature.analog_stick.left); - break; - case JOYSTICK_FEATURE_TYPE_ACCELEROMETER: - PositiveX().ToStruct(feature.accelerometer.positive_x); - PositiveY().ToStruct(feature.accelerometer.positive_y); - PositiveZ().ToStruct(feature.accelerometer.positive_z); - break; - default: - break; - } + for (unsigned int i = 0; i < JOYSTICK_PRIMITIVE_MAX; i++) + m_primitives[i].ToStruct(feature.primitives[i]); + std::strcpy(feature.name, m_name.c_str()); } @@ -650,7 +634,7 @@ namespace ADDON private: std::string m_name; JOYSTICK_FEATURE_TYPE m_type; - std::vector m_primitives; + std::array m_primitives; }; typedef PeripheralVector JoystickFeatures; diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_adsp.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_adsp.h index 46e34a6..fb0c15f 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_adsp.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_adsp.h @@ -29,12 +29,8 @@ typedef void* ADSPHANDLE; -#ifdef _WIN32 -#define ADSP_HELPER_DLL "\\library.kodi.adsp\\libKODI_adsp" ADDON_HELPER_EXT -#else -#define ADSP_HELPER_DLL_NAME "libKODI_adsp-" ADDON_HELPER_ARCH ADDON_HELPER_EXT -#define ADSP_HELPER_DLL "/library.kodi.adsp/" ADSP_HELPER_DLL_NAME -#endif +#define ADSP_HELPER_DLL KODI_DLL("adsp") +#define ADSP_HELPER_DLL_NAME KODI_DLL_NAME("adsp") class CAddonSoundPlay; @@ -69,15 +65,6 @@ public: libBasePath = ((cb_array*)m_Handle)->libPath; libBasePath += ADSP_HELPER_DLL; -#if defined(ANDROID) - struct stat st; - if(stat(libBasePath.c_str(),&st) != 0) - { - std::string tempbin = getenv("XBMC_ANDROID_LIBS"); - libBasePath = tempbin + "/" + ADSP_HELPER_DLL_NAME; - } -#endif - m_libKODI_adsp = dlopen(libBasePath.c_str(), RTLD_LAZY); if (m_libKODI_adsp == NULL) { diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h index be3b93d..7dbf7af 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h @@ -38,12 +38,8 @@ #include "libXBMC_addon.h" -#ifdef _WIN32 -#define AUDIOENGINE_HELPER_DLL "\\library.kodi.audioengine\\libKODI_audioengine" ADDON_HELPER_EXT -#else -#define AUDIOENGINE_HELPER_DLL_NAME "libKODI_audioengine-" ADDON_HELPER_ARCH ADDON_HELPER_EXT -#define AUDIOENGINE_HELPER_DLL "/library.kodi.audioengine/" AUDIOENGINE_HELPER_DLL_NAME -#endif +#define AUDIOENGINE_HELPER_DLL KODI_DLL("audioengine") +#define AUDIOENGINE_HELPER_DLL_NAME KODI_DLL_NAME("audioengine") class CAddonAEStream; @@ -78,15 +74,6 @@ public: libBasePath = ((cb_array*)m_Handle)->libPath; libBasePath += AUDIOENGINE_HELPER_DLL; -#if defined(ANDROID) - struct stat st; - if(stat(libBasePath.c_str(),&st) != 0) - { - std::string tempbin = getenv("XBMC_ANDROID_LIBS"); - libBasePath = tempbin + "/" + AUDIOENGINE_HELPER_DLL; - } -#endif - m_libKODI_audioengine = dlopen(libBasePath.c_str(), RTLD_LAZY); if (m_libKODI_audioengine == NULL) { @@ -207,8 +194,8 @@ public: virtual bool IsBuffering(); /** - * Returns the time in seconds that it will take - * to underrun the cache if no sample is added. + * Returns the time in seconds of the stream's + * cached audio samples. Engine buffers excluded. * @return seconds */ virtual double GetCacheTime(); diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h index bdaeb4c..3fe12c9 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h @@ -28,12 +28,8 @@ typedef void* GUIHANDLE; -#ifdef _WIN32 -#define GUI_HELPER_DLL "\\library.kodi.guilib\\libKODI_guilib" ADDON_HELPER_EXT -#else -#define GUI_HELPER_DLL_NAME "libKODI_guilib-" ADDON_HELPER_ARCH ADDON_HELPER_EXT -#define GUI_HELPER_DLL "/library.kodi.guilib/" GUI_HELPER_DLL_NAME -#endif +#define GUI_HELPER_DLL KODI_DLL("guilib") +#define GUI_HELPER_DLL_NAME KODI_DLL_NAME("guilib") /* current ADDONGUI API version */ #define KODI_GUILIB_API_VERSION "5.11.0" @@ -80,15 +76,6 @@ public: libBasePath = ((cb_array*)m_Handle)->libPath; libBasePath += GUI_HELPER_DLL; -#if defined(ANDROID) - struct stat st; - if(stat(libBasePath.c_str(),&st) != 0) - { - std::string tempbin = getenv("XBMC_ANDROID_LIBS"); - libBasePath = tempbin + "/" + GUI_HELPER_DLL_NAME; - } -#endif - m_libKODI_guilib = dlopen(libBasePath.c_str(), RTLD_LAZY); if (m_libKODI_guilib == NULL) { diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h index 7fe1725..a6e83cb 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h @@ -33,12 +33,8 @@ #include "cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h" #endif -#ifdef _WIN32 -#define INPUTSTREAM_HELPER_DLL "\\library.kodi.inputstream\\libKODI_inputstream" ADDON_HELPER_EXT -#else -#define INPUTSTREAM_HELPER_DLL_NAME "libKODI_inputstream-" ADDON_HELPER_ARCH ADDON_HELPER_EXT -#define INPUTSTREAM_HELPER_DLL "/library.kodi.inputstream/" INPUTSTREAM_HELPER_DLL_NAME -#endif +#define INPUTSTREAM_HELPER_DLL KODI_DLL("inputstream") +#define INPUTSTREAM_HELPER_DLL_NAME KODI_DLL_NAME("inputstream") /* current input stream API version */ #define KODI_INPUTSTREAM_API_VERSION "1.0.0" diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_peripheral.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_peripheral.h index 9f3f986..a28e48d 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_peripheral.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_peripheral.h @@ -105,6 +105,7 @@ public: if (!PERIPHERAL_REGISTER_SYMBOL(m_libKODI_peripheral, PERIPHERAL_unregister_me)) return false; if (!PERIPHERAL_REGISTER_SYMBOL(m_libKODI_peripheral, PERIPHERAL_trigger_scan)) return false; if (!PERIPHERAL_REGISTER_SYMBOL(m_libKODI_peripheral, PERIPHERAL_refresh_button_maps)) return false; + if (!PERIPHERAL_REGISTER_SYMBOL(m_libKODI_peripheral, PERIPHERAL_feature_count)) return false; m_callbacks = PERIPHERAL_register_me(m_handle); return m_callbacks != NULL; @@ -120,11 +121,17 @@ public: return PERIPHERAL_refresh_button_maps(m_handle, m_callbacks, strDeviceName.c_str(), strControllerId.c_str()); } + unsigned int FeatureCount(const std::string& strControllerId, JOYSTICK_FEATURE_TYPE type = JOYSTICK_FEATURE_TYPE_UNKNOWN) + { + return PERIPHERAL_feature_count(m_handle, m_callbacks, strControllerId.c_str(), type); + } + protected: CB_PeripheralLib* (*PERIPHERAL_register_me)(void* handle); void (*PERIPHERAL_unregister_me)(void* handle, CB_PeripheralLib* cb); void (*PERIPHERAL_trigger_scan)(void* handle, CB_PeripheralLib* cb); void (*PERIPHERAL_refresh_button_maps)(void* handle, CB_PeripheralLib* cb, const char* deviceName, const char* controllerId); + unsigned int (*PERIPHERAL_feature_count)(void* handle, CB_PeripheralLib* cb, const char* controllerId, JOYSTICK_FEATURE_TYPE type); private: void* m_handle; diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h index ddeb1db..70bd19b 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h @@ -34,6 +34,7 @@ #endif struct VFSDirEntry; +struct __stat64; #ifdef _WIN32 // windows #ifndef _SSIZE_T_DEFINED @@ -47,9 +48,14 @@ typedef intptr_t ssize_t; #include "dlfcn-win32.h" #endif -#define ADDON_DLL "\\library.xbmc.addon\\libXBMC_addon" ADDON_HELPER_EXT #define ADDON_HELPER_EXT ".dll" +#define ADDON_HELPER_PATHSEP "\\" +#define ADDON_HELPER_ARCHSEP "" +#define ADDON_HELPER_ARCH "" + #else // windows +#define ADDON_HELPER_PATHSEP "/" +#define ADDON_HELPER_ARCHSEP "-" // the ADDON_HELPER_ARCH is the platform dependend name which is used // as part of the name of dynamic addon libraries. It has to match the // strings which are set in configure.ac for the "ARCH" variable. @@ -79,14 +85,20 @@ typedef intptr_t ssize_t; #define ADDON_HELPER_EXT ".so" #endif #include // linux+osx -#define ADDON_DLL_NAME "libXBMC_addon-" ADDON_HELPER_ARCH ADDON_HELPER_EXT -#define ADDON_DLL "/library.xbmc.addon/" ADDON_DLL_NAME #endif + +#define KODI_DLL_NAME(name) "libKODI_" name ADDON_HELPER_ARCHSEP ADDON_HELPER_ARCH ADDON_HELPER_EXT +#define XBMC_DLL_NAME(name) "libXBMC_" name ADDON_HELPER_ARCHSEP ADDON_HELPER_ARCH ADDON_HELPER_EXT #if defined(ANDROID) -#include +#define KODI_DLL(name) ADDON_HELPER_PATHSEP KODI_DLL_NAME(name) +#define XBMC_DLL(name) ADDON_HELPER_PATHSEP XBMC_DLL_NAME(name) +#else +#define KODI_DLL(name) ADDON_HELPER_PATHSEP "library.kodi." name ADDON_HELPER_PATHSEP KODI_DLL_NAME(name) +#define XBMC_DLL(name) ADDON_HELPER_PATHSEP "library.xbmc." name ADDON_HELPER_PATHSEP XBMC_DLL_NAME(name) #endif -struct __stat64; +#define ADDON_DLL_NAME XBMC_DLL_NAME("addon") +#define ADDON_DLL XBMC_DLL("addon") #ifdef LOG_DEBUG #undef LOG_DEBUG @@ -147,15 +159,6 @@ namespace ADDON libBasePath = ((cb_array*)m_Handle)->libPath; libBasePath += ADDON_DLL; -#if defined(ANDROID) - struct stat st; - if(stat(libBasePath.c_str(),&st) != 0) - { - std::string tempbin = getenv("XBMC_ANDROID_LIBS"); - libBasePath = tempbin + "/" + ADDON_DLL_NAME; - } -#endif - m_libXBMC_addon = dlopen(libBasePath.c_str(), RTLD_LAZY); if (m_libXBMC_addon == NULL) { diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h index 3853f08..0e64b11 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h @@ -27,12 +27,8 @@ #include "xbmc_codec_types.h" #include "libXBMC_addon.h" -#ifdef _WIN32 -#define CODEC_HELPER_DLL "\\library.xbmc.codec\\libXBMC_codec" ADDON_HELPER_EXT -#else -#define CODEC_HELPER_DLL_NAME "libXBMC_codec-" ADDON_HELPER_ARCH ADDON_HELPER_EXT -#define CODEC_HELPER_DLL "/library.xbmc.codec/" CODEC_HELPER_DLL_NAME -#endif +#define CODEC_HELPER_DLL_NAME XBMC_DLL_NAME("codec") +#define CODEC_HELPER_DLL XBMC_DLL("codec") class CHelper_libXBMC_codec { @@ -65,15 +61,6 @@ public: libBasePath = ((cb_array*)m_Handle)->libPath; libBasePath += CODEC_HELPER_DLL; -#if defined(ANDROID) - struct stat st; - if(stat(libBasePath.c_str(),&st) != 0) - { - std::string tempbin = getenv("XBMC_ANDROID_LIBS"); - libBasePath = tempbin + "/" + CODEC_HELPER_DLL_NAME; - } -#endif - m_libXBMC_codec = dlopen(libBasePath.c_str(), RTLD_LAZY); if (m_libXBMC_codec == NULL) { diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h index 700f912..a769328 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h @@ -27,16 +27,12 @@ #include "xbmc_pvr_types.h" #include "libXBMC_addon.h" -#ifdef _WIN32 -#define PVR_HELPER_DLL "\\library.xbmc.pvr\\libXBMC_pvr" ADDON_HELPER_EXT -#else -#define PVR_HELPER_DLL_NAME "libXBMC_pvr-" ADDON_HELPER_ARCH ADDON_HELPER_EXT -#define PVR_HELPER_DLL "/library.xbmc.pvr/" PVR_HELPER_DLL_NAME -#endif +#define PVR_HELPER_DLL_NAME XBMC_DLL_NAME("pvr") +#define PVR_HELPER_DLL XBMC_DLL("pvr") #define DVD_TIME_BASE 1000000 -//TODO original definition is in DVDClock.h +//! @todo original definition is in DVDClock.h #define DVD_NOPTS_VALUE 0xFFF0000000000000 class CHelper_libXBMC_pvr @@ -70,15 +66,6 @@ public: libBasePath = ((cb_array*)m_Handle)->libPath; libBasePath += PVR_HELPER_DLL; -#if defined(ANDROID) - struct stat st; - if(stat(libBasePath.c_str(),&st) != 0) - { - std::string tempbin = getenv("XBMC_ANDROID_LIBS"); - libBasePath = tempbin + "/" + PVR_HELPER_DLL_NAME; - } -#endif - m_libXBMC_pvr = dlopen(libBasePath.c_str(), RTLD_LAZY); if (m_libXBMC_pvr == NULL) { 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 9460952..b6200bf 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 @@ -90,7 +90,7 @@ extern "C" { * @brief Representation of an EPG event. */ typedef struct EPG_TAG { - unsigned int iUniqueBroadcastId; /*!< @brief (required) identifier for this event. Valid uids must be greater than EPG_TAG_INVALID_UID. */ + unsigned int iUniqueBroadcastId; /*!< @brief (required) identifier for this event. Event uids must be unique for a channel. Valid uids must be greater than EPG_TAG_INVALID_UID. */ const char * strTitle; /*!< @brief (required) this event's title */ unsigned int iChannelNumber; /*!< @brief (required) the number of the channel this event occurs on */ time_t startTime; /*!< @brief (required) start time in UTC */ 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 b50483d..08ae183 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 @@ -455,7 +455,7 @@ extern "C" { unsigned int iWeekdays; /*!< @brief (optional) week days, for repeating timers */ unsigned int iPreventDuplicateEpisodes; /*!< @brief (optional) 1 if backend should only record new episodes in case of a repeating epg-based timer, 0 if all episodes shall be recorded (no duplicate detection). Actual algorithm for duplicate detection is defined by the backend. Addons may define own values for different duplicate detection algorithms, thus this is not just a bool.*/ - unsigned int iEpgUid; /*!< @brief (optional) EPG event id associated with this timer. Valid ids must be greater than EPG_TAG_INVALID_UID. */ + unsigned int iEpgUid; /*!< @brief (optional) EPG event id associated with this timer. Event ids must be unique for a channel. Valid ids must be greater than EPG_TAG_INVALID_UID. */ unsigned int iMarginStart; /*!< @brief (optional) if set, the backend starts the recording iMarginStart minutes before startTime. */ unsigned int iMarginEnd; /*!< @brief (optional) if set, the backend ends the recording iMarginEnd minutes after endTime. */ int iGenreType; /*!< @brief (optional) genre type */ -- cgit v1.2.3