![]() |
Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
|
Functions | |
PVR add-on methods | |
Functions that the PVR client add-on must implement, but some can be empty. The 'remarks' field indicates which methods should be implemented, and which ones are optional. | |
PVR_ERROR | GetAddonCapabilities (PVR_ADDON_CAPABILITIES *pCapabilities) |
const char * | GetBackendName (void) |
const char * | GetBackendVersion (void) |
const char * | GetConnectionString (void) |
PVR_ERROR | GetDriveSpace (long long *iTotal, long long *iUsed) |
PVR_ERROR | CallMenuHook (const PVR_MENUHOOK &menuhook, const PVR_MENUHOOK_DATA &item) |
PVR EPG methods | |
| |
PVR_ERROR | GetEPGForChannel (ADDON_HANDLE handle, const PVR_CHANNEL &channel, time_t iStart, time_t iEnd) |
PVR_ERROR | IsEPGTagRecordable (const EPG_TAG *tag, bool *bIsRecordable) |
PVR_ERROR | IsEPGTagPlayable (const EPG_TAG *tag, bool *bIsPlayable) |
PVR_ERROR | GetEPGTagEdl (const EPG_TAG *epgTag, PVR_EDL_ENTRY edl[], int *size) |
PVR_ERROR | GetEPGTagStreamProperties (const EPG_TAG *tag, PVR_NAMED_VALUE *properties, unsigned int *iPropertiesCount) |
PVR channel group methods | |
| |
int | GetChannelGroupsAmount (void) |
PVR_ERROR | GetChannelGroups (ADDON_HANDLE handle, bool bRadio) |
PVR_ERROR | GetChannelGroupMembers (ADDON_HANDLE handle, const PVR_CHANNEL_GROUP &group) |
PVR channel methods | |
| |
PVR_ERROR | OpenDialogChannelScan (void) |
int | GetChannelsAmount (void) |
PVR_ERROR | GetChannels (ADDON_HANDLE handle, bool bRadio) |
PVR_ERROR | DeleteChannel (const PVR_CHANNEL &channel) |
PVR_ERROR | RenameChannel (const PVR_CHANNEL &channel) |
PVR_ERROR | OpenDialogChannelSettings (const PVR_CHANNEL &channel) |
PVR_ERROR | OpenDialogChannelAdd (const PVR_CHANNEL &channel) |
PVR recording methods | |
| |
int | GetRecordingsAmount (bool deleted) |
PVR_ERROR | GetRecordings (ADDON_HANDLE handle, bool deleted) |
PVR_ERROR | DeleteRecording (const PVR_RECORDING &recording) |
PVR_ERROR | UndeleteRecording (const PVR_RECORDING &recording) |
PVR_ERROR | DeleteAllRecordingsFromTrash () |
Delete all recordings permanent which in the deleted folder on the backend. More... | |
PVR_ERROR | RenameRecording (const PVR_RECORDING &recording) |
PVR_ERROR | SetRecordingLifetime (const PVR_RECORDING *recording) |
PVR_ERROR | SetRecordingPlayCount (const PVR_RECORDING &recording, int count) |
PVR_ERROR | SetRecordingLastPlayedPosition (const PVR_RECORDING &recording, int lastplayedposition) |
int | GetRecordingLastPlayedPosition (const PVR_RECORDING &recording) |
PVR_ERROR | GetRecordingEdl (const PVR_RECORDING &recording, PVR_EDL_ENTRY edl[], int *size) |
PVR_ERROR | GetTimerTypes (PVR_TIMER_TYPE types[], int *typesCount) |
PVR timer methods | |
| |
int | GetTimersAmount (void) |
PVR_ERROR | GetTimers (ADDON_HANDLE handle) |
PVR_ERROR | AddTimer (const PVR_TIMER &timer) |
PVR_ERROR | DeleteTimer (const PVR_TIMER &timer, bool bForceDelete) |
PVR_ERROR | UpdateTimer (const PVR_TIMER &timer) |
PVR live stream methods, used to open and close a stream to a channel, and optionally perform read operations on the stream | |
bool | OpenLiveStream (const PVR_CHANNEL &channel) |
void | CloseLiveStream (void) |
int | ReadLiveStream (unsigned char *pBuffer, unsigned int iBufferSize) |
long long | SeekLiveStream (long long iPosition, int iWhence=SEEK_SET) |
long long | LengthLiveStream (void) |
PVR_ERROR | SignalStatus (PVR_SIGNAL_STATUS &signalStatus) |
PVR_ERROR | GetDescrambleInfo (PVR_DESCRAMBLE_INFO *descrambleInfo) |
PVR_ERROR | GetChannelStreamProperties (const PVR_CHANNEL *channel, PVR_NAMED_VALUE *properties, unsigned int *iPropertiesCount) |
PVR_ERROR | GetRecordingStreamProperties (const PVR_RECORDING *recording, PVR_NAMED_VALUE *properties, unsigned int *iPropertiesCount) |
PVR_ERROR | GetStreamProperties (PVR_STREAM_PROPERTIES *pProperties) |
PVR recording stream methods, used to open and close a stream to a recording, and perform read operations on the stream. | |
| |
PVR_ERROR | GetStreamReadChunkSize (int *chunksize) |
bool | OpenRecordedStream (const PVR_RECORDING &recording) |
void | CloseRecordedStream (void) |
int | ReadRecordedStream (unsigned char *pBuffer, unsigned int iBufferSize) |
long long | SeekRecordedStream (long long iPosition, int iWhence=SEEK_SET) |
long long | LengthRecordedStream (void) |
PVR demultiplexer methods | |
| |
void | DemuxReset (void) |
void | DemuxAbort (void) |
void | DemuxFlush (void) |
DemuxPacket * | DemuxRead (void) |
bool | CanPauseStream () |
bool | CanSeekStream () |
void | PauseStream (bool bPaused) |
Notify the pvr addon that Kodi (un)paused the currently playing stream. More... | |
bool | SeekTime (double time, bool backwards, double *startpts) |
void | SetSpeed (int speed) |
const char * | GetBackendHostname () |
bool | IsTimeshifting () |
bool | IsRealTimeStream () |
PVR_ERROR | SetEPGTimeFrame (int iDays) |
void | OnSystemSleep () |
void | OnSystemWake () |
void | OnPowerSavingActivated () |
void | OnPowerSavingDeactivated () |
PVR_ERROR | GetStreamTimes (PVR_STREAM_TIMES *times) |
void | __declspec (dllexport) get_addon(void *ptr) |
void __declspec | ( | dllexport | ) |
Called by Kodi to assign the function pointers of this add-on to pClient.
ptr | The struct to assign the function pointers to. |
Add a timer on the backend.
timer | The timer to add. |
PVR_ERROR CallMenuHook | ( | const PVR_MENUHOOK & | menuhook, |
const PVR_MENUHOOK_DATA & | item | ||
) |
Call one of the menu hooks (if supported). Supported PVR_MENUHOOK instances have to be added in ADDON_Create(), by calling AddMenuHook() on the callback.
menuhook | The hook to call. |
item | The selected item for which the hook was called. |
bool CanPauseStream | ( | ) |
Check if the backend support pausing the currently playing stream This will enable/disable the pause button in Kodi based on the return value
bool CanSeekStream | ( | ) |
Check if the backend supports seeking for the currently playing stream This will enable/disable the rewind/forward buttons in Kodi based on the return value
Close an open live stream.
Close an open stream from a recording.
PVR_ERROR DeleteAllRecordingsFromTrash | ( | ) |
Delete all recordings permanent which in the deleted folder on the backend.
PVR_ERROR DeleteChannel | ( | const PVR_CHANNEL & | channel | ) |
Delete a channel from the backend.
channel | The channel to delete. |
PVR_ERROR DeleteRecording | ( | const PVR_RECORDING & | recording | ) |
Delete a recording on the backend.
recording | The recording to delete. |
Delete a timer on the backend.
timer | The timer to delete. |
bForceDelete | Set to true to delete a timer that is currently recording a program. |
Abort the demultiplexer thread in the add-on.
Flush all data that's currently in the demultiplexer buffer in the add-on.
DemuxPacket * DemuxRead | ( | void | ) |
Read the next packet from the demultiplexer, if there is one.
Reset the demultiplexer in the add-on.
PVR_ERROR GetAddonCapabilities | ( | PVR_ADDON_CAPABILITIES * | pCapabilities | ) |
Get the list of features that this add-on provides. Called by Kodi to query the add-on's capabilities. Used to check which options should be presented in the UI, which methods to call, etc. All capabilities that the add-on supports should be set to true.
pCapabilities | The add-on's capabilities. |
const char * GetBackendHostname | ( | ) |
Get the hostname of the pvr backend server
const char * GetBackendName | ( | void | ) |
const char * GetBackendVersion | ( | void | ) |
PVR_ERROR GetChannelGroupMembers | ( | ADDON_HANDLE | handle, |
const PVR_CHANNEL_GROUP & | group | ||
) |
Request the list of all group members of a group from the backend if it supports channel groups. Member entries are added to Kodi by calling TransferChannelGroupMember() on the callback.
handle | Handle to pass to the callback method. |
group | The group to get the members for. |
PVR_ERROR GetChannelGroups | ( | ADDON_HANDLE | handle, |
bool | bRadio | ||
) |
Request the list of all channel groups from the backend if it supports channel groups. Channel group entries are added to Kodi by calling TransferChannelGroup() on the callback.
handle | Handle to pass to the callback method. |
bRadio | True to get the radio channel groups, false to get the TV channel groups. |
int GetChannelGroupsAmount | ( | void | ) |
Get the total amount of channel groups on the backend if it supports channel groups.
PVR_ERROR GetChannels | ( | ADDON_HANDLE | handle, |
bool | bRadio | ||
) |
Request the list of all channels from the backend. Channel entries are added to Kodi by calling TransferChannelEntry() on the callback.
handle | Handle to pass to the callback method. |
bRadio | True to get the radio channels, false to get the TV channels. |
int GetChannelsAmount | ( | void | ) |
PVR_ERROR GetChannelStreamProperties | ( | const PVR_CHANNEL * | channel, |
PVR_NAMED_VALUE * | properties, | ||
unsigned int * | iPropertiesCount | ||
) |
Get the stream properties for a channel from the backend.
[in] | channel | The channel to get the stream properties for. |
[in,out] | properties | in: an array for the properties to return, out: the properties required to play the stream. |
[in,out] | iPropertiesCount | in: the size of the properties array, out: the number of properties returned. |
const char * GetConnectionString | ( | void | ) |
PVR_ERROR GetDescrambleInfo | ( | PVR_DESCRAMBLE_INFO * | descrambleInfo | ) |
Get the descramble information of the stream that's currently open.
[out] | descrambleInfo | The descramble information. |
PVR_ERROR GetDriveSpace | ( | long long * | iTotal, |
long long * | iUsed | ||
) |
Get the disk space reported by the backend (if supported).
iTotal | The total disk space in bytes. |
iUsed | The used disk space in bytes. |
PVR_ERROR GetEPGForChannel | ( | ADDON_HANDLE | handle, |
const PVR_CHANNEL & | channel, | ||
time_t | iStart, | ||
time_t | iEnd | ||
) |
Request the EPG for a channel from the backend. EPG entries are added to Kodi by calling TransferEpgEntry() on the callback.
handle | Handle to pass to the callback method. |
channel | The channel to get the EPG table for. |
iStart | Get events after this time (UTC). |
iEnd | Get events before this time (UTC). |
PVR_ERROR GetEPGTagEdl | ( | const EPG_TAG * | epgTag, |
PVR_EDL_ENTRY | edl[], | ||
int * | size | ||
) |
Retrieve the edit decision list (EDL) of an EPG tag on the backend.
epgTag | The EPG tag. |
edl | out: The function has to write the EDL into this array. |
size | in: The maximum size of the EDL, out: the actual size of the EDL. |
PVR_ERROR GetEPGTagStreamProperties | ( | const EPG_TAG * | tag, |
PVR_NAMED_VALUE * | properties, | ||
unsigned int * | iPropertiesCount | ||
) |
Get the stream properties for an epg tag from the backend.
[in] | tag | The epg tag to get the stream properties for. |
[in,out] | properties | in: an array for the properties to return, out: the properties required to play the stream. |
[in,out] | iPropertiesCount | in: the size of the properties array, out: the number of properties returned. |
PVR_ERROR GetRecordingEdl | ( | const PVR_RECORDING & | recording, |
PVR_EDL_ENTRY | edl[], | ||
int * | size | ||
) |
Retrieve the edit decision list (EDL) of a recording on the backend.
recording | The recording. |
edl | out: The function has to write the EDL into this array. |
size | in: The maximum size of the EDL, out: the actual size of the EDL. |
int GetRecordingLastPlayedPosition | ( | const PVR_RECORDING & | recording | ) |
Retrieve the last watched position of a recording on the backend.
recording | The recording. |
PVR_ERROR GetRecordings | ( | ADDON_HANDLE | handle, |
bool | deleted | ||
) |
Request the list of all recordings from the backend, if supported. Recording entries are added to Kodi by calling TransferRecordingEntry() on the callback.
handle | Handle to pass to the callback method. |
deleted | if set return deleted recording (called if bSupportsRecordingsUndelete set to true) |
int GetRecordingsAmount | ( | bool | deleted | ) |
deleted | if set return deleted recording (called if bSupportsRecordingsUndelete set to true) |
PVR_ERROR GetRecordingStreamProperties | ( | const PVR_RECORDING * | recording, |
PVR_NAMED_VALUE * | properties, | ||
unsigned int * | iPropertiesCount | ||
) |
Get the stream properties for a recording from the backend.
[in] | recording | The recording to get the stream properties for. |
[in,out] | properties | in: an array for the properties to return, out: the properties required to play the stream. |
[in,out] | iPropertiesCount | in: the size of the properties array, out: the number of properties returned. |
PVR_ERROR GetStreamProperties | ( | PVR_STREAM_PROPERTIES * | pProperties | ) |
Get the stream properties of the stream that's currently being read.
pProperties | The properties of the currently playing stream. |
PVR_ERROR GetStreamReadChunkSize | ( | int * | chunksize | ) |
Obtain the chunk size to use when reading streams.
chunksize | must be filled with the chunk size in bytes. |
PVR_ERROR GetStreamTimes | ( | PVR_STREAM_TIMES * | times | ) |
Get stream times.
times | A pointer to the data to be filled by the implementation. |
PVR_ERROR GetTimers | ( | ADDON_HANDLE | handle | ) |
Request the list of all timers from the backend if supported. Timer entries are added to Kodi by calling TransferTimerEntry() on the callback.
handle | Handle to pass to the callback method. |
int GetTimersAmount | ( | void | ) |
PVR_ERROR GetTimerTypes | ( | PVR_TIMER_TYPE | types[], |
int * | typesCount | ||
) |
Retrieve the timer types supported by the backend.
types | out: The function has to write the definition of the supported timer types into this array. |
typesCount | in: The maximum size of the list, out: the actual size of the list. default: PVR_ADDON_TIMERTYPE_ARRAY_SIZE |
bool IsRealTimeStream | ( | ) |
Check for real-time streaming
bool IsTimeshifting | ( | ) |
Check if timeshift is active
long long LengthLiveStream | ( | void | ) |
Obtain the length of a live stream.
long long LengthRecordedStream | ( | void | ) |
Obtain the length of a recorded stream.
void OnPowerSavingActivated | ( | ) |
void OnPowerSavingDeactivated | ( | ) |
void OnSystemSleep | ( | ) |
Notify the pvr addon for power management events
void OnSystemWake | ( | ) |
PVR_ERROR OpenDialogChannelAdd | ( | const PVR_CHANNEL & | channel | ) |
Show the dialog to add a channel on the backend, if supported by the backend.
channel | The channel to add. |
Show the channel scan dialog if this backend supports it.
PVR_ERROR OpenDialogChannelSettings | ( | const PVR_CHANNEL & | channel | ) |
Show the channel settings dialog, if supported by the backend.
channel | The channel to show the dialog for. |
bool OpenLiveStream | ( | const PVR_CHANNEL & | channel | ) |
Open a live stream on the backend.
channel | The channel to stream. |
bool OpenRecordedStream | ( | const PVR_RECORDING & | recording | ) |
Open a stream to a recording on the backend.
recording | The recording to open. |
void PauseStream | ( | bool | bPaused | ) |
Notify the pvr addon that Kodi (un)paused the currently playing stream.
int ReadLiveStream | ( | unsigned char * | pBuffer, |
unsigned int | iBufferSize | ||
) |
Read from an open live stream.
pBuffer | The buffer to store the data in. |
iBufferSize | The amount of bytes to read. |
int ReadRecordedStream | ( | unsigned char * | pBuffer, |
unsigned int | iBufferSize | ||
) |
Read from a recording.
pBuffer | The buffer to store the data in. |
iBufferSize | The amount of bytes to read. |
PVR_ERROR RenameChannel | ( | const PVR_CHANNEL & | channel | ) |
Rename a channel on the backend.
channel | The channel to rename, containing the new channel name. |
PVR_ERROR RenameRecording | ( | const PVR_RECORDING & | recording | ) |
Rename a recording on the backend.
recording | The recording to rename, containing the new name. |
long long SeekLiveStream | ( | long long | iPosition, |
int | iWhence = SEEK_SET |
||
) |
Seek in a live stream on a backend that supports timeshifting.
iPosition | The position to seek to. |
iWhence | ? |
long long SeekRecordedStream | ( | long long | iPosition, |
int | iWhence = SEEK_SET |
||
) |
Seek in a recorded stream.
iPosition | The position to seek to. |
iWhence | ? |
bool SeekTime | ( | double | time, |
bool | backwards, | ||
double * | startpts | ||
) |
Notify the pvr addon/demuxer that Kodi wishes to seek the stream by time
time | The absolute time since stream start |
backwards | True to seek to keyframe BEFORE time, else AFTER |
startpts | can be updated to point to where display should start |
PVR_ERROR SetEPGTimeFrame | ( | int | iDays | ) |
Tell the client the 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 epg time frame Kodi uses. Kodi supplies the current epg time frame value in PVR_PROPERTIES.iEpgMaxDays when creating the addon and calls SetEPGTimeFrame later whenever Kodi's epg time frame value changes.
iDays | number of days from "now". EPG_TIMEFRAME_UNLIMITED means that Kodi is interested in all epg events, regardless of event times. |
PVR_ERROR SetRecordingLastPlayedPosition | ( | const PVR_RECORDING & | recording, |
int | lastplayedposition | ||
) |
Set the last watched position of a recording on the backend.
recording | The recording. |
lastplayedposition | The last watched position in seconds |
PVR_ERROR SetRecordingLifetime | ( | const PVR_RECORDING * | recording | ) |
Set the lifetime of a recording on the backend.
recording | The recording to change the lifetime for. recording.iLifetime contains the new lieftime value. |
PVR_ERROR SetRecordingPlayCount | ( | const PVR_RECORDING & | recording, |
int | count | ||
) |
Set the play count of a recording on the backend.
recording | The recording to change the play count. |
count | Play count. |
void SetSpeed | ( | int | speed | ) |
Notify the pvr addon/demuxer that Kodi wishes to change playback speed
speed | The requested playback speed |
PVR_ERROR SignalStatus | ( | PVR_SIGNAL_STATUS & | signalStatus | ) |
Get the signal status of the stream that's currently open.
signalStatus | The signal status. |
PVR_ERROR UndeleteRecording | ( | const PVR_RECORDING & | recording | ) |
Undelete a recording on the backend.
recording | The recording to undelete. |
Update the timer information on the backend.
timer | The timer to update. |