Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches

PVR TV stream
Stream processing regarding live TV. More...

Topics

 8.1.1. Stream demuxing
 PVR stream demuxing
Read TV streams with own demux within addon.
 

Functions

virtual bool kodi::addon::CInstancePVRClient::OpenLiveStream (const kodi::addon::PVRChannel &channel)
 Open a live stream on the backend.
 
virtual void kodi::addon::CInstancePVRClient::CloseLiveStream ()
 Close an open live stream.
 
virtual int kodi::addon::CInstancePVRClient::ReadLiveStream (unsigned char *buffer, unsigned int size)
 Read from an open live stream.
 
virtual int64_t kodi::addon::CInstancePVRClient::SeekLiveStream (int64_t position, int whence)
 Seek in a live stream on a backend that supports timeshifting.
 
virtual int64_t kodi::addon::CInstancePVRClient::LengthLiveStream ()
 Obtain the length of a live stream.
 

Detailed Description

PVR TV stream
Stream processing regarding live TV.


TV stream parts in interface:
Copy this to your project and extend with your parts or leave functions complete away where not used or supported.

Function Documentation

◆ CloseLiveStream()

virtual void kodi::addon::CInstancePVRClient::CloseLiveStream ( )
inlinevirtual

Close an open live stream.

Remarks
Required if PVRCapabilities::SetHandlesInputStream() or PVRCapabilities::SetHandlesDemuxing() is set to true.

◆ LengthLiveStream()

virtual int64_t kodi::addon::CInstancePVRClient::LengthLiveStream ( )
inlinevirtual

Obtain the length of a live stream.

Returns
The total length of the stream that's currently being read.
Remarks
Optional, and only used if PVRCapabilities::SetHandlesInputStream() is set to true.

◆ OpenLiveStream()

virtual bool kodi::addon::CInstancePVRClient::OpenLiveStream ( const kodi::addon::PVRChannel & channel)
inlinevirtual

Open a live stream on the backend.

Parameters
[in]channelThe channel to stream.
Returns
True if the stream has been opened successfully, false otherwise.

The following table contains values that can be set with class PVRChannel :

Name Type Set call Get call Usage
Unique id unsigned int SetUniqueId GetUniqueId required to set
Is radio bool SetIsRadio GetIsRadio required to set
Channel number unsigned int SetChannelNumber GetChannelNumber optional
Sub channel number unsigned int SetSubChannelNumber GetSubChannelNumber optional
Channel name std::string SetChannelName GetChannelName optional
Mime type std::string SetMimeType GetMimeType optional
Encryption system unsigned int SetEncryptionSystem GetEncryptionSystem optional
Icon path std::string SetIconPath GetIconPath optional
Is hidden bool SetIsHidden GetIsHidden optional
Has archive bool SetHasArchive GetHasArchive optional
Order int SetOrder GetOrder optional
Client provider unique identifier int SetClientProviderUid GetClientProviderUid optional

Remarks
Required if PVRCapabilities::SetHandlesInputStream() or PVRCapabilities::SetHandlesDemuxing() is set to true. CloseLiveStream() will always be called by Kodi prior to calling this function.

◆ ReadLiveStream()

virtual int kodi::addon::CInstancePVRClient::ReadLiveStream ( unsigned char * buffer,
unsigned int size )
inlinevirtual

Read from an open live stream.

Parameters
[in]pBufferThe buffer to store the data in.
[in]iBufferSizeThe amount of bytes to read.
Returns
The amount of bytes that were actually read from the stream.
Remarks
Required if PVRCapabilities::SetHandlesInputStream() is set to true.

◆ SeekLiveStream()

virtual int64_t kodi::addon::CInstancePVRClient::SeekLiveStream ( int64_t position,
int whence )
inlinevirtual

Seek in a live stream on a backend that supports timeshifting.

Parameters
[in]positionThe position to seek to.
[in]whence[optional] offset relative to You can set the value of whence to one of three things:
Value int Description
SEEK_SET 0 position is relative to the beginning of the file. This is probably what you had in mind anyway, and is the most commonly used value for whence.
SEEK_CUR 1 position is relative to the current file pointer position. So, in effect, you can say, "Move to my current position plus 30 bytes," or, "move to my current position minus 20 bytes."
SEEK_END 2 position is relative to the end of the file. Just like SEEK_SET except from the other end of the file. Be sure to use negative values for offset if you want to back up from the end of the file, instead of going past the end into oblivion.
Returns
The new position.
Remarks
Optional, and only used if PVRCapabilities::SetHandlesInputStream() is set to true.