diff options
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance')
5 files changed, 69 insertions, 13 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/CMakeLists.txt b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/CMakeLists.txt new file mode 100644 index 0000000..ba4f889 --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/CMakeLists.txt | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | set(HEADERS AudioDSP.h | ||
| 2 | AudioDecoder.h | ||
| 3 | AudioEncoder.h | ||
| 4 | ImageDecoder.h | ||
| 5 | Inputstream.h | ||
| 6 | Peripheral.h | ||
| 7 | PeripheralUtils.h | ||
| 8 | Screensaver.h | ||
| 9 | VFS.h | ||
| 10 | VideoCodec.h | ||
| 11 | Visualization.h) | ||
| 12 | |||
| 13 | if(NOT ENABLE_STATIC_LIBS) | ||
| 14 | core_add_library(addons_kodi-addon-dev-kit_include_kodi_addon-instance) | ||
| 15 | endif() | ||
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 8db17c0..08d01ad 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 | |||
| @@ -29,9 +29,9 @@ | |||
| 29 | #include "../StreamCodec.h" | 29 | #include "../StreamCodec.h" |
| 30 | 30 | ||
| 31 | #ifdef BUILD_KODI_ADDON | 31 | #ifdef BUILD_KODI_ADDON |
| 32 | #include "../DVDDemuxPacket.h" | 32 | #include "../DemuxPacket.h" |
| 33 | #else | 33 | #else |
| 34 | #include "cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h" | 34 | #include "cores/VideoPlayer/Interface/Addon/DemuxPacket.h" |
| 35 | #endif | 35 | #endif |
| 36 | 36 | ||
| 37 | namespace kodi { namespace addon { class CInstanceInputStream; }} | 37 | namespace kodi { namespace addon { class CInstanceInputStream; }} |
| @@ -41,7 +41,7 @@ extern "C" { | |||
| 41 | /*! | 41 | /*! |
| 42 | * @brief InputStream add-on capabilities. All capabilities are set to "false" as default. | 42 | * @brief InputStream add-on capabilities. All capabilities are set to "false" as default. |
| 43 | */ | 43 | */ |
| 44 | typedef struct INPUTSTREAM_CAPABILITIES | 44 | struct INPUTSTREAM_CAPABILITIES |
| 45 | { | 45 | { |
| 46 | enum MASKTYPE: uint32_t | 46 | enum MASKTYPE: uint32_t |
| 47 | { | 47 | { |
| @@ -58,17 +58,20 @@ extern "C" { | |||
| 58 | SUPPORTS_SEEK = (1 << 3), | 58 | SUPPORTS_SEEK = (1 << 3), |
| 59 | 59 | ||
| 60 | /// supports pause | 60 | /// supports pause |
| 61 | SUPPORTS_PAUSE = (1 << 4) | 61 | SUPPORTS_PAUSE = (1 << 4), |
| 62 | |||
| 63 | /// supports interface ITime | ||
| 64 | SUPPORTS_ITIME = (1 << 5) | ||
| 62 | }; | 65 | }; |
| 63 | 66 | ||
| 64 | /// set of supported capabilities | 67 | /// set of supported capabilities |
| 65 | uint32_t m_mask; | 68 | uint32_t m_mask; |
| 66 | } INPUTSTREAM_CAPABILITIES; | 69 | }; |
| 67 | 70 | ||
| 68 | /*! | 71 | /*! |
| 69 | * @brief structure of key/value pairs passed to addon on Open() | 72 | * @brief structure of key/value pairs passed to addon on Open() |
| 70 | */ | 73 | */ |
| 71 | typedef struct INPUTSTREAM | 74 | struct INPUTSTREAM |
| 72 | { | 75 | { |
| 73 | static const unsigned int MAX_INFO_COUNT = 8; | 76 | static const unsigned int MAX_INFO_COUNT = 8; |
| 74 | 77 | ||
| @@ -83,22 +86,22 @@ extern "C" { | |||
| 83 | 86 | ||
| 84 | const char *m_libFolder; | 87 | const char *m_libFolder; |
| 85 | const char *m_profileFolder; | 88 | const char *m_profileFolder; |
| 86 | } INPUTSTREAM; | 89 | }; |
| 87 | 90 | ||
| 88 | /*! | 91 | /*! |
| 89 | * @brief Array of stream IDs | 92 | * @brief Array of stream IDs |
| 90 | */ | 93 | */ |
| 91 | typedef struct INPUTSTREAM_IDS | 94 | struct INPUTSTREAM_IDS |
| 92 | { | 95 | { |
| 93 | static const unsigned int MAX_STREAM_COUNT = 32; | 96 | static const unsigned int MAX_STREAM_COUNT = 32; |
| 94 | unsigned int m_streamCount; | 97 | unsigned int m_streamCount; |
| 95 | unsigned int m_streamIds[MAX_STREAM_COUNT]; | 98 | unsigned int m_streamIds[MAX_STREAM_COUNT]; |
| 96 | } INPUTSTREAM_IDS; | 99 | }; |
| 97 | 100 | ||
| 98 | /*! | 101 | /*! |
| 99 | * @brief stream properties | 102 | * @brief stream properties |
| 100 | */ | 103 | */ |
| 101 | typedef struct INPUTSTREAM_INFO | 104 | struct INPUTSTREAM_INFO |
| 102 | { | 105 | { |
| 103 | enum STREAM_TYPE | 106 | enum STREAM_TYPE |
| 104 | { | 107 | { |
| @@ -130,6 +133,7 @@ extern "C" { | |||
| 130 | }; | 133 | }; |
| 131 | uint32_t m_flags; | 134 | uint32_t m_flags; |
| 132 | 135 | ||
| 136 | char m_name[256]; /*!< @brief (optinal) name of the stream, \0 for default handling */ | ||
| 133 | char m_codecName[32]; /*!< @brief (required) name of codec according to ffmpeg */ | 137 | char m_codecName[32]; /*!< @brief (required) name of codec according to ffmpeg */ |
| 134 | char m_codecInternalName[32]; /*!< @brief (optional) internal name of codec (selectionstream info) */ | 138 | char m_codecInternalName[32]; /*!< @brief (optional) internal name of codec (selectionstream info) */ |
| 135 | STREAMCODEC_PROFILE m_codecProfile; /*!< @brief (optional) the profile of the codec */ | 139 | STREAMCODEC_PROFILE m_codecProfile; /*!< @brief (optional) the profile of the codec */ |
| @@ -153,7 +157,15 @@ extern "C" { | |||
| 153 | unsigned int m_BlockAlign; | 157 | unsigned int m_BlockAlign; |
| 154 | 158 | ||
| 155 | CRYPTO_INFO m_cryptoInfo; | 159 | CRYPTO_INFO m_cryptoInfo; |
| 156 | } INPUTSTREAM_INFO; | 160 | }; |
| 161 | |||
| 162 | struct INPUTSTREAM_TIMES | ||
| 163 | { | ||
| 164 | time_t startTime; | ||
| 165 | double ptsStart; | ||
| 166 | double ptsBegin; | ||
| 167 | double ptsEnd; | ||
| 168 | }; | ||
| 157 | 169 | ||
| 158 | /*! | 170 | /*! |
| 159 | * @brief Structure to transfer the methods from xbmc_inputstream_dll.h to XBMC | 171 | * @brief Structure to transfer the methods from xbmc_inputstream_dll.h to XBMC |
| @@ -201,6 +213,9 @@ extern "C" { | |||
| 201 | int (__cdecl* get_total_time)(const AddonInstance_InputStream* instance); | 213 | int (__cdecl* get_total_time)(const AddonInstance_InputStream* instance); |
| 202 | int (__cdecl* get_time)(const AddonInstance_InputStream* instance); | 214 | int (__cdecl* get_time)(const AddonInstance_InputStream* instance); |
| 203 | 215 | ||
| 216 | // ITime | ||
| 217 | bool(__cdecl* get_times)(const AddonInstance_InputStream* instance, INPUTSTREAM_TIMES *times); | ||
| 218 | |||
| 204 | // IPosTime | 219 | // IPosTime |
| 205 | bool (__cdecl* pos_time)(const AddonInstance_InputStream* instance, int ms); | 220 | bool (__cdecl* pos_time)(const AddonInstance_InputStream* instance, int ms); |
| 206 | 221 | ||
| @@ -364,6 +379,12 @@ namespace addon | |||
| 364 | virtual int GetTime() { return -1; } | 379 | virtual int GetTime() { return -1; } |
| 365 | 380 | ||
| 366 | /*! | 381 | /*! |
| 382 | * Get current timing values in PTS scale | ||
| 383 | * @remarks | ||
| 384 | */ | ||
| 385 | virtual bool GetTimes(INPUTSTREAM_TIMES ×) { return false; } | ||
| 386 | |||
| 387 | /*! | ||
| 367 | * Positions inputstream to playing time given in ms | 388 | * Positions inputstream to playing time given in ms |
| 368 | * @remarks | 389 | * @remarks |
| 369 | */ | 390 | */ |
| @@ -483,6 +504,8 @@ namespace addon | |||
| 483 | m_instanceData->toAddon.get_total_time = ADDON_GetTotalTime; | 504 | m_instanceData->toAddon.get_total_time = ADDON_GetTotalTime; |
| 484 | m_instanceData->toAddon.get_time = ADDON_GetTime; | 505 | m_instanceData->toAddon.get_time = ADDON_GetTime; |
| 485 | 506 | ||
| 507 | m_instanceData->toAddon.get_times = ADDON_GetTimes; | ||
| 508 | |||
| 486 | m_instanceData->toAddon.pos_time = ADDON_PosTime; | 509 | m_instanceData->toAddon.pos_time = ADDON_PosTime; |
| 487 | 510 | ||
| 488 | m_instanceData->toAddon.can_pause_stream = ADDON_CanPauseStream; | 511 | m_instanceData->toAddon.can_pause_stream = ADDON_CanPauseStream; |
| @@ -580,6 +603,11 @@ namespace addon | |||
| 580 | return instance->toAddon.addonInstance->GetTime(); | 603 | return instance->toAddon.addonInstance->GetTime(); |
| 581 | } | 604 | } |
| 582 | 605 | ||
| 606 | // ITime | ||
| 607 | inline static bool ADDON_GetTimes(const AddonInstance_InputStream* instance, INPUTSTREAM_TIMES *times) | ||
| 608 | { | ||
| 609 | return instance->toAddon.addonInstance->GetTimes(*times); | ||
| 610 | } | ||
| 583 | 611 | ||
| 584 | // IPosTime | 612 | // IPosTime |
| 585 | inline static bool ADDON_PosTime(const AddonInstance_InputStream* instance, int ms) | 613 | inline static bool ADDON_PosTime(const AddonInstance_InputStream* instance, int ms) |
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 c1a18e0..0dae06c 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 | |||
| @@ -212,6 +212,8 @@ extern "C" | |||
| 212 | JOYSTICK_FEATURE_TYPE_MOTOR, | 212 | JOYSTICK_FEATURE_TYPE_MOTOR, |
| 213 | JOYSTICK_FEATURE_TYPE_RELPOINTER, | 213 | JOYSTICK_FEATURE_TYPE_RELPOINTER, |
| 214 | JOYSTICK_FEATURE_TYPE_ABSPOINTER, | 214 | JOYSTICK_FEATURE_TYPE_ABSPOINTER, |
| 215 | JOYSTICK_FEATURE_TYPE_WHEEL, | ||
| 216 | JOYSTICK_FEATURE_TYPE_THROTTLE, | ||
| 215 | } JOYSTICK_FEATURE_TYPE; | 217 | } JOYSTICK_FEATURE_TYPE; |
| 216 | 218 | ||
| 217 | typedef enum JOYSTICK_FEATURE_PRIMITIVE | 219 | typedef enum JOYSTICK_FEATURE_PRIMITIVE |
| @@ -233,6 +235,14 @@ extern "C" | |||
| 233 | // Motor | 235 | // Motor |
| 234 | JOYSTICK_MOTOR_PRIMITIVE = 0, | 236 | JOYSTICK_MOTOR_PRIMITIVE = 0, |
| 235 | 237 | ||
| 238 | // Wheel | ||
| 239 | JOYSTICK_WHEEL_LEFT = 0, | ||
| 240 | JOYSTICK_WHEEL_RIGHT = 1, | ||
| 241 | |||
| 242 | // Throttle | ||
| 243 | JOYSTICK_THROTTLE_UP = 0, | ||
| 244 | JOYSTICK_THROTTLE_DOWN = 1, | ||
| 245 | |||
| 236 | // Maximum number of primitives | 246 | // Maximum number of primitives |
| 237 | JOYSTICK_PRIMITIVE_MAX = 4, | 247 | JOYSTICK_PRIMITIVE_MAX = 4, |
| 238 | } JOYSTICK_FEATURE_PRIMITIVE; | 248 | } JOYSTICK_FEATURE_PRIMITIVE; |
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 ea70b30..3c4cab3 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 | |||
| @@ -581,6 +581,9 @@ namespace addon | |||
| 581 | * 3) accelerometer | 581 | * 3) accelerometer |
| 582 | * 4) motor | 582 | * 4) motor |
| 583 | * 5) relative pointer[2] | 583 | * 5) relative pointer[2] |
| 584 | * 6) absolute pointer | ||
| 585 | * 7) wheel | ||
| 586 | * 8) throttle | ||
| 584 | * | 587 | * |
| 585 | * [1] All three driver primitives (buttons, hats and axes) have a state that | 588 | * [1] All three driver primitives (buttons, hats and axes) have a state that |
| 586 | * can be represented using a single scalar value. For this reason, | 589 | * can be represented using a single scalar value. For this reason, |
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 02d39c6..eb4351e 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 | |||
| @@ -25,9 +25,9 @@ | |||
| 25 | #include "../StreamCodec.h" | 25 | #include "../StreamCodec.h" |
| 26 | 26 | ||
| 27 | #ifdef BUILD_KODI_ADDON | 27 | #ifdef BUILD_KODI_ADDON |
| 28 | #include "../DVDDemuxPacket.h" | 28 | #include "../DemuxPacket.h" |
| 29 | #else | 29 | #else |
| 30 | #include "cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h" | 30 | #include "cores/VideoPlayer/Interface/Addon/DemuxPacket.h" |
| 31 | #endif | 31 | #endif |
| 32 | 32 | ||
| 33 | namespace kodi { namespace addon { class CInstanceVideoCodec; } } | 33 | namespace kodi { namespace addon { class CInstanceVideoCodec; } } |
