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