xbmc
PVRClient.h
1 /*
2  * Copyright (C) 2012-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 "addons/binary-addons/AddonInstanceHandler.h"
12 #include "addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr.h"
13 #include "pvr/addons/PVRClientCapabilities.h"
14 #include "threads/Event.h"
15 
16 #include <atomic>
17 #include <functional>
18 #include <memory>
19 #include <string>
20 #include <utility>
21 #include <vector>
22 
23 struct DemuxPacket;
24 
25 namespace PVR
26 {
27 class CPVRChannel;
28 class CPVRChannelGroup;
29 class CPVRChannelGroupMember;
30 class CPVRChannelGroups;
31 class CPVRProvider;
32 class CPVRProvidersContainer;
33 class CPVRClientMenuHook;
34 class CPVRClientMenuHooks;
35 class CPVREpg;
36 class CPVREpgInfoTag;
37 class CPVRRecording;
38 class CPVRRecordings;
39 class CPVRStreamProperties;
40 class CPVRTimerInfoTag;
41 class CPVRTimerType;
42 class CPVRTimersContainer;
43 
44 #define PVR_INVALID_CLIENT_ID (-2)
45 
52 {
53 public:
54  CPVRClient(const ADDON::AddonInfoPtr& addonInfo, ADDON::AddonInstanceId instanceId, int clientId);
55  ~CPVRClient() override;
56 
57  void OnPreInstall() override;
58  void OnPreUnInstall() override;
59 
62 
67 
71  void Stop();
72 
76  void Continue();
77 
81  void Destroy();
82 
86  void ReCreate();
87 
91  bool ReadyToUse() const;
92 
98 
104 
110 
115  bool IgnoreClient() const;
116 
121  bool IsEnabled() const;
122 
126  int GetID() const;
127 
129 
131 
136  const CPVRClientCapabilities& GetClientCapabilities() const { return m_clientCapabilities; }
137 
144 
148  const std::string& GetBackendName() const;
149 
153  const std::string& GetBackendVersion() const;
154 
158  const std::string& GetBackendHostname() const;
159 
163  const std::string& GetConnectionString() const;
164 
169  const std::string GetFriendlyName() const;
170 
177  PVR_ERROR GetDriveSpace(uint64_t& iTotal, uint64_t& iUsed);
178 
184 
190  PVR_ERROR OpenDialogChannelAdd(const std::shared_ptr<CPVRChannel>& channel);
191 
197  PVR_ERROR OpenDialogChannelSettings(const std::shared_ptr<CPVRChannel>& channel);
198 
204  PVR_ERROR DeleteChannel(const std::shared_ptr<CPVRChannel>& channel);
205 
211  PVR_ERROR RenameChannel(const std::shared_ptr<CPVRChannel>& channel);
212 
213  /*
214  * @brief Check if an epg tag can be recorded
215  * @param tag The epg tag
216  * @param bIsRecordable Set to true if the tag can be recorded
217  * @return PVR_ERROR_NO_ERROR if bIsRecordable has been set successfully.
218  */
219  PVR_ERROR IsRecordable(const std::shared_ptr<const CPVREpgInfoTag>& tag,
220  bool& bIsRecordable) const;
221 
222  /*
223  * @brief Check if an epg tag can be played
224  * @param tag The epg tag
225  * @param bIsPlayable Set to true if the tag can be played
226  * @return PVR_ERROR_NO_ERROR if bIsPlayable has been set successfully.
227  */
228  PVR_ERROR IsPlayable(const std::shared_ptr<const CPVREpgInfoTag>& tag, bool& bIsPlayable) const;
229 
238  PVR_ERROR GetEpgTagStreamProperties(const std::shared_ptr<CPVREpgInfoTag>& tag,
239  CPVRStreamProperties& props);
240 
242 
244 
253  PVR_ERROR GetEPGForChannel(int iChannelUid, CPVREpg* epg, time_t start, time_t end);
254 
269  PVR_ERROR SetEPGMaxPastDays(int iPastDays);
270 
285  PVR_ERROR SetEPGMaxFutureDays(int iFutureDays);
286 
288 
290 
296  PVR_ERROR GetChannelGroupsAmount(int& iGroups);
297 
304 
312  CPVRChannelGroup* group, std::vector<std::shared_ptr<CPVRChannelGroupMember>>& groupMembers);
313 
315 
317 
323  PVR_ERROR GetChannelsAmount(int& iChannels);
324 
331  PVR_ERROR GetChannels(bool bRadio, std::vector<std::shared_ptr<CPVRChannel>>& channels);
332 
338  PVR_ERROR GetProvidersAmount(int& iProviders);
339 
346 
348 
350 
357  PVR_ERROR GetRecordingsAmount(bool deleted, int& iRecordings);
358 
365  PVR_ERROR GetRecordings(CPVRRecordings* results, bool deleted);
366 
372  PVR_ERROR DeleteRecording(const CPVRRecording& recording);
373 
379  PVR_ERROR UndeleteRecording(const CPVRRecording& recording);
380 
386 
392  PVR_ERROR RenameRecording(const CPVRRecording& recording);
393 
399  PVR_ERROR SetRecordingLifetime(const CPVRRecording& recording);
400 
407  PVR_ERROR SetRecordingPlayCount(const CPVRRecording& recording, int count);
408 
415  PVR_ERROR SetRecordingLastPlayedPosition(const CPVRRecording& recording, int lastplayedposition);
416 
423  PVR_ERROR GetRecordingLastPlayedPosition(const CPVRRecording& recording, int& iPosition);
424 
431  PVR_ERROR GetRecordingEdl(const CPVRRecording& recording, std::vector<PVR_EDL_ENTRY>& edls);
432 
439  PVR_ERROR GetRecordingSize(const CPVRRecording& recording, int64_t& sizeInBytes);
440 
447  PVR_ERROR GetEpgTagEdl(const std::shared_ptr<const CPVREpgInfoTag>& epgTag,
448  std::vector<PVR_EDL_ENTRY>& edls);
449 
451 
453 
459  PVR_ERROR GetTimersAmount(int& iTimers);
460 
467 
473  PVR_ERROR AddTimer(const CPVRTimerInfoTag& timer);
474 
481  PVR_ERROR DeleteTimer(const CPVRTimerInfoTag& timer, bool bForce = false);
482 
488  PVR_ERROR UpdateTimer(const CPVRTimerInfoTag& timer);
489 
495  PVR_ERROR GetTimerTypes(std::vector<std::shared_ptr<CPVRTimerType>>& results) const;
496 
498 
500 
506  PVR_ERROR OpenLiveStream(const std::shared_ptr<CPVRChannel>& channel);
507 
513 
521  PVR_ERROR ReadLiveStream(void* lpBuf, int64_t uiBufSize, int& iRead);
522 
530  PVR_ERROR SeekLiveStream(int64_t iFilePosition, int iWhence, int64_t& iPosition);
531 
537  PVR_ERROR GetLiveStreamLength(int64_t& iLength);
538 
544  PVR_ERROR PauseStream(bool bPaused);
545 
552  PVR_ERROR SignalQuality(int channelUid, PVR_SIGNAL_STATUS& qualityinfo);
553 
560  PVR_ERROR GetDescrambleInfo(int channelUid, PVR_DESCRAMBLE_INFO& descrambleinfo) const;
561 
568  PVR_ERROR GetChannelStreamProperties(const std::shared_ptr<CPVRChannel>& channel,
569  CPVRStreamProperties& props);
570 
576  PVR_ERROR CanPauseStream(bool& bCanPause) const;
577 
583  PVR_ERROR CanSeekStream(bool& bCanSeek) const;
584 
593  PVR_ERROR SeekTime(double time, bool backwards, double* startpts);
594 
601  PVR_ERROR SetSpeed(int speed);
602 
609  PVR_ERROR FillBuffer(bool mode);
610 
612 
614 
620  PVR_ERROR OpenRecordedStream(const std::shared_ptr<CPVRRecording>& recording);
621 
627 
635  PVR_ERROR ReadRecordedStream(void* lpBuf, int64_t uiBufSize, int& iRead);
636 
644  PVR_ERROR SeekRecordedStream(int64_t iFilePosition, int iWhence, int64_t& iPosition);
645 
651  PVR_ERROR GetRecordedStreamLength(int64_t& iLength);
652 
659  PVR_ERROR GetRecordingStreamProperties(const std::shared_ptr<CPVRRecording>& recording,
660  CPVRStreamProperties& props);
661 
663 
665 
671 
677 
683 
689  PVR_ERROR DemuxRead(DemuxPacket*& packet);
690 
691  static const char* ToString(const PVR_ERROR error);
692 
698  PVR_ERROR IsRealTimeStream(bool& bRealTime) const;
699 
706 
711  std::shared_ptr<CPVRClientMenuHooks> GetMenuHooks();
712 
720  const std::shared_ptr<CPVREpgInfoTag>& tag);
721 
729  const std::shared_ptr<CPVRChannel>& channel);
730 
739  const std::shared_ptr<CPVRRecording>& recording,
740  bool bDeleted);
741 
749  const std::shared_ptr<CPVRTimerInfoTag>& timer);
750 
757 
763  PVR_ERROR OnSystemWake();
764  PVR_ERROR OnPowerSavingActivated();
765  PVR_ERROR OnPowerSavingDeactivated();
766 
771  int GetPriority() const;
772 
777  void SetPriority(int iPriority);
778 
784  PVR_ERROR GetStreamReadChunkSize(int& iChunkSize);
785 
790  AddonInstance_PVR* GetInstanceInterface() { return m_ifc.pvr; }
791 
792 private:
796  void ResetProperties();
797 
802  bool GetAddonProperties();
803 
808  bool GetAddonNameStringProperties();
809 
816  static void WriteStreamProperties(const PVR_NAMED_VALUE* properties,
817  unsigned int iPropertyCount,
818  CPVRStreamProperties& props);
819 
825  bool CanPlayChannel(const std::shared_ptr<CPVRChannel>& channel) const;
826 
830  void StopRunningInstance();
831 
841  PVR_ERROR DoAddonCall(const char* strFunctionName,
842  const std::function<PVR_ERROR(const AddonInstance*)>& function,
843  bool bIsImplemented = true,
844  bool bCheckReadyToUse = true) const;
845 
853  static void HandleAddonCallback(const char* strFunctionName,
854  void* kodiInstance,
855  const std::function<void(CPVRClient* client)>& function,
856  bool bForceCall = false);
857 
862 
869  static void cb_transfer_channel_group(void* kodiInstance,
870  const PVR_HANDLE handle,
871  const PVR_CHANNEL_GROUP* entry);
872 
879  static void cb_transfer_channel_group_member(void* kodiInstance,
880  const PVR_HANDLE handle,
881  const PVR_CHANNEL_GROUP_MEMBER* entry);
882 
889  static void cb_transfer_epg_entry(void* kodiInstance,
890  const PVR_HANDLE handle,
891  const EPG_TAG* entry);
892 
899  static void cb_transfer_channel_entry(void* kodiInstance,
900  const PVR_HANDLE handle,
901  const PVR_CHANNEL* entry);
902 
909  static void cb_transfer_provider_entry(void* kodiInstance,
910  const PVR_HANDLE handle,
911  const PVR_PROVIDER* entry);
912 
919  static void cb_transfer_timer_entry(void* kodiInstance,
920  const PVR_HANDLE handle,
921  const PVR_TIMER* entry);
922 
929  static void cb_transfer_recording_entry(void* kodiInstance,
930  const PVR_HANDLE handle,
931  const PVR_RECORDING* entry);
932 
938  static void cb_add_menu_hook(void* kodiInstance, const PVR_MENUHOOK* hook);
939 
947  static void cb_recording_notification(void* kodiInstance,
948  const char* strName,
949  const char* strFileName,
950  bool bOnOff);
951 
956  static void cb_trigger_channel_update(void* kodiInstance);
957 
962  static void cb_trigger_provider_update(void* kodiInstance);
963 
968  static void cb_trigger_timer_update(void* kodiInstance);
969 
974  static void cb_trigger_recording_update(void* kodiInstance);
975 
980  static void cb_trigger_channel_groups_update(void* kodiInstance);
981 
987  static void cb_trigger_epg_update(void* kodiInstance, unsigned int iChannelUid);
988 
994  static void cb_free_demux_packet(void* kodiInstance, DEMUX_PACKET* pPacket);
995 
1002  static DEMUX_PACKET* cb_allocate_demux_packet(void* kodiInstance, int iDataSize = 0);
1003 
1012  static void cb_connection_state_change(void* kodiInstance,
1013  const char* strConnectionString,
1014  PVR_CONNECTION_STATE newState,
1015  const char* strMessage);
1016 
1025  static void cb_epg_event_state_change(void* kodiInstance, EPG_TAG* tag, EPG_EVENT_STATE newState);
1026 
1030  static PVR_CODEC cb_get_codec_by_name(const void* kodiInstance, const char* strCodecName);
1032 
1033  const int m_iClientId;
1034  std::atomic<bool>
1035  m_bReadyToUse;
1036  std::atomic<bool> m_bBlockAddonCalls;
1037  mutable std::atomic<int> m_iAddonCalls;
1038  mutable CEvent m_allAddonCallsFinished;
1039  PVR_CONNECTION_STATE m_connectionState;
1040  PVR_CONNECTION_STATE m_prevConnectionState;
1041  bool
1042  m_ignoreClient;
1043  std::vector<std::shared_ptr<CPVRTimerType>>
1044  m_timertypes;
1045  mutable int m_iPriority;
1046  mutable bool m_bPriorityFetched;
1047 
1048  /* cached data */
1049  std::string m_strBackendName;
1050  std::string m_strBackendVersion;
1051  std::string m_strConnectionString;
1052  std::string m_strBackendHostname;
1053  CPVRClientCapabilities m_clientCapabilities;
1054  std::shared_ptr<CPVRClientMenuHooks> m_menuhooks;
1056  /* stored strings to make sure const char* members in AddonProperties_PVR stay valid */
1057  std::string m_strUserPath;
1058  std::string m_strClientPath;
1060  mutable CCriticalSection m_critSection;
1061 };
1062 } // namespace PVR
PVR_ERROR GetTimersAmount(int &iTimers)
Get the total amount of timers from the backend.
Definition: PVRClient.cpp:1015
This is an Event class built from a ConditionVariable.
Definition: Event.h:35
PVR_ERROR SeekTime(double time, bool backwards, double *startpts)
Notify the pvr addon/demuxer that Kodi wishes to seek the stream by time.
Definition: PVRClient.cpp:1129
std::shared_ptr< CPVRClientMenuHooks > GetMenuHooks()
Get the client&#39;s menu hooks.
Definition: PVRClient.cpp:1494
PVR_ERROR CallSettingsMenuHook(const CPVRClientMenuHook &hook)
Call one of the settings menu hooks of the client.
Definition: PVRClient.cpp:1566
PVR_ERROR GetChannelGroups(CPVRChannelGroups *groups)
Request the list of all channel groups from the backend.
Definition: PVRClient.cpp:789
PVR_ERROR SetEPGMaxFutureDays(int iFutureDays)
Tell the client the future time frame to use when notifying epg events back to Kodi.
Definition: PVRClient.cpp:611
bool ReadyToUse() const
Definition: PVRClient.cpp:226
PVR_ERROR CallTimerMenuHook(const CPVRClientMenuHook &hook, const std::shared_ptr< CPVRTimerInfoTag > &timer)
Call one of the timer menu hooks of the client.
Definition: PVRClient.cpp:1550
PVR_ERROR CallEpgTagMenuHook(const CPVRClientMenuHook &hook, const std::shared_ptr< CPVREpgInfoTag > &tag)
Call one of the EPG tag menu hooks of the client.
Definition: PVRClient.cpp:1502
Definition: PVRRecordings.h:28
PVR_ERROR
Definition: pvr_general.h:34
PVR_ERROR RenameRecording(const CPVRRecording &recording)
Rename a recording on the backend.
Definition: PVRClient.cpp:917
Definition: pvr.h:332
PVR_ERROR SetSpeed(int speed)
Notify the pvr addon/demuxer that Kodi wishes to change playback speed.
Definition: PVRClient.cpp:1418
void Destroy()
Destroy the instance of this add-on.
Definition: PVRClient.cpp:187
PVR_ERROR GetRecordedStreamLength(int64_t &iLength)
Get the length of the currently playing recording stream, if any.
Definition: PVRClient.cpp:1146
PVR_ERROR GetRecordingEdl(const CPVRRecording &recording, std::vector< PVR_EDL_ENTRY > &edls)
Retrieve the edit decision list (EDL) from the backend.
Definition: PVRClient.cpp:979
Definition: PVRStreamProperties.h:18
PVR_ERROR GetDriveSpace(uint64_t &iTotal, uint64_t &iUsed)
Get the disk space reported by the server.
Definition: PVRClient.cpp:505
"C" PVR add-on descramble information.
Definition: pvr_channels.h:91
"C" PVR add-on channel group member.
Definition: pvr_channel_groups.h:44
"C" PVR add-on recording.
Definition: pvr_recordings.h:109
Definition: ContextMenuManager.h:24
PVR_ERROR RenameChannel(const std::shared_ptr< CPVRChannel > &channel)
Request the client to rename given channel.
Definition: PVRClient.cpp:568
"C" PVR add-on channel group member.
Definition: pvr_epg.h:622
"C" PVR add-on channel.
Definition: pvr_channels.h:40
PVR_ERROR CanSeekStream(bool &bCanSeek) const
Check whether PVR backend supports seeking for the currently playing stream.
Definition: PVRClient.cpp:1443
PVR_ERROR OpenRecordedStream(const std::shared_ptr< CPVRRecording > &recording)
Open a recording on the server.
Definition: PVRClient.cpp:1375
void SetPriority(int iPriority)
Set a new priority for this client.
Definition: PVRClient.cpp:1578
PVR_ERROR SignalQuality(int channelUid, PVR_SIGNAL_STATUS &qualityinfo)
Get the signal quality of the stream that&#39;s currently open.
Definition: PVRClient.cpp:1155
PVR_ERROR SeekRecordedStream(int64_t iFilePosition, int iWhence, int64_t &iPosition)
Seek in a recording stream on a backend.
Definition: PVRClient.cpp:1120
PVR_ERROR DemuxFlush()
Flush all data that&#39;s currently in the demultiplexer buffer in the add-on.
Definition: PVRClient.cpp:1247
const std::string & GetBackendHostname() const
the ip address or alias of the pvr backend server
Definition: PVRClient.cpp:482
PVR_ERROR GetStreamReadChunkSize(int &iChunkSize)
Obtain the chunk size to use when reading streams.
Definition: PVRClient.cpp:1081
PVR_ERROR UpdateTimer(const CPVRTimerInfoTag &timer)
Update the timer information on the server.
Definition: PVRClient.cpp:1062
AddonInstance_PVR * GetInstanceInterface()
Get the interface table used between addon and Kodi.
Definition: PVRClient.h:790
PVR_ERROR DemuxAbort()
Abort the demultiplexer thread in the add-on.
Definition: PVRClient.cpp:1236
A container class for channel groups.
Definition: PVRChannelGroups.h:26
PVR_ERROR OnSystemSleep()
Propagate power management events to this add-on.
Definition: PVRClient.cpp:1468
PVR_ERROR DemuxReset()
Reset the demultiplexer in the add-on.
Definition: PVRClient.cpp:1225
PVR_CONNECTION_STATE
Definition: pvr_general.h:81
PVR_ERROR AddTimer(const CPVRTimerInfoTag &timer)
Add a timer on the backend.
Definition: PVRClient.cpp:1038
void Continue()
Continue this add-on instance. Client add-on access is okay again after this call.
Definition: PVRClient.cpp:215
PVR_ERROR OpenDialogChannelSettings(const std::shared_ptr< CPVRChannel > &channel)
Request the client to open dialog about given channel settings.
Definition: PVRClient.cpp:544
PVR_ERROR GetChannelGroupMembers(CPVRChannelGroup *group, std::vector< std::shared_ptr< CPVRChannelGroupMember >> &groupMembers)
Request the list of all group members from the backend.
Definition: PVRClient.cpp:801
void SetConnectionState(PVR_CONNECTION_STATE state)
Sets the backend connection state.
Definition: PVRClient.cpp:237
PVR_CONNECTION_STATE GetConnectionState() const
Gets the backend connection state.
Definition: PVRClient.cpp:231
PVR_ERROR DeleteAllRecordingsFromTrash()
Delete all recordings permanent which in the deleted folder on the backend.
Definition: PVRClient.cpp:907
Definition: AddonInstanceHandler.h:33
void Stop()
Stop this add-on instance. No more client add-on access after this call.
Definition: PVRClient.cpp:209
const std::string & GetBackendVersion() const
Definition: PVRClient.cpp:477
Definition: PVRClientCapabilities.h:21
PVR_ERROR ReadRecordedStream(void *lpBuf, int64_t uiBufSize, int &iRead)
Read from an open recording stream.
Definition: PVRClient.cpp:1101
"C" Times of playing stream (Live TV and recordings)
Definition: pvr_stream.h:144
const std::string & GetConnectionString() const
Definition: PVRClient.cpp:487
PVR_ERROR SetRecordingLifetime(const CPVRRecording &recording)
Set the lifetime of a recording on the backend.
Definition: PVRClient.cpp:929
PVR_ERROR PauseStream(bool bPaused)
(Un)Pause a stream.
Definition: PVRClient.cpp:1410
PVR_ERROR GetChannelGroupsAmount(int &iGroups)
Get the total amount of channel groups from the backend.
Definition: PVRClient.cpp:778
PVR_ERROR UndeleteRecording(const CPVRRecording &recording)
Undelete a recording on the backend.
Definition: PVRClient.cpp:895
ADDON_STATUS Create()
Initialise the instance of this add-on.
Definition: PVRClient.cpp:167
"C" Representation of a named value.
Definition: pvr_defines.h:56
PVR_ERROR IsRealTimeStream(bool &bRealTime) const
Check whether the currently playing stream, if any, is a real-time stream.
Definition: PVRClient.cpp:1459
Definition: PVRTimerInfoTag.h:33
"C" PVR add-on signal status information.
Definition: pvr_channels.h:63
ADDON_STATUS
Definition: addon_base.h:137
PVR_ERROR SetRecordingLastPlayedPosition(const CPVRRecording &recording, int lastplayedposition)
Set the last watched position of a recording on the backend.
Definition: PVRClient.cpp:953
PVR_ERROR GetChannels(bool bRadio, std::vector< std::shared_ptr< CPVRChannel >> &channels)
Request the list of all channels from the backend.
Definition: PVRClient.cpp:845
PVR_ERROR SetEPGMaxPastDays(int iPastDays)
Tell the client the past time frame to use when notifying epg events back to Kodi.
Definition: PVRClient.cpp:601
PVR_ERROR GetRecordingLastPlayedPosition(const CPVRRecording &recording, int &iPosition)
Retrieve the last watched position of a recording on the backend.
Definition: PVRClient.cpp:966
PVR_ERROR GetEPGForChannel(int iChannelUid, CPVREpg *epg, time_t start, time_t end)
Request an EPG table for a channel from the client.
Definition: PVRClient.cpp:582
PVR_ERROR GetProvidersAmount(int &iProviders)
Get the total amount of providers from the backend.
Definition: PVRClient.cpp:817
PVR_ERROR GetRecordingStreamProperties(const std::shared_ptr< CPVRRecording > &recording, CPVRStreamProperties &props)
Fill the given container with the properties required for playback of the given recording. Values are obtained from the PVR backend.
Definition: PVRClient.cpp:1195
PVR_ERROR GetProviders(CPVRProvidersContainer &providers)
Request the list of all providers from the backend.
Definition: PVRClient.cpp:825
int GetPriority() const
Get the priority of this client. Larger value means higher priority.
Definition: PVRClient.cpp:1592
PVR_ERROR GetChannelStreamProperties(const std::shared_ptr< CPVRChannel > &channel, CPVRStreamProperties &props)
Fill the given container with the properties required for playback of the given channel. Values are obtained from the PVR backend.
Definition: PVRClient.cpp:1172
PVR_ERROR GetTimerTypes(std::vector< std::shared_ptr< CPVRTimerType >> &results) const
Get all timer types supported by the backend.
Definition: PVRClient.cpp:1074
Definition: PVRRecording.h:52
Definition: SmartPlayList.cpp:137
Definition: demux_packet.h:45
PVR_ERROR GetChannelsAmount(int &iChannels)
Get the total amount of channels from the backend.
Definition: PVRClient.cpp:837
"C" PVR add-on channel group.
Definition: pvr_channel_groups.h:30
PVR_ERROR DemuxRead(DemuxPacket *&packet)
Read a packet from the demultiplexer.
Definition: PVRClient.cpp:1258
PVR_ERROR GetStreamProperties(PVR_STREAM_PROPERTIES *pProperties)
Get the stream properties of the stream that&#39;s currently being read.
Definition: PVRClient.cpp:1218
"C" Stream properties
Definition: pvr_stream.h:114
PVR_ERROR SeekLiveStream(int64_t iFilePosition, int iWhence, int64_t &iPosition)
Seek in a live stream on a backend.
Definition: PVRClient.cpp:1111
PVR_ERROR CanPauseStream(bool &bCanPause) const
Check whether PVR backend supports pausing the currently playing stream.
Definition: PVRClient.cpp:1434
const std::string & GetBackendName() const
Definition: PVRClient.cpp:472
"C" PVR add-on timer event.
Definition: pvr_timers.h:339
PVR_ERROR CallRecordingMenuHook(const CPVRClientMenuHook &hook, const std::shared_ptr< CPVRRecording > &recording, bool bDeleted)
Call one of the recording menu hooks of the client.
Definition: PVRClient.cpp:1533
const std::string GetFriendlyName() const
A friendly name used to uniquely identify the addon instance.
Definition: PVRClient.cpp:492
PVR_ERROR OpenLiveStream(const std::shared_ptr< CPVRChannel > &channel)
Open a live stream on the server.
Definition: PVRClient.cpp:1350
PVR_CONNECTION_STATE GetPreviousConnectionState() const
Gets the backend&#39;s previous connection state.
Definition: PVRClient.cpp:263
Definition: DemuxPacket.h:22
PVR_ERROR GetRecordingsAmount(bool deleted, int &iRecordings)
Get the total amount of recordings from the backend.
Definition: PVRClient.cpp:858
PVR_ERROR GetRecordingSize(const CPVRRecording &recording, int64_t &sizeInBytes)
Retrieve the size of a recording on the backend.
Definition: PVRClient.cpp:1003
"C" PVR add-on provider.
Definition: pvr_providers.h:79
PVR_ERROR DeleteRecording(const CPVRRecording &recording)
Delete a recording on the backend.
Definition: PVRClient.cpp:883
Definition: Epg.h:31
const CPVRClientCapabilities & GetClientCapabilities() const
Query this add-on&#39;s capabilities.
Definition: PVRClient.h:136
Definition: pvr_stream.h:96
PVR_ERROR OpenDialogChannelAdd(const std::shared_ptr< CPVRChannel > &channel)
Request the client to open dialog about given channel to add.
Definition: PVRClient.cpp:532
Definition: PVRProviders.h:23
PVR_ERROR ReadLiveStream(void *lpBuf, int64_t uiBufSize, int &iRead)
Read from an open live stream.
Definition: PVRClient.cpp:1091
bool IsEnabled() const
Check whether this client is enabled, according to its instance/add-on configuration.
Definition: PVRClient.cpp:275
PVR_ERROR DeleteChannel(const std::shared_ptr< CPVRChannel > &channel)
Request the client to delete given channel.
Definition: PVRClient.cpp:556
PVR_ERROR CallChannelMenuHook(const CPVRClientMenuHook &hook, const std::shared_ptr< CPVRChannel > &channel)
Call one of the channel menu hooks of the client.
Definition: PVRClient.cpp:1517
EPG_EVENT_STATE
Definition: pvr_epg.h:601
void ReCreate()
Destroy and recreate this add-on.
Definition: PVRClient.cpp:220
PVR_ERROR GetTimers(CPVRTimersContainer *results)
Request the list of all timers from the backend.
Definition: PVRClient.cpp:1026
Definition: PVRTimers.h:32
"C" PVR add-on menu hook.
Definition: pvr_menu_hook.h:64
Handle used to return data from the PVR add-on to CPVRClient.
Definition: pvr_defines.h:65
PVR_ERROR CloseRecordedStream()
Close an open recording stream.
Definition: PVRClient.cpp:1402
int GetID() const
Definition: PVRClient.cpp:290
Definition: PVRChannelGroup.h:46
PVR_ERROR FillBuffer(bool mode)
Notify the pvr addon/demuxer that Kodi wishes to fill demux queue.
Definition: PVRClient.cpp:1426
Definition: PVRClientMenuHooks.h:20
Definition: PVRClient.h:51
PVR_ERROR CloseLiveStream()
Close an open live stream.
Definition: PVRClient.cpp:1394
bool IgnoreClient() const
Check whether this client should be ignored.
Definition: PVRClient.cpp:269
PVR_ERROR StartChannelScan()
Start a channel scan on the server.
Definition: PVRClient.cpp:524
PVR_ERROR GetRecordings(CPVRRecordings *results, bool deleted)
Request the list of all recordings from the backend.
Definition: PVRClient.cpp:870
PVR_ERROR DeleteTimer(const CPVRTimerInfoTag &timer, bool bForce=false)
Delete a timer on the backend.
Definition: PVRClient.cpp:1050
PVR_ERROR GetStreamTimes(PVR_STREAM_TIMES *times)
Get Stream times for the currently playing stream, if any (will be moved to inputstream).
Definition: PVRClient.cpp:1452
PVR_ERROR GetDescrambleInfo(int channelUid, PVR_DESCRAMBLE_INFO &descrambleinfo) const
Get the descramble information of the stream that&#39;s currently open.
Definition: PVRClient.cpp:1162
PVR_ERROR GetEpgTagEdl(const std::shared_ptr< const CPVREpgInfoTag > &epgTag, std::vector< PVR_EDL_ENTRY > &edls)
Retrieve the edit decision list (EDL) from the backend.
Definition: PVRClient.cpp:755
PVR_ERROR GetLiveStreamLength(int64_t &iLength)
Get the length of the currently playing live stream, if any.
Definition: PVRClient.cpp:1137
PVR_ERROR SetRecordingPlayCount(const CPVRRecording &recording, int count)
Set the play count of a recording on the backend.
Definition: PVRClient.cpp:941
PVR_ERROR GetEpgTagStreamProperties(const std::shared_ptr< CPVREpgInfoTag > &tag, CPVRStreamProperties &props)
Fill the given container with the properties required for playback of the given EPG tag...
Definition: PVRClient.cpp:736