kodi
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) const;
179 
185 
191  PVR_ERROR OpenDialogChannelAdd(const std::shared_ptr<const CPVRChannel>& channel);
192 
198  PVR_ERROR OpenDialogChannelSettings(const std::shared_ptr<const CPVRChannel>& channel);
199 
205  PVR_ERROR DeleteChannel(const std::shared_ptr<const CPVRChannel>& channel);
206 
212  PVR_ERROR RenameChannel(const std::shared_ptr<const 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<const CPVREpgInfoTag>& tag,
240  CPVRStreamProperties& props) const;
241 
243 
245 
254  PVR_ERROR GetEPGForChannel(int iChannelUid, CPVREpg* epg, time_t start, time_t end) const;
255 
270  PVR_ERROR SetEPGMaxPastDays(int iPastDays);
271 
286  PVR_ERROR SetEPGMaxFutureDays(int iFutureDays);
287 
289 
291 
297  PVR_ERROR GetChannelGroupsAmount(int& iGroups) const;
298 
305 
314  std::vector<std::shared_ptr<CPVRChannelGroupMember>>& groupMembers) const;
315 
317 
319 
325  PVR_ERROR GetChannelsAmount(int& iChannels) const;
326 
333  PVR_ERROR GetChannels(bool bRadio, std::vector<std::shared_ptr<CPVRChannel>>& channels) const;
334 
340  PVR_ERROR GetProvidersAmount(int& iProviders) const;
341 
348 
350 
352 
359  PVR_ERROR GetRecordingsAmount(bool deleted, int& iRecordings) const;
360 
367  PVR_ERROR GetRecordings(CPVRRecordings* results, bool deleted) const;
368 
374  PVR_ERROR DeleteRecording(const CPVRRecording& recording);
375 
381  PVR_ERROR UndeleteRecording(const CPVRRecording& recording);
382 
388 
394  PVR_ERROR RenameRecording(const CPVRRecording& recording);
395 
401  PVR_ERROR SetRecordingLifetime(const CPVRRecording& recording);
402 
409  PVR_ERROR SetRecordingPlayCount(const CPVRRecording& recording, int count);
410 
417  PVR_ERROR SetRecordingLastPlayedPosition(const CPVRRecording& recording, int lastplayedposition);
418 
425  PVR_ERROR GetRecordingLastPlayedPosition(const CPVRRecording& recording, int& iPosition) const;
426 
433  PVR_ERROR GetRecordingEdl(const CPVRRecording& recording, std::vector<PVR_EDL_ENTRY>& edls) const;
434 
441  PVR_ERROR GetRecordingSize(const CPVRRecording& recording, int64_t& sizeInBytes) const;
442 
449  PVR_ERROR GetEpgTagEdl(const std::shared_ptr<const CPVREpgInfoTag>& epgTag,
450  std::vector<PVR_EDL_ENTRY>& edls) const;
451 
453 
455 
461  PVR_ERROR GetTimersAmount(int& iTimers) const;
462 
468  PVR_ERROR GetTimers(CPVRTimersContainer* results) const;
469 
475  PVR_ERROR AddTimer(const CPVRTimerInfoTag& timer);
476 
483  PVR_ERROR DeleteTimer(const CPVRTimerInfoTag& timer, bool bForce = false);
484 
490  PVR_ERROR UpdateTimer(const CPVRTimerInfoTag& timer);
491 
497 
502  const std::vector<std::shared_ptr<CPVRTimerType>>& GetTimerTypes() const;
503 
505 
507 
513  PVR_ERROR OpenLiveStream(const std::shared_ptr<const CPVRChannel>& channel);
514 
520 
528  PVR_ERROR ReadLiveStream(void* lpBuf, int64_t uiBufSize, int& iRead);
529 
537  PVR_ERROR SeekLiveStream(int64_t iFilePosition, int iWhence, int64_t& iPosition);
538 
544  PVR_ERROR GetLiveStreamLength(int64_t& iLength) const;
545 
551  PVR_ERROR PauseStream(bool bPaused);
552 
559  PVR_ERROR SignalQuality(int channelUid, PVR_SIGNAL_STATUS& qualityinfo) const;
560 
567  PVR_ERROR GetDescrambleInfo(int channelUid, PVR_DESCRAMBLE_INFO& descrambleinfo) const;
568 
575  PVR_ERROR GetChannelStreamProperties(const std::shared_ptr<const CPVRChannel>& channel,
576  CPVRStreamProperties& props) const;
577 
583  PVR_ERROR CanPauseStream(bool& bCanPause) const;
584 
590  PVR_ERROR CanSeekStream(bool& bCanSeek) const;
591 
600  PVR_ERROR SeekTime(double time, bool backwards, double* startpts);
601 
608  PVR_ERROR SetSpeed(int speed);
609 
616  PVR_ERROR FillBuffer(bool mode);
617 
619 
621 
627  PVR_ERROR OpenRecordedStream(const std::shared_ptr<const CPVRRecording>& recording);
628 
634 
642  PVR_ERROR ReadRecordedStream(void* lpBuf, int64_t uiBufSize, int& iRead);
643 
651  PVR_ERROR SeekRecordedStream(int64_t iFilePosition, int iWhence, int64_t& iPosition);
652 
658  PVR_ERROR GetRecordedStreamLength(int64_t& iLength) const;
659 
666  PVR_ERROR GetRecordingStreamProperties(const std::shared_ptr<const CPVRRecording>& recording,
667  CPVRStreamProperties& props) const;
668 
670 
672 
678 
684 
690 
696  PVR_ERROR DemuxRead(DemuxPacket*& packet);
697 
698  static const char* ToString(const PVR_ERROR error);
699 
705  PVR_ERROR IsRealTimeStream(bool& bRealTime) const;
706 
713 
718  std::shared_ptr<CPVRClientMenuHooks> GetMenuHooks() const;
719 
727  const std::shared_ptr<const CPVREpgInfoTag>& tag);
728 
736  const std::shared_ptr<const CPVRChannel>& channel);
737 
746  const std::shared_ptr<const CPVRRecording>& recording,
747  bool bDeleted);
748 
756  const std::shared_ptr<const CPVRTimerInfoTag>& timer);
757 
764 
770  PVR_ERROR OnSystemWake();
771  PVR_ERROR OnPowerSavingActivated();
772  PVR_ERROR OnPowerSavingDeactivated();
773 
778  int GetPriority() const;
779 
784  void SetPriority(int iPriority);
785 
791  PVR_ERROR GetStreamReadChunkSize(int& iChunkSize) const;
792 
797  AddonInstance_PVR* GetInstanceInterface() { return m_ifc.pvr; }
798 
799 private:
803  void ResetProperties();
804 
809  bool GetAddonProperties();
810 
815  bool GetAddonNameStringProperties();
816 
823  static void WriteStreamProperties(const PVR_NAMED_VALUE* properties,
824  unsigned int iPropertyCount,
825  CPVRStreamProperties& props);
826 
832  bool CanPlayChannel(const std::shared_ptr<const CPVRChannel>& channel) const;
833 
837  void StopRunningInstance();
838 
848  PVR_ERROR DoAddonCall(const char* strFunctionName,
849  const std::function<PVR_ERROR(const AddonInstance*)>& function,
850  bool bIsImplemented = true,
851  bool bCheckReadyToUse = true) const;
852 
860  static void HandleAddonCallback(const char* strFunctionName,
861  void* kodiInstance,
862  const std::function<void(CPVRClient* client)>& function,
863  bool bForceCall = false);
864 
869 
876  static void cb_transfer_channel_group(void* kodiInstance,
877  const PVR_HANDLE handle,
878  const PVR_CHANNEL_GROUP* entry);
879 
886  static void cb_transfer_channel_group_member(void* kodiInstance,
887  const PVR_HANDLE handle,
888  const PVR_CHANNEL_GROUP_MEMBER* entry);
889 
896  static void cb_transfer_epg_entry(void* kodiInstance,
897  const PVR_HANDLE handle,
898  const EPG_TAG* entry);
899 
906  static void cb_transfer_channel_entry(void* kodiInstance,
907  const PVR_HANDLE handle,
908  const PVR_CHANNEL* entry);
909 
916  static void cb_transfer_provider_entry(void* kodiInstance,
917  const PVR_HANDLE handle,
918  const PVR_PROVIDER* entry);
919 
926  static void cb_transfer_timer_entry(void* kodiInstance,
927  const PVR_HANDLE handle,
928  const PVR_TIMER* entry);
929 
936  static void cb_transfer_recording_entry(void* kodiInstance,
937  const PVR_HANDLE handle,
938  const PVR_RECORDING* entry);
939 
945  static void cb_add_menu_hook(void* kodiInstance, const PVR_MENUHOOK* hook);
946 
954  static void cb_recording_notification(void* kodiInstance,
955  const char* strName,
956  const char* strFileName,
957  bool bOnOff);
958 
963  static void cb_trigger_channel_update(void* kodiInstance);
964 
969  static void cb_trigger_provider_update(void* kodiInstance);
970 
975  static void cb_trigger_timer_update(void* kodiInstance);
976 
981  static void cb_trigger_recording_update(void* kodiInstance);
982 
987  static void cb_trigger_channel_groups_update(void* kodiInstance);
988 
994  static void cb_trigger_epg_update(void* kodiInstance, unsigned int iChannelUid);
995 
1001  static void cb_free_demux_packet(void* kodiInstance, DEMUX_PACKET* pPacket);
1002 
1009  static DEMUX_PACKET* cb_allocate_demux_packet(void* kodiInstance, int iDataSize = 0);
1010 
1019  static void cb_connection_state_change(void* kodiInstance,
1020  const char* strConnectionString,
1021  PVR_CONNECTION_STATE newState,
1022  const char* strMessage);
1023 
1032  static void cb_epg_event_state_change(void* kodiInstance, EPG_TAG* tag, EPG_EVENT_STATE newState);
1033 
1037  static PVR_CODEC cb_get_codec_by_name(const void* kodiInstance, const char* strCodecName);
1039 
1040  const int m_iClientId;
1041  std::atomic<bool>
1042  m_bReadyToUse;
1043  std::atomic<bool> m_bBlockAddonCalls;
1044  mutable std::atomic<int> m_iAddonCalls;
1045  mutable CEvent m_allAddonCallsFinished;
1046  PVR_CONNECTION_STATE m_connectionState;
1047  PVR_CONNECTION_STATE m_prevConnectionState;
1048  bool
1049  m_ignoreClient;
1050  std::vector<std::shared_ptr<CPVRTimerType>>
1051  m_timertypes;
1052  mutable std::optional<int> m_priority;
1054  /* cached data */
1055  std::string m_strBackendName;
1056  std::string m_strBackendVersion;
1057  std::string m_strConnectionString;
1058  std::string m_strBackendHostname;
1059  CPVRClientCapabilities m_clientCapabilities;
1060  mutable std::shared_ptr<CPVRClientMenuHooks> m_menuhooks;
1062  /* stored strings to make sure const char* members in AddonProperties_PVR stay valid */
1063  std::string m_strUserPath;
1064  std::string m_strClientPath;
1066  mutable CCriticalSection m_critSection;
1067 };
1068 } // namespace PVR
This is an Event class built from a ConditionVariable.
Definition: Event.h:35
PVR_ERROR GetRecordedStreamLength(int64_t &iLength) const
Get the length of the currently playing recording stream, if any.
Definition: PVRClient.cpp:1184
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:1167
PVR_ERROR CallSettingsMenuHook(const CPVRClientMenuHook &hook)
Call one of the settings menu hooks of the client.
Definition: PVRClient.cpp:1610
PVR_ERROR SetEPGMaxFutureDays(int iFutureDays)
Tell the client the future time frame to use when notifying epg events back to Kodi.
Definition: PVRClient.cpp:533
bool ReadyToUse() const
Definition: PVRClient.cpp:234
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:999
PVR_ERROR OpenDialogChannelAdd(const std::shared_ptr< const CPVRChannel > &channel)
Request the client to open dialog about given channel to add.
Definition: PVRClient.cpp:451
Definition: PVRRecordings.h:28
PVR_ERROR DeleteChannel(const std::shared_ptr< const CPVRChannel > &channel)
Request the client to delete given channel.
Definition: PVRClient.cpp:475
PVR_ERROR
Definition: pvr_general.h:34
PVR_ERROR GetDriveSpace(uint64_t &iTotal, uint64_t &iUsed) const
Get the disk space reported by the server.
Definition: PVRClient.cpp:424
PVR_ERROR GetEpgTagEdl(const std::shared_ptr< const CPVREpgInfoTag > &epgTag, std::vector< PVR_EDL_ENTRY > &edls) const
Retrieve the edit decision list (EDL) from the backend.
Definition: PVRClient.cpp:677
PVR_ERROR RenameRecording(const CPVRRecording &recording)
Rename a recording on the backend.
Definition: PVRClient.cpp:841
Definition: pvr.h:332
PVR_ERROR SetSpeed(int speed)
Notify the pvr addon/demuxer that Kodi wishes to change playback speed.
Definition: PVRClient.cpp:1462
void Destroy()
Destroy the instance of this add-on.
Definition: PVRClient.cpp:195
PVR_ERROR CallTimerMenuHook(const CPVRClientMenuHook &hook, const std::shared_ptr< const CPVRTimerInfoTag > &timer)
Call one of the timer menu hooks of the client.
Definition: PVRClient.cpp:1594
Definition: PVRStreamProperties.h:18
"C" PVR add-on descramble information.
Definition: pvr_channels.h:91
PVR_ERROR GetTimersAmount(int &iTimers) const
Get the total amount of timers from the backend.
Definition: PVRClient.cpp:940
PVR_ERROR GetProviders(CPVRProvidersContainer &providers) const
Request the list of all providers from the backend.
Definition: PVRClient.cpp:748
"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 GetRecordingLastPlayedPosition(const CPVRRecording &recording, int &iPosition) const
Retrieve the last watched position of a recording on the backend.
Definition: PVRClient.cpp:890
PVR_ERROR GetChannelGroups(CPVRChannelGroups *groups) const
Request the list of all channel groups from the backend.
Definition: PVRClient.cpp:711
PVR_ERROR GetRecordings(CPVRRecordings *results, bool deleted) const
Request the list of all recordings from the backend.
Definition: PVRClient.cpp:794
"C" PVR add-on channel group member.
Definition: pvr_epg.h:622
"C" PVR add-on channel.
Definition: pvr_channels.h:40
PVR_ERROR SignalQuality(int channelUid, PVR_SIGNAL_STATUS &qualityinfo) const
Get the signal quality of the stream that&#39;s currently open.
Definition: PVRClient.cpp:1193
PVR_ERROR CanSeekStream(bool &bCanSeek) const
Check whether PVR backend supports seeking for the currently playing stream.
Definition: PVRClient.cpp:1487
void SetPriority(int iPriority)
Set a new priority for this client.
Definition: PVRClient.cpp:1622
PVR_ERROR SeekRecordedStream(int64_t iFilePosition, int iWhence, int64_t &iPosition)
Seek in a recording stream on a backend.
Definition: PVRClient.cpp:1158
PVR_ERROR DemuxFlush()
Flush all data that&#39;s currently in the demultiplexer buffer in the add-on.
Definition: PVRClient.cpp:1285
const std::string & GetBackendHostname() const
the ip address or alias of the pvr backend server
Definition: PVRClient.cpp:401
PVR_ERROR UpdateTimer(const CPVRTimerInfoTag &timer)
Update the timer information on the server.
Definition: PVRClient.cpp:987
AddonInstance_PVR * GetInstanceInterface()
Get the interface table used between addon and Kodi.
Definition: PVRClient.h:797
PVR_ERROR CallRecordingMenuHook(const CPVRClientMenuHook &hook, const std::shared_ptr< const CPVRRecording > &recording, bool bDeleted)
Call one of the recording menu hooks of the client.
Definition: PVRClient.cpp:1577
PVR_ERROR DemuxAbort()
Abort the demultiplexer thread in the add-on.
Definition: PVRClient.cpp:1274
A container class for channel groups.
Definition: PVRChannelGroups.h:30
PVR_ERROR OnSystemSleep()
Propagate power management events to this add-on.
Definition: PVRClient.cpp:1512
PVR_ERROR DemuxReset()
Reset the demultiplexer in the add-on.
Definition: PVRClient.cpp:1263
PVR_CONNECTION_STATE
Definition: pvr_general.h:81
PVR_ERROR AddTimer(const CPVRTimerInfoTag &timer)
Add a timer on the backend.
Definition: PVRClient.cpp:963
PVR_ERROR GetLiveStreamLength(int64_t &iLength) const
Get the length of the currently playing live stream, if any.
Definition: PVRClient.cpp:1175
void Continue()
Continue this add-on instance. Client add-on access is okay again after this call.
Definition: PVRClient.cpp:223
PVR_ERROR GetChannelsAmount(int &iChannels) const
Get the total amount of channels from the backend.
Definition: PVRClient.cpp:760
PVR_ERROR UpdateTimerTypes()
Update all timer types supported by the backend.
Definition: PVRClient.cpp:1005
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 GetEPGForChannel(int iChannelUid, CPVREpg *epg, time_t start, time_t end) const
Request an EPG table for a channel from the client.
Definition: PVRClient.cpp:501
PVR_ERROR DeleteAllRecordingsFromTrash()
Delete all recordings permanent which in the deleted folder on the backend.
Definition: PVRClient.cpp:831
PVR_ERROR GetStreamReadChunkSize(int &iChunkSize) const
Obtain the chunk size to use when reading streams.
Definition: PVRClient.cpp:1119
Definition: AddonInstanceHandler.h:33
PVR_ERROR GetChannelStreamProperties(const std::shared_ptr< const CPVRChannel > &channel, CPVRStreamProperties &props) const
Fill the given container with the properties required for playback of the given channel. Values are obtained from the PVR backend.
Definition: PVRClient.cpp:1210
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
PVR_ERROR GetRecordingEdl(const CPVRRecording &recording, std::vector< PVR_EDL_ENTRY > &edls) const
Retrieve the edit decision list (EDL) from the backend.
Definition: PVRClient.cpp:904
Definition: PVRClientCapabilities.h:21
PVR_ERROR ReadRecordedStream(void *lpBuf, int64_t uiBufSize, int &iRead)
Read from an open recording stream.
Definition: PVRClient.cpp:1139
PVR_ERROR GetStreamTimes(PVR_STREAM_TIMES *times) const
Get Stream times for the currently playing stream, if any (will be moved to inputstream).
Definition: PVRClient.cpp:1496
"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:853
PVR_ERROR PauseStream(bool bPaused)
(Un)Pause a stream.
Definition: PVRClient.cpp:1454
PVR_ERROR GetChannels(bool bRadio, std::vector< std::shared_ptr< CPVRChannel >> &channels) const
Request the list of all channels from the backend.
Definition: PVRClient.cpp:768
std::shared_ptr< CPVRClientMenuHooks > GetMenuHooks() const
Get the client&#39;s menu hooks.
Definition: PVRClient.cpp:1538
PVR_ERROR UndeleteRecording(const CPVRRecording &recording)
Undelete a recording on the backend.
Definition: PVRClient.cpp:819
ADDON_STATUS Create()
Initialise the instance of this add-on.
Definition: PVRClient.cpp:167
PVR_ERROR GetEpgTagStreamProperties(const std::shared_ptr< const CPVREpgInfoTag > &tag, CPVRStreamProperties &props) const
Fill the given container with the properties required for playback of the given EPG tag...
Definition: PVRClient.cpp:658
PVR_ERROR GetRecordingSize(const CPVRRecording &recording, int64_t &sizeInBytes) const
Retrieve the size of a recording on the backend.
Definition: PVRClient.cpp:928
"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:1503
Definition: PVRTimerInfoTag.h:33
PVR_ERROR GetTimers(CPVRTimersContainer *results) const
Request the list of all timers from the backend.
Definition: PVRClient.cpp:951
"C" PVR add-on signal status information.
Definition: pvr_channels.h:63
ADDON_STATUS
Definition: addon_base.h:137
PVR_ERROR GetRecordingStreamProperties(const std::shared_ptr< const CPVRRecording > &recording, CPVRStreamProperties &props) const
Fill the given container with the properties required for playback of the given recording. Values are obtained from the PVR backend.
Definition: PVRClient.cpp:1233
PVR_ERROR SetRecordingLastPlayedPosition(const CPVRRecording &recording, int lastplayedposition)
Set the last watched position of a recording on the backend.
Definition: PVRClient.cpp:877
PVR_ERROR SetEPGMaxPastDays(int iPastDays)
Tell the client the past time frame to use when notifying epg events back to Kodi.
Definition: PVRClient.cpp:523
PVR_ERROR OpenDialogChannelSettings(const std::shared_ptr< const CPVRChannel > &channel)
Request the client to open dialog about given channel settings.
Definition: PVRClient.cpp:463
int GetPriority() const
Get the priority of this client. Larger value means higher priority.
Definition: PVRClient.cpp:1636
Definition: PVRRecording.h:52
Definition: SmartPlayList.cpp:137
Definition: demux_packet.h:45
"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:1296
"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:1149
PVR_ERROR CanPauseStream(bool &bCanPause) const
Check whether PVR backend supports pausing the currently playing stream.
Definition: PVRClient.cpp:1478
const std::string & GetBackendName() const
Definition: PVRClient.cpp:391
"C" PVR add-on timer event.
Definition: pvr_timers.h:339
PVR_ERROR GetChannelGroupMembers(CPVRChannelGroup *group, std::vector< std::shared_ptr< CPVRChannelGroupMember >> &groupMembers) const
Request the list of all group members from the backend.
Definition: PVRClient.cpp:723
const std::string GetFriendlyName() const
A friendly name used to uniquely identify the addon instance.
Definition: PVRClient.cpp:411
PVR_ERROR GetRecordingsAmount(bool deleted, int &iRecordings) const
Get the total amount of recordings from the backend.
Definition: PVRClient.cpp:782
PVR_CONNECTION_STATE GetPreviousConnectionState() const
Gets the backend&#39;s previous connection state.
Definition: PVRClient.cpp:271
Definition: DemuxPacket.h:22
"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:807
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 OpenRecordedStream(const std::shared_ptr< const CPVRRecording > &recording)
Open a recording on the server.
Definition: PVRClient.cpp:1419
PVR_ERROR OpenLiveStream(const std::shared_ptr< const CPVRChannel > &channel)
Open a live stream on the server.
Definition: PVRClient.cpp:1394
Definition: PVRProviders.h:23
PVR_ERROR ReadLiveStream(void *lpBuf, int64_t uiBufSize, int &iRead)
Read from an open live stream.
Definition: PVRClient.cpp:1129
PVR_ERROR GetChannelGroupsAmount(int &iGroups) const
Get the total amount of channel groups from the backend.
Definition: PVRClient.cpp:700
bool IsEnabled() const
Check whether this client is enabled, according to its instance/add-on configuration.
Definition: PVRClient.cpp:283
PVR_ERROR RenameChannel(const std::shared_ptr< const CPVRChannel > &channel)
Request the client to rename given channel.
Definition: PVRClient.cpp:487
PVR_ERROR CallEpgTagMenuHook(const CPVRClientMenuHook &hook, const std::shared_ptr< const CPVREpgInfoTag > &tag)
Call one of the EPG tag menu hooks of the client.
Definition: PVRClient.cpp:1546
EPG_EVENT_STATE
Definition: pvr_epg.h:601
PVR_ERROR GetProvidersAmount(int &iProviders) const
Get the total amount of providers from the backend.
Definition: PVRClient.cpp:740
void ReCreate()
Destroy and recreate this add-on.
Definition: PVRClient.cpp:228
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:1446
int GetID() const
Definition: PVRClient.cpp:298
Definition: PVRChannelGroup.h:52
PVR_ERROR CallChannelMenuHook(const CPVRClientMenuHook &hook, const std::shared_ptr< const CPVRChannel > &channel)
Call one of the channel menu hooks of the client.
Definition: PVRClient.cpp:1561
PVR_ERROR FillBuffer(bool mode)
Notify the pvr addon/demuxer that Kodi wishes to fill demux queue.
Definition: PVRClient.cpp:1470
Definition: PVRClientMenuHooks.h:20
Definition: PVRClient.h:52
PVR_ERROR CloseLiveStream()
Close an open live stream.
Definition: PVRClient.cpp:1438
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 DeleteTimer(const CPVRTimerInfoTag &timer, bool bForce=false)
Delete a timer on the backend.
Definition: PVRClient.cpp:975
PVR_ERROR GetStreamProperties(PVR_STREAM_PROPERTIES *pProperties) const
Get the stream properties of the stream that&#39;s currently being read.
Definition: PVRClient.cpp:1256
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:1200
PVR_ERROR SetRecordingPlayCount(const CPVRRecording &recording, int count)
Set the play count of a recording on the backend.
Definition: PVRClient.cpp:865