summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/include/xbmc_pvr_dll.h
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/addons/include/xbmc_pvr_dll.h')
-rw-r--r--xbmc/addons/include/xbmc_pvr_dll.h710
1 files changed, 710 insertions, 0 deletions
diff --git a/xbmc/addons/include/xbmc_pvr_dll.h b/xbmc/addons/include/xbmc_pvr_dll.h
new file mode 100644
index 0000000..3ad46fc
--- /dev/null
+++ b/xbmc/addons/include/xbmc_pvr_dll.h
@@ -0,0 +1,710 @@
1/*
2 * Copyright (C) 2005-2013 Team XBMC
3 * http://xbmc.org
4 *
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
8 * any later version.
9 *
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with XBMC; see the file COPYING. If not, see
17 * <http://www.gnu.org/licenses/>.
18 *
19 */
20
21#ifndef __XBMC_PVR_H__
22#define __XBMC_PVR_H__
23
24#include "xbmc_addon_dll.h"
25#include "xbmc_pvr_types.h"
26
27/*!
28 * Functions that the PVR client add-on must implement, but some can be empty.
29 *
30 * The 'remarks' field indicates which methods should be implemented, and which ones are optional.
31 */
32
33extern "C"
34{
35 /*! @name PVR add-on methods */
36 //@{
37 /*!
38 * Get the XBMC_PVR_API_VERSION that was used to compile this add-on.
39 * Used to check if this add-on is compatible with XBMC.
40 * @return The XBMC_PVR_API_VERSION that was used to compile this add-on.
41 * @remarks Valid implementation required.
42 */
43 const char* GetPVRAPIVersion(void);
44
45 /*!
46 * Get the XBMC_PVR_MIN_API_VERSION that was used to compile this add-on.
47 * Used to check if this add-on is compatible with XBMC.
48 * @return The XBMC_PVR_MIN_API_VERSION that was used to compile this add-on.
49 * @remarks Valid implementation required.
50 */
51 const char* GetMininumPVRAPIVersion(void);
52
53 /*!
54 * Get the XBMC_GUI_API_VERSION that was used to compile this add-on.
55 * Used to check if this add-on is compatible with XBMC.
56 * @return The XBMC_GUI_API_VERSION that was used to compile this add-on.
57 * @remarks Valid implementation required.
58 */
59 const char* GetGUIAPIVersion(void);
60
61 /*!
62 * Get the XBMC_GUI_MIN_API_VERSION that was used to compile this add-on.
63 * Used to check if this add-on is compatible with XBMC.
64 * @return The XBMC_GUI_MIN_API_VERSION that was used to compile this add-on.
65 * @remarks Valid implementation required.
66 */
67 const char* GetMininumGUIAPIVersion(void);
68
69 /*!
70 * Get the list of features that this add-on provides.
71 * Called by XBMC to query the add-on's capabilities.
72 * Used to check which options should be presented in the UI, which methods to call, etc.
73 * All capabilities that the add-on supports should be set to true.
74 * @param pCapabilities The add-on's capabilities.
75 * @return PVR_ERROR_NO_ERROR if the properties were fetched successfully.
76 * @remarks Valid implementation required.
77 */
78 PVR_ERROR GetAddonCapabilities(PVR_ADDON_CAPABILITIES *pCapabilities);
79
80 /*!
81 * @return The name reported by the backend that will be displayed in the UI.
82 * @remarks Valid implementation required.
83 */
84 const char* GetBackendName(void);
85
86 /*!
87 * @return The version string reported by the backend that will be displayed in the UI.
88 * @remarks Valid implementation required.
89 */
90 const char* GetBackendVersion(void);
91
92 /*!
93 * @return The connection string reported by the backend that will be displayed in the UI.
94 * @remarks Valid implementation required.
95 */
96 const char* GetConnectionString(void);
97
98 /*!
99 * Get the disk space reported by the backend (if supported).
100 * @param iTotal The total disk space in bytes.
101 * @param iUsed The used disk space in bytes.
102 * @return PVR_ERROR_NO_ERROR if the drive space has been fetched successfully.
103 * @remarks Optional. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function.
104 */
105 PVR_ERROR GetDriveSpace(long long* iTotal, long long* iUsed);
106
107 /*!
108 * Call one of the menu hooks (if supported).
109 * Supported PVR_MENUHOOK instances have to be added in ADDON_Create(), by calling AddMenuHook() on the callback.
110 * @param menuhook The hook to call.
111 * @param item The selected item for which the hook was called.
112 * @return PVR_ERROR_NO_ERROR if the hook was called successfully.
113 * @remarks Optional. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function.
114 */
115 PVR_ERROR CallMenuHook(const PVR_MENUHOOK& menuhook, const PVR_MENUHOOK_DATA &item);
116 //@}
117
118 /*! @name PVR EPG methods
119 * @remarks Only used by XBMC if bSupportsEPG is set to true.
120 */
121 //@{
122 /*!
123 * Request the EPG for a channel from the backend.
124 * EPG entries are added to XBMC by calling TransferEpgEntry() on the callback.
125 * @param handle Handle to pass to the callback method.
126 * @param channel The channel to get the EPG table for.
127 * @param iStart Get events after this time (UTC).
128 * @param iEnd Get events before this time (UTC).
129 * @return PVR_ERROR_NO_ERROR if the table has been fetched successfully.
130 * @remarks Required if bSupportsEPG is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function.
131 */
132 PVR_ERROR GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL& channel, time_t iStart, time_t iEnd);
133 //@}
134
135 /*! @name PVR channel group methods
136 * @remarks Only used by XBMC is bSupportsChannelGroups is set to true.
137 * If a group or one of the group members changes after the initial import, or if a new one was added, then the add-on
138 * should call TriggerChannelGroupsUpdate()
139 */
140 //@{
141 /*!
142 * Get the total amount of channel groups on the backend if it supports channel groups.
143 * @return The amount of channels, or -1 on error.
144 * @remarks Required if bSupportsChannelGroups is set to true. Return -1 if this add-on won't provide this function.
145 */
146 int GetChannelGroupsAmount(void);
147
148 /*!
149 * Request the list of all channel groups from the backend if it supports channel groups.
150 * Channel group entries are added to XBMC by calling TransferChannelGroup() on the callback.
151 * @param handle Handle to pass to the callback method.
152 * @param bRadio True to get the radio channel groups, false to get the TV channel groups.
153 * @return PVR_ERROR_NO_ERROR if the list has been fetched successfully.
154 * @remarks Required if bSupportsChannelGroups is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function.
155 */
156 PVR_ERROR GetChannelGroups(ADDON_HANDLE handle, bool bRadio);
157
158 /*!
159 * Request the list of all group members of a group from the backend if it supports channel groups.
160 * Member entries are added to XBMC by calling TransferChannelGroupMember() on the callback.
161 * @param handle Handle to pass to the callback method.
162 * @param group The group to get the members for.
163 * @return PVR_ERROR_NO_ERROR if the list has been fetched successfully.
164 * @remarks Required if bSupportsChannelGroups is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function.
165 */
166 PVR_ERROR GetChannelGroupMembers(ADDON_HANDLE handle, const PVR_CHANNEL_GROUP& group);
167 //@}
168
169 /** @name PVR channel methods
170 * @remarks Either bSupportsTV or bSupportsRadio is required to be set to true.
171 * If a channel changes after the initial import, or if a new one was added, then the add-on
172 * should call TriggerChannelUpdate()
173 */
174 //@{
175 /*!
176 * Show the channel scan dialog if this backend supports it.
177 * @return PVR_ERROR_NO_ERROR if the dialog was displayed successfully.
178 * @remarks Required if bSupportsChannelScan is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function.
179 * @note see libXBMC_gui.h about related parts
180 */
181 PVR_ERROR OpenDialogChannelScan(void);
182
183 /*!
184 * @return The total amount of channels on the backend, or -1 on error.
185 * @remarks Valid implementation required.
186 */
187 int GetChannelsAmount(void);
188
189 /*!
190 * Request the list of all channels from the backend.
191 * Channel entries are added to XBMC by calling TransferChannelEntry() on the callback.
192 * @param handle Handle to pass to the callback method.
193 * @param bRadio True to get the radio channels, false to get the TV channels.
194 * @return PVR_ERROR_NO_ERROR if the list has been fetched successfully.
195 * @remarks If bSupportsTV is set to true, a valid result set needs to be provided for bRadio = false.
196 * If bSupportsRadio is set to true, a valid result set needs to be provided for bRadio = true.
197 * At least one of these two must provide a valid result set.
198 */
199 PVR_ERROR GetChannels(ADDON_HANDLE handle, bool bRadio);
200
201 /*!
202 * Delete a channel from the backend.
203 * @param channel The channel to delete.
204 * @return PVR_ERROR_NO_ERROR if the channel has been deleted successfully.
205 * @remarks Required if bSupportsChannelSettings is set to true.
206 */
207 PVR_ERROR DeleteChannel(const PVR_CHANNEL& channel);
208
209 /*!
210 * Rename a channel on the backend.
211 * @param channel The channel to rename, containing the new channel name.
212 * @return PVR_ERROR_NO_ERROR if the channel has been renamed successfully.
213 * @remarks Optional, and only used if bSupportsChannelSettings is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function.
214 */
215 PVR_ERROR RenameChannel(const PVR_CHANNEL& channel);
216
217 /*!
218 * Move a channel to another channel number on the backend.
219 * @param channel The channel to move, containing the new channel number.
220 * @return PVR_ERROR_NO_ERROR if the channel has been moved successfully.
221 * @remarks Optional, and only used if bSupportsChannelSettings is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function.
222 */
223 PVR_ERROR MoveChannel(const PVR_CHANNEL& channel);
224
225 /*!
226 * Show the channel settings dialog, if supported by the backend.
227 * @param channel The channel to show the dialog for.
228 * @return PVR_ERROR_NO_ERROR if the dialog has been displayed successfully.
229 * @remarks Required if bSupportsChannelSettings is set to true.
230 * @note see libXBMC_gui.h about related parts
231 */
232 PVR_ERROR OpenDialogChannelSettings(const PVR_CHANNEL& channel);
233
234 /*!
235 * Show the dialog to add a channel on the backend, if supported by the backend.
236 * @param channel The channel to add.
237 * @return PVR_ERROR_NO_ERROR if the channel has been added successfully.
238 * @remarks Required if bSupportsChannelSettings is set to true.
239 * @note see libXBMC_gui.h about related parts
240 */
241 PVR_ERROR OpenDialogChannelAdd(const PVR_CHANNEL& channel);
242 //@}
243
244 /** @name PVR recording methods
245 * @remarks Only used by XBMC is bSupportsRecordings is set to true.
246 * If a recording changes after the initial import, or if a new one was added,
247 * then the add-on should call TriggerRecordingUpdate()
248 */
249 //@{
250 /*!
251 * @return The total amount of recordings on the backend or -1 on error.
252 * @param deleted if set return deleted recording (called if bSupportsRecordingsUndelete set to true)
253 * @remarks Required if bSupportsRecordings is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function.
254 */
255 int GetRecordingsAmount(bool deleted);
256
257 /*!
258 * Request the list of all recordings from the backend, if supported.
259 * Recording entries are added to XBMC by calling TransferRecordingEntry() on the callback.
260 * @param handle Handle to pass to the callback method.
261 * @param deleted if set return deleted recording (called if bSupportsRecordingsUndelete set to true)
262 * @return PVR_ERROR_NO_ERROR if the recordings have been fetched successfully.
263 * @remarks Required if bSupportsRecordings is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function.
264 */
265 PVR_ERROR GetRecordings(ADDON_HANDLE handle, bool deleted);
266
267 /*!
268 * Delete a recording on the backend.
269 * @param recording The recording to delete.
270 * @return PVR_ERROR_NO_ERROR if the recording has been deleted successfully.
271 * @remarks Optional, and only used if bSupportsRecordings is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function.
272 */
273 PVR_ERROR DeleteRecording(const PVR_RECORDING& recording);
274
275 /*!
276 * Undelete a recording on the backend.
277 * @param recording The recording to undelete.
278 * @return PVR_ERROR_NO_ERROR if the recording has been undeleted successfully.
279 * @remarks Optional, and only used if bSupportsRecordingsUndelete is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function.
280 */
281 PVR_ERROR UndeleteRecording(const PVR_RECORDING& recording);
282
283 /*!
284 * @brief Delete all recordings permanent which in the deleted folder on the backend.
285 * @return PVR_ERROR_NO_ERROR if the recordings has been deleted successfully.
286 */
287 PVR_ERROR DeleteAllRecordingsFromTrash();
288
289 /*!
290 * Rename a recording on the backend.
291 * @param recording The recording to rename, containing the new name.
292 * @return PVR_ERROR_NO_ERROR if the recording has been renamed successfully.
293 * @remarks Optional, and only used if bSupportsRecordings is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function.
294 */
295 PVR_ERROR RenameRecording(const PVR_RECORDING& recording);
296
297 /*!
298 * Set the play count of a recording on the backend.
299 * @param recording The recording to change the play count.
300 * @param count Play count.
301 * @return PVR_ERROR_NO_ERROR if the recording's play count has been set successfully.
302 * @remarks Required if bSupportsRecordingPlayCount is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function.
303 */
304 PVR_ERROR SetRecordingPlayCount(const PVR_RECORDING& recording, int count);
305
306 /*!
307 * Set the last watched position of a recording on the backend.
308 * @param recording The recording.
309 * @param position The last watched position in seconds
310 * @return PVR_ERROR_NO_ERROR if the position has been stored successfully.
311 * @remarks Required if bSupportsLastPlayedPosition is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function.
312 */
313 PVR_ERROR SetRecordingLastPlayedPosition(const PVR_RECORDING& recording, int lastplayedposition);
314
315 /*!
316 * Retrieve the last watched position of a recording on the backend.
317 * @param recording The recording.
318 * @return The last watched position in seconds or -1 on error
319 * @remarks Required if bSupportsRecordingPlayCount is set to true. Return -1 if this add-on won't provide this function.
320 */
321 int GetRecordingLastPlayedPosition(const PVR_RECORDING& recording);
322
323 /*!
324 * Retrieve the edit decision list (EDL) of a recording on the backend.
325 * @param recording The recording.
326 * @param edl out: The function has to write the EDL list into this array.
327 * @param size in: The maximum size of the EDL, out: the actual size of the EDL.
328 * @return PVR_ERROR_NO_ERROR if the EDL was successfully read.
329 * @remarks Required if bSupportsRecordingEdl is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function.
330 */
331 PVR_ERROR GetRecordingEdl(const PVR_RECORDING&, PVR_EDL_ENTRY edl[], int *size);
332
333 //@}
334 /** @name PVR timer methods
335 * @remarks Only used by XBMC is bSupportsTimers is set to true.
336 * If a timer changes after the initial import, or if a new one was added,
337 * then the add-on should call TriggerTimerUpdate()
338 */
339 //@{
340 /*!
341 * @return The total amount of timers on the backend or -1 on error.
342 * @remarks Required if bSupportsTimers is set to true. Return -1 if this add-on won't provide this function.
343 */
344 int GetTimersAmount(void);
345
346 /*!
347 * Request the list of all timers from the backend if supported.
348 * Timer entries are added to XBMC by calling TransferTimerEntry() on the callback.
349 * @param handle Handle to pass to the callback method.
350 * @return PVR_ERROR_NO_ERROR if the list has been fetched successfully.
351 * @remarks Required if bSupportsTimers is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function.
352 */
353 PVR_ERROR GetTimers(ADDON_HANDLE handle);
354
355 /*!
356 * Add a timer on the backend.
357 * @param timer The timer to add.
358 * @return PVR_ERROR_NO_ERROR if the timer has been added successfully.
359 * @remarks Required if bSupportsTimers is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function.
360 */
361 PVR_ERROR AddTimer(const PVR_TIMER& timer);
362
363 /*!
364 * Delete a timer on the backend.
365 * @param timer The timer to delete.
366 * @param bForceDelete Set to true to delete a timer that is currently recording a program.
367 * @return PVR_ERROR_NO_ERROR if the timer has been deleted successfully.
368 * @remarks Required if bSupportsTimers is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function.
369 */
370 PVR_ERROR DeleteTimer(const PVR_TIMER& timer, bool bForceDelete);
371
372 /*!
373 * Update the timer information on the backend.
374 * @param timer The timer to update.
375 * @return PVR_ERROR_NO_ERROR if the timer has been updated successfully.
376 * @remarks Required if bSupportsTimers is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function.
377 */
378 PVR_ERROR UpdateTimer(const PVR_TIMER& timer);
379
380 //@}
381
382 /** @name PVR live stream methods, used to open and close a stream to a channel, and optionally perform read operations on the stream */
383 //@{
384 /*!
385 * Open a live stream on the backend.
386 * @param channel The channel to stream.
387 * @return True if the stream has been opened successfully, false otherwise.
388 * @remarks Required if bHandlesInputStream or bHandlesDemuxing is set to true. Return false if this add-on won't provide this function.
389 */
390 bool OpenLiveStream(const PVR_CHANNEL& channel);
391
392 /*!
393 * Close an open live stream.
394 * @remarks Required if bHandlesInputStream or bHandlesDemuxing is set to true.
395 */
396 void CloseLiveStream(void);
397
398 /*!
399 * Read from an open live stream.
400 * @param pBuffer The buffer to store the data in.
401 * @param iBufferSize The amount of bytes to read.
402 * @return The amount of bytes that were actually read from the stream.
403 * @remarks Required if bHandlesInputStream is set to true. Return -1 if this add-on won't provide this function.
404 */
405 int ReadLiveStream(unsigned char* pBuffer, unsigned int iBufferSize);
406
407 /*!
408 * Seek in a live stream on a backend that supports timeshifting.
409 * @param iPosition The position to seek to.
410 * @param iWhence ?
411 * @return The new position.
412 * @remarks Optional, and only used if bHandlesInputStream is set to true. Return -1 if this add-on won't provide this function.
413 */
414 long long SeekLiveStream(long long iPosition, int iWhence = SEEK_SET);
415
416 /*!
417 * @return The position in the stream that's currently being read.
418 * @remarks Optional, and only used if bHandlesInputStream is set to true. Return -1 if this add-on won't provide this function.
419 */
420 long long PositionLiveStream(void);
421
422 /*!
423 * @return The total length of the stream that's currently being read.
424 * @remarks Optional, and only used if bHandlesInputStream is set to true. Return -1 if this add-on won't provide this function.
425 */
426 long long LengthLiveStream(void);
427
428 /*!
429 * @return The channel number on the backend of the live stream that's currently being read.
430 * @remarks Required if bHandlesInputStream or bHandlesDemuxing is set to true. Return -1 if this add-on won't provide this function.
431 */
432 int GetCurrentClientChannel(void);
433
434 /*!
435 * Switch to another channel. Only to be called when a live stream has already been opened.
436 * @param channel The channel to switch to.
437 * @return True if the switch was successful, false otherwise.
438 * @remarks Required if bHandlesInputStream or bHandlesDemuxing is set to true. Return false if this add-on won't provide this function.
439 */
440 bool SwitchChannel(const PVR_CHANNEL& channel);
441
442 /*!
443 * Get the signal status of the stream that's currently open.
444 * @param signalStatus The signal status.
445 * @return True if the signal status has been read successfully, false otherwise.
446 * @remarks Optional, and only used if bHandlesInputStream or bHandlesDemuxing is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function.
447 */
448 PVR_ERROR SignalStatus(PVR_SIGNAL_STATUS& signalStatus);
449
450 /*!
451 * Get the stream URL for a channel from the backend. Used by the MediaPortal add-on.
452 * @param channel The channel to get the stream URL for.
453 * @return The requested URL.
454 * @remarks Optional, and only used if bHandlesInputStream is set to true. Return NULL if this add-on won't provide this function.
455 */
456 const char* GetLiveStreamURL(const PVR_CHANNEL& channel);
457
458 /*!
459 * Get the stream properties of the stream that's currently being read.
460 * @param pProperties The properties of the currently playing stream.
461 * @return PVR_ERROR_NO_ERROR if the properties have been fetched successfully.
462 * @remarks Required if bHandlesInputStream or bHandlesDemuxing is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function.
463 */
464 PVR_ERROR GetStreamProperties(PVR_STREAM_PROPERTIES* pProperties);
465 //@}
466
467 /** @name PVR recording stream methods, used to open and close a stream to a recording, and perform read operations on the stream.
468 * @remarks This will only be used if the backend doesn't provide a direct URL in the recording tag.
469 */
470 //@{
471 /*!
472 * Open a stream to a recording on the backend.
473 * @param recording The recording to open.
474 * @return True if the stream has been opened successfully, false otherwise.
475 * @remarks Optional, and only used if bSupportsRecordings is set to true. Return false if this add-on won't provide this function.
476 */
477 bool OpenRecordedStream(const PVR_RECORDING& recording);
478
479 /*!
480 * Close an open stream from a recording.
481 * @remarks Optional, and only used if bSupportsRecordings is set to true.
482 */
483 void CloseRecordedStream(void);
484
485 /*!
486 * Read from a recording.
487 * @param pBuffer The buffer to store the data in.
488 * @param iBufferSize The amount of bytes to read.
489 * @return The amount of bytes that were actually read from the stream.
490 * @remarks Optional, and only used if bSupportsRecordings is set to true, but required if OpenRecordedStream() is implemented. Return -1 if this add-on won't provide this function.
491 */
492 int ReadRecordedStream(unsigned char* pBuffer, unsigned int iBufferSize);
493
494 /*!
495 * Seek in a recorded stream.
496 * @param iPosition The position to seek to.
497 * @param iWhence ?
498 * @return The new position.
499 * @remarks Optional, and only used if bSupportsRecordings is set to true. Return -1 if this add-on won't provide this function.
500 */
501 long long SeekRecordedStream(long long iPosition, int iWhence = SEEK_SET);
502
503 /*!
504 * @return The position in the stream that's currently being read.
505 * @remarks Optional, and only used if bSupportsRecordings is set to true. Return -1 if this add-on won't provide this function.
506 */
507 long long PositionRecordedStream(void);
508
509 /*!
510 * @return The total length of the stream that's currently being read.
511 * @remarks Optional, and only used if bSupportsRecordings is set to true. Return -1 if this add-on won't provide this function.
512 */
513 long long LengthRecordedStream(void);
514 //@}
515
516 /** @name PVR demultiplexer methods
517 * @remarks Only used by XBMC is bHandlesDemuxing is set to true.
518 */
519 //@{
520 /*!
521 * Reset the demultiplexer in the add-on.
522 * @remarks Required if bHandlesDemuxing is set to true.
523 */
524 void DemuxReset(void);
525
526 /*!
527 * Abort the demultiplexer thread in the add-on.
528 * @remarks Required if bHandlesDemuxing is set to true.
529 */
530 void DemuxAbort(void);
531
532 /*!
533 * Flush all data that's currently in the demultiplexer buffer in the add-on.
534 * @remarks Required if bHandlesDemuxing is set to true.
535 */
536 void DemuxFlush(void);
537
538 /*!
539 * Read the next packet from the demultiplexer, if there is one.
540 * @return The next packet.
541 * If there is no next packet, then the add-on should return the
542 * packet created by calling AllocateDemuxPacket(0) on the callback.
543 * If the stream changed and XBMC's player needs to be reinitialised,
544 * then, the add-on should call AllocateDemuxPacket(0) on the
545 * callback, and set the streamid to DMX_SPECIALID_STREAMCHANGE and
546 * return the value.
547 * The add-on should return NULL if an error occured.
548 * @remarks Required if bHandlesDemuxing is set to true. Return NULL if this add-on won't provide this function.
549 */
550 DemuxPacket* DemuxRead(void);
551 //@}
552
553 /*!
554 * Delay to use when using switching channels for add-ons not providing an input stream.
555 * If the add-on does provide an input stream, then this method will not be called.
556 * Those add-ons can do that in OpenLiveStream() if needed.
557 * @return The delay in milliseconds.
558 */
559 unsigned int GetChannelSwitchDelay(void);
560
561 /*!
562 * Check if the backend support pausing the currently playing stream
563 * This will enable/disable the pause button in XBMC based on the return value
564 * @return false if the PVR addon/backend does not support pausing, true if possible
565 */
566 bool CanPauseStream();
567
568 /*!
569 * Check if the backend supports seeking for the currently playing stream
570 * This will enable/disable the rewind/forward buttons in XBMC based on the return value
571 * @return false if the PVR addon/backend does not support seeking, true if possible
572 */
573 bool CanSeekStream();
574
575 /*!
576 * @brief Notify the pvr addon that XBMC (un)paused the currently playing stream
577 */
578 void PauseStream(bool bPaused);
579
580 /*!
581 * Notify the pvr addon/demuxer that XBMC wishes to seek the stream by time
582 * @param time The absolute time since stream start
583 * @param backwards True to seek to keyframe BEFORE time, else AFTER
584 * @param startpts can be updated to point to where display should start
585 * @return True if the seek operation was possible
586 * @remarks Optional, and only used if addon has its own demuxer. Return False if this add-on won't provide this function.
587 */
588 bool SeekTime(int time, bool backwards, double *startpts);
589
590 /*!
591 * Notify the pvr addon/demuxer that XBMC wishes to change playback speed
592 * @param speed The requested playback speed
593 * @remarks Optional, and only used if addon has its own demuxer.
594 */
595 void SetSpeed(int speed);
596
597 /*!
598 * Get actual playing time from addon. With timeshift enabled this is
599 * different to live.
600 * @return time as UTC
601 */
602 time_t GetPlayingTime();
603
604 /*!
605 * Get time of oldest packet in timeshift buffer
606 * @return time as UTC
607 */
608 time_t GetBufferTimeStart();
609
610 /*!
611 * Get time of latest packet in timeshift buffer
612 * @return time as UTC
613 */
614 time_t GetBufferTimeEnd();
615
616 /*!
617 * Get the hostname of the pvr backend server
618 * @return hostname as ip address or alias. If backend does not
619 * utilize a server, return empty string.
620 */
621 const char* GetBackendHostname();
622
623 /*!
624 * Called by XBMC to assign the function pointers of this add-on to pClient.
625 * @param pClient The struct to assign the function pointers to.
626 */
627 void __declspec(dllexport) get_addon(struct PVRClient* pClient)
628 {
629 pClient->GetPVRAPIVersion = GetPVRAPIVersion;
630 pClient->GetMininumPVRAPIVersion = GetMininumPVRAPIVersion;
631 pClient->GetGUIAPIVersion = GetGUIAPIVersion;
632 pClient->GetMininumGUIAPIVersion = GetMininumGUIAPIVersion;
633 pClient->GetAddonCapabilities = GetAddonCapabilities;
634 pClient->GetStreamProperties = GetStreamProperties;
635 pClient->GetConnectionString = GetConnectionString;
636 pClient->GetBackendName = GetBackendName;
637 pClient->GetBackendVersion = GetBackendVersion;
638 pClient->GetDriveSpace = GetDriveSpace;
639 pClient->OpenDialogChannelScan = OpenDialogChannelScan;
640 pClient->MenuHook = CallMenuHook;
641
642 pClient->GetEpg = GetEPGForChannel;
643
644 pClient->GetChannelGroupsAmount = GetChannelGroupsAmount;
645 pClient->GetChannelGroups = GetChannelGroups;
646 pClient->GetChannelGroupMembers = GetChannelGroupMembers;
647
648 pClient->GetChannelsAmount = GetChannelsAmount;
649 pClient->GetChannels = GetChannels;
650 pClient->DeleteChannel = DeleteChannel;
651 pClient->RenameChannel = RenameChannel;
652 pClient->MoveChannel = MoveChannel;
653 pClient->OpenDialogChannelSettings = OpenDialogChannelSettings;
654 pClient->OpenDialogChannelAdd = OpenDialogChannelAdd;
655
656 pClient->GetRecordingsAmount = GetRecordingsAmount;
657 pClient->GetRecordings = GetRecordings;
658 pClient->DeleteRecording = DeleteRecording;
659 pClient->UndeleteRecording = UndeleteRecording;
660 pClient->DeleteAllRecordingsFromTrash = DeleteAllRecordingsFromTrash;
661 pClient->RenameRecording = RenameRecording;
662 pClient->SetRecordingPlayCount = SetRecordingPlayCount;
663 pClient->SetRecordingLastPlayedPosition = SetRecordingLastPlayedPosition;
664 pClient->GetRecordingLastPlayedPosition = GetRecordingLastPlayedPosition;
665 pClient->GetRecordingEdl = GetRecordingEdl;
666
667 pClient->GetTimersAmount = GetTimersAmount;
668 pClient->GetTimers = GetTimers;
669 pClient->AddTimer = AddTimer;
670 pClient->DeleteTimer = DeleteTimer;
671 pClient->UpdateTimer = UpdateTimer;
672
673 pClient->OpenLiveStream = OpenLiveStream;
674 pClient->CloseLiveStream = CloseLiveStream;
675 pClient->ReadLiveStream = ReadLiveStream;
676 pClient->SeekLiveStream = SeekLiveStream;
677 pClient->PositionLiveStream = PositionLiveStream;
678 pClient->LengthLiveStream = LengthLiveStream;
679 pClient->GetCurrentClientChannel = GetCurrentClientChannel;
680 pClient->SwitchChannel = SwitchChannel;
681 pClient->SignalStatus = SignalStatus;
682 pClient->GetLiveStreamURL = GetLiveStreamURL;
683 pClient->GetChannelSwitchDelay = GetChannelSwitchDelay;
684 pClient->CanPauseStream = CanPauseStream;
685 pClient->PauseStream = PauseStream;
686 pClient->CanSeekStream = CanSeekStream;
687 pClient->SeekTime = SeekTime;
688 pClient->SetSpeed = SetSpeed;
689
690 pClient->OpenRecordedStream = OpenRecordedStream;
691 pClient->CloseRecordedStream = CloseRecordedStream;
692 pClient->ReadRecordedStream = ReadRecordedStream;
693 pClient->SeekRecordedStream = SeekRecordedStream;
694 pClient->PositionRecordedStream = PositionRecordedStream;
695 pClient->LengthRecordedStream = LengthRecordedStream;
696
697 pClient->DemuxReset = DemuxReset;
698 pClient->DemuxAbort = DemuxAbort;
699 pClient->DemuxFlush = DemuxFlush;
700 pClient->DemuxRead = DemuxRead;
701
702 pClient->GetPlayingTime = GetPlayingTime;
703 pClient->GetBufferTimeStart = GetBufferTimeStart;
704 pClient->GetBufferTimeEnd = GetBufferTimeEnd;
705
706 pClient->GetBackendHostname = GetBackendHostname;
707 };
708};
709
710#endif