diff options
Diffstat (limited to 'xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr.h')
| -rw-r--r-- | xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr.h | 332 |
1 files changed, 332 insertions, 0 deletions
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr.h new file mode 100644 index 0000000..a50ea2b --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr.h | |||
| @@ -0,0 +1,332 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2005-2018 Team Kodi | ||
| 3 | * This file is part of Kodi - https://kodi.tv | ||
| 4 | * | ||
| 5 | * SPDX-License-Identifier: GPL-2.0-or-later | ||
| 6 | * See LICENSES/README.md for more information. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #ifndef C_API_ADDONINSTANCE_PVR_H | ||
| 12 | #define C_API_ADDONINSTANCE_PVR_H | ||
| 13 | |||
| 14 | #include "../../AddonBase.h" | ||
| 15 | #include "pvr/pvr_channel_groups.h" | ||
| 16 | #include "pvr/pvr_channels.h" | ||
| 17 | #include "pvr/pvr_defines.h" | ||
| 18 | #include "pvr/pvr_edl.h" | ||
| 19 | #include "pvr/pvr_epg.h" | ||
| 20 | #include "pvr/pvr_general.h" | ||
| 21 | #include "pvr/pvr_menu_hook.h" | ||
| 22 | #include "pvr/pvr_recordings.h" | ||
| 23 | #include "pvr/pvr_stream.h" | ||
| 24 | #include "pvr/pvr_timers.h" | ||
| 25 | |||
| 26 | //¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ | ||
| 27 | // "C" main interface function tables between Kodi and addon | ||
| 28 | // | ||
| 29 | // Values related to all parts and not used direct on addon, are to define here. | ||
| 30 | // | ||
| 31 | #ifdef __cplusplus | ||
| 32 | extern "C" | ||
| 33 | { | ||
| 34 | #endif /* __cplusplus */ | ||
| 35 | |||
| 36 | /*! | ||
| 37 | * @internal | ||
| 38 | * @brief PVR "C" basis API interface | ||
| 39 | * | ||
| 40 | * This field contains things that are exchanged between Kodi and Addon | ||
| 41 | * and is the basis of the PVR-side "C" API. | ||
| 42 | * | ||
| 43 | * @warning Care should be taken when making changes in this fields!\n | ||
| 44 | * Changes can destroy API in addons that have already been created. If a | ||
| 45 | * necessary change or new feature is added, the version of the PVR | ||
| 46 | * at @ref ADDON_INSTANCE_VERSION_PVR_MIN must be increased too.\n | ||
| 47 | * \n | ||
| 48 | * Conditional changes can be made in some places, without min PVR version | ||
| 49 | * increase. The add-on should then use CreateInstanceEx and add partial tests | ||
| 50 | * for this in the C++ header. | ||
| 51 | * | ||
| 52 | * Have by add of new parts a look about **Doxygen** `\\ingroup`, so that | ||
| 53 | * added parts included in documentation. | ||
| 54 | * | ||
| 55 | * If you add addon side related documentation, where his dev need know, | ||
| 56 | * use `///`. For parts only for Kodi make it like here. | ||
| 57 | * | ||
| 58 | * @endinternal | ||
| 59 | */ | ||
| 60 | |||
| 61 | struct AddonInstance_PVR; | ||
| 62 | |||
| 63 | /*! | ||
| 64 | * @brief Structure to define typical standard values | ||
| 65 | */ | ||
| 66 | typedef struct AddonProperties_PVR | ||
| 67 | { | ||
| 68 | const char* strUserPath; | ||
| 69 | const char* strClientPath; | ||
| 70 | int iEpgMaxDays; | ||
| 71 | } AddonProperties_PVR; | ||
| 72 | |||
| 73 | /*! | ||
| 74 | * @brief Structure to transfer the methods from Kodi to addon | ||
| 75 | */ | ||
| 76 | typedef struct AddonToKodiFuncTable_PVR | ||
| 77 | { | ||
| 78 | // Pointer inside Kodi where used from him to find his class | ||
| 79 | KODI_HANDLE kodiInstance; | ||
| 80 | |||
| 81 | //--==----==----==----==----==----==----==----==----==----==----==----==----== | ||
| 82 | // General callback functions | ||
| 83 | void (*AddMenuHook)(void* kodiInstance, const struct PVR_MENUHOOK* hook); | ||
| 84 | void (*RecordingNotification)(void* kodiInstance, | ||
| 85 | const char* name, | ||
| 86 | const char* fileName, | ||
| 87 | bool on); | ||
| 88 | void (*ConnectionStateChange)(void* kodiInstance, | ||
| 89 | const char* strConnectionString, | ||
| 90 | enum PVR_CONNECTION_STATE newState, | ||
| 91 | const char* strMessage); | ||
| 92 | void (*EpgEventStateChange)(void* kodiInstance, | ||
| 93 | struct EPG_TAG* tag, | ||
| 94 | enum EPG_EVENT_STATE newState); | ||
| 95 | |||
| 96 | //--==----==----==----==----==----==----==----==----==----==----==----==----== | ||
| 97 | // Transfer functions where give data back to Kodi, e.g. GetChannels calls TransferChannelEntry | ||
| 98 | void (*TransferChannelEntry)(void* kodiInstance, | ||
| 99 | const ADDON_HANDLE handle, | ||
| 100 | const struct PVR_CHANNEL* chan); | ||
| 101 | void (*TransferChannelGroup)(void* kodiInstance, | ||
| 102 | const ADDON_HANDLE handle, | ||
| 103 | const struct PVR_CHANNEL_GROUP* group); | ||
| 104 | void (*TransferChannelGroupMember)(void* kodiInstance, | ||
| 105 | const ADDON_HANDLE handle, | ||
| 106 | const struct PVR_CHANNEL_GROUP_MEMBER* member); | ||
| 107 | void (*TransferEpgEntry)(void* kodiInstance, | ||
| 108 | const ADDON_HANDLE handle, | ||
| 109 | const struct EPG_TAG* epgentry); | ||
| 110 | void (*TransferRecordingEntry)(void* kodiInstance, | ||
| 111 | const ADDON_HANDLE handle, | ||
| 112 | const struct PVR_RECORDING* recording); | ||
| 113 | void (*TransferTimerEntry)(void* kodiInstance, | ||
| 114 | const ADDON_HANDLE handle, | ||
| 115 | const struct PVR_TIMER* timer); | ||
| 116 | |||
| 117 | //--==----==----==----==----==----==----==----==----==----==----==----==----== | ||
| 118 | // Kodi inform interface functions | ||
| 119 | void (*TriggerChannelUpdate)(void* kodiInstance); | ||
| 120 | void (*TriggerChannelGroupsUpdate)(void* kodiInstance); | ||
| 121 | void (*TriggerEpgUpdate)(void* kodiInstance, unsigned int iChannelUid); | ||
| 122 | void (*TriggerRecordingUpdate)(void* kodiInstance); | ||
| 123 | void (*TriggerTimerUpdate)(void* kodiInstance); | ||
| 124 | |||
| 125 | //--==----==----==----==----==----==----==----==----==----==----==----==----== | ||
| 126 | // Stream demux interface functions | ||
| 127 | void (*FreeDemuxPacket)(void* kodiInstance, struct DemuxPacket* pPacket); | ||
| 128 | struct DemuxPacket* (*AllocateDemuxPacket)(void* kodiInstance, int iDataSize); | ||
| 129 | struct PVR_CODEC (*GetCodecByName)(const void* kodiInstance, const char* strCodecName); | ||
| 130 | |||
| 131 | //--==----==----==----==----==----==----==----==----==----==----==----==----== | ||
| 132 | // New functions becomes added below and can be on another API change (where | ||
| 133 | // breaks min API version) moved up. | ||
| 134 | } AddonToKodiFuncTable_PVR; | ||
| 135 | |||
| 136 | /*! | ||
| 137 | * @brief Structure to transfer the methods from addon to Kodi | ||
| 138 | */ | ||
| 139 | typedef struct KodiToAddonFuncTable_PVR | ||
| 140 | { | ||
| 141 | // Pointer inside addon where used on them to find his instance class (currently unused!) | ||
| 142 | KODI_HANDLE addonInstance; | ||
| 143 | |||
| 144 | //--==----==----==----==----==----==----==----==----==----==----==----==----== | ||
| 145 | // General interface functions | ||
| 146 | enum PVR_ERROR(__cdecl* GetCapabilities)(const struct AddonInstance_PVR*, | ||
| 147 | struct PVR_ADDON_CAPABILITIES*); | ||
| 148 | enum PVR_ERROR(__cdecl* GetBackendName)(const struct AddonInstance_PVR*, char*, int); | ||
| 149 | enum PVR_ERROR(__cdecl* GetBackendVersion)(const struct AddonInstance_PVR*, char*, int); | ||
| 150 | enum PVR_ERROR(__cdecl* GetBackendHostname)(const struct AddonInstance_PVR*, char*, int); | ||
| 151 | enum PVR_ERROR(__cdecl* GetConnectionString)(const struct AddonInstance_PVR*, char*, int); | ||
| 152 | enum PVR_ERROR(__cdecl* GetDriveSpace)(const struct AddonInstance_PVR*, uint64_t*, uint64_t*); | ||
| 153 | enum PVR_ERROR(__cdecl* CallSettingsMenuHook)(const struct AddonInstance_PVR*, | ||
| 154 | const struct PVR_MENUHOOK*); | ||
| 155 | |||
| 156 | //--==----==----==----==----==----==----==----==----==----==----==----==----== | ||
| 157 | // Channel interface functions | ||
| 158 | |||
| 159 | enum PVR_ERROR(__cdecl* GetChannelsAmount)(const struct AddonInstance_PVR*, int*); | ||
| 160 | enum PVR_ERROR(__cdecl* GetChannels)(const struct AddonInstance_PVR*, ADDON_HANDLE, bool); | ||
| 161 | enum PVR_ERROR(__cdecl* GetChannelStreamProperties)(const struct AddonInstance_PVR*, | ||
| 162 | const struct PVR_CHANNEL*, | ||
| 163 | struct PVR_NAMED_VALUE*, | ||
| 164 | unsigned int*); | ||
| 165 | enum PVR_ERROR(__cdecl* GetSignalStatus)(const struct AddonInstance_PVR*, | ||
| 166 | int, | ||
| 167 | struct PVR_SIGNAL_STATUS*); | ||
| 168 | enum PVR_ERROR(__cdecl* GetDescrambleInfo)(const struct AddonInstance_PVR*, | ||
| 169 | int, | ||
| 170 | struct PVR_DESCRAMBLE_INFO*); | ||
| 171 | |||
| 172 | //--==----==----==----==----==----==----==----==----==----==----==----==----== | ||
| 173 | // Channel group interface functions | ||
| 174 | enum PVR_ERROR(__cdecl* GetChannelGroupsAmount)(const struct AddonInstance_PVR*, int*); | ||
| 175 | enum PVR_ERROR(__cdecl* GetChannelGroups)(const struct AddonInstance_PVR*, ADDON_HANDLE, bool); | ||
| 176 | enum PVR_ERROR(__cdecl* GetChannelGroupMembers)(const struct AddonInstance_PVR*, | ||
| 177 | ADDON_HANDLE, | ||
| 178 | const struct PVR_CHANNEL_GROUP*); | ||
| 179 | |||
| 180 | //--==----==----==----==----==----==----==----==----==----==----==----==----== | ||
| 181 | // Channel edit interface functions | ||
| 182 | enum PVR_ERROR(__cdecl* DeleteChannel)(const struct AddonInstance_PVR*, | ||
| 183 | const struct PVR_CHANNEL*); | ||
| 184 | enum PVR_ERROR(__cdecl* RenameChannel)(const struct AddonInstance_PVR*, | ||
| 185 | const struct PVR_CHANNEL*); | ||
| 186 | enum PVR_ERROR(__cdecl* OpenDialogChannelSettings)(const struct AddonInstance_PVR*, | ||
| 187 | const struct PVR_CHANNEL*); | ||
| 188 | enum PVR_ERROR(__cdecl* OpenDialogChannelAdd)(const struct AddonInstance_PVR*, | ||
| 189 | const struct PVR_CHANNEL*); | ||
| 190 | enum PVR_ERROR(__cdecl* OpenDialogChannelScan)(const struct AddonInstance_PVR*); | ||
| 191 | enum PVR_ERROR(__cdecl* CallChannelMenuHook)(const struct AddonInstance_PVR*, | ||
| 192 | const PVR_MENUHOOK*, | ||
| 193 | const PVR_CHANNEL*); | ||
| 194 | |||
| 195 | //--==----==----==----==----==----==----==----==----==----==----==----==----== | ||
| 196 | // EPG interface functions | ||
| 197 | enum PVR_ERROR(__cdecl* GetEPGForChannel)( | ||
| 198 | const struct AddonInstance_PVR*, ADDON_HANDLE, int, time_t, time_t); | ||
| 199 | enum PVR_ERROR(__cdecl* IsEPGTagRecordable)(const struct AddonInstance_PVR*, | ||
| 200 | const struct EPG_TAG*, | ||
| 201 | bool*); | ||
| 202 | enum PVR_ERROR(__cdecl* IsEPGTagPlayable)(const struct AddonInstance_PVR*, | ||
| 203 | const struct EPG_TAG*, | ||
| 204 | bool*); | ||
| 205 | enum PVR_ERROR(__cdecl* GetEPGTagEdl)(const struct AddonInstance_PVR*, | ||
| 206 | const struct EPG_TAG*, | ||
| 207 | struct PVR_EDL_ENTRY[], | ||
| 208 | int*); | ||
| 209 | enum PVR_ERROR(__cdecl* GetEPGTagStreamProperties)(const struct AddonInstance_PVR*, | ||
| 210 | const struct EPG_TAG*, | ||
| 211 | struct PVR_NAMED_VALUE*, | ||
| 212 | unsigned int*); | ||
| 213 | enum PVR_ERROR(__cdecl* SetEPGTimeFrame)(const struct AddonInstance_PVR*, int); | ||
| 214 | enum PVR_ERROR(__cdecl* CallEPGMenuHook)(const struct AddonInstance_PVR*, | ||
| 215 | const struct PVR_MENUHOOK*, | ||
| 216 | const struct EPG_TAG*); | ||
| 217 | |||
| 218 | //--==----==----==----==----==----==----==----==----==----==----==----==----== | ||
| 219 | // Recording interface functions | ||
| 220 | enum PVR_ERROR(__cdecl* GetRecordingsAmount)(const struct AddonInstance_PVR*, bool, int*); | ||
| 221 | enum PVR_ERROR(__cdecl* GetRecordings)(const struct AddonInstance_PVR*, ADDON_HANDLE, bool); | ||
| 222 | enum PVR_ERROR(__cdecl* DeleteRecording)(const struct AddonInstance_PVR*, | ||
| 223 | const struct PVR_RECORDING*); | ||
| 224 | enum PVR_ERROR(__cdecl* UndeleteRecording)(const struct AddonInstance_PVR*, | ||
| 225 | const struct PVR_RECORDING*); | ||
| 226 | enum PVR_ERROR(__cdecl* DeleteAllRecordingsFromTrash)(const struct AddonInstance_PVR*); | ||
| 227 | enum PVR_ERROR(__cdecl* RenameRecording)(const struct AddonInstance_PVR*, | ||
| 228 | const struct PVR_RECORDING*); | ||
| 229 | enum PVR_ERROR(__cdecl* SetRecordingLifetime)(const struct AddonInstance_PVR*, | ||
| 230 | const struct PVR_RECORDING*); | ||
| 231 | enum PVR_ERROR(__cdecl* SetRecordingPlayCount)(const struct AddonInstance_PVR*, | ||
| 232 | const struct PVR_RECORDING*, | ||
| 233 | int); | ||
| 234 | enum PVR_ERROR(__cdecl* SetRecordingLastPlayedPosition)(const struct AddonInstance_PVR*, | ||
| 235 | const struct PVR_RECORDING*, | ||
| 236 | int); | ||
| 237 | enum PVR_ERROR(__cdecl* GetRecordingLastPlayedPosition)(const struct AddonInstance_PVR*, | ||
| 238 | const struct PVR_RECORDING*, | ||
| 239 | int*); | ||
| 240 | enum PVR_ERROR(__cdecl* GetRecordingEdl)(const struct AddonInstance_PVR*, | ||
| 241 | const struct PVR_RECORDING*, | ||
| 242 | struct PVR_EDL_ENTRY[], | ||
| 243 | int*); | ||
| 244 | enum PVR_ERROR(__cdecl* GetRecordingSize)(const struct AddonInstance_PVR*, | ||
| 245 | const PVR_RECORDING*, | ||
| 246 | int64_t*); | ||
| 247 | enum PVR_ERROR(__cdecl* GetRecordingStreamProperties)(const struct AddonInstance_PVR*, | ||
| 248 | const struct PVR_RECORDING*, | ||
| 249 | struct PVR_NAMED_VALUE*, | ||
| 250 | unsigned int*); | ||
| 251 | enum PVR_ERROR(__cdecl* CallRecordingMenuHook)(const struct AddonInstance_PVR*, | ||
| 252 | const struct PVR_MENUHOOK*, | ||
| 253 | const struct PVR_RECORDING*); | ||
| 254 | |||
| 255 | //--==----==----==----==----==----==----==----==----==----==----==----==----== | ||
| 256 | // Timer interface functions | ||
| 257 | enum PVR_ERROR(__cdecl* GetTimerTypes)(const struct AddonInstance_PVR*, | ||
| 258 | struct PVR_TIMER_TYPE[], | ||
| 259 | int*); | ||
| 260 | enum PVR_ERROR(__cdecl* GetTimersAmount)(const struct AddonInstance_PVR*, int*); | ||
| 261 | enum PVR_ERROR(__cdecl* GetTimers)(const struct AddonInstance_PVR*, ADDON_HANDLE); | ||
| 262 | enum PVR_ERROR(__cdecl* AddTimer)(const struct AddonInstance_PVR*, const struct PVR_TIMER*); | ||
| 263 | enum PVR_ERROR(__cdecl* DeleteTimer)(const struct AddonInstance_PVR*, | ||
| 264 | const struct PVR_TIMER*, | ||
| 265 | bool); | ||
| 266 | enum PVR_ERROR(__cdecl* UpdateTimer)(const struct AddonInstance_PVR*, const struct PVR_TIMER*); | ||
| 267 | enum PVR_ERROR(__cdecl* CallTimerMenuHook)(const struct AddonInstance_PVR*, | ||
| 268 | const struct PVR_MENUHOOK*, | ||
| 269 | const struct PVR_TIMER*); | ||
| 270 | |||
| 271 | //--==----==----==----==----==----==----==----==----==----==----==----==----== | ||
| 272 | // Powersaving interface functions | ||
| 273 | enum PVR_ERROR(__cdecl* OnSystemSleep)(const struct AddonInstance_PVR*); | ||
| 274 | enum PVR_ERROR(__cdecl* OnSystemWake)(const struct AddonInstance_PVR*); | ||
| 275 | enum PVR_ERROR(__cdecl* OnPowerSavingActivated)(const struct AddonInstance_PVR*); | ||
| 276 | enum PVR_ERROR(__cdecl* OnPowerSavingDeactivated)(const struct AddonInstance_PVR*); | ||
| 277 | |||
| 278 | //--==----==----==----==----==----==----==----==----==----==----==----==----== | ||
| 279 | // Live stream read interface functions | ||
| 280 | bool(__cdecl* OpenLiveStream)(const struct AddonInstance_PVR*, const struct PVR_CHANNEL*); | ||
| 281 | void(__cdecl* CloseLiveStream)(const struct AddonInstance_PVR*); | ||
| 282 | int(__cdecl* ReadLiveStream)(const struct AddonInstance_PVR*, unsigned char*, unsigned int); | ||
| 283 | int64_t(__cdecl* SeekLiveStream)(const struct AddonInstance_PVR*, int64_t, int); | ||
| 284 | int64_t(__cdecl* LengthLiveStream)(const struct AddonInstance_PVR*); | ||
| 285 | |||
| 286 | //--==----==----==----==----==----==----==----==----==----==----==----==----== | ||
| 287 | // Recording stream read interface functions | ||
| 288 | bool(__cdecl* OpenRecordedStream)(const struct AddonInstance_PVR*, const struct PVR_RECORDING*); | ||
| 289 | void(__cdecl* CloseRecordedStream)(const struct AddonInstance_PVR*); | ||
| 290 | int(__cdecl* ReadRecordedStream)(const struct AddonInstance_PVR*, unsigned char*, unsigned int); | ||
| 291 | int64_t(__cdecl* SeekRecordedStream)(const struct AddonInstance_PVR*, int64_t, int); | ||
| 292 | int64_t(__cdecl* LengthRecordedStream)(const struct AddonInstance_PVR*); | ||
| 293 | |||
| 294 | //--==----==----==----==----==----==----==----==----==----==----==----==----== | ||
| 295 | // Stream demux interface functions | ||
| 296 | enum PVR_ERROR(__cdecl* GetStreamProperties)(const struct AddonInstance_PVR*, | ||
| 297 | struct PVR_STREAM_PROPERTIES*); | ||
| 298 | struct DemuxPacket*(__cdecl* DemuxRead)(const struct AddonInstance_PVR*); | ||
| 299 | void(__cdecl* DemuxReset)(const struct AddonInstance_PVR*); | ||
| 300 | void(__cdecl* DemuxAbort)(const struct AddonInstance_PVR*); | ||
| 301 | void(__cdecl* DemuxFlush)(const struct AddonInstance_PVR*); | ||
| 302 | void(__cdecl* SetSpeed)(const struct AddonInstance_PVR*, int); | ||
| 303 | void(__cdecl* FillBuffer)(const struct AddonInstance_PVR*, bool); | ||
| 304 | bool(__cdecl* SeekTime)(const struct AddonInstance_PVR*, double, bool, double*); | ||
| 305 | |||
| 306 | //--==----==----==----==----==----==----==----==----==----==----==----==----== | ||
| 307 | // General stream interface functions | ||
| 308 | bool(__cdecl* CanPauseStream)(const struct AddonInstance_PVR*); | ||
| 309 | void(__cdecl* PauseStream)(const struct AddonInstance_PVR*, bool); | ||
| 310 | bool(__cdecl* CanSeekStream)(const struct AddonInstance_PVR*); | ||
| 311 | bool(__cdecl* IsRealTimeStream)(const struct AddonInstance_PVR*); | ||
| 312 | enum PVR_ERROR(__cdecl* GetStreamTimes)(const struct AddonInstance_PVR*, | ||
| 313 | struct PVR_STREAM_TIMES*); | ||
| 314 | enum PVR_ERROR(__cdecl* GetStreamReadChunkSize)(const struct AddonInstance_PVR*, int*); | ||
| 315 | |||
| 316 | //--==----==----==----==----==----==----==----==----==----==----==----==----== | ||
| 317 | // New functions becomes added below and can be on another API change (where | ||
| 318 | // breaks min API version) moved up. | ||
| 319 | } KodiToAddonFuncTable_PVR; | ||
| 320 | |||
| 321 | typedef struct AddonInstance_PVR | ||
| 322 | { | ||
| 323 | struct AddonProperties_PVR* props; | ||
| 324 | struct AddonToKodiFuncTable_PVR* toKodi; | ||
| 325 | struct KodiToAddonFuncTable_PVR* toAddon; | ||
| 326 | } AddonInstance_PVR; | ||
| 327 | |||
| 328 | #ifdef __cplusplus | ||
| 329 | } | ||
| 330 | #endif /* __cplusplus */ | ||
| 331 | |||
| 332 | #endif /* !C_API_ADDONINSTANCE_PVR_H */ | ||
