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