Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
kodi::addon::CInstanceInputStream Class Referenceabstract

#include <Inputstream.h>

Inheritance diagram for kodi::addon::CInstanceInputStream:
kodi::addon::IAddonInstance

Public Member Functions

 CInstanceInputStream (KODI_HANDLE instance)
 
 ~CInstanceInputStream () override=default
 
virtual bool Open (INPUTSTREAM &props)=0
 
virtual void Close ()=0
 
virtual void GetCapabilities (INPUTSTREAM_CAPABILITIES &capabilities)=0
 
virtual INPUTSTREAM_IDS GetStreamIds ()=0
 
virtual INPUTSTREAM_INFO GetStream (int streamid)=0
 
virtual void EnableStream (int streamid, bool enable)=0
 
virtual bool OpenStream (int streamid)=0
 
virtual void DemuxReset ()
 
virtual void DemuxAbort ()
 
virtual void DemuxFlush ()
 
virtual DemuxPacketDemuxRead ()
 
virtual bool DemuxSeekTime (double time, bool backwards, double &startpts)
 
virtual void DemuxSetSpeed (int speed)
 
virtual void SetVideoResolution (int width, int height)
 
virtual int GetTotalTime ()
 
virtual int GetTime ()
 
virtual bool GetTimes (INPUTSTREAM_TIMES &times)
 
virtual bool PosTime (int ms)
 
virtual bool CanPauseStream ()
 
virtual bool CanSeekStream ()
 
virtual int ReadStream (uint8_t *buffer, unsigned int bufferSize)
 
virtual int64_t SeekStream (int64_t position, int whence=SEEK_SET)
 
virtual int64_t PositionStream ()
 
virtual int64_t LengthStream ()
 
virtual void PauseStream (double time)
 Notify the InputStream addon that Kodi (un)paused the currently playing stream. More...
 
virtual bool IsRealTimeStream ()
 
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...
 
void FreeDemuxPacket (DemuxPacket *packet)
 Free a packet that was allocated with AllocateDemuxPacket. More...
 
- Public Member Functions inherited from kodi::addon::IAddonInstance
 IAddonInstance (ADDON_TYPE type)
 
virtual ~IAddonInstance ()=default
 
virtual ADDON_STATUS CreateInstance (int instanceType, std::string instanceID, KODI_HANDLE instance, KODI_HANDLE &addonInstance)
 
virtual ADDON_STATUS CreateInstanceEx (int instanceType, std::string instanceID, KODI_HANDLE instance, KODI_HANDLE &addonInstance, const std::string &version)
 

Additional Inherited Members

- Public Attributes inherited from kodi::addon::IAddonInstance
const ADDON_TYPE m_type
 

Constructor & Destructor Documentation

◆ CInstanceInputStream()

kodi::addon::CInstanceInputStream::CInstanceInputStream ( KODI_HANDLE  instance)
inlineexplicit

◆ ~CInstanceInputStream()

kodi::addon::CInstanceInputStream::~CInstanceInputStream ( )
overridedefault

Member Function Documentation

◆ AllocateDemuxPacket()

DemuxPacket * kodi::addon::CInstanceInputStream::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 * kodi::addon::CInstanceInputStream::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

◆ CanPauseStream()

virtual bool kodi::addon::CInstanceInputStream::CanPauseStream ( )
inlinevirtual

Check if the backend support pausing the currently playing stream This will enable/disable the pause button in Kodi based on the return value

Returns
false if the InputStream addon/backend does not support pausing, true if possible

◆ CanSeekStream()

virtual bool kodi::addon::CInstanceInputStream::CanSeekStream ( )
inlinevirtual

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

Returns
false if the InputStream addon/backend does not support seeking, true if possible

◆ Close()

virtual void kodi::addon::CInstanceInputStream::Close ( )
pure virtual

Close an open stream.

Remarks

◆ DemuxAbort()

virtual void kodi::addon::CInstanceInputStream::DemuxAbort ( )
inlinevirtual

Abort the demultiplexer thread in the add-on.

Remarks
Required if bHandlesDemuxing is set to true.

◆ DemuxFlush()

virtual void kodi::addon::CInstanceInputStream::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 * kodi::addon::CInstanceInputStream::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 occured.
Remarks
Return NULL if this add-on won't provide this function.

◆ DemuxReset()

virtual void kodi::addon::CInstanceInputStream::DemuxReset ( )
inlinevirtual

Reset the demultiplexer in the add-on.

Remarks
Required if bHandlesDemuxing is set to true.

◆ DemuxSeekTime()

virtual bool kodi::addon::CInstanceInputStream::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 kodi::addon::CInstanceInputStream::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.

◆ EnableStream()

virtual void kodi::addon::CInstanceInputStream::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

◆ FreeDemuxPacket()

void kodi::addon::CInstanceInputStream::FreeDemuxPacket ( DemuxPacket packet)
inline

Free a packet that was allocated with AllocateDemuxPacket.

Parameters
packetThe packet to free

◆ GetCapabilities()

virtual void kodi::addon::CInstanceInputStream::GetCapabilities ( INPUTSTREAM_CAPABILITIES capabilities)
pure virtual

Get Capabilities of this addon.

Parameters
capabilitiesThe add-on's capabilities.
Remarks

◆ GetStream()

virtual INPUTSTREAM_INFO kodi::addon::CInstanceInputStream::GetStream ( int  streamid)
pure virtual

Get stream properties of a stream.

Parameters
streamidunique id of stream
Returns
struc of stream properties
Remarks

◆ GetStreamIds()

virtual INPUTSTREAM_IDS kodi::addon::CInstanceInputStream::GetStreamIds ( )
pure virtual

Get IDs of available streams

Remarks

◆ GetTime()

virtual int kodi::addon::CInstanceInputStream::GetTime ( )
inlinevirtual

Playing time in ms

Remarks

◆ GetTimes()

virtual bool kodi::addon::CInstanceInputStream::GetTimes ( INPUTSTREAM_TIMES times)
inlinevirtual

Get current timing values in PTS scale

Remarks

◆ GetTotalTime()

virtual int kodi::addon::CInstanceInputStream::GetTotalTime ( )
inlinevirtual

Totel time in ms

Remarks

◆ IsRealTimeStream()

virtual bool kodi::addon::CInstanceInputStream::IsRealTimeStream ( )
inlinevirtual

Check for real-time streaming

Returns
true if current stream is real-time

◆ LengthStream()

virtual int64_t kodi::addon::CInstanceInputStream::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.

◆ Open()

virtual bool kodi::addon::CInstanceInputStream::Open ( INPUTSTREAM props)
pure virtual

Open a stream.

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

◆ OpenStream()

virtual bool kodi::addon::CInstanceInputStream::OpenStream ( int  streamid)
pure virtual

Opens a stream for playback.

Parameters
streamidunique id of stream
Remarks

◆ PauseStream()

virtual void kodi::addon::CInstanceInputStream::PauseStream ( double  time)
inlinevirtual

Notify the InputStream addon that Kodi (un)paused the currently playing stream.

◆ PositionStream()

virtual int64_t kodi::addon::CInstanceInputStream::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.

◆ PosTime()

virtual bool kodi::addon::CInstanceInputStream::PosTime ( int  ms)
inlinevirtual

Positions inputstream to playing time given in ms

Remarks

◆ ReadStream()

virtual int kodi::addon::CInstanceInputStream::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 kodi::addon::CInstanceInputStream::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.

◆ SetVideoResolution()

virtual void kodi::addon::CInstanceInputStream::SetVideoResolution ( int  width,
int  height 
)
inlinevirtual

Sets desired width / height

Parameters
width/ hight

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