Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
PVR::CPVRClient Class Reference

#include <PVRClient.h>

Inheritance diagram for PVR::CPVRClient:
ADDON::IAddonInstanceHandler

Public Member Functions

 CPVRClient (const ADDON::AddonInfoPtr &addonInfo, ADDON::AddonInstanceId instanceId, int clientId)
 
 ~CPVRClient () override
 
void OnPreInstall () override
 
void OnPreUnInstall () override
 
PVR add-on methods
ADDON_STATUS Create ()
 Initialise the instance of this add-on.
 
void Stop ()
 Stop this add-on instance. No more client add-on access after this call.
 
void Continue ()
 Continue this add-on instance. Client add-on access is okay again after this call.
 
void Destroy ()
 Destroy the instance of this add-on.
 
void ReCreate ()
 Destroy and recreate this add-on.
 
bool ReadyToUse () const
 
PVR_CONNECTION_STATE GetConnectionState () const
 Gets the backend connection state.
 
void SetConnectionState (PVR_CONNECTION_STATE state)
 Sets the backend connection state.
 
PVR_CONNECTION_STATE GetPreviousConnectionState () const
 Gets the backend's previous connection state.
 
bool IgnoreClient () const
 Check whether this client should be ignored.
 
bool IsEnabled () const
 Check whether this client is enabled, according to its instance/add-on configuration.
 
int GetID () const
 
PVR server methods
const CPVRClientCapabilitiesGetClientCapabilities () const
 Query this add-on's capabilities.
 
PVR_ERROR GetStreamProperties (PVR_STREAM_PROPERTIES *pProperties) const
 Get the stream properties of the stream that's currently being read.
 
const std::string & GetBackendName () const
 
const std::string & GetBackendVersion () const
 
const std::string & GetBackendHostname () const
 the ip address or alias of the pvr backend server
 
const std::string & GetConnectionString () const
 
std::string GetClientName () const
 The name of the PVR client, as specified by the addon developer.
 
std::string GetInstanceName () const
 The name of the PVR client addon instance, as specified by the user in the addon settings. Empty if addon does not support multiple instances.
 
std::string GetFullClientName () const
 A name used to uniquely identify the client, inclusing addon name and instance name, if multiple instances are supported by the client implementation.
 
PVR_ERROR GetDriveSpace (uint64_t &iTotal, uint64_t &iUsed) const
 Get the disk space reported by the server.
 
PVR_ERROR StartChannelScan ()
 Start a channel scan on the server.
 
PVR_ERROR OpenDialogChannelAdd (const std::shared_ptr< const CPVRChannel > &channel)
 Request the client to open dialog about given channel to add.
 
PVR_ERROR OpenDialogChannelSettings (const std::shared_ptr< const CPVRChannel > &channel)
 Request the client to open dialog about given channel settings.
 
PVR_ERROR DeleteChannel (const std::shared_ptr< const CPVRChannel > &channel)
 Request the client to delete given channel.
 
PVR_ERROR RenameChannel (const std::shared_ptr< const CPVRChannel > &channel)
 Request the client to rename given channel.
 
PVR_ERROR IsRecordable (const std::shared_ptr< const CPVREpgInfoTag > &tag, bool &bIsRecordable) const
 
PVR_ERROR IsPlayable (const std::shared_ptr< const CPVREpgInfoTag > &tag, bool &bIsPlayable) const
 
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. Values are obtained from the PVR backend.
 
PVR EPG methods
PVR_ERROR GetEPGForChannel (int iChannelUid, CPVREpg *epg, time_t start, time_t end) const
 Request an EPG table for a channel from the client.
 
PVR_ERROR SetEPGMaxPastDays (int iPastDays)
 Tell the client the past time frame to use when notifying epg events back to Kodi.
 
PVR_ERROR SetEPGMaxFutureDays (int iFutureDays)
 Tell the client the future time frame to use when notifying epg events back to Kodi.
 
PVR channel group methods
PVR_ERROR GetChannelGroupsAmount (int &iGroups) const
 Get the total amount of channel groups from the backend.
 
PVR_ERROR GetChannelGroups (CPVRChannelGroups *groups) const
 Request the list of all channel groups from the backend.
 
PVR_ERROR GetChannelGroupMembers (CPVRChannelGroup *group, std::vector< std::shared_ptr< CPVRChannelGroupMember > > &groupMembers) const
 Request the list of all group members from the backend.
 
PVR channel methods
PVR_ERROR GetChannelsAmount (int &iChannels) const
 Get the total amount of channels from the backend.
 
PVR_ERROR GetChannels (bool bRadio, std::vector< std::shared_ptr< CPVRChannel > > &channels) const
 Request the list of all channels from the backend.
 
PVR_ERROR GetProvidersAmount (int &iProviders) const
 Get the total amount of providers from the backend.
 
PVR_ERROR GetProviders (CPVRProvidersContainer &providers) const
 Request the list of all providers from the backend.
 
PVR recording methods
PVR_ERROR GetRecordingsAmount (bool deleted, int &iRecordings) const
 Get the total amount of recordings from the backend.
 
PVR_ERROR GetRecordings (CPVRRecordings *results, bool deleted) const
 Request the list of all recordings from the backend.
 
PVR_ERROR DeleteRecording (const CPVRRecording &recording)
 Delete a recording on the backend.
 
PVR_ERROR UndeleteRecording (const CPVRRecording &recording)
 Undelete a recording on the backend.
 
PVR_ERROR DeleteAllRecordingsFromTrash ()
 Delete all recordings permanent which in the deleted folder on the backend.
 
PVR_ERROR RenameRecording (const CPVRRecording &recording)
 Rename a recording on the backend.
 
PVR_ERROR SetRecordingLifetime (const CPVRRecording &recording)
 Set the lifetime of a recording on the backend.
 
PVR_ERROR SetRecordingPlayCount (const CPVRRecording &recording, int count)
 Set the play count of a recording on the backend.
 
PVR_ERROR SetRecordingLastPlayedPosition (const CPVRRecording &recording, int lastplayedposition)
 Set the last watched position of a recording on the backend.
 
PVR_ERROR GetRecordingLastPlayedPosition (const CPVRRecording &recording, int &iPosition) const
 Retrieve the last watched position of a recording on the backend.
 
PVR_ERROR GetRecordingEdl (const CPVRRecording &recording, std::vector< PVR_EDL_ENTRY > &edls) const
 Retrieve the edit decision list (EDL) from the backend.
 
PVR_ERROR GetRecordingSize (const CPVRRecording &recording, int64_t &sizeInBytes) const
 Retrieve the size of a recording on the backend.
 
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.
 
PVR timer methods
PVR_ERROR GetTimersAmount (int &iTimers) const
 Get the total amount of timers from the backend.
 
PVR_ERROR GetTimers (CPVRTimersContainer *results) const
 Request the list of all timers from the backend.
 
PVR_ERROR AddTimer (const CPVRTimerInfoTag &timer)
 Add a timer on the backend.
 
PVR_ERROR DeleteTimer (const CPVRTimerInfoTag &timer, bool bForce=false)
 Delete a timer on the backend.
 
PVR_ERROR UpdateTimer (const CPVRTimerInfoTag &timer)
 Update the timer information on the server.
 
PVR_ERROR UpdateTimerTypes ()
 Update all timer types supported by the backend.
 
const std::vector< std::shared_ptr< CPVRTimerType > > & GetTimerTypes () const
 Get the timer types supported by the backend, without updating them from the backend.
 
PVR live stream methods
PVR_ERROR OpenLiveStream (const std::shared_ptr< const CPVRChannel > &channel)
 Open a live stream on the server.
 
PVR_ERROR CloseLiveStream ()
 Close an open live stream.
 
PVR_ERROR ReadLiveStream (void *lpBuf, int64_t uiBufSize, int &iRead)
 Read from an open live stream.
 
PVR_ERROR SeekLiveStream (int64_t iFilePosition, int iWhence, int64_t &iPosition)
 Seek in a live stream on a backend.
 
PVR_ERROR GetLiveStreamLength (int64_t &iLength) const
 Get the length of the currently playing live stream, if any.
 
PVR_ERROR PauseStream (bool bPaused)
 (Un)Pause a stream.
 
PVR_ERROR SignalQuality (int channelUid, PVR_SIGNAL_STATUS &qualityinfo) const
 Get the signal quality of the stream that's currently open.
 
PVR_ERROR GetDescrambleInfo (int channelUid, PVR_DESCRAMBLE_INFO &descrambleinfo) const
 Get the descramble information of the stream that's currently open.
 
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.
 
PVR_ERROR CanPauseStream (bool &bCanPause) const
 Check whether PVR backend supports pausing the currently playing stream.
 
PVR_ERROR CanSeekStream (bool &bCanSeek) const
 Check whether PVR backend supports seeking for the currently playing stream.
 
PVR_ERROR SeekTime (double time, bool backwards, double *startpts)
 Notify the pvr addon/demuxer that Kodi wishes to seek the stream by time.
 
PVR_ERROR SetSpeed (int speed)
 Notify the pvr addon/demuxer that Kodi wishes to change playback speed.
 
PVR_ERROR FillBuffer (bool mode)
 Notify the pvr addon/demuxer that Kodi wishes to fill demux queue.
 
PVR recording stream methods
PVR_ERROR OpenRecordedStream (const std::shared_ptr< const CPVRRecording > &recording)
 Open a recording on the server.
 
PVR_ERROR CloseRecordedStream ()
 Close an open recording stream.
 
PVR_ERROR ReadRecordedStream (void *lpBuf, int64_t uiBufSize, int &iRead)
 Read from an open recording stream.
 
PVR_ERROR SeekRecordedStream (int64_t iFilePosition, int iWhence, int64_t &iPosition)
 Seek in a recording stream on a backend.
 
PVR_ERROR GetRecordedStreamLength (int64_t &iLength) const
 Get the length of the currently playing recording stream, if any.
 
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.
 
- Public Member Functions inherited from ADDON::IAddonInstanceHandler
 IAddonInstanceHandler (ADDON_TYPE type, const AddonInfoPtr &addonInfo, AddonInstanceId instanceId=ADDON_INSTANCE_ID_UNUSED, KODI_HANDLE parentInstance=nullptr, const std::string &uniqueWorkID="")
 Class constructor for handling add-on instance processes, allowing an add-on to handle multiple work simultaneously and independently.
 
virtual ~IAddonInstanceHandler ()
 
ADDON_TYPE UsedType () const
 
AddonInstanceId InstanceId () const
 
const std::string & UniqueWorkID ()
 
std::string ID () const
 
std::string Name () const
 
std::string Author () const
 
std::string Icon () const
 
std::string Path () const
 
std::string Profile () const
 
CAddonVersion Version () const
 
ADDON_STATUS CreateInstance ()
 
void DestroyInstance ()
 
const AddonDllPtrAddon () const
 
AddonInfoPtr GetAddonInfo () const
 
virtual void OnPostInstall (bool update, bool modal)
 
virtual void OnPostUnInstall ()
 

PVR demultiplexer methods

PVR_ERROR DemuxReset ()
 Reset the demultiplexer in the add-on.
 
PVR_ERROR DemuxAbort ()
 Abort the demultiplexer thread in the add-on.
 
PVR_ERROR DemuxFlush ()
 Flush all data that's currently in the demultiplexer buffer in the add-on.
 
PVR_ERROR DemuxRead (DemuxPacket *&packet)
 Read a packet from the demultiplexer.
 
PVR_ERROR IsRealTimeStream (bool &bRealTime) const
 Check whether the currently playing stream, if any, is a real-time stream.
 
PVR_ERROR GetStreamTimes (PVR_STREAM_TIMES *times) const
 Get Stream times for the currently playing stream, if any (will be moved to inputstream).
 
std::shared_ptr< CPVRClientMenuHooksGetMenuHooks () const
 Get the client's menu hooks.
 
PVR_ERROR CallEpgTagMenuHook (const CPVRClientMenuHook &hook, const std::shared_ptr< const CPVREpgInfoTag > &tag)
 Call one of the EPG tag menu hooks of the client.
 
PVR_ERROR CallChannelMenuHook (const CPVRClientMenuHook &hook, const std::shared_ptr< const CPVRChannel > &channel)
 Call one of the channel menu hooks of the client.
 
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.
 
PVR_ERROR CallTimerMenuHook (const CPVRClientMenuHook &hook, const std::shared_ptr< const CPVRTimerInfoTag > &timer)
 Call one of the timer menu hooks of the client.
 
PVR_ERROR CallSettingsMenuHook (const CPVRClientMenuHook &hook)
 Call one of the settings menu hooks of the client.
 
PVR_ERROR OnSystemSleep ()
 Propagate power management events to this add-on.
 
PVR_ERROR OnSystemWake ()
 
PVR_ERROR OnPowerSavingActivated ()
 
PVR_ERROR OnPowerSavingDeactivated ()
 
int GetPriority () const
 Get the priority of this client. Larger value means higher priority.
 
void SetPriority (int iPriority)
 Set a new priority for this client.
 
PVR_ERROR GetStreamReadChunkSize (int &iChunkSize) const
 Obtain the chunk size to use when reading streams.
 
AddonInstance_PVRGetInstanceInterface ()
 Get the interface table used between addon and Kodi.
 
static const char * ToString (const PVR_ERROR error)
 

Additional Inherited Members

- Protected Attributes inherited from ADDON::IAddonInstanceHandler
KODI_ADDON_INSTANCE_INFO m_info {}
 
KODI_ADDON_INSTANCE_STRUCT m_ifc {}
 

Detailed Description

Interface from Kodi to a PVR add-on.

Also translates Kodi's C++ structures to the add-on's C structures.

Constructor & Destructor Documentation

◆ CPVRClient()

PVR::CPVRClient::CPVRClient ( const ADDON::AddonInfoPtr & addonInfo,
ADDON::AddonInstanceId instanceId,
int clientId )

◆ ~CPVRClient()

PVR::CPVRClient::~CPVRClient ( )
override

Member Function Documentation

◆ AddTimer()

PVR_ERROR PVR::CPVRClient::AddTimer ( const CPVRTimerInfoTag & timer)

Add a timer on the backend.

Parameters
timerThe timer to add.
Returns
PVR_ERROR_NO_ERROR if the timer has been added successfully.

◆ CallChannelMenuHook()

PVR_ERROR PVR::CPVRClient::CallChannelMenuHook ( const CPVRClientMenuHook & hook,
const std::shared_ptr< const CPVRChannel > & channel )

Call one of the channel menu hooks of the client.

Parameters
hookThe hook to call.
tagThe channel associated with the hook to be called.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ CallEpgTagMenuHook()

PVR_ERROR PVR::CPVRClient::CallEpgTagMenuHook ( const CPVRClientMenuHook & hook,
const std::shared_ptr< const CPVREpgInfoTag > & tag )

Call one of the EPG tag menu hooks of the client.

Parameters
hookThe hook to call.
tagThe EPG tag associated with the hook to be called.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ CallRecordingMenuHook()

PVR_ERROR PVR::CPVRClient::CallRecordingMenuHook ( const CPVRClientMenuHook & hook,
const std::shared_ptr< const CPVRRecording > & recording,
bool bDeleted )

Call one of the recording menu hooks of the client.

Parameters
hookThe hook to call.
tagThe recording associated with the hook to be called.
bDeletedTrue, if the recording is deleted (trashed), false otherwise
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ CallSettingsMenuHook()

PVR_ERROR PVR::CPVRClient::CallSettingsMenuHook ( const CPVRClientMenuHook & hook)

Call one of the settings menu hooks of the client.

Parameters
hookThe hook to call.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ CallTimerMenuHook()

PVR_ERROR PVR::CPVRClient::CallTimerMenuHook ( const CPVRClientMenuHook & hook,
const std::shared_ptr< const CPVRTimerInfoTag > & timer )

Call one of the timer menu hooks of the client.

Parameters
hookThe hook to call.
tagThe timer associated with the hook to be called.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ CanPauseStream()

PVR_ERROR PVR::CPVRClient::CanPauseStream ( bool & bCanPause) const

Check whether PVR backend supports pausing the currently playing stream.

Parameters
bCanPauseTrue if the stream can be paused, false otherwise.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ CanSeekStream()

PVR_ERROR PVR::CPVRClient::CanSeekStream ( bool & bCanSeek) const

Check whether PVR backend supports seeking for the currently playing stream.

Parameters
bCanSeekTrue if the stream can be seeked, false otherwise.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ CloseLiveStream()

PVR_ERROR PVR::CPVRClient::CloseLiveStream ( )

Close an open live stream.

Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ CloseRecordedStream()

PVR_ERROR PVR::CPVRClient::CloseRecordedStream ( )

Close an open recording stream.

Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ Continue()

void PVR::CPVRClient::Continue ( )

Continue this add-on instance. Client add-on access is okay again after this call.

◆ Create()

ADDON_STATUS PVR::CPVRClient::Create ( )

Initialise the instance of this add-on.

◆ DeleteAllRecordingsFromTrash()

PVR_ERROR PVR::CPVRClient::DeleteAllRecordingsFromTrash ( )

Delete all recordings permanent which in the deleted folder on the backend.

Returns
PVR_ERROR_NO_ERROR if the recordings has been deleted successfully.

◆ DeleteChannel()

PVR_ERROR PVR::CPVRClient::DeleteChannel ( const std::shared_ptr< const CPVRChannel > & channel)

Request the client to delete given channel.

Parameters
channelThe channel to delete
Returns
PVR_ERROR_NO_ERROR if the delete has been fetched successfully.

◆ DeleteRecording()

PVR_ERROR PVR::CPVRClient::DeleteRecording ( const CPVRRecording & recording)

Delete a recording on the backend.

Parameters
recordingThe recording to delete.
Returns
PVR_ERROR_NO_ERROR if the recording has been deleted successfully.

◆ DeleteTimer()

PVR_ERROR PVR::CPVRClient::DeleteTimer ( const CPVRTimerInfoTag & timer,
bool bForce = false )

Delete a timer on the backend.

Parameters
timerThe timer to delete.
bForceSet to true to delete a timer that is currently recording a program.
Returns
PVR_ERROR_NO_ERROR if the timer has been deleted successfully.

◆ DemuxAbort()

PVR_ERROR PVR::CPVRClient::DemuxAbort ( )

Abort the demultiplexer thread in the add-on.

Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ DemuxFlush()

PVR_ERROR PVR::CPVRClient::DemuxFlush ( )

Flush all data that's currently in the demultiplexer buffer in the add-on.

Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ DemuxRead()

PVR_ERROR PVR::CPVRClient::DemuxRead ( DemuxPacket *& packet)

Read a packet from the demultiplexer.

Parameters
packetThe packet read.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ DemuxReset()

PVR_ERROR PVR::CPVRClient::DemuxReset ( )

Reset the demultiplexer in the add-on.

Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ Destroy()

void PVR::CPVRClient::Destroy ( )

Destroy the instance of this add-on.

◆ FillBuffer()

PVR_ERROR PVR::CPVRClient::FillBuffer ( bool mode)

Notify the pvr addon/demuxer that Kodi wishes to fill demux queue.

Parameters
modefor setting on/off
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.
Remarks
Optional, and only used if addon has its own demuxer.

◆ GetBackendHostname()

const std::string & PVR::CPVRClient::GetBackendHostname ( ) const

the ip address or alias of the pvr backend server

◆ GetBackendName()

const std::string & PVR::CPVRClient::GetBackendName ( ) const
Returns
The name reported by the backend.

◆ GetBackendVersion()

const std::string & PVR::CPVRClient::GetBackendVersion ( ) const
Returns
The version string reported by the backend.

◆ GetChannelGroupMembers()

PVR_ERROR PVR::CPVRClient::GetChannelGroupMembers ( CPVRChannelGroup * group,
std::vector< std::shared_ptr< CPVRChannelGroupMember > > & groupMembers ) const

Request the list of all group members from the backend.

Parameters
groupThe group to get the members for.
groupMembersThe container for the group members.
Returns
PVR_ERROR_NO_ERROR if the list has been fetched successfully.

◆ GetChannelGroups()

PVR_ERROR PVR::CPVRClient::GetChannelGroups ( CPVRChannelGroups * groups) const

Request the list of all channel groups from the backend.

Parameters
groupsThe groups container to get the groups for.
Returns
PVR_ERROR_NO_ERROR if the list has been fetched successfully.

◆ GetChannelGroupsAmount()

PVR_ERROR PVR::CPVRClient::GetChannelGroupsAmount ( int & iGroups) const

Get the total amount of channel groups from the backend.

Parameters
iGroupsThe total amount of channel groups on the server or -1 on error.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ GetChannels()

PVR_ERROR PVR::CPVRClient::GetChannels ( bool bRadio,
std::vector< std::shared_ptr< CPVRChannel > > & channels ) const

Request the list of all channels from the backend.

Parameters
bRadioTrue to get the radio channels, false to get the TV channels.
channelsThe container for the channels.
Returns
PVR_ERROR_NO_ERROR if the list has been fetched successfully.

◆ GetChannelsAmount()

PVR_ERROR PVR::CPVRClient::GetChannelsAmount ( int & iChannels) const

Get the total amount of channels from the backend.

Parameters
iChannelsThe total amount of channels on the server or -1 on error.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ GetChannelStreamProperties()

PVR_ERROR PVR::CPVRClient::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.

Parameters
channelThe channel.
propsThe container to be filled with the stream properties.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ GetClientCapabilities()

const CPVRClientCapabilities & PVR::CPVRClient::GetClientCapabilities ( ) const
inline

Query this add-on's capabilities.

Returns
The add-on's capabilities.

◆ GetClientName()

std::string PVR::CPVRClient::GetClientName ( ) const

The name of the PVR client, as specified by the addon developer.

Returns
string that can be used in log messages and the GUI.

◆ GetConnectionState()

PVR_CONNECTION_STATE PVR::CPVRClient::GetConnectionState ( ) const

Gets the backend connection state.

Returns
the backend connection state.

◆ GetConnectionString()

const std::string & PVR::CPVRClient::GetConnectionString ( ) const
Returns
The connection string reported by the backend.

◆ GetDescrambleInfo()

PVR_ERROR PVR::CPVRClient::GetDescrambleInfo ( int channelUid,
PVR_DESCRAMBLE_INFO & descrambleinfo ) const

Get the descramble information of the stream that's currently open.

Parameters
channelUidChannel unique identifier
descrambleinfoThe descramble information.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ GetDriveSpace()

PVR_ERROR PVR::CPVRClient::GetDriveSpace ( uint64_t & iTotal,
uint64_t & iUsed ) const

Get the disk space reported by the server.

Parameters
iTotalThe total disk space.
iUsedThe used disk space.
Returns
PVR_ERROR_NO_ERROR if the drive space has been fetched successfully.

◆ GetEPGForChannel()

PVR_ERROR PVR::CPVRClient::GetEPGForChannel ( int iChannelUid,
CPVREpg * epg,
time_t start,
time_t end ) const

Request an EPG table for a channel from the client.

Parameters
iChannelUidThe UID of the channel to get the EPG table for.
epgThe table to write the data to.
startThe start time to use.
endThe end time to use.
Returns
PVR_ERROR_NO_ERROR if the table has been fetched successfully.

◆ GetEpgTagEdl()

PVR_ERROR PVR::CPVRClient::GetEpgTagEdl ( const std::shared_ptr< const CPVREpgInfoTag > & epgTag,
std::vector< PVR_EDL_ENTRY > & edls ) const

Retrieve the edit decision list (EDL) from the backend.

Parameters
epgTagThe EPG tag.
edlsThe edit decision list (empty on error).
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ GetEpgTagStreamProperties()

PVR_ERROR PVR::CPVRClient::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. Values are obtained from the PVR backend.

Parameters
tagThe EPG tag.
propsThe container to be filled with the stream properties.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ GetFullClientName()

std::string PVR::CPVRClient::GetFullClientName ( ) const

A name used to uniquely identify the client, inclusing addon name and instance name, if multiple instances are supported by the client implementation.

Returns
string that can be used in log messages and the GUI.

◆ GetID()

int PVR::CPVRClient::GetID ( ) const
Returns
The ID of this instance.

◆ GetInstanceInterface()

AddonInstance_PVR * PVR::CPVRClient::GetInstanceInterface ( )
inline

Get the interface table used between addon and Kodi.

Todo
This function will be removed after old callback library system is removed.

◆ GetInstanceName()

std::string PVR::CPVRClient::GetInstanceName ( ) const

The name of the PVR client addon instance, as specified by the user in the addon settings. Empty if addon does not support multiple instances.

Returns
string that can be used in log messages and the GUI.

◆ GetLiveStreamLength()

PVR_ERROR PVR::CPVRClient::GetLiveStreamLength ( int64_t & iLength) const

Get the length of the currently playing live stream, if any.

Parameters
iLengthThe total length of the stream that's currently being read or -1 on error.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ GetMenuHooks()

std::shared_ptr< CPVRClientMenuHooks > PVR::CPVRClient::GetMenuHooks ( ) const

Get the client's menu hooks.

Returns
The hooks. Guaranteed never to be nullptr.

◆ GetPreviousConnectionState()

PVR_CONNECTION_STATE PVR::CPVRClient::GetPreviousConnectionState ( ) const

Gets the backend's previous connection state.

Returns
the backend's previous connection state.

◆ GetPriority()

int PVR::CPVRClient::GetPriority ( ) const

Get the priority of this client. Larger value means higher priority.

Returns
The priority.

◆ GetProviders()

PVR_ERROR PVR::CPVRClient::GetProviders ( CPVRProvidersContainer & providers) const

Request the list of all providers from the backend.

Parameters
providersThe providers list to add the providers to.
Returns
PVR_ERROR_NO_ERROR if the list has been fetched successfully.

◆ GetProvidersAmount()

PVR_ERROR PVR::CPVRClient::GetProvidersAmount ( int & iProviders) const

Get the total amount of providers from the backend.

Parameters
iChannelsThe total amount of channels on the server or -1 on error.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ GetRecordedStreamLength()

PVR_ERROR PVR::CPVRClient::GetRecordedStreamLength ( int64_t & iLength) const

Get the length of the currently playing recording stream, if any.

Parameters
iLengthThe total length of the stream that's currently being read or -1 on error.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ GetRecordingEdl()

PVR_ERROR PVR::CPVRClient::GetRecordingEdl ( const CPVRRecording & recording,
std::vector< PVR_EDL_ENTRY > & edls ) const

Retrieve the edit decision list (EDL) from the backend.

Parameters
recordingThe recording.
edlsThe edit decision list (empty on error).
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ GetRecordingLastPlayedPosition()

PVR_ERROR PVR::CPVRClient::GetRecordingLastPlayedPosition ( const CPVRRecording & recording,
int & iPosition ) const

Retrieve the last watched position of a recording on the backend.

Parameters
recordingThe recording.
iPositionThe last watched position in seconds or -1 on error
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ GetRecordings()

PVR_ERROR PVR::CPVRClient::GetRecordings ( CPVRRecordings * results,
bool deleted ) const

Request the list of all recordings from the backend.

Parameters
resultsThe container to add the recordings to.
deletedTrue to return deleted recordings.
Returns
PVR_ERROR_NO_ERROR if the list has been fetched successfully.

◆ GetRecordingsAmount()

PVR_ERROR PVR::CPVRClient::GetRecordingsAmount ( bool deleted,
int & iRecordings ) const

Get the total amount of recordings from the backend.

Parameters
deletedTrue to return deleted recordings.
iRecordingsThe total amount of recordings on the server or -1 on error.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ GetRecordingSize()

PVR_ERROR PVR::CPVRClient::GetRecordingSize ( const CPVRRecording & recording,
int64_t & sizeInBytes ) const

Retrieve the size of a recording on the backend.

Parameters
recordingThe recording.
sizeInBytesThe size in bytes
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ GetRecordingStreamProperties()

PVR_ERROR PVR::CPVRClient::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.

Parameters
recordingThe recording.
propsThe container to be filled with the stream properties.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ GetStreamProperties()

PVR_ERROR PVR::CPVRClient::GetStreamProperties ( PVR_STREAM_PROPERTIES * pProperties) const

Get the stream properties of the stream that's currently being read.

Parameters
pPropertiesThe properties.
Returns
PVR_ERROR_NO_ERROR if the properties have been fetched successfully.

◆ GetStreamReadChunkSize()

PVR_ERROR PVR::CPVRClient::GetStreamReadChunkSize ( int & iChunkSize) const

Obtain the chunk size to use when reading streams.

Parameters
iChunkSizethe chunk size in bytes.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ GetStreamTimes()

PVR_ERROR PVR::CPVRClient::GetStreamTimes ( PVR_STREAM_TIMES * times) const

Get Stream times for the currently playing stream, if any (will be moved to inputstream).

Parameters
timesThe stream times.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ GetTimers()

PVR_ERROR PVR::CPVRClient::GetTimers ( CPVRTimersContainer * results) const

Request the list of all timers from the backend.

Parameters
resultsThe container to store the result in.
Returns
PVR_ERROR_NO_ERROR if the list has been fetched successfully.

◆ GetTimersAmount()

PVR_ERROR PVR::CPVRClient::GetTimersAmount ( int & iTimers) const

Get the total amount of timers from the backend.

Parameters
iTimersThe total amount of timers on the backend or -1 on error.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ GetTimerTypes()

const std::vector< std::shared_ptr< CPVRTimerType > > & PVR::CPVRClient::GetTimerTypes ( ) const

Get the timer types supported by the backend, without updating them from the backend.

Returns
the types.

◆ IgnoreClient()

bool PVR::CPVRClient::IgnoreClient ( ) const

Check whether this client should be ignored.

Returns
True if this client should be ignored, false otherwise.

◆ IsEnabled()

bool PVR::CPVRClient::IsEnabled ( ) const

Check whether this client is enabled, according to its instance/add-on configuration.

Returns
True if this client is enabled, false otherwise.

◆ IsPlayable()

PVR_ERROR PVR::CPVRClient::IsPlayable ( const std::shared_ptr< const CPVREpgInfoTag > & tag,
bool & bIsPlayable ) const

◆ IsRealTimeStream()

PVR_ERROR PVR::CPVRClient::IsRealTimeStream ( bool & bRealTime) const

Check whether the currently playing stream, if any, is a real-time stream.

Parameters
bRealTimeTrue if real-time, false otherwise.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ IsRecordable()

PVR_ERROR PVR::CPVRClient::IsRecordable ( const std::shared_ptr< const CPVREpgInfoTag > & tag,
bool & bIsRecordable ) const

◆ OnPowerSavingActivated()

PVR_ERROR PVR::CPVRClient::OnPowerSavingActivated ( )

◆ OnPowerSavingDeactivated()

PVR_ERROR PVR::CPVRClient::OnPowerSavingDeactivated ( )

◆ OnPreInstall()

void PVR::CPVRClient::OnPreInstall ( )
overridevirtual

Reimplemented from ADDON::IAddonInstanceHandler.

◆ OnPreUnInstall()

void PVR::CPVRClient::OnPreUnInstall ( )
overridevirtual

Reimplemented from ADDON::IAddonInstanceHandler.

◆ OnSystemSleep()

PVR_ERROR PVR::CPVRClient::OnSystemSleep ( )

Propagate power management events to this add-on.

Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ OnSystemWake()

PVR_ERROR PVR::CPVRClient::OnSystemWake ( )

◆ OpenDialogChannelAdd()

PVR_ERROR PVR::CPVRClient::OpenDialogChannelAdd ( const std::shared_ptr< const CPVRChannel > & channel)

Request the client to open dialog about given channel to add.

Parameters
channelThe channel to add
Returns
PVR_ERROR_NO_ERROR if the add has been fetched successfully.

◆ OpenDialogChannelSettings()

PVR_ERROR PVR::CPVRClient::OpenDialogChannelSettings ( const std::shared_ptr< const CPVRChannel > & channel)

Request the client to open dialog about given channel settings.

Parameters
channelThe channel to edit
Returns
PVR_ERROR_NO_ERROR if the edit has been fetched successfully.

◆ OpenLiveStream()

PVR_ERROR PVR::CPVRClient::OpenLiveStream ( const std::shared_ptr< const CPVRChannel > & channel)

Open a live stream on the server.

Parameters
channelThe channel to stream.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ OpenRecordedStream()

PVR_ERROR PVR::CPVRClient::OpenRecordedStream ( const std::shared_ptr< const CPVRRecording > & recording)

Open a recording on the server.

Parameters
recordingThe recording to open.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ PauseStream()

PVR_ERROR PVR::CPVRClient::PauseStream ( bool bPaused)

(Un)Pause a stream.

Parameters
bPausedTrue to pause the stream, false to unpause.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ ReadLiveStream()

PVR_ERROR PVR::CPVRClient::ReadLiveStream ( void * lpBuf,
int64_t uiBufSize,
int & iRead )

Read from an open live stream.

Parameters
lpBufThe buffer to store the data in.
uiBufSizeThe amount of bytes to read.
iReadThe amount of bytes that were actually read from the stream.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ ReadRecordedStream()

PVR_ERROR PVR::CPVRClient::ReadRecordedStream ( void * lpBuf,
int64_t uiBufSize,
int & iRead )

Read from an open recording stream.

Parameters
lpBufThe buffer to store the data in.
uiBufSizeThe amount of bytes to read.
iReadThe amount of bytes that were actually read from the stream.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ ReadyToUse()

bool PVR::CPVRClient::ReadyToUse ( ) const
Returns
True if this instance is initialised (ADDON_Create returned true), false otherwise.

◆ ReCreate()

void PVR::CPVRClient::ReCreate ( )

Destroy and recreate this add-on.

◆ RenameChannel()

PVR_ERROR PVR::CPVRClient::RenameChannel ( const std::shared_ptr< const CPVRChannel > & channel)

Request the client to rename given channel.

Parameters
channelThe channel to rename
Returns
PVR_ERROR_NO_ERROR if the rename has been fetched successfully.

◆ RenameRecording()

PVR_ERROR PVR::CPVRClient::RenameRecording ( const CPVRRecording & recording)

Rename a recording on the backend.

Parameters
recordingThe recording to rename.
Returns
PVR_ERROR_NO_ERROR if the recording has been renamed successfully.

◆ SeekLiveStream()

PVR_ERROR PVR::CPVRClient::SeekLiveStream ( int64_t iFilePosition,
int iWhence,
int64_t & iPosition )

Seek in a live stream on a backend.

Parameters
iFilePositionThe position to seek to.
iWhence?
iPositionThe new position or -1 on error.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ SeekRecordedStream()

PVR_ERROR PVR::CPVRClient::SeekRecordedStream ( int64_t iFilePosition,
int iWhence,
int64_t & iPosition )

Seek in a recording stream on a backend.

Parameters
iFilePositionThe position to seek to.
iWhence?
iPositionThe new position or -1 on error.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ SeekTime()

PVR_ERROR PVR::CPVRClient::SeekTime ( double time,
bool backwards,
double * startpts )

Notify the pvr addon/demuxer that Kodi wishes to seek the stream by time.

Parameters
timeThe absolute time since stream start
backwardsTrue to seek to keyframe BEFORE time, else AFTER
startptscan be updated to point to where display should start
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.
Remarks
Optional, and only used if addon has its own demuxer.

◆ SetConnectionState()

void PVR::CPVRClient::SetConnectionState ( PVR_CONNECTION_STATE state)

Sets the backend connection state.

Parameters
statethe new backend connection state.

◆ SetEPGMaxFutureDays()

PVR_ERROR PVR::CPVRClient::SetEPGMaxFutureDays ( int iFutureDays)

Tell the client the future time frame to use when notifying epg events back to Kodi.

The client might push epg events asynchronously to Kodi using the callback function EpgEventStateChange. To be able to only push events that are actually of interest for Kodi, client needs to know about the future epg time frame Kodi uses.

Parameters
[in]iFutureDaysnumber of days after "now". EPG_TIMEFRAME_UNLIMITED means that Kodi is interested in all epg events, regardless of event times.
Returns
PVR_ERROR_NO_ERROR if new value was successfully set.

◆ SetEPGMaxPastDays()

PVR_ERROR PVR::CPVRClient::SetEPGMaxPastDays ( int iPastDays)

Tell the client the past time frame to use when notifying epg events back to Kodi.

The client might push epg events asynchronously to Kodi using the callback function EpgEventStateChange. To be able to only push events that are actually of interest for Kodi, client needs to know about the past epg time frame Kodi uses.

Parameters
[in]iPastDaysnumber of days before "now". EPG_TIMEFRAME_UNLIMITED means that Kodi is interested in all epg events, regardless of event times.
Returns
PVR_ERROR_NO_ERROR if new value was successfully set.

◆ SetPriority()

void PVR::CPVRClient::SetPriority ( int iPriority)

Set a new priority for this client.

Parameters
iPriorityThe new priority.

◆ SetRecordingLastPlayedPosition()

PVR_ERROR PVR::CPVRClient::SetRecordingLastPlayedPosition ( const CPVRRecording & recording,
int lastplayedposition )

Set the last watched position of a recording on the backend.

Parameters
recordingThe recording.
lastplayedpositionThe last watched position in seconds
Returns
PVR_ERROR_NO_ERROR if the position has been stored successfully.

◆ SetRecordingLifetime()

PVR_ERROR PVR::CPVRClient::SetRecordingLifetime ( const CPVRRecording & recording)

Set the lifetime of a recording on the backend.

Parameters
recordingThe recording to set the lifetime for. recording.m_iLifetime contains the new lifetime value.
Returns
PVR_ERROR_NO_ERROR if the recording's lifetime has been set successfully.

◆ SetRecordingPlayCount()

PVR_ERROR PVR::CPVRClient::SetRecordingPlayCount ( const CPVRRecording & recording,
int count )

Set the play count of a recording on the backend.

Parameters
recordingThe recording to set the play count.
countPlay count.
Returns
PVR_ERROR_NO_ERROR if the recording's play count has been set successfully.

◆ SetSpeed()

PVR_ERROR PVR::CPVRClient::SetSpeed ( int speed)

Notify the pvr addon/demuxer that Kodi wishes to change playback speed.

Parameters
speedThe requested playback speed
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.
Remarks
Optional, and only used if addon has its own demuxer.

◆ SignalQuality()

PVR_ERROR PVR::CPVRClient::SignalQuality ( int channelUid,
PVR_SIGNAL_STATUS & qualityinfo ) const

Get the signal quality of the stream that's currently open.

Parameters
channelUidChannel unique identifier
qualityinfoThe signal quality.
Returns
PVR_ERROR_NO_ERROR on success, respective error code otherwise.

◆ StartChannelScan()

PVR_ERROR PVR::CPVRClient::StartChannelScan ( )

Start a channel scan on the server.

Returns
PVR_ERROR_NO_ERROR if the channel scan has been started successfully.

◆ Stop()

void PVR::CPVRClient::Stop ( )

Stop this add-on instance. No more client add-on access after this call.

◆ ToString()

const char * PVR::CPVRClient::ToString ( const PVR_ERROR error)
static

◆ UndeleteRecording()

PVR_ERROR PVR::CPVRClient::UndeleteRecording ( const CPVRRecording & recording)

Undelete a recording on the backend.

Parameters
recordingThe recording to undelete.
Returns
PVR_ERROR_NO_ERROR if the recording has been undeleted successfully.

◆ UpdateTimer()

PVR_ERROR PVR::CPVRClient::UpdateTimer ( const CPVRTimerInfoTag & timer)

Update the timer information on the server.

Parameters
timerThe timer to update.
Returns
PVR_ERROR_NO_ERROR if the timer has been updated successfully.

◆ UpdateTimerTypes()

PVR_ERROR PVR::CPVRClient::UpdateTimerTypes ( )

Update all timer types supported by the backend.

Returns
PVR_ERROR_NO_ERROR if the list has been fetched successfully.

The documentation for this class was generated from the following files: