diff options
| author | manuel <manuel@mausz.at> | 2020-10-19 00:52:24 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2020-10-19 00:52:24 +0200 |
| commit | be933ef2241d79558f91796cc5b3a161f72ebf9c (patch) | |
| tree | fe3ab2f130e20c99001f2d7a81d610c78c96a3f4 /xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_general.h | |
| parent | 5f8335c1e49ce108ef3481863833c98efa00411b (diff) | |
| download | kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.gz kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.bz2 kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.zip | |
sync with upstream
Diffstat (limited to 'xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_general.h')
| -rw-r--r-- | xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_general.h | 295 |
1 files changed, 295 insertions, 0 deletions
diff --git a/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_general.h b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_general.h new file mode 100644 index 0000000..e2136f6 --- /dev/null +++ b/xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_general.h | |||
| @@ -0,0 +1,295 @@ | |||
| 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_GENERAL_H | ||
| 12 | #define C_API_ADDONINSTANCE_PVR_GENERAL_H | ||
| 13 | |||
| 14 | #include "pvr_defines.h" | ||
| 15 | |||
| 16 | #ifdef BUILD_KODI_ADDON | ||
| 17 | #include "../../../InputStreamConstants.h" | ||
| 18 | #else | ||
| 19 | #include "cores/VideoPlayer/Interface/Addon/InputStreamConstants.h" | ||
| 20 | #endif | ||
| 21 | |||
| 22 | #include <stdbool.h> | ||
| 23 | |||
| 24 | //¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ | ||
| 25 | // "C" Definitions group 1 - General PVR | ||
| 26 | #ifdef __cplusplus | ||
| 27 | extern "C" | ||
| 28 | { | ||
| 29 | #endif /* __cplusplus */ | ||
| 30 | |||
| 31 | //============================================================================ | ||
| 32 | /// @defgroup cpp_kodi_addon_pvr_Defs_General_PVR_ERROR enum PVR_ERROR | ||
| 33 | /// @ingroup cpp_kodi_addon_pvr_Defs_General | ||
| 34 | /// @brief **PVR add-on error codes**\n | ||
| 35 | /// Used as return values on most PVR related functions. | ||
| 36 | /// | ||
| 37 | /// In this way, a PVR instance signals errors in its processing and, under | ||
| 38 | /// certain conditions, allows Kodi to make corrections. | ||
| 39 | /// | ||
| 40 | ///@{ | ||
| 41 | typedef enum PVR_ERROR | ||
| 42 | { | ||
| 43 | /// @brief __0__ : No error occurred. | ||
| 44 | PVR_ERROR_NO_ERROR = 0, | ||
| 45 | |||
| 46 | /// @brief __-1__ : An unknown error occurred. | ||
| 47 | PVR_ERROR_UNKNOWN = -1, | ||
| 48 | |||
| 49 | /// @brief __-2__ : The method that Kodi called is not implemented by the add-on. | ||
| 50 | PVR_ERROR_NOT_IMPLEMENTED = -2, | ||
| 51 | |||
| 52 | /// @brief __-3__ : The backend reported an error, or the add-on isn't connected. | ||
| 53 | PVR_ERROR_SERVER_ERROR = -3, | ||
| 54 | |||
| 55 | /// @brief __-4__ : The command was sent to the backend, but the response timed out. | ||
| 56 | PVR_ERROR_SERVER_TIMEOUT = -4, | ||
| 57 | |||
| 58 | /// @brief __-5__ : The command was rejected by the backend. | ||
| 59 | PVR_ERROR_REJECTED = -5, | ||
| 60 | |||
| 61 | /// @brief __-6__ : The requested item can not be added, because it's already present. | ||
| 62 | PVR_ERROR_ALREADY_PRESENT = -6, | ||
| 63 | |||
| 64 | /// @brief __-7__ : The parameters of the method that was called are invalid for this | ||
| 65 | /// operation. | ||
| 66 | PVR_ERROR_INVALID_PARAMETERS = -7, | ||
| 67 | |||
| 68 | /// @brief __-8__ : A recording is running, so the timer can't be deleted without | ||
| 69 | /// doing a forced delete. | ||
| 70 | PVR_ERROR_RECORDING_RUNNING = -8, | ||
| 71 | |||
| 72 | /// @brief __-9__ : The command failed. | ||
| 73 | PVR_ERROR_FAILED = -9, | ||
| 74 | } PVR_ERROR; | ||
| 75 | ///@} | ||
| 76 | //---------------------------------------------------------------------------- | ||
| 77 | |||
| 78 | //============================================================================ | ||
| 79 | /// @defgroup cpp_kodi_addon_pvr_Defs_General_PVR_CONNECTION_STATE enum PVR_CONNECTION_STATE | ||
| 80 | /// @ingroup cpp_kodi_addon_pvr_Defs_General | ||
| 81 | /// @brief **PVR backend connection states**\n | ||
| 82 | /// Used with @ref kodi::addon::CInstancePVRClient::ConnectionStateChange() callback. | ||
| 83 | /// | ||
| 84 | /// With this, a PVR instance signals that Kodi should perform special | ||
| 85 | /// operations. | ||
| 86 | /// | ||
| 87 | ///@{ | ||
| 88 | typedef enum PVR_CONNECTION_STATE | ||
| 89 | { | ||
| 90 | /// @brief __0__ : Unknown state (e.g. not yet tried to connect). | ||
| 91 | PVR_CONNECTION_STATE_UNKNOWN = 0, | ||
| 92 | |||
| 93 | /// @brief __1__ : Backend server is not reachable (e.g. server not existing or | ||
| 94 | /// network down). | ||
| 95 | PVR_CONNECTION_STATE_SERVER_UNREACHABLE = 1, | ||
| 96 | |||
| 97 | /// @brief __2__ : Backend server is reachable, but there is not the expected type of | ||
| 98 | /// server running (e.g. HTSP required, but FTP running at given server:port). | ||
| 99 | PVR_CONNECTION_STATE_SERVER_MISMATCH = 2, | ||
| 100 | |||
| 101 | /// @brief __3__ : Backend server is reachable, but server version does not match | ||
| 102 | /// client requirements. | ||
| 103 | PVR_CONNECTION_STATE_VERSION_MISMATCH = 3, | ||
| 104 | |||
| 105 | /// @brief __4__ : Backend server is reachable, but denies client access (e.g. due | ||
| 106 | /// to wrong credentials). | ||
| 107 | PVR_CONNECTION_STATE_ACCESS_DENIED = 4, | ||
| 108 | |||
| 109 | /// @brief __5__ : Connection to backend server is established. | ||
| 110 | PVR_CONNECTION_STATE_CONNECTED = 5, | ||
| 111 | |||
| 112 | /// @brief __6__ : No connection to backend server (e.g. due to network errors or | ||
| 113 | /// client initiated disconnect). | ||
| 114 | PVR_CONNECTION_STATE_DISCONNECTED = 6, | ||
| 115 | |||
| 116 | /// @brief __7__ : Connecting to backend. | ||
| 117 | PVR_CONNECTION_STATE_CONNECTING = 7, | ||
| 118 | } PVR_CONNECTION_STATE; | ||
| 119 | ///@} | ||
| 120 | //---------------------------------------------------------------------------- | ||
| 121 | |||
| 122 | //============================================================================ | ||
| 123 | /// @defgroup cpp_kodi_addon_pvr_Defs_General_PVR_STREAM_PROPERTY definition PVR_STREAM_PROPERTY | ||
| 124 | /// @ingroup cpp_kodi_addon_pvr_Defs_General_Inputstream | ||
| 125 | /// @brief **PVR related stream property values**\n | ||
| 126 | /// This is used to pass additional data to Kodi on a given PVR stream. | ||
| 127 | /// | ||
| 128 | /// Then transferred to livestream, recordings or EPG Tag stream using the | ||
| 129 | /// properties. | ||
| 130 | /// | ||
| 131 | /// This defines are used by: | ||
| 132 | /// - @ref kodi::addon::CInstancePVRClient::GetChannelStreamProperties() | ||
| 133 | /// - @ref kodi::addon::CInstancePVRClient::GetEPGTagStreamProperties() | ||
| 134 | /// - @ref kodi::addon::CInstancePVRClient::GetRecordingStreamProperties() | ||
| 135 | /// | ||
| 136 | /// | ||
| 137 | ///--------------------------------------------------------------------------- | ||
| 138 | /// | ||
| 139 | /// **Example:** | ||
| 140 | /// ~~~~~~~~~~~~~{.cpp} | ||
| 141 | /// ... | ||
| 142 | /// | ||
| 143 | /// PVR_ERROR CMyPVRInstance::GetChannelStreamProperties(const kodi::addon::PVRChannel& channel, | ||
| 144 | /// std::vector<PVRStreamProperty>& properties) | ||
| 145 | /// { | ||
| 146 | /// ... | ||
| 147 | /// properties.emplace_back(PVR_STREAM_PROPERTY_INPUTSTREAM, "inputstream.adaptive"); | ||
| 148 | /// properties.emplace_back("inputstream.adaptive.manifest_type", "mpd"); | ||
| 149 | /// properties.emplace_back("inputstream.adaptive.manifest_update_parameter", "full"); | ||
| 150 | /// properties.emplace_back(PVR_STREAM_PROPERTY_MIMETYPE, "application/xml+dash"); | ||
| 151 | /// return PVR_ERROR_NO_ERROR; | ||
| 152 | /// } | ||
| 153 | /// | ||
| 154 | /// ... | ||
| 155 | /// ~~~~~~~~~~~~~ | ||
| 156 | /// | ||
| 157 | ///@{ | ||
| 158 | |||
| 159 | /// @brief the URL of the stream that should be played. | ||
| 160 | /// | ||
| 161 | #define PVR_STREAM_PROPERTY_STREAMURL "streamurl" | ||
| 162 | |||
| 163 | /// @brief To define in stream properties the name of the inputstream add-on | ||
| 164 | /// that should be used. | ||
| 165 | /// | ||
| 166 | /// Leave blank to use Kodi's built-in playing capabilities or to allow ffmpeg | ||
| 167 | /// to handle directly set to @ref PVR_STREAM_PROPERTY_VALUE_INPUTSTREAMFFMPEG. | ||
| 168 | /// | ||
| 169 | #define PVR_STREAM_PROPERTY_INPUTSTREAM STREAM_PROPERTY_INPUTSTREAM | ||
| 170 | |||
| 171 | /// @brief Identification string for an input stream. | ||
| 172 | /// | ||
| 173 | /// This value can be used in addition to @ref PVR_STREAM_PROPERTY_INPUTSTREAM. | ||
| 174 | /// It is used to provide the respective inpustream addon with additional | ||
| 175 | /// identification. | ||
| 176 | /// | ||
| 177 | /// The difference between this and other stream properties is that it is also | ||
| 178 | /// passed in the associated @ref kodi::addon::CAddonBase::CreateInstance() | ||
| 179 | /// call. | ||
| 180 | /// | ||
| 181 | /// This makes it possible to select different processing classes within the | ||
| 182 | /// associated add-on. | ||
| 183 | /// | ||
| 184 | /// | ||
| 185 | ///--------------------------------------------------------------------------- | ||
| 186 | /// | ||
| 187 | /// **Example:** | ||
| 188 | /// ~~~~~~~~~~~~~{.cpp} | ||
| 189 | /// ... | ||
| 190 | /// | ||
| 191 | /// // On PVR instance of addon | ||
| 192 | /// PVR_ERROR CMyPVRInstance::GetChannelStreamProperties(const kodi::addon::PVRChannel& channel, | ||
| 193 | /// std::vector<PVRStreamProperty>& properties) | ||
| 194 | /// { | ||
| 195 | /// ... | ||
| 196 | /// // For here on example the inpustream is also inside the PVR addon | ||
| 197 | /// properties.emplace_back(PVR_STREAM_PROPERTY_INPUTSTREAM, "pvr.my_one"); | ||
| 198 | /// properties.emplace_back(PVR_STREAM_PROPERTY_INPUTSTREAM_INSTANCE_ID, "my_special_id_1"); | ||
| 199 | /// return PVR_ERROR_NO_ERROR; | ||
| 200 | /// } | ||
| 201 | /// | ||
| 202 | /// ... | ||
| 203 | /// | ||
| 204 | /// // On CAddonBase part of addon | ||
| 205 | /// ADDON_STATUS CMyAddon::CreateInstanceEx(int instanceType, | ||
| 206 | /// std::string instanceID, | ||
| 207 | /// KODI_HANDLE instance, | ||
| 208 | /// KODI_HANDLE& addonInstance | ||
| 209 | /// const std::string& version) | ||
| 210 | /// { | ||
| 211 | /// if (instanceType == ADDON_INSTANCE_INPUTSTREAM) | ||
| 212 | /// { | ||
| 213 | /// kodi::Log(ADDON_LOG_INFO, "Creating my special inputstream"); | ||
| 214 | /// if (instanceID == "my_special_id_1") | ||
| 215 | /// addonInstance = new CMyPVRClientInstance_Type1(instance, version); | ||
| 216 | /// else if (instanceID == "my_special_id_2") | ||
| 217 | /// addonInstance = new CMyPVRClientInstance_Type2(instance, version); | ||
| 218 | /// return ADDON_STATUS_OK; | ||
| 219 | /// } | ||
| 220 | /// else if (...) | ||
| 221 | /// { | ||
| 222 | /// ... | ||
| 223 | /// } | ||
| 224 | /// return ADDON_STATUS_UNKNOWN; | ||
| 225 | /// } | ||
| 226 | /// | ||
| 227 | /// ... | ||
| 228 | /// ~~~~~~~~~~~~~ | ||
| 229 | /// | ||
| 230 | #define PVR_STREAM_PROPERTY_INPUTSTREAM_INSTANCE_ID STREAM_PROPERTY_INPUTSTREAM_INSTANCE_ID | ||
| 231 | |||
| 232 | /// @brief the MIME type of the stream that should be played. | ||
| 233 | /// | ||
| 234 | #define PVR_STREAM_PROPERTY_MIMETYPE "mimetype" | ||
| 235 | |||
| 236 | /// @brief <b>"true"</b> to denote that the stream that should be played is a | ||
| 237 | /// realtime stream. | ||
| 238 | /// | ||
| 239 | /// Any other value indicates that this is no realtime stream. | ||
| 240 | /// | ||
| 241 | #define PVR_STREAM_PROPERTY_ISREALTIMESTREAM STREAM_PROPERTY_ISREALTIMESTREAM | ||
| 242 | |||
| 243 | /// @brief <b>"true"</b> to denote that if the stream is from an EPG tag. | ||
| 244 | /// | ||
| 245 | /// It should be played is a live stream. Otherwise if it's a EPG tag it will | ||
| 246 | /// play as normal video. | ||
| 247 | /// | ||
| 248 | #define PVR_STREAM_PROPERTY_EPGPLAYBACKASLIVE "epgplaybackaslive" | ||
| 249 | |||
| 250 | /// @brief Special value for @ref PVR_STREAM_PROPERTY_INPUTSTREAM to use | ||
| 251 | /// ffmpeg to directly play a stream URL. | ||
| 252 | #define PVR_STREAM_PROPERTY_VALUE_INPUTSTREAMFFMPEG STREAM_PROPERTY_VALUE_INPUTSTREAMFFMPEG | ||
| 253 | |||
| 254 | ///@} | ||
| 255 | //----------------------------------------------------------------------------- | ||
| 256 | |||
| 257 | /*! | ||
| 258 | * @brief "C" PVR add-on capabilities. | ||
| 259 | * | ||
| 260 | * Structure used to interface in "C" between Kodi and Addon. | ||
| 261 | * | ||
| 262 | * See @ref kodi::addon::PVRCapabilities for description of values. | ||
| 263 | */ | ||
| 264 | typedef struct PVR_ADDON_CAPABILITIES | ||
| 265 | { | ||
| 266 | bool bSupportsEPG; | ||
| 267 | bool bSupportsEPGEdl; | ||
| 268 | bool bSupportsTV; | ||
| 269 | bool bSupportsRadio; | ||
| 270 | bool bSupportsRecordings; | ||
| 271 | bool bSupportsRecordingsUndelete; | ||
| 272 | bool bSupportsTimers; | ||
| 273 | bool bSupportsChannelGroups; | ||
| 274 | bool bSupportsChannelScan; | ||
| 275 | bool bSupportsChannelSettings; | ||
| 276 | bool bHandlesInputStream; | ||
| 277 | bool bHandlesDemuxing; | ||
| 278 | bool bSupportsRecordingPlayCount; | ||
| 279 | bool bSupportsLastPlayedPosition; | ||
| 280 | bool bSupportsRecordingEdl; | ||
| 281 | bool bSupportsRecordingsRename; | ||
| 282 | bool bSupportsRecordingsLifetimeChange; | ||
| 283 | bool bSupportsDescrambleInfo; | ||
| 284 | bool bSupportsAsyncEPGTransfer; | ||
| 285 | bool bSupportsRecordingSize; | ||
| 286 | |||
| 287 | unsigned int iRecordingsLifetimesSize; | ||
| 288 | struct PVR_ATTRIBUTE_INT_VALUE recordingsLifetimeValues[PVR_ADDON_ATTRIBUTE_VALUES_ARRAY_SIZE]; | ||
| 289 | } PVR_ADDON_CAPABILITIES; | ||
| 290 | |||
| 291 | #ifdef __cplusplus | ||
| 292 | } | ||
| 293 | #endif /* __cplusplus */ | ||
| 294 | |||
| 295 | #endif /* !C_API_ADDONINSTANCE_PVR_GENERAL_H */ | ||
