Kodi Development  20.0
for Binary and Script based Add-Ons

Detailed Description

PVR Recording stream
Stream processing regarding recordings.

Note
Demuxing is not possible with the recordings.

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

Header parts:

bool OpenRecordedStream(const kodi::addon::PVRRecording& recording) override;
void CloseRecordedStream() override;
int ReadRecordedStream(unsigned char* buffer, unsigned int size) override;
int64_t SeekRecordedStream(int64_t position, int whence) override;
int64_t LengthRecordedStream() override;
Definition: Recordings.h:39
virtual int ReadRecordedStream(unsigned char *buffer, unsigned int size)
Read from a recording.
Definition: PVR.h:2613
virtual bool OpenRecordedStream(const kodi::addon::PVRRecording &recording)
Open a stream to a recording on the backend.
Definition: PVR.h:2591
virtual int64_t LengthRecordedStream()
Obtain the length of a recorded stream.
Definition: PVR.h:2644
virtual void CloseRecordedStream()
Close an open stream from a recording.
Definition: PVR.h:2600
virtual int64_t SeekRecordedStream(int64_t position, int whence)
Seek in a recorded stream.
Definition: PVR.h:2633

Source parts:

bool CMyInstance::OpenRecordedStream(const kodi::addon::PVRRecording& recording)
{
return false;
}
void CMyInstance::CloseRecordedStream()
{
}
int CMyInstance::ReadRecordedStream(unsigned char* buffer, unsigned int size)
{
return 0;
}
int64_t CMyInstance::SeekRecordedStream(int64_t position, int whence)
{
return 0;
}
int64_t CMyInstance::LengthRecordedStream()
{
return 0;
}

Modules

 Group header include
 
 Group source include
 

Function Documentation

◆ OpenRecordedStream()

virtual bool OpenRecordedStream ( const kodi::addon::PVRRecording recording)
inlinevirtual

Open a stream to a recording on the backend.

Parameters
[in]recordingThe recording to open.
Returns
True if the stream has been opened successfully, false otherwise.
Remarks
Optional, and only used if PVRCapabilities::SetSupportsRecordings() is set to true. CloseRecordedStream() will always be called by Kodi prior to calling this function.

◆ CloseRecordedStream()

virtual void CloseRecordedStream ( )
inlinevirtual

Close an open stream from a recording.

Remarks
Optional, and only used if PVRCapabilities::SetSupportsRecordings() is set to true.

◆ ReadRecordedStream()

virtual int ReadRecordedStream ( unsigned char *  buffer,
unsigned int  size 
)
inlinevirtual

Read from a recording.

Parameters
[in]bufferThe buffer to store the data in.
[in]sizeThe amount of bytes to read.
Returns
The amount of bytes that were actually read from the stream.
Remarks
Optional, and only used if PVRCapabilities::SetSupportsRecordings() is set to true.

◆ SeekRecordedStream()

virtual int64_t SeekRecordedStream ( int64_t  position,
int  whence 
)
inlinevirtual

Seek in a recorded stream.

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::SetSupportsRecordings() is set to true.

◆ LengthRecordedStream()

virtual int64_t LengthRecordedStream ( )
inlinevirtual

Obtain the length of a recorded stream.

Returns
The total length of the stream that's currently being read.
Remarks
Optional, and only used if PVRCapabilities::SetSupportsRecordings() is true (=> ReadRecordedStream).