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 <optional>
20 #include <string>
21 #include <utility>
22 #include <vector>
23 
24 struct DemuxPacket;
25 
26 namespace PVR
27 {
28 class CPVRChannel;
29 class CPVRChannelGroup;
30 class CPVRChannelGroupMember;
31 class CPVRChannelGroups;
32 class CPVRProvider;
33 class CPVRProvidersContainer;
34 class CPVRClientMenuHook;
35 class CPVRClientMenuHooks;
36 class CPVREpg;
37 class CPVREpgInfoTag;
38 class CPVRRecording;
39 class CPVRRecordings;
40 class CPVRStreamProperties;
41 class CPVRTimerInfoTag;
42 class CPVRTimerType;
43 class CPVRTimersContainer;
44 
45 #define PVR_INVALID_CLIENT_ID (-2)
46 
53 {
54 public:
55  CPVRClient(const ADDON::AddonInfoPtr& addonInfo, ADDON::AddonInstanceId instanceId, int clientId);
56  ~CPVRClient() override;
57 
58  void OnPreInstall() override;
59  void OnPreUnInstall() override;
60 
63 
68 
72  void Stop();
73 
77  void Continue();
78 
82  void Destroy();
83 
87  void ReCreate();
88 
92  bool ReadyToUse() const;
93 
99 
105 
111 
116  bool IgnoreClient() const;
117 
122  bool IsEnabled() const;
123 
127  int GetID() const;
128 
130 
132 
137  const CPVRClientCapabilities& GetClientCapabilities() const { return m_clientCapabilities; }
138 
145 
149  const std::string& GetBackendName() const;
150 
154  const std::string& GetBackendVersion() const;
155 
159  const std::string& GetBackendHostname() const;
160 
164  const std::string& GetConnectionString() const;
165 
170  const std::string GetFriendlyName() const;
171 
178  PVR_ERROR GetDriveSpace(uint64_t& iTotal, uint64_t& iUsed);
179 
185 
191  PVR_ERROR OpenDialogChannelAdd(const std::shared_ptr<CPVRChannel>& channel);
192 
198  PVR_ERROR OpenDialogChannelSettings(const std::shared_ptr<CPVRChannel>& channel);
199 
205  PVR_ERROR DeleteChannel(const std::shared_ptr<CPVRChannel>& channel);
206 
212  PVR_ERROR RenameChannel(const std::shared_ptr<CPVRChannel>& channel);
213 
214  /*
215  * @brief Check if an epg tag can be recorded
216  * @param tag The epg tag
217  * @param bIsRecordable Set to true if the tag can be recorded
218  * @return PVR_ERROR_NO_ERROR if bIsRecordable has been set successfully.
219  */
220  PVR_ERROR IsRecordable(const std::shared_ptr<const CPVREpgInfoTag>& tag,
221  bool& bIsRecordable) const;
222 
223  /*
224  * @brief Check if an epg tag can be played
225  * @param tag The epg tag
226  * @param bIsPlayable Set to true if the tag can be played
227  * @return PVR_ERROR_NO_ERROR if bIsPlayable has been set successfully.
228  */
229  PVR_ERROR IsPlayable(const std::shared_ptr<const CPVREpgInfoTag>& tag, bool& bIsPlayable) const;
230 
239  PVR_ERROR GetEpgTagStreamProperties(const std::shared_ptr<CPVREpgInfoTag>& tag,
240  CPVRStreamProperties& props);
241 
243 
245 
254  PVR_ERROR GetEPGForChannel(int iChannelUid, CPVREpg* epg, time_t start, time_t end);
255 
270  PVR_ERROR SetEPGMaxPastDays(int iPastDays);
271 
286  PVR_ERROR SetEPGMaxFutureDays(int iFutureDays);
287 
289 
291 
297  PVR_ERROR GetChannelGroupsAmount(int& iGroups);
298 
305 
313  CPVRChannelGroup* group, std::vector<std::shared_ptr<CPVRChannelGroupMember>>& groupMembers);
314 
316 
318 
324  PVR_ERROR GetChannelsAmount(int& iChannels);
325 
332  PVR_ERROR GetChannels(bool bRadio, std::vector<std::shared_ptr<CPVRChannel>>& channels);
333 
339  PVR_ERROR GetProvidersAmount(int& iProviders);
340 
347 
349 
351 
358  PVR_ERROR GetRecordingsAmount(bool deleted, int& iRecordings);
359 
366  PVR_ERROR GetRecordings(CPVRRecordings* results, bool deleted);
367 
373  PVR_ERROR DeleteRecording(const CPVRRecording& recording);
374 
380  PVR_ERROR UndeleteRecording(const CPVRRecording& recording);
381 
387 
393  PVR_ERROR RenameRecording(const CPVRRecording& recording);
394 
400  PVR_ERROR SetRecordingLifetime(const CPVRRecording& recording);
401 
408  PVR_ERROR SetRecordingPlayCount(const CPVRRecording& recording, int count);
409 
416  PVR_ERROR SetRecordingLastPlayedPosition(const CPVRRecording& recording, int lastplayedposition);
417 
424  PVR_ERROR GetRecordingLastPlayedPosition(const CPVRRecording& recording, int& iPosition);
425 
432  PVR_ERROR GetRecordingEdl(const CPVRRecording& recording, std::vector<PVR_EDL_ENTRY>& edls);
433 
440  PVR_ERROR GetRecordingSize(const CPVRRecording& recording, int64_t& sizeInBytes);
441 
448  PVR_ERROR GetEpgTagEdl(const std::shared_ptr<const CPVREpgInfoTag>& epgTag,
449  std::vector<PVR_EDL_ENTRY>& edls);
450 
452 
454 
460  PVR_ERROR GetTimersAmount(int& iTimers);
461 
468 
474  PVR_ERROR AddTimer(const CPVRTimerInfoTag& timer);
475 
482  PVR_ERROR DeleteTimer(const CPVRTimerInfoTag& timer, bool bForce = false);
483 
489  PVR_ERROR UpdateTimer(const CPVRTimerInfoTag& timer);
490 
496 
501  const std::vector<std::shared_ptr<CPVRTimerType>>& GetTimerTypes() const;
502 
504 
506 
512  PVR_ERROR OpenLiveStream(const std::shared_ptr<CPVRChannel>& channel);
513 
519 
527  PVR_ERROR ReadLiveStream(void* lpBuf, int64_t uiBufSize, int& iRead);
528 
536  PVR_ERROR SeekLiveStream(int64_t iFilePosition, int iWhence, int64_t& iPosition);
537 
543  PVR_ERROR GetLiveStreamLength(int64_t& iLength);
544 
550  PVR_ERROR PauseStream(bool bPaused);
551 
558  PVR_ERROR SignalQuality(int channelUid, PVR_SIGNAL_STATUS& qualityinfo);
559 
566  PVR_ERROR GetDescrambleInfo(int channelUid, PVR_DESCRAMBLE_INFO& descrambleinfo) const;
567 
574  PVR_ERROR GetChannelStreamProperties(const std::shared_ptr<CPVRChannel>& channel,
575  CPVRStreamProperties& props);
576 
582  PVR_ERROR CanPauseStream(bool& bCanPause) const;
583 
589  PVR_ERROR CanSeekStream(bool& bCanSeek) const;
590 
599  PVR_ERROR SeekTime(double time, bool backwards, double* startpts);
600 
607  PVR_ERROR SetSpeed(int speed);
608 
615  PVR_ERROR FillBuffer(bool mode);
616 
618 
620 
626  PVR_ERROR OpenRecordedStream(const std::shared_ptr<CPVRRecording>& recording);
627 
633 
641  PVR_ERROR ReadRecordedStream(void* lpBuf, int64_t uiBufSize, int& iRead);
642 
650  PVR_ERROR SeekRecordedStream(int64_t iFilePosition, int iWhence, int64_t& iPosition);
651 
657  PVR_ERROR GetRecordedStreamLength(int64_t& iLength);
658 
665  PVR_ERROR GetRecordingStreamProperties(const std::shared_ptr<CPVRRecording>& recording,
666  CPVRStreamProperties& props);
667 
669 
671 
677 
683 
689 
695  PVR_ERROR DemuxRead(DemuxPacket*& packet);
696 
697  static const char* ToString(const PVR_ERROR error);
698 
704  PVR_ERROR IsRealTimeStream(bool& bRealTime) const;
705 
712 
717  std::shared_ptr<CPVRClientMenuHooks> GetMenuHooks();
718 
726  const std::shared_ptr<CPVREpgInfoTag>& tag);
727 
735  const std::shared_ptr<CPVRChannel>& channel);
736 
745  const std::shared_ptr<CPVRRecording>& recording,
746  bool bDeleted);
747 
755  const std::shared_ptr<CPVRTimerInfoTag>& timer);
756 
763 
769  PVR_ERROR OnSystemWake();
770  PVR_ERROR OnPowerSavingActivated();
771  PVR_ERROR OnPowerSavingDeactivated();
772 
777  int GetPriority() const;
778 
783  void SetPriority(int iPriority);
784 
790  PVR_ERROR GetStreamReadChunkSize(int& iChunkSize);
791 
796  AddonInstance_PVR* GetInstanceInterface() { return m_ifc.pvr; }
797 
798 private:
802  void ResetProperties();
803 
808  bool GetAddonProperties();
809 
814  bool GetAddonNameStringProperties();
815 
822  static void WriteStreamProperties(const PVR_NAMED_VALUE* properties,
823  unsigned int iPropertyCount,
824  CPVRStreamProperties& props);
825 
831  bool CanPlayChannel(const std::shared_ptr<CPVRChannel>& channel) const;
832 
836  void StopRunningInstance();
837 
847  PVR_ERROR DoAddonCall(const char* strFunctionName,
848  const std::function<PVR_ERROR(const AddonInstance*)>& function,
849  bool bIsImplemented = true,
850  bool bCheckReadyToUse = true) const;
851 
859  static void HandleAddonCallback(const char* strFunctionName,
860  void* kodiInstance,
861  const std::function<void(CPVRClient* client)>& function,
862  bool bForceCall = false);
863 
868 
875  static void cb_transfer_channel_group(void* kodiInstance,
876  const PVR_HANDLE handle,
877  const PVR_CHANNEL_GROUP* entry);
878 
885  static void cb_transfer_channel_group_member(void* kodiInstance,
886  const PVR_HANDLE handle,
887  const PVR_CHANNEL_GROUP_MEMBER* entry);
888 
895  static void cb_transfer_epg_entry(void* kodiInstance,
896  const PVR_HANDLE handle,
897  const EPG_TAG* entry);
898 
905  static void cb_transfer_channel_entry(void* kodiInstance,
906  const PVR_HANDLE handle,
907  const PVR_CHANNEL* entry);
908 
915  static void cb_transfer_provider_entry(void* kodiInstance,
916  const PVR_HANDLE handle,
917  const PVR_PROVIDER* entry);
918 
925  static void cb_transfer_timer_entry(void* kodiInstance,
926  const PVR_HANDLE handle,
927  const PVR_TIMER* entry);
928 
935  static void cb_transfer_recording_entry(void* kodiInstance,
936  const PVR_HANDLE handle,
937  const PVR_RECORDING* entry);
938 
944  static void cb_add_menu_hook(void* kodiInstance, const PVR_MENUHOOK* hook);
945 
953  static void cb_recording_notification(void* kodiInstance,
954  const char* strName,
955  const char* strFileName,
956  bool bOnOff);
957 
962  static void cb_trigger_channel_update(void* kodiInstance);
963 
968  static void cb_trigger_provider_update(void* kodiInstance);
969 
974  static void cb_trigger_timer_update(void* kodiInstance);
975 
980  static void cb_trigger_recording_update(void* kodiInstance);
981 
986  static void cb_trigger_channel_groups_update(void* kodiInstance);
987 
993  static void cb_trigger_epg_update(void* kodiInstance, unsigned int iChannelUid);
994 
1000  static void cb_free_demux_packet(void* kodiInstance, DEMUX_PACKET* pPacket);
1001 
1008  static DEMUX_PACKET* cb_allocate_demux_packet(void* kodiInstance, int iDataSize = 0);
1009 
1018  static void cb_connection_state_change(void* kodiInstance,
1019  const char* strConnectionString,
1020  PVR_CONNECTION_STATE newState,
1021  const char* strMessage);
1022 
1031  static void cb_epg_event_state_change(void* kodiInstance, EPG_TAG* tag, EPG_EVENT_STATE newState);
1032 
1036  static PVR_CODEC cb_get_codec_by_name(const void* kodiInstance, const char* strCodecName);
1038 
1039  const int m_iClientId;
1040  std::atomic<bool>
1041  m_bReadyToUse;
1042  std::atomic<bool> m_bBlockAddonCalls;
1043  mutable std::atomic<int> m_iAddonCalls;
1044  mutable CEvent m_allAddonCallsFinished;
1045  PVR_CONNECTION_STATE m_connectionState;
1046  PVR_CONNECTION_STATE m_prevConnectionState;
1047  bool
1048  m_ignoreClient;
1049  std::vector<std::shared_ptr<CPVRTimerType>>
1050  m_timertypes;
1051  mutable std::optional<int> m_priority;
1053  /* cached data */
1054  std::string m_strBackendName;
1055  std::string m_strBackendVersion;
1056  std::string m_strConnectionString;
1057  std::string m_strBackendHostname;
1058  CPVRClientCapabilities m_clientCapabilities;
1059  std::shared_ptr<CPVRClientMenuHooks> m_menuhooks;
1061  /* stored strings to make sure const char* members in AddonProperties_PVR stay valid */
1062  std::string m_strUserPath;
1063  std::string m_strClientPath;
1065  mutable CCriticalSection m_critSection;
1066 };
1067 } // namespace PVR
PVR_ERROR GetTimersAmount(int &iTimers)
Get the total amount of timers from the backend.
Definition: PVRClient.cpp:934
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:1161
std::shared_ptr< CPVRClientMenuHooks > GetMenuHooks()
Get the client&#39;s menu hooks.
Definition: PVRClient.cpp:1532
PVR_ERROR CallSettingsMenuHook(const CPVRClientMenuHook &hook)
Call one of the settings menu hooks of the client.
Definition: PVRClient.cpp:1604
PVR_ERROR GetChannelGroups(CPVRChannelGroups *groups)
Request the list of all channel groups from the backend.
Definition: PVRClient.cpp:708
PVR_ERROR SetEPGMaxFutureDays(int iFutureDays)
Tell the client the future time frame to use when notifying epg events back to Kodi.
Definition: PVRClient.cpp:530
bool ReadyToUse() const
Definition: PVRClient.cpp:234
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:1588
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:1540
const std::vector< std::shared_ptr< CPVRTimerType > > & GetTimerTypes() const
Get the timer types supported by the backend, without updating them from the backend.
Definition: PVRClient.cpp:993
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:836
Definition: pvr.h:332
PVR_ERROR SetSpeed(int speed)
Notify the pvr addon/demuxer that Kodi wishes to change playback speed.
Definition: PVRClient.cpp:1456
void Destroy()
Destroy the instance of this add-on.
Definition: PVRClient.cpp:195
PVR_ERROR GetRecordedStreamLength(int64_t &iLength)
Get the length of the currently playing recording stream, if any.
Definition: PVRClient.cpp:1178
PVR_ERROR GetRecordingEdl(const CPVRRecording &recording, std::vector< PVR_EDL_ENTRY > &edls)
Retrieve the edit decision list (EDL) from the backend.
Definition: PVRClient.cpp:898
Definition: PVRStreamProperties.h:18
PVR_ERROR GetDriveSpace(uint64_t &iTotal, uint64_t &iUsed)
Get the disk space reported by the server.
Definition: PVRClient.cpp:424
"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:487
"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:1481
PVR_ERROR OpenRecordedStream(const std::shared_ptr< CPVRRecording > &recording)
Open a recording on the server.
Definition: PVRClient.cpp:1413
void SetPriority(int iPriority)
Set a new priority for this client.
Definition: PVRClient.cpp:1616
PVR_ERROR SignalQuality(int channelUid, PVR_SIGNAL_STATUS &qualityinfo)
Get the signal quality of the stream that&#39;s currently open.
Definition: PVRClient.cpp:1187
PVR_ERROR SeekRecordedStream(int64_t iFilePosition, int iWhence, int64_t &iPosition)
Seek in a recording stream on a backend.
Definition: PVRClient.cpp:1152
PVR_ERROR DemuxFlush()
Flush all data that&#39;s currently in the demultiplexer buffer in the add-on.
Definition: PVRClient.cpp:1279
const std::string & GetBackendHostname() const
the ip address or alias of the pvr backend server
Definition: PVRClient.cpp:401
PVR_ERROR GetStreamReadChunkSize(int &iChunkSize)
Obtain the chunk size to use when reading streams.
Definition: PVRClient.cpp:1113
PVR_ERROR UpdateTimer(const CPVRTimerInfoTag &timer)
Update the timer information on the server.
Definition: PVRClient.cpp:981
AddonInstance_PVR * GetInstanceInterface()
Get the interface table used between addon and Kodi.
Definition: PVRClient.h:796
PVR_ERROR DemuxAbort()
Abort the demultiplexer thread in the add-on.
Definition: PVRClient.cpp:1268
A container class for channel groups.
Definition: PVRChannelGroups.h:30
PVR_ERROR OnSystemSleep()
Propagate power management events to this add-on.
Definition: PVRClient.cpp:1506
PVR_ERROR DemuxReset()
Reset the demultiplexer in the add-on.
Definition: PVRClient.cpp:1257
PVR_CONNECTION_STATE
Definition: pvr_general.h:81
PVR_ERROR AddTimer(const CPVRTimerInfoTag &timer)
Add a timer on the backend.
Definition: PVRClient.cpp:957
void Continue()
Continue this add-on instance. Client add-on access is okay again after this call.
Definition: PVRClient.cpp:223
PVR_ERROR UpdateTimerTypes()
Update all timer types supported by the backend.
Definition: PVRClient.cpp:999
PVR_ERROR OpenDialogChannelSettings(const std::shared_ptr< CPVRChannel > &channel)
Request the client to open dialog about given channel settings.
Definition: PVRClient.cpp:463
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:720
void SetConnectionState(PVR_CONNECTION_STATE state)
Sets the backend connection state.
Definition: PVRClient.cpp:245
PVR_CONNECTION_STATE GetConnectionState() const
Gets the backend connection state.
Definition: PVRClient.cpp:239
PVR_ERROR DeleteAllRecordingsFromTrash()
Delete all recordings permanent which in the deleted folder on the backend.
Definition: PVRClient.cpp:826
Definition: AddonInstanceHandler.h:33
void Stop()
Stop this add-on instance. No more client add-on access after this call.
Definition: PVRClient.cpp:217
const std::string & GetBackendVersion() const
Definition: PVRClient.cpp:396
Definition: PVRClientCapabilities.h:21
PVR_ERROR ReadRecordedStream(void *lpBuf, int64_t uiBufSize, int &iRead)
Read from an open recording stream.
Definition: PVRClient.cpp:1133
"C" Times of playing stream (Live TV and recordings)
Definition: pvr_stream.h:144
const std::string & GetConnectionString() const
Definition: PVRClient.cpp:406
PVR_ERROR SetRecordingLifetime(const CPVRRecording &recording)
Set the lifetime of a recording on the backend.
Definition: PVRClient.cpp:848
PVR_ERROR PauseStream(bool bPaused)
(Un)Pause a stream.
Definition: PVRClient.cpp:1448
PVR_ERROR GetChannelGroupsAmount(int &iGroups)
Get the total amount of channel groups from the backend.
Definition: PVRClient.cpp:697
PVR_ERROR UndeleteRecording(const CPVRRecording &recording)
Undelete a recording on the backend.
Definition: PVRClient.cpp:814
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:1497
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:872
PVR_ERROR GetChannels(bool bRadio, std::vector< std::shared_ptr< CPVRChannel >> &channels)
Request the list of all channels from the backend.
Definition: PVRClient.cpp:764
PVR_ERROR SetEPGMaxPastDays(int iPastDays)
Tell the client the past time frame to use when notifying epg events back to Kodi.
Definition: PVRClient.cpp:520
PVR_ERROR GetRecordingLastPlayedPosition(const CPVRRecording &recording, int &iPosition)
Retrieve the last watched position of a recording on the backend.
Definition: PVRClient.cpp:885
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:501
PVR_ERROR GetProvidersAmount(int &iProviders)
Get the total amount of providers from the backend.
Definition: PVRClient.cpp:736
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:1227
PVR_ERROR GetProviders(CPVRProvidersContainer &providers)
Request the list of all providers from the backend.
Definition: PVRClient.cpp:744
int GetPriority() const
Get the priority of this client. Larger value means higher priority.
Definition: PVRClient.cpp:1630
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:1204
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:756
"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:1290
PVR_ERROR GetStreamProperties(PVR_STREAM_PROPERTIES *pProperties)
Get the stream properties of the stream that&#39;s currently being read.
Definition: PVRClient.cpp:1250
"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:1143
PVR_ERROR CanPauseStream(bool &bCanPause) const
Check whether PVR backend supports pausing the currently playing stream.
Definition: PVRClient.cpp:1472
const std::string & GetBackendName() const
Definition: PVRClient.cpp:391
"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:1571
const std::string GetFriendlyName() const
A friendly name used to uniquely identify the addon instance.
Definition: PVRClient.cpp:411
PVR_ERROR OpenLiveStream(const std::shared_ptr< CPVRChannel > &channel)
Open a live stream on the server.
Definition: PVRClient.cpp:1388
PVR_CONNECTION_STATE GetPreviousConnectionState() const
Gets the backend&#39;s previous connection state.
Definition: PVRClient.cpp:271
Definition: DemuxPacket.h:22
PVR_ERROR GetRecordingsAmount(bool deleted, int &iRecordings)
Get the total amount of recordings from the backend.
Definition: PVRClient.cpp:777
PVR_ERROR GetRecordingSize(const CPVRRecording &recording, int64_t &sizeInBytes)
Retrieve the size of a recording on the backend.
Definition: PVRClient.cpp:922
"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:802
Definition: Epg.h:31
const CPVRClientCapabilities & GetClientCapabilities() const
Query this add-on&#39;s capabilities.
Definition: PVRClient.h:137
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:451
Definition: PVRProviders.h:23
PVR_ERROR ReadLiveStream(void *lpBuf, int64_t uiBufSize, int &iRead)
Read from an open live stream.
Definition: PVRClient.cpp:1123
bool IsEnabled() const
Check whether this client is enabled, according to its instance/add-on configuration.
Definition: PVRClient.cpp:283
PVR_ERROR DeleteChannel(const std::shared_ptr< CPVRChannel > &channel)
Request the client to delete given channel.
Definition: PVRClient.cpp:475
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:1555
EPG_EVENT_STATE
Definition: pvr_epg.h:601
void ReCreate()
Destroy and recreate this add-on.
Definition: PVRClient.cpp:228
PVR_ERROR GetTimers(CPVRTimersContainer *results)
Request the list of all timers from the backend.
Definition: PVRClient.cpp:945
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:1440
int GetID() const
Definition: PVRClient.cpp:298
Definition: PVRChannelGroup.h:52
PVR_ERROR FillBuffer(bool mode)
Notify the pvr addon/demuxer that Kodi wishes to fill demux queue.
Definition: PVRClient.cpp:1464
Definition: PVRClientMenuHooks.h:20
Definition: PVRClient.h:52
PVR_ERROR CloseLiveStream()
Close an open live stream.
Definition: PVRClient.cpp:1432
bool IgnoreClient() const
Check whether this client should be ignored.
Definition: PVRClient.cpp:277
PVR_ERROR StartChannelScan()
Start a channel scan on the server.
Definition: PVRClient.cpp:443
PVR_ERROR GetRecordings(CPVRRecordings *results, bool deleted)
Request the list of all recordings from the backend.
Definition: PVRClient.cpp:789
PVR_ERROR DeleteTimer(const CPVRTimerInfoTag &timer, bool bForce=false)
Delete a timer on the backend.
Definition: PVRClient.cpp:969
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:1490
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:1194
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:674
PVR_ERROR GetLiveStreamLength(int64_t &iLength)
Get the length of the currently playing live stream, if any.
Definition: PVRClient.cpp:1169
PVR_ERROR SetRecordingPlayCount(const CPVRRecording &recording, int count)
Set the play count of a recording on the backend.
Definition: PVRClient.cpp:860
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:655