xbmc
Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
CVideoPlayer Class Reference
Inheritance diagram for CVideoPlayer:
Inheritance graph
[legend]
Collaboration diagram for CVideoPlayer:
Collaboration graph
[legend]

Classes

struct  SContent
 
struct  SDVDInfo
 
struct  SSpeedState
 

Public Member Functions

 CVideoPlayer (IPlayerCallback &callback)
 
bool OpenFile (const CFileItem &file, const CPlayerOptions &options) override
 
bool CloseFile (bool reopen=false) override
 
bool IsPlaying () const override
 
void Pause () override
 
bool HasVideo () const override
 
bool HasAudio () const override
 
bool HasRDS () const override
 
bool HasID3 () const override
 
bool IsPassthrough () const override
 
bool CanSeek () const override
 
void Seek (bool bPlus, bool bLargeStep, bool bChapterOverride) override
 
bool SeekScene (bool bPlus=true) override
 
void SeekPercentage (float iPercent) override
 
float GetCachePercentage () const override
 
void SetDynamicRangeCompression (long drc) override
 
bool CanPause () const override
 
void SetAVDelay (float fValue=0.0f) override
 
float GetAVDelay () override
 
bool IsInMenu () const override
 
MenuType GetSupportedMenuType () const override
 Get the supported menu type. More...
 
void SetSubTitleDelay (float fValue=0.0f) override
 
float GetSubTitleDelay () override
 
int GetSubtitleCount () const override
 
int GetSubtitle () override
 
void GetSubtitleStreamInfo (int index, SubtitleStreamInfo &info) const override
 
void SetSubtitle (int iStream) override
 
bool GetSubtitleVisible () const override
 
void SetSubtitleVisible (bool bVisible) override
 
void SetSubtitleVerticalPosition (const int value, bool save) override
 Set the subtitle vertical position, it depends on current screen resolution. More...
 
void AddSubtitle (const std::string &strSubPath) override
 Adds the subtitle(s) provided by the given file to the available player streams and actives the first of the added stream(s). More...
 
int GetAudioStreamCount () const override
 
int GetAudioStream () override
 
void SetAudioStream (int iStream) override
 
int GetVideoStream () const override
 
int GetVideoStreamCount () const override
 
void GetVideoStreamInfo (int streamId, VideoStreamInfo &info) const override
 
void SetVideoStream (int iStream) override
 
int GetPrograms (std::vector< ProgramInfo > &programs) override
 
void SetProgram (int progId) override
 
int GetProgramsCount () const override
 
std::shared_ptr< TextCacheStruct_tGetTeletextCache () override
 
bool HasTeletextCache () const override
 
void LoadPage (int p, int sp, unsigned char *buffer) override
 
int GetChapterCount () const override
 
int GetChapter () const override
 
void GetChapterName (std::string &strChapterName, int chapterIdx=-1) const override
 
int64_t GetChapterPos (int chapterIdx=-1) const override
 
int SeekChapter (int iChapter) override
 
void SeekTime (int64_t iTime) override
 
bool SeekTimeRelative (int64_t iTime) override
 
void SetSpeed (float speed) override
 
void SetTempo (float tempo) override
 
bool SupportsTempo () const override
 
void FrameAdvance (int frames) override
 
bool OnAction (const CAction &action) override
 
void GetAudioStreamInfo (int index, AudioStreamInfo &info) const override
 
std::string GetPlayerState () override
 
bool SetPlayerState (const std::string &state) override
 
void FrameMove () override
 
void Render (bool clear, uint32_t alpha=255, bool gui=true) override
 hook into render loop of render thread
 
void FlushRenderer () override
 
void SetRenderViewMode (int mode, float zoom, float par, float shift, bool stretch) override
 
float GetRenderAspectRatio () const override
 
void TriggerUpdateResolution () override
 
bool IsRenderingVideo () const override
 
bool Supports (EINTERLACEMETHOD method) const override
 
EINTERLACEMETHOD GetDeinterlacingMethodDefault () const override
 
bool Supports (ESCALINGMETHOD method) const override
 
bool Supports (ERENDERFEATURE feature) const override
 
unsigned int RenderCaptureAlloc () override
 
void RenderCapture (unsigned int captureId, unsigned int width, unsigned int height, int flags) override
 
void RenderCaptureRelease (unsigned int captureId) override
 
bool RenderCaptureGetPixels (unsigned int captureId, unsigned int millis, uint8_t *buffer, unsigned int size) override
 
void OnLostDisplay () override
 
void OnResetDisplay () override
 
bool IsCaching () const override
 
int GetCacheLevel () const override
 
int OnDiscNavResult (void *pData, int iMessage) override
 
void GetVideoResolution (unsigned int &width, unsigned int &height) override
 
CVideoSettings GetVideoSettings () const override
 
void SetVideoSettings (CVideoSettings &settings) override
 
void SetUpdateStreamDetails ()
 
- Public Member Functions inherited from IPlayer
 IPlayer (IPlayerCallback &callback)
 
virtual bool Initialize (TiXmlElement *pConfig)
 
virtual bool QueueNextFile (const CFileItem &file)
 
virtual void OnNothingToQueueNotify ()
 
virtual bool HasGame () const
 
virtual void SetMute (bool bOnOff)
 
virtual void SetVolume (float volume)
 
virtual void SetTime (int64_t time)
 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)
 
virtual void SetTotalTime (int64_t time)
 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)
 
virtual void DoAudioWork ()
 
virtual void GetAudioCapabilities (std::vector< int > &audioCaps) const
 
virtual void GetSubtitleCapabilities (std::vector< int > &subCaps) const
 define the subtitle capabilities of the player
 
virtual bool HasGameAgent () const
 Check if any players are playing a game. More...
 
- Public Member Functions inherited from CThread
 CThread (IRunnable *pRunnable, const char *ThreadName)
 
void Create (bool bAutoDelete=false)
 
template<typename Rep , typename Period >
void Sleep (std::chrono::duration< Rep, Period > duration)
 
bool IsAutoDelete () const
 
virtual void StopThread (bool bWait=true)
 
bool IsRunning () const
 
bool IsCurrentThread () const
 
bool Join (std::chrono::milliseconds duration)
 
bool SetPriority (const ThreadPriority &priority)
 Set the threads priority. This uses the platforms native threading library to do so.
 
virtual void OnException ()
 
- Public Member Functions inherited from IDispResource
virtual void OnAppFocusChange (bool focus)
 

Protected Types

enum  ECacheState {
  CACHESTATE_DONE = 0, CACHESTATE_FULL, CACHESTATE_INIT, CACHESTATE_PLAY,
  CACHESTATE_FLUSH
}
 
- Protected Types inherited from CThread
enum  WaitResponse { WAIT_INTERRUPTED = -1, WAIT_SIGNALED = 0, WAIT_TIMEDOUT = 1 }
 

Protected Member Functions

void OnStartup () override
 
void OnExit () override
 
void Process () override
 
void VideoParamsChange () override
 
void GetDebugInfo (std::string &audio, std::string &video, std::string &general) override
 
void UpdateClockSync (bool enabled) override
 
void UpdateRenderInfo (CRenderInfo &info) override
 
void UpdateRenderBuffers (int queued, int discard, int free) override
 
void UpdateGuiRender (bool gui) override
 
void UpdateVideoRender (bool video) override
 
void CreatePlayers ()
 
void DestroyPlayers ()
 
void Prepare ()
 
bool OpenStream (CCurrentStream &current, int64_t demuxerId, int iStream, int source, bool reset=true)
 
bool OpenAudioStream (CDVDStreamInfo &hint, bool reset=true)
 
bool OpenVideoStream (CDVDStreamInfo &hint, bool reset=true)
 
bool OpenSubtitleStream (const CDVDStreamInfo &hint)
 
bool OpenTeletextStream (CDVDStreamInfo &hint)
 
bool OpenRadioRDSStream (CDVDStreamInfo &hint)
 
bool OpenAudioID3Stream (CDVDStreamInfo &hint)
 
void AdaptForcedSubtitles ()
 Switches forced subtitles to forced subtitles matching the language of the current audio track. More...
 
bool CloseStream (CCurrentStream &current, bool bWaitForBuffers)
 
bool CheckIsCurrent (const CCurrentStream &current, CDemuxStream *stream, DemuxPacket *pkg)
 
void ProcessPacket (CDemuxStream *pStream, DemuxPacket *pPacket)
 
void ProcessAudioData (CDemuxStream *pStream, DemuxPacket *pPacket)
 
void ProcessVideoData (CDemuxStream *pStream, DemuxPacket *pPacket)
 
void ProcessSubData (CDemuxStream *pStream, DemuxPacket *pPacket)
 
void ProcessTeletextData (CDemuxStream *pStream, DemuxPacket *pPacket)
 
void ProcessRadioRDSData (CDemuxStream *pStream, DemuxPacket *pPacket)
 
void ProcessAudioID3Data (CDemuxStream *pStream, DemuxPacket *pPacket)
 
int AddSubtitleFile (const std::string &filename, const std::string &subfilename="")
 
void SetSubtitleVisibleInternal (bool bVisible)
 
void SetPlaySpeed (int iSpeed)
 one of the DVD_PLAYSPEED defines
 
void SetCaching (ECacheState state)
 
double GetQueueTime ()
 
bool GetCachingTimes (double &play_left, double &cache_left, double &file_offset)
 
void FlushBuffers (double pts, bool accurate, bool sync)
 
void HandleMessages ()
 
void HandlePlaySpeed ()
 
bool IsInMenuInternal () const
 
void SynchronizeDemuxer ()
 
void CheckAutoSceneSkip ()
 
bool CheckContinuity (CCurrentStream &current, DemuxPacket *pPacket)
 
bool CheckSceneSkip (const CCurrentStream &current)
 
bool CheckPlayerInit (CCurrentStream &current)
 
void UpdateCorrection (DemuxPacket *pkt, double correction)
 
void UpdateTimestamps (CCurrentStream &current, DemuxPacket *pPacket)
 
IDVDStreamPlayerGetStreamPlayer (unsigned int player)
 
void SendPlayerMessage (std::shared_ptr< CDVDMsg > pMsg, unsigned int target)
 
bool ReadPacket (DemuxPacket *&packet, CDemuxStream *&stream)
 
bool IsValidStream (const CCurrentStream &stream)
 
bool IsBetterStream (const CCurrentStream &current, CDemuxStream *stream)
 
void CheckBetterStream (CCurrentStream &current, CDemuxStream *stream)
 
void CheckStreamChanges (CCurrentStream &current, CDemuxStream *stream)
 
bool OpenInputStream ()
 
bool OpenDemuxStream ()
 
void CloseDemuxer ()
 
void OpenDefaultStreams (bool reset=true)
 
void UpdatePlayState (double timeout)
 
void GetGeneralInfo (std::string &strVideoInfo)
 
int64_t GetUpdatedTime ()
 
int64_t GetTime ()
 
float GetPercentage ()
 
void UpdateContent ()
 
void UpdateContentState ()
 
void UpdateFileItemStreamDetails (CFileItem &item)
 
- Protected Member Functions inherited from CThread
 CThread (const char *ThreadName)
 
WaitResponse AbortableWait (CEvent &event, std::chrono::milliseconds duration=std::chrono::milliseconds(-1))
 This call will wait on a CEvent in an interruptible way such that if stop is called on the thread the wait will return with a response indicating what happened.
 

Protected Attributes

bool m_players_created
 
CFileItem m_item
 
CPlayerOptions m_playerOptions
 
bool m_bAbortRequest
 
bool m_error
 
bool m_bCloseRequest
 
ECacheState m_caching
 
XbmcThreads::EndTime m_cachingTimer
 
std::unique_ptr< CProcessInfom_processInfo
 
CCurrentStream m_CurrentAudio
 
CCurrentStream m_CurrentVideo
 
CCurrentStream m_CurrentSubtitle
 
CCurrentStream m_CurrentTeletext
 
CCurrentStream m_CurrentRadioRDS
 
CCurrentStream m_CurrentAudioID3
 
CSelectionStreams m_SelectionStreams
 
std::vector< ProgramInfom_programs
 
struct CVideoPlayer::SContent m_content
 
int m_playSpeed
 
int m_streamPlayerSpeed
 
int m_demuxerSpeed = DVD_PLAYSPEED_NORMAL
 
struct CVideoPlayer::SSpeedState m_SpeedState
 
double m_offset_pts
 
CDVDMessageQueue m_messenger
 
std::unique_ptr< CJobQueuem_outboundEvents
 
IDVDStreamPlayerVideom_VideoPlayerVideo
 
IDVDStreamPlayerAudiom_VideoPlayerAudio
 
CVideoPlayerSubtitlem_VideoPlayerSubtitle
 
CDVDTeletextDatam_VideoPlayerTeletext
 
CDVDRadioRDSDatam_VideoPlayerRadioRDS
 
std::unique_ptr< CVideoPlayerAudioID3m_VideoPlayerAudioID3
 
CDVDClock m_clock
 
CDVDOverlayContainer m_overlayContainer
 
std::shared_ptr< CDVDInputStreamm_pInputStream
 
std::unique_ptr< CDVDDemuxm_pDemuxer
 
std::shared_ptr< CDVDDemuxm_pSubtitleDemuxer
 
std::unordered_map< int64_t, std::shared_ptr< CDVDDemux > > m_subtitleDemuxerMap
 
std::unique_ptr< CDVDDemuxCCm_pCCDemuxer
 
CRenderManager m_renderManager
 
struct CVideoPlayer::SDVDInfo m_dvd
 
SPlayerState m_State
 
CCriticalSection m_StateSection
 
XbmcThreads::EndTime m_syncTimer
 
CEdl m_Edl
 
bool m_SkipCommercials
 
bool m_HasVideo
 
bool m_HasAudio
 
bool m_UpdateStreamDetails
 
std::atomic< bool > m_displayLost
 
- Protected Attributes inherited from IPlayer
IPlayerCallbackm_callback
 
- Protected Attributes inherited from CThread
std::atomic< bool > m_bStop
 

Friends

class CSelectionStreams
 

Additional Inherited Members

- Static Public Member Functions inherited from CThread
static const std::thread::id GetCurrentThreadId ()
 
static CThreadGetCurrentThread ()
 
- Public Attributes inherited from IPlayer
std::string m_name
 
std::string m_type
 

Member Function Documentation

◆ AdaptForcedSubtitles()

void CVideoPlayer::AdaptForcedSubtitles ( )
protected

Switches forced subtitles to forced subtitles matching the language of the current audio track.

If these are not available, subtitles are disabled.

◆ AddSubtitle()

void CVideoPlayer::AddSubtitle ( const std::string &  strSubPath)
overridevirtual

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.

Parameters
[in]strSubPathThe full path of the subtitle file.

Reimplemented from IPlayer.

◆ GetSupportedMenuType()

MenuType CVideoPlayer::GetSupportedMenuType ( ) const
overridevirtual

Get the supported menu type.

Returns
The supported menu type

Reimplemented from IPlayer.

◆ HandleMessages()

void CVideoPlayer::HandleMessages ( )
protected
Todo:
After demuxer we add an offset to input pts so that displayed time and clock are increasing steadily. For seeking we need to determine the boundaries and offset of the desired segment. With the current approach calculated time may point to nirvana

◆ SetSubtitleVerticalPosition()

void CVideoPlayer::SetSubtitleVerticalPosition ( const int  value,
bool  save 
)
overridevirtual

Set the subtitle vertical position, it depends on current screen resolution.

Parameters
valueThe subtitle position in pixels
saveIf true, the value will be saved to resolution info

Reimplemented from IPlayer.


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