Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
PAPlayer Class Reference

#include <PAPlayer.h>

Inheritance diagram for PAPlayer:
IPlayer CThread IJobCallback

Public Member Functions

 PAPlayer (IPlayerCallback &callback)
 
 ~PAPlayer () override
 
bool OpenFile (const CFileItem &file, const CPlayerOptions &options) override
 
bool QueueNextFile (const CFileItem &file) override
 
void OnNothingToQueueNotify () override
 
bool CloseFile (bool reopen=false) override
 
bool IsPlaying () const override
 
void Pause () override
 
bool HasVideo () const override
 
bool HasAudio () const override
 
bool CanSeek () override
 
void Seek (bool bPlus=true, bool bLargeStep=false, bool bChapterOverride=false) override
 
void SeekPercentage (float fPercent=0.0f) override
 
void SetVolume (float volume) override
 
void SetDynamicRangeCompression (long drc) override
 
void SetSpeed (float speed=0) override
 
int GetCacheLevel () const override
 
void SetTotalTime (int64_t time) override
 Set the total time in milliseconds this can be used for injecting the duration in case its not available in the underlaying decoder (airtunes for example) More...
 
void GetAudioStreamInfo (int index, AudioStreamInfo &info) override
 
void SetTime (int64_t time) override
 Sets the current time. This can be used for injecting the current time. This is not to be confused with a seek. It just can be used if endless streams contain multiple tracks in reality (like with airtunes) More...
 
void SeekTime (int64_t iTime=0) override
 
void GetAudioCapabilities (std::vector< int > &audioCaps) override
 
void OnJobComplete (unsigned int jobID, bool success, CJob *job) override
 The callback used when a job completes. More...
 
- Public Member Functions inherited from IPlayer
 IPlayer (IPlayerCallback &callback)
 
virtual ~IPlayer ()=default
 
virtual bool Initialize (TiXmlElement *pConfig)
 
virtual bool CanPause ()
 
virtual bool HasGame () const
 
virtual bool HasRDS () const
 
virtual bool IsPassthrough () const
 
virtual bool SeekScene (bool bPlus=true)
 
virtual float GetCachePercentage ()
 
virtual void SetMute (bool bOnOff)
 
virtual void SetAVDelay (float fValue=0.0f)
 
virtual float GetAVDelay ()
 
virtual void SetSubTitleDelay (float fValue=0.0f)
 
virtual float GetSubTitleDelay ()
 
virtual int GetSubtitleCount ()
 
virtual int GetSubtitle ()
 
virtual void GetSubtitleStreamInfo (int index, SubtitleStreamInfo &info)
 
virtual void SetSubtitle (int iStream)
 
virtual bool GetSubtitleVisible ()
 
virtual void SetSubtitleVisible (bool bVisible)
 
virtual void AddSubtitle (const std::string &strSubPath)
 Adds the subtitle(s) provided by the given file to the available player streams and actives the first of the added stream(s). E.g., vob subs can contain multiple streams. More...
 
virtual int GetAudioStreamCount ()
 
virtual int GetAudioStream ()
 
virtual void SetAudioStream (int iStream)
 
virtual int GetVideoStream () const
 
virtual int GetVideoStreamCount () const
 
virtual void GetVideoStreamInfo (int streamId, VideoStreamInfo &info)
 
virtual void SetVideoStream (int iStream)
 
virtual int GetPrograms (std::vector< ProgramInfo > &programs)
 
virtual void SetProgram (int progId)
 
virtual int GetProgramsCount ()
 
virtual std::shared_ptr< TextCacheStruct_tGetTeletextCache ()
 
virtual void LoadPage (int p, int sp, unsigned char *buffer)
 
virtual std::string GetRadioText (unsigned int line)
 
virtual int GetChapterCount ()
 
virtual int GetChapter ()
 
virtual void GetChapterName (std::string &strChapterName, int chapterIdx=-1)
 
virtual int64_t GetChapterPos (int chapterIdx=-1)
 
virtual int SeekChapter (int iChapter)
 
virtual bool SeekTimeRelative (int64_t iTime)
 
virtual void SetTempo (float tempo)
 
virtual bool SupportsTempo ()
 
virtual void FrameAdvance (int frames)
 
virtual bool IsCaching () const
 
virtual bool IsInMenu () const
 
virtual bool HasMenu () const
 
virtual void DoAudioWork ()
 
virtual bool OnAction (const CAction &action)
 
virtual std::string GetPlayerState ()
 
virtual bool SetPlayerState (const std::string &state)
 
virtual void GetSubtitleCapabilities (std::vector< int > &subCaps)
 define the subtitle capabilities of the player More...
 
virtual void Render (bool clear, uint32_t alpha=255, bool gui=true)
 hook into render loop of render thread More...
 
virtual void FlushRenderer ()
 
virtual void SetRenderViewMode (int mode, float zoom, float par, float shift, bool stretch)
 
virtual float GetRenderAspectRatio ()
 
virtual void TriggerUpdateResolution ()
 
virtual bool IsRenderingVideo ()
 
virtual bool Supports (EINTERLACEMETHOD method)
 
virtual EINTERLACEMETHOD GetDeinterlacingMethodDefault ()
 
virtual bool Supports (ESCALINGMETHOD method)
 
virtual bool Supports (ERENDERFEATURE feature)
 
virtual unsigned int RenderCaptureAlloc ()
 
virtual void RenderCaptureRelease (unsigned int captureId)
 
virtual void RenderCapture (unsigned int captureId, unsigned int width, unsigned int height, int flags)
 
virtual bool RenderCaptureGetPixels (unsigned int captureId, unsigned int millis, uint8_t *buffer, unsigned int size)
 
virtual CVideoSettings GetVideoSettings ()
 
virtual void SetVideoSettings (CVideoSettings &settings)
 
virtual bool HasGameAgent ()
 Check if any players are playing a game. More...
 
- Public Member Functions inherited from CThread
 CThread (IRunnable *pRunnable, const char *ThreadName)
 
virtual ~CThread ()
 
void Create (bool bAutoDelete=false, unsigned stacksize=0)
 
void Sleep (unsigned int milliseconds)
 
int GetSchedRRPriority (void)
 
bool SetPrioritySched_RR (int iPriority)
 
bool IsAutoDelete () const
 
virtual void StopThread (bool bWait=true)
 
bool IsRunning () const
 
bool IsCurrentThread () const
 
int GetMinPriority (void)
 
int GetMaxPriority (void)
 
int GetNormalPriority (void)
 
int GetPriority (void)
 
bool SetPriority (const int iPriority)
 
bool WaitForThreadExit (unsigned int milliseconds)
 
float GetRelativeUsage ()
 
int64_t GetAbsoluteUsage ()
 
virtual void OnException ()
 
- Public Member Functions inherited from IJobCallback
virtual ~IJobCallback ()=default
 Destructor for job call back objects. More...
 
virtual void OnJobProgress (unsigned int jobID, unsigned int progress, unsigned int total, const CJob *job)
 An optional callback function that a job may call while processing. More...
 

Static Public Member Functions

static bool HandlesType (const std::string &type)
 
- Static Public Member Functions inherited from CThread
static bool IsCurrentThread (const ThreadIdentifier tid)
 
static ThreadIdentifier GetCurrentThreadId ()
 
static ThreadIdentifier GetDisplayThreadId (const ThreadIdentifier tid)
 
static CThreadGetCurrentThread ()
 

Public Attributes

struct {
   char   m_codec [21]
 
   int64_t   m_time
 
   int64_t   m_totalTime
 
   int   m_channelCount
 
   int   m_bitsPerSample
 
   int   m_sampleRate
 
   int   m_audioBitrate
 
   int   m_cacheLevel
 
   bool   m_canSeek
 
m_playerGUIData
 
- Public Attributes inherited from IPlayer
std::string m_name
 
std::string m_type
 

Protected Member Functions

void OnStartup () override
 
void Process () override
 
void OnExit () override
 
float GetPercentage ()
 
- Protected Member Functions inherited from CThread
 CThread (const char *ThreadName)
 
WaitResponse AbortableWait (CEvent &event, int timeoutMillis=-1)
 

Friends

class CQueueNextFileJob
 

Additional Inherited Members

- Protected Types inherited from CThread
enum  WaitResponse { WAIT_INTERRUPTED = -1 , WAIT_SIGNALED = 0 , WAIT_TIMEDOUT = 1 }
 
- Protected Attributes inherited from IPlayer
IPlayerCallbackm_callback
 
- Protected Attributes inherited from CThread
std::atomic< bool > m_bStop
 

Constructor & Destructor Documentation

◆ PAPlayer()

PAPlayer::PAPlayer ( IPlayerCallback callback)
explicit

◆ ~PAPlayer()

PAPlayer::~PAPlayer ( )
override

Member Function Documentation

◆ CanSeek()

bool PAPlayer::CanSeek ( )
overridevirtual

Reimplemented from IPlayer.

◆ CloseFile()

bool PAPlayer::CloseFile ( bool  reopen = false)
overridevirtual

Implements IPlayer.

◆ GetAudioCapabilities()

void PAPlayer::GetAudioCapabilities ( std::vector< int > &  audioCaps)
inlineoverridevirtual

Reimplemented from IPlayer.

◆ GetAudioStreamInfo()

void PAPlayer::GetAudioStreamInfo ( int  index,
AudioStreamInfo info 
)
overridevirtual

Reimplemented from IPlayer.

◆ GetCacheLevel()

int PAPlayer::GetCacheLevel ( ) const
overridevirtual

Reimplemented from IPlayer.

◆ GetPercentage()

float PAPlayer::GetPercentage ( )
protected

◆ HandlesType()

bool PAPlayer::HandlesType ( const std::string &  type)
static

◆ HasAudio()

bool PAPlayer::HasAudio ( ) const
inlineoverridevirtual

Implements IPlayer.

◆ HasVideo()

bool PAPlayer::HasVideo ( ) const
inlineoverridevirtual

Implements IPlayer.

◆ IsPlaying()

bool PAPlayer::IsPlaying ( ) const
overridevirtual

Reimplemented from IPlayer.

◆ OnExit()

void PAPlayer::OnExit ( )
overrideprotectedvirtual

Reimplemented from CThread.

◆ OnJobComplete()

void PAPlayer::OnJobComplete ( unsigned int  jobID,
bool  success,
CJob job 
)
overridevirtual

The callback used when a job completes.

OnJobComplete is called at the completion of the job's DoWork() function, and is used to return information to the caller on the result of the job. On returning form this function the CJobManager will destroy this job.

Parameters
jobIDthe unique id of the job (as retrieved from CJobManager::AddJob)
successthe result from the DoWork call
jobthe job that has been processed. The job will be destroyed after this function returns
See also
CJobManager and CJob

Implements IJobCallback.

◆ OnNothingToQueueNotify()

void PAPlayer::OnNothingToQueueNotify ( )
overridevirtual

Reimplemented from IPlayer.

◆ OnStartup()

void PAPlayer::OnStartup ( )
inlineoverrideprotectedvirtual

Reimplemented from CThread.

◆ OpenFile()

bool PAPlayer::OpenFile ( const CFileItem file,
const CPlayerOptions options 
)
overridevirtual

Reimplemented from IPlayer.

◆ Pause()

void PAPlayer::Pause ( )
overridevirtual

Implements IPlayer.

◆ Process()

void PAPlayer::Process ( void  )
overrideprotectedvirtual

Reimplemented from CThread.

◆ QueueNextFile()

bool PAPlayer::QueueNextFile ( const CFileItem file)
overridevirtual

Reimplemented from IPlayer.

◆ Seek()

void PAPlayer::Seek ( bool  bPlus = true,
bool  bLargeStep = false,
bool  bChapterOverride = false 
)
overridevirtual

Implements IPlayer.

◆ SeekPercentage()

void PAPlayer::SeekPercentage ( float  fPercent = 0.0f)
overridevirtual

Reimplemented from IPlayer.

◆ SeekTime()

void PAPlayer::SeekTime ( int64_t  iTime = 0)
overridevirtual

Reimplemented from IPlayer.

◆ SetDynamicRangeCompression()

void PAPlayer::SetDynamicRangeCompression ( long  drc)
overridevirtual

Reimplemented from IPlayer.

◆ SetSpeed()

void PAPlayer::SetSpeed ( float  speed = 0)
overridevirtual

Implements IPlayer.

◆ SetTime()

void PAPlayer::SetTime ( int64_t  time)
overridevirtual

Sets the current time. This can be used for injecting the current time. This is not to be confused with a seek. It just can be used if endless streams contain multiple tracks in reality (like with airtunes)

Reimplemented from IPlayer.

◆ SetTotalTime()

void PAPlayer::SetTotalTime ( int64_t  time)
overridevirtual

Set the total time in milliseconds this can be used for injecting the duration in case its not available in the underlaying decoder (airtunes for example)

Reimplemented from IPlayer.

◆ SetVolume()

void PAPlayer::SetVolume ( float  volume)
overridevirtual

Reimplemented from IPlayer.

Friends And Related Function Documentation

◆ CQueueNextFileJob

friend class CQueueNextFileJob
friend

Member Data Documentation

◆ m_audioBitrate

int PAPlayer::m_audioBitrate

◆ m_bitsPerSample

int PAPlayer::m_bitsPerSample

◆ m_cacheLevel

int PAPlayer::m_cacheLevel

◆ m_canSeek

bool PAPlayer::m_canSeek

◆ m_channelCount

int PAPlayer::m_channelCount

◆ m_codec

char PAPlayer::m_codec[21]

◆ 

struct { ... } PAPlayer::m_playerGUIData

◆ m_sampleRate

int PAPlayer::m_sampleRate

◆ m_time

int64_t PAPlayer::m_time

◆ m_totalTime

int64_t PAPlayer::m_totalTime

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