Kodi Documentation 23.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CInputStreamAddon Class Reference

Input stream class. More...

#include <InputStreamAddon.h>

Inheritance diagram for CInputStreamAddon:
ADDON::IAddonInstanceHandler CDVDInputStream CDVDInputStream::IDisplayTime CDVDInputStream::ITimes CDVDInputStream::IPosTime CDVDInputStream::IDemux CDVDInputStream::IChapter

Public Member Functions

 CInputStreamAddon (const ADDON::AddonInfoPtr &addonInfo, IVideoPlayer *player, const CFileItem &fileitem, const std::string &instanceId)
 
 ~CInputStreamAddon () override
 
bool Open () override
 
void Close () override
 
int Read (uint8_t *buf, int buf_size) override
 
int64_t Seek (int64_t offset, int whence) override
 
int64_t GetLength () override
 
int GetBlockSize () override
 
bool IsEOF () override
 
bool CanSeek () override
 
bool CanPause () override
 
CDVDInputStream::IDisplayTime * GetIDisplayTime () override
 
int GetTotalTime () override
 
int GetTime () override
 
CDVDInputStream::ITimes * GetITimes () override
 
bool GetTimes (Times &times) override
 
CDVDInputStream::IPosTime * GetIPosTime () override
 
bool PosTime (int ms) override
 
CDVDInputStream::IDemux * GetIDemux () override
 
bool OpenDemux () override
 
DemuxPacket * ReadDemux () override
 
CDemuxStream * GetStream (int streamId) const override
 
std::vector< CDemuxStream * > GetStreams () const override
 
bool EnableStream (int streamId, bool enable) override
 Enable or disable the delivery of packets of a stream.
 
bool OpenStream (int streamid) override
 
int GetNrOfStreams () const override
 
void SetSpeed (int speed) override
 
bool SeekTime (double time, bool backward=false, double *startpts=nullptr) override
 
void AbortDemux () override
 
void FlushDemux () override
 
void SetVideoResolution (unsigned int width, unsigned int height, unsigned int maxWidth, unsigned int maxHeight) override
 
bool IsRealtime () override
 
CDVDInputStream::IChapter * GetIChapter () override
 
int GetChapter () override
 
int GetChapterCount () override
 
void GetChapterName (std::string &name, int ch=-1) override
 
std::chrono::milliseconds GetChapterPos (int ch=-1) override
 
bool SeekChapter (int ch) override
 
- Public Member Functions inherited from ADDON::IAddonInstanceHandler
 IAddonInstanceHandler (ADDON_TYPE type, const AddonInfoPtr &addonInfo, AddonInstanceId instanceId=ADDON_INSTANCE_ID_UNUSED, KODI_HANDLE parentInstance=nullptr, const std::string &uniqueWorkID="")
 Class constructor for handling add-on instance processes, allowing an add-on to handle multiple work simultaneously and independently.
 
virtual ~IAddonInstanceHandler ()
 
ADDON_TYPE UsedType () const
 
AddonInstanceId InstanceId () const
 
const std::string & UniqueWorkID () const
 
std::string ID () const
 
AddonInstanceId InstanceID () const
 
std::string Name () const
 
std::string Author () const
 
std::string Icon () const
 
std::string Path () const
 
std::string Profile () const
 
CAddonVersion Version () const
 
ADDON_STATUS CreateInstance ()
 
void DestroyInstance ()
 
const std::shared_ptr< CAddonDll > & Addon () const
 
AddonInfoPtr GetAddonInfo () const
 
virtual void OnPreInstall ()
 
virtual void OnPostInstall (bool update, bool modal)
 
virtual void OnPreUnInstall ()
 
virtual void OnPostUnInstall ()
 
- Public Member Functions inherited from CDVDInputStream
 CDVDInputStream (DVDStreamType m_streamType, const CFileItem &fileitem)
 
virtual ~CDVDInputStream ()
 
virtual std::string & GetContent ()
 
virtual std::string GetFileName ()
 
virtual CURL GetURL ()
 
virtual ENextStream NextStream ()
 
virtual void Abort ()
 
bool Aborted () const
 
virtual void SetReadRate (uint32_t rate)
 Indicate expected read rate in bytes per second. This could be used to throttle caching rate. Should be seen as only a hint.
 
virtual bool GetCacheStatus (XFILE::SCacheStatus *status)
 Get the cache status.
 
bool IsStreamType (DVDStreamType type) const
 
virtual BitstreamStats GetBitstreamStats () const
 
bool ContentLookup ()
 
virtual bool IsStreaming () const
 
void SetRealtime (bool realtime)
 
const CVariant & GetProperty (const std::string &key)
 
virtual void SaveCurrentState (const CStreamDetails &details)
 Saves the current state of the current stream (including stream details)
 
virtual UpdateState UpdateItemFromSavedStates (CFileItem &item, double time, bool &closed)
 Updates the given fileitem with the state and streamdetails of what is decided to be the main (ie. main movie) title.
 
virtual void UpdateStack (CFileItem &item)
 
- Public Member Functions inherited from CDVDInputStream::IDisplayTime
virtual ~IDisplayTime ()=default
 
- Public Member Functions inherited from CDVDInputStream::ITimes
virtual ~ITimes ()=default
 
- Public Member Functions inherited from CDVDInputStream::IPosTime
virtual ~IPosTime ()=default
 
- Public Member Functions inherited from CDVDInputStream::IDemux
virtual ~IDemux ()=default
 
virtual void FillBuffer (bool mode)
 
- Public Member Functions inherited from CDVDInputStream::IChapter
virtual ~IChapter ()=default
 

Static Public Member Functions

static bool Supports (const ADDON::AddonInfoPtr &addonInfo, const CFileItem &fileitem)
 
- Static Public Member Functions inherited from CDVDInputStream
static void SavePlaylistDetails (std::vector< PlaylistInformation > &playedPlaylists, std::chrono::steady_clock::time_point startTime, const PlaylistInformation &currentPlaylistInformation)
 Function shared with DVDInputStreamBluray (for Blurays) and DVDInputStreamNavigator (for DVDs) to save playlist/title details.
 
static UpdateState UpdateItemFromPlaylistDetails (DVDStreamType type, std::vector< PlaylistInformation > &playedPlaylists, CFileItem &item, double time, bool &closed)
 Function shared with DVDInputStreamBluray (for Blurays) and DVDInputStreamNavigator (for DVDs) to updates the given fileitem with \ the state and streamdetails of what is decided to be the main (ie. main movie) title.
 
static void UpdateStackItem (CFileItem &item, std::chrono::milliseconds length)
 

Static Protected Member Functions

static int ConvertVideoCodecProfile (STREAMCODEC_PROFILE profile)
 
static int ConvertAudioCodecProfile (STREAMCODEC_PROFILE profile)
 

Protected Attributes

IVideoPlayer * m_player
 
- Protected Attributes inherited from ADDON::IAddonInstanceHandler
KODI_ADDON_INSTANCE_STRUCT m_ifc {}
 
- Protected Attributes inherited from CDVDInputStream
DVDStreamType m_streamType
 
BitstreamStats m_stats
 
std::string m_content
 
CFileItem m_item
 
bool m_contentLookup
 
bool m_realtime
 
std::atomic_bool m_aborted {false}
 

Additional Inherited Members

- Public Types inherited from CDVDInputStream
enum  ENextStream { NEXTSTREAM_NONE , NEXTSTREAM_OPEN , NEXTSTREAM_RETRY }
 
enum class  UpdateState : uint8_t { NONE , FINISHED , NOT_PLAYED }
 

Detailed Description

Input stream class.

Constructor & Destructor Documentation

◆ CInputStreamAddon()

CInputStreamAddon::CInputStreamAddon ( const ADDON::AddonInfoPtr & addonInfo,
IVideoPlayer * player,
const CFileItem & fileitem,
const std::string & instanceId )

◆ ~CInputStreamAddon()

CInputStreamAddon::~CInputStreamAddon ( )
override

Member Function Documentation

◆ AbortDemux()

void CInputStreamAddon::AbortDemux ( )
overridevirtual

◆ CanPause()

bool CInputStreamAddon::CanPause ( )
overridevirtual
Todo
drop this

Reimplemented from CDVDInputStream.

◆ CanSeek()

bool CInputStreamAddon::CanSeek ( )
overridevirtual

Reimplemented from CDVDInputStream.

◆ Close()

void CInputStreamAddon::Close ( )
overridevirtual

Reimplemented from CDVDInputStream.

◆ ConvertAudioCodecProfile()

int CInputStreamAddon::ConvertAudioCodecProfile ( STREAMCODEC_PROFILE profile)
staticprotected

◆ ConvertVideoCodecProfile()

int CInputStreamAddon::ConvertVideoCodecProfile ( STREAMCODEC_PROFILE profile)
staticprotected

◆ EnableStream()

bool CInputStreamAddon::EnableStream ( int iStreamId,
bool enable )
overridevirtual

Enable or disable the delivery of packets of a stream.

Returns
true if the request was passed on to an implementation that can act on it, false if enabling/disabling streams is not supported

Reimplemented from CDVDInputStream::IDemux.

◆ FlushDemux()

void CInputStreamAddon::FlushDemux ( )
overridevirtual

◆ GetBlockSize()

int CInputStreamAddon::GetBlockSize ( )
overridevirtual

Reimplemented from CDVDInputStream.

◆ GetChapter()

int CInputStreamAddon::GetChapter ( )
overridevirtual

◆ GetChapterCount()

int CInputStreamAddon::GetChapterCount ( )
overridevirtual

◆ GetChapterName()

void CInputStreamAddon::GetChapterName ( std::string & name,
int ch = -1 )
overridevirtual

◆ GetChapterPos()

std::chrono::milliseconds CInputStreamAddon::GetChapterPos ( int ch = -1)
overridevirtual
Todo
add API for ms precision

Implements CDVDInputStream::IChapter.

◆ GetIChapter()

CDVDInputStream::IChapter * CInputStreamAddon::GetIChapter ( )
overridevirtual

Reimplemented from CDVDInputStream.

◆ GetIDemux()

CDVDInputStream::IDemux * CInputStreamAddon::GetIDemux ( )
overridevirtual

Reimplemented from CDVDInputStream.

◆ GetIDisplayTime()

CDVDInputStream::IDisplayTime * CInputStreamAddon::GetIDisplayTime ( )
overridevirtual

Reimplemented from CDVDInputStream.

◆ GetIPosTime()

CDVDInputStream::IPosTime * CInputStreamAddon::GetIPosTime ( )
overridevirtual

Reimplemented from CDVDInputStream.

◆ GetITimes()

CDVDInputStream::ITimes * CInputStreamAddon::GetITimes ( )
overridevirtual

Reimplemented from CDVDInputStream.

◆ GetLength()

int64_t CInputStreamAddon::GetLength ( )
overridevirtual

Implements CDVDInputStream.

◆ GetNrOfStreams()

int CInputStreamAddon::GetNrOfStreams ( ) const
overridevirtual

◆ GetStream()

CDemuxStream * CInputStreamAddon::GetStream ( int streamId) const
overridevirtual

◆ GetStreams()

std::vector< CDemuxStream * > CInputStreamAddon::GetStreams ( ) const
overridevirtual

◆ GetTime()

int CInputStreamAddon::GetTime ( )
overridevirtual

◆ GetTimes()

bool CInputStreamAddon::GetTimes ( Times & times)
overridevirtual

◆ GetTotalTime()

int CInputStreamAddon::GetTotalTime ( )
overridevirtual

◆ IsEOF()

bool CInputStreamAddon::IsEOF ( )
overridevirtual

Implements CDVDInputStream.

◆ IsRealtime()

bool CInputStreamAddon::IsRealtime ( )
overridevirtual

Reimplemented from CDVDInputStream.

◆ Open()

bool CInputStreamAddon::Open ( )
overridevirtual

Reimplemented from CDVDInputStream.

◆ OpenDemux()

bool CInputStreamAddon::OpenDemux ( )
overridevirtual

◆ OpenStream()

bool CInputStreamAddon::OpenStream ( int streamid)
overridevirtual

Reimplemented from CDVDInputStream::IDemux.

◆ PosTime()

bool CInputStreamAddon::PosTime ( int ms)
overridevirtual

◆ Read()

int CInputStreamAddon::Read ( uint8_t * buf,
int buf_size )
overridevirtual

Implements CDVDInputStream.

◆ ReadDemux()

DemuxPacket * CInputStreamAddon::ReadDemux ( )
overridevirtual

◆ Seek()

int64_t CInputStreamAddon::Seek ( int64_t offset,
int whence )
overridevirtual

Implements CDVDInputStream.

◆ SeekChapter()

bool CInputStreamAddon::SeekChapter ( int ch)
overridevirtual

◆ SeekTime()

bool CInputStreamAddon::SeekTime ( double time,
bool backward = false,
double * startpts = nullptr )
overridevirtual

◆ SetSpeed()

void CInputStreamAddon::SetSpeed ( int speed)
overridevirtual

◆ SetVideoResolution()

void CInputStreamAddon::SetVideoResolution ( unsigned int width,
unsigned int height,
unsigned int maxWidth,
unsigned int maxHeight )
overridevirtual

Reimplemented from CDVDInputStream::IDemux.

◆ Supports()

bool CInputStreamAddon::Supports ( const ADDON::AddonInfoPtr & addonInfo,
const CFileItem & fileitem )
static
Todo
Error for users to show deprecation, can be removed in Kodi 20

Member Data Documentation

◆ m_player

IVideoPlayer* CInputStreamAddon::m_player
protected

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