Kodi Development  19.0
for Binary and Script based Add-Ons
CInstanceInputStreamabstract

Inherits IAddonInstance.

Public Member Functions

DemuxPacketAllocateDemuxPacket (int dataSize)
 Allocate a demux packet. Free with FreeDemuxPacket. More...
 
DemuxPacketAllocateEncryptedDemuxPacket (int dataSize, unsigned int encryptedSubsampleCount)
 Allocate a demux packet. Free with FreeDemuxPacket. More...
 
 CInstanceInputStream (KODI_HANDLE instance, const std::string &kodiVersion="")
 
virtual void Close ()=0
 
virtual void DemuxAbort ()
 
virtual void DemuxFlush ()
 
virtual DemuxPacketDemuxRead ()
 
virtual void DemuxReset ()
 
virtual bool DemuxSeekTime (double time, bool backwards, double &startpts)
 
virtual void DemuxSetSpeed (int speed)
 
virtual void EnableStream (int streamid, bool enable)=0
 
void FreeDemuxPacket (DemuxPacket *packet)
 Free a packet that was allocated with AllocateDemuxPacket. More...
 
virtual int GetBlockSize ()
 
virtual void GetCapabilities (INPUTSTREAM_CAPABILITIES &capabilities)=0
 
virtual int GetChapter ()
 
virtual int GetChapterCount ()
 
virtual const char * GetChapterName (int ch)
 
virtual int64_t GetChapterPos (int ch)
 
virtual INPUTSTREAM_INFO GetStream (int streamid)=0
 
virtual INPUTSTREAM_IDS GetStreamIds ()=0
 
virtual int GetTime ()
 
virtual bool GetTimes (INPUTSTREAM_TIMES &times)
 
virtual int GetTotalTime ()
 
virtual bool IsRealTimeStream ()
 
virtual int64_t LengthStream ()
 
virtual bool Open (INPUTSTREAM &props)=0
 
virtual bool OpenStream (int streamid)=0
 
virtual int64_t PositionStream ()
 
virtual bool PosTime (int ms)
 
virtual int ReadStream (uint8_t *buffer, unsigned int bufferSize)
 
virtual bool SeekChapter (int ch)
 
virtual int64_t SeekStream (int64_t position, int whence=SEEK_SET)
 
virtual void SetVideoResolution (int width, int height)
 
- Public Member Functions inherited from IAddonInstance
virtual ADDON_STATUS CreateInstance (int instanceType, const std::string &instanceID, KODI_HANDLE instance, const std::string &version, KODI_HANDLE &addonInstance)
 
 IAddonInstance (ADDON_TYPE type, const std::string &version)
 

Additional Inherited Members

- Public Attributes inherited from IAddonInstance
std::string m_id
 
const std::string m_kodiVersion
 
const ADDON_TYPE m_type
 

Member Function Documentation

◆ Open()

virtual bool Open ( INPUTSTREAM props)
pure virtual

Open a stream.

Parameters
props
Returns
True if the stream has been opened successfully, false otherwise.
Remarks

◆ Close()

virtual void Close ( )
pure virtual

Close an open stream.

Remarks

◆ GetCapabilities()

virtual void GetCapabilities ( INPUTSTREAM_CAPABILITIES capabilities)
pure virtual

Get Capabilities of this addon.

Parameters
capabilitiesThe add-on's capabilities.
Remarks

◆ GetStreamIds()

virtual INPUTSTREAM_IDS GetStreamIds ( )
pure virtual

Get IDs of available streams

Remarks

◆ GetStream()

virtual INPUTSTREAM_INFO GetStream ( int  streamid)
pure virtual

Get stream properties of a stream.

Parameters
streamidunique id of stream
Returns
struc of stream properties
Remarks

◆ EnableStream()

virtual void EnableStream ( int  streamid,
bool  enable 
)
pure virtual

Enable or disable a stream. A disabled stream does not send demux packets

Parameters
streamidunique id of stream
enabletrue for enable, false for disable
Remarks

◆ OpenStream()

virtual bool OpenStream ( int  streamid)
pure virtual

Opens a stream for playback.

Parameters
streamidunique id of stream
Remarks

◆ DemuxReset()

virtual void DemuxReset ( )
inlinevirtual

Reset the demultiplexer in the add-on.

Remarks
Required if bHandlesDemuxing is set to true.

◆ DemuxAbort()

virtual void DemuxAbort ( )
inlinevirtual

Abort the demultiplexer thread in the add-on.

Remarks
Required if bHandlesDemuxing is set to true.

◆ DemuxFlush()

virtual void DemuxFlush ( )
inlinevirtual

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

Remarks
Required if bHandlesDemuxing is set to true.

◆ DemuxRead()

virtual DemuxPacket* DemuxRead ( )
inlinevirtual

Read the next packet from the demultiplexer, if there is one.

Returns
The next packet. If there is no next packet, then the add-on should return the packet created by calling AllocateDemuxPacket(0) on the callback. If the stream changed and Kodi's player needs to be reinitialised, then, the add-on should call AllocateDemuxPacket(0) on the callback, and set the streamid to DMX_SPECIALID_STREAMCHANGE and return the value. The add-on should return NULL if an error occurred.
Remarks
Return NULL if this add-on won't provide this function.

◆ DemuxSeekTime()

virtual bool DemuxSeekTime ( double  time,
bool  backwards,
double &  startpts 
)
inlinevirtual

Notify the InputStream addon/demuxer that Kodi wishes to seek the stream by time Demuxer is required to set stream to an IDR frame

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
True if the seek operation was possible
Remarks
Optional, and only used if addon has its own demuxer.

◆ DemuxSetSpeed()

virtual void DemuxSetSpeed ( int  speed)
inlinevirtual

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

Parameters
speedThe requested playback speed
Remarks
Optional, and only used if addon has its own demuxer.

◆ SetVideoResolution()

virtual void SetVideoResolution ( int  width,
int  height 
)
inlinevirtual

Sets desired width / height

Parameters
width/ hight

◆ GetTotalTime()

virtual int GetTotalTime ( )
inlinevirtual

Totel time in ms

Remarks

◆ GetTime()

virtual int GetTime ( )
inlinevirtual

Playing time in ms

Remarks

◆ GetTimes()

virtual bool GetTimes ( INPUTSTREAM_TIMES times)
inlinevirtual

Get current timing values in PTS scale

Remarks

◆ PosTime()

virtual bool PosTime ( int  ms)
inlinevirtual

Positions inputstream to playing time given in ms

Remarks

◆ GetChapter()

virtual int GetChapter ( )
inlinevirtual

Return currently selected chapter

Remarks

◆ GetChapterCount()

virtual int GetChapterCount ( )
inlinevirtual

Return number of available chapters

Remarks

◆ GetChapterName()

virtual const char* GetChapterName ( int  ch)
inlinevirtual

Return name of chapter # ch

Remarks

◆ GetChapterPos()

virtual int64_t GetChapterPos ( int  ch)
inlinevirtual

Return position if chapter # ch in milliseconds

Remarks

◆ SeekChapter()

virtual bool SeekChapter ( int  ch)
inlinevirtual

Seek to the beginning of chapter # ch

Remarks

◆ ReadStream()

virtual int ReadStream ( uint8_t *  buffer,
unsigned int  bufferSize 
)
inlinevirtual

Read from an open stream.

Parameters
bufferThe buffer to store the data in.
bufferSizeThe amount of bytes to read.
Returns
The amount of bytes that were actually read from the stream.
Remarks
Return -1 if this add-on won't provide this function.

◆ SeekStream()

virtual int64_t SeekStream ( int64_t  position,
int  whence = SEEK_SET 
)
inlinevirtual

Seek in a stream.

Parameters
positionThe position to seek to.
whence?
Returns
The new position.
Remarks
Return -1 if this add-on won't provide this function.

◆ PositionStream()

virtual int64_t PositionStream ( )
inlinevirtual
Returns
The position in the stream that's currently being read.
Remarks
Return -1 if this add-on won't provide this function.

◆ LengthStream()

virtual int64_t LengthStream ( )
inlinevirtual
Returns
The total length of the stream that's currently being read.
Remarks
Return -1 if this add-on won't provide this function.

◆ GetBlockSize()

virtual int GetBlockSize ( )
inlinevirtual
Returns
Obtain the chunk size to use when reading streams.
Remarks
Return 0 if this add-on won't provide this function.

◆ IsRealTimeStream()

virtual bool IsRealTimeStream ( )
inlinevirtual

Check for real-time streaming

Returns
true if current stream is real-time

◆ AllocateDemuxPacket()

DemuxPacket* AllocateDemuxPacket ( int  dataSize)
inline

Allocate a demux packet. Free with FreeDemuxPacket.

Parameters
dataSizeThe size of the data that will go into the packet
Returns
The allocated packet

◆ AllocateEncryptedDemuxPacket()

DemuxPacket* AllocateEncryptedDemuxPacket ( int  dataSize,
unsigned int  encryptedSubsampleCount 
)
inline

Allocate a demux packet. Free with FreeDemuxPacket.

Parameters
dataSizeThe size of the data that will go into the packet
Returns
The allocated packet

◆ FreeDemuxPacket()

void FreeDemuxPacket ( DemuxPacket packet)
inline

Free a packet that was allocated with AllocateDemuxPacket.

Parameters
packetThe packet to free

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