diff options
author | Rainer Hochecker <fernetmenta@online.de> | 2015-12-27 10:31:04 +0100 |
---|---|---|
committer | Rainer Hochecker <fernetmenta@online.de> | 2016-01-04 22:19:24 +0100 |
commit | 9cce4fd3de2950ff3f6f5179919dca7b347ad66a (patch) | |
tree | 782b69c98f6cdd24ec331c06c3f5734ac15d8333 | |
parent | 3fc0959df6c8185b91ca170773878784096dee1e (diff) |
VideoPlayer: cosmetics
-rw-r--r-- | xbmc/cores/VideoPlayer/IVideoPlayer.h | 2 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp | 18 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoPlayerVideo.h | 93 |
3 files changed, 38 insertions, 75 deletions
diff --git a/xbmc/cores/VideoPlayer/IVideoPlayer.h b/xbmc/cores/VideoPlayer/IVideoPlayer.h index 0c59662628..ea3c7f6010 100644 --- a/xbmc/cores/VideoPlayer/IVideoPlayer.h +++ b/xbmc/cores/VideoPlayer/IVideoPlayer.h @@ -145,7 +145,7 @@ public: float GetRelativeUsage() { return 0.0f; } virtual bool OpenStream(CDVDStreamInfo &hint) = 0; virtual void CloseStream(bool bWaitForBuffers) = 0; - virtual bool StepFrame() = 0; + virtual bool StepFrame() { return false; }; virtual void Flush(bool sync) = 0; virtual void WaitForBuffers() = 0; virtual bool AcceptsData() const = 0; diff --git a/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp b/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp index 04e07690c9..f5bedd7b1e 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp +++ b/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp @@ -285,12 +285,8 @@ bool CVideoPlayerVideo::AcceptsData() const void CVideoPlayerVideo::OnStartup() { m_iDroppedFrames = 0; - - m_crop.x1 = m_crop.x2 = 0.0f; - m_crop.y1 = m_crop.y2 = 0.0f; - m_FlipTimeStamp = m_pClock->GetAbsoluteClock(); - m_FlipTimePts = 0.0; + m_FlipTimePts = 0.0; } void CVideoPlayerVideo::Process() @@ -768,18 +764,6 @@ void CVideoPlayerVideo::SetSpeed(int speed) m_speed = speed; } -bool CVideoPlayerVideo::StepFrame() -{ -#if 0 - // sadly this doesn't work for now, audio player must - // drop packets at the same rate as we play frames - m_iNrOfPicturesNotToSkip++; - return true; -#else - return false; -#endif -} - void CVideoPlayerVideo::Flush(bool sync) { /* flush using message as this get's called from VideoPlayer thread */ diff --git a/xbmc/cores/VideoPlayer/VideoPlayerVideo.h b/xbmc/cores/VideoPlayer/VideoPlayerVideo.h index ad38acbe81..dca2873139 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayerVideo.h +++ b/xbmc/cores/VideoPlayer/VideoPlayerVideo.h @@ -37,6 +37,11 @@ class CDemuxStreamVideo; #define VIDEO_PICTURE_QUEUE_SIZE 1 +#define EOS_ABORT 1 +#define EOS_DROPPED 2 +#define EOS_VERYLATE 4 +#define EOS_BUFFER_LEVEL 8 + class CDroppingStats { public: @@ -67,74 +72,55 @@ public: bool OpenStream(CDVDStreamInfo &hint); void CloseStream(bool bWaitForBuffers); - bool StepFrame(); void Flush(bool sync); - - // waits until all available data has been rendered - // just waiting for packetqueue should be enough for video - void WaitForBuffers() { m_messageQueue.WaitUntilEmpty(); } bool AcceptsData() const; - bool HasData() const { return m_messageQueue.GetDataSize() > 0; } - int GetLevel() const { return m_messageQueue.GetLevel(); } - bool IsInited() const { return m_messageQueue.IsInited(); } + bool HasData() const { return m_messageQueue.GetDataSize() > 0; } + int GetLevel() const { return m_messageQueue.GetLevel(); } + bool IsInited() const { return m_messageQueue.IsInited(); } void SendMessage(CDVDMsg* pMsg, int priority = 0) { m_messageQueue.Put(pMsg, priority); } - void FlushMessages() { m_messageQueue.Flush(); } - - void EnableSubtitle(bool bEnable) { m_bRenderSubs = bEnable; } - bool IsSubtitleEnabled() { return m_bRenderSubs; } - - void EnableFullscreen(bool bEnable) { m_bAllowFullscreen = bEnable; } - - double GetDelay() { return m_iVideoDelay; } - void SetDelay(double delay) { m_iVideoDelay = delay; } - - double GetSubtitleDelay() { return m_iSubtitleDelay; } - void SetSubtitleDelay(double delay) { m_iSubtitleDelay = delay; } - - bool IsStalled() const { return m_stalled; } - bool IsEOS() { return false; } - bool SubmittedEOS() const { return false; } - + void FlushMessages() { m_messageQueue.Flush(); } + + void EnableSubtitle(bool bEnable) { m_bRenderSubs = bEnable; } + bool IsSubtitleEnabled() { return m_bRenderSubs; } + void EnableFullscreen(bool bEnable) { m_bAllowFullscreen = bEnable; } + double GetDelay() { return m_iVideoDelay; } + void SetDelay(double delay) { m_iVideoDelay = delay; } + double GetSubtitleDelay() { return m_iSubtitleDelay; } + void SetSubtitleDelay(double delay) { m_iSubtitleDelay = delay; } + bool IsStalled() const { return m_stalled; } + bool IsEOS() { return false; } + bool SubmittedEOS() const { return false; } double GetCurrentPts(); - double GetOutputDelay(); /* returns the expected delay, from that a packet is put in queue */ int GetDecoderFreeSpace() { return 0; } std::string GetPlayerInfo(); int GetVideoBitrate(); std::string GetStereoMode(); - void SetSpeed(int iSpeed); // IVPClockCallback interface virtual double GetInterpolatedClock(); - // classes CDVDOverlayContainer* m_pOverlayContainer; - CDVDClock* m_pClock; protected: + virtual void OnStartup(); virtual void OnExit(); virtual void Process(); -#define EOS_ABORT 1 -#define EOS_DROPPED 2 -#define EOS_VERYLATE 4 -#define EOS_BUFFER_LEVEL 8 - - void AutoCrop(DVDVideoPicture* pPicture); - void AutoCrop(DVDVideoPicture *pPicture, RECT &crop); - CRect m_crop; - int OutputPicture(const DVDVideoPicture* src, double pts); -#ifdef HAS_VIDEO_PLAYBACK void ProcessOverlays(DVDVideoPicture* pSource, double pts); -#endif void OpenStream(CDVDStreamInfo &hint, CDVDVideoCodec* codec); - CDVDMessageQueue m_messageQueue; - CDVDMessageQueue& m_messageParent; + // waits until all available data has been rendered + // just waiting for packetqueue should be enough for video + void WaitForBuffers() { m_messageQueue.WaitUntilEmpty(); } + + void ResetFrameRateCalc(); + void CalcFrameRate(); + int CalcDropRequirement(double pts, bool updateOnly); double m_iVideoDelay; double m_iSubtitleDelay; @@ -145,36 +131,29 @@ protected: int m_iDroppedFrames; int m_iDroppedRequest; - void ResetFrameRateCalc(); - void CalcFrameRate(); - int CalcDropRequirement(double pts, bool updateOnly); - double m_fFrameRate; //framerate of the video currently playing - bool m_bCalcFrameRate; //if we should calculate the framerate from the timestamps + bool m_bCalcFrameRate; //if we should calculate the framerate from the timestamps double m_fStableFrameRate; //place to store calculated framerates - int m_iFrameRateCount; //how many calculated framerates we stored in m_fStableFrameRate - bool m_bAllowDrop; //we can't drop frames until we've calculated the framerate - int m_iFrameRateErr; //how many frames we couldn't calculate the framerate, we give up after a while - int m_iFrameRateLength; //how many seconds we should measure the framerate + int m_iFrameRateCount; //how many calculated framerates we stored in m_fStableFrameRate + bool m_bAllowDrop; //we can't drop frames until we've calculated the framerate + int m_iFrameRateErr; //how many frames we couldn't calculate the framerate, we give up after a while + int m_iFrameRateLength; //how many seconds we should measure the framerate //this is increased exponentially from CVideoPlayerVideo::CalcFrameRate() - bool m_bFpsInvalid; // needed to ignore fps (e.g. dvd stills) - + bool m_bFpsInvalid; // needed to ignore fps (e.g. dvd stills) bool m_bAllowFullscreen; bool m_bRenderSubs; - float m_fForcedAspectRatio; - int m_iNrOfPicturesNotToSkip; int m_speed; - bool m_stalled; IDVDStreamPlayer::ESyncState m_syncState; std::string m_codecname; BitstreamStats m_videoStats; - // classes + CDVDMessageQueue m_messageQueue; + CDVDMessageQueue& m_messageParent; CDVDStreamInfo m_hints; CDVDVideoCodec* m_pVideoCodec; DVDVideoPicture* m_pTempOverlayPicture; |