Skip to content

Commit

Permalink
VideoPlayer: some cleanup to interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
FernetMenta authored and popcornmix committed Apr 12, 2016
1 parent 4d78f34 commit b1b1657
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 31 deletions.
8 changes: 2 additions & 6 deletions xbmc/cores/VideoPlayer/IVideoPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ class IDVDStreamPlayerVideo : public IDVDStreamPlayer
~IDVDStreamPlayerVideo() {}
virtual bool OpenStream(CDVDStreamInfo &hint) = 0;
virtual void CloseStream(bool bWaitForBuffers) = 0;
virtual bool StepFrame() { return false; };
virtual void Flush(bool sync) = 0;
virtual void WaitForBuffers() = 0;
virtual bool AcceptsData() const = 0;
virtual bool HasData() const = 0;
virtual int GetLevel() const = 0;
Expand All @@ -160,8 +158,7 @@ class IDVDStreamPlayerVideo : public IDVDStreamPlayer
virtual void SetSpeed(int iSpeed) = 0;
virtual int GetDecoderBufferSize() { return 0; }
virtual int GetDecoderFreeSpace() = 0;
virtual bool IsEOS() = 0;
virtual bool SubmittedEOS() const = 0;
virtual bool IsEOS() { return false; };
};

class CDVDAudioCodec;
Expand All @@ -174,7 +171,6 @@ class IDVDStreamPlayerAudio : public IDVDStreamPlayer
virtual void CloseStream(bool bWaitForBuffers) = 0;
virtual void SetSpeed(int speed) = 0;
virtual void Flush(bool sync) = 0;
virtual void WaitForBuffers() = 0;
virtual bool AcceptsData() const = 0;
virtual bool HasData() const = 0;
virtual int GetLevel() const = 0;
Expand All @@ -190,5 +186,5 @@ class IDVDStreamPlayerAudio : public IDVDStreamPlayer
virtual bool IsStalled() const = 0;
virtual bool IsPassthrough() const = 0;
virtual float GetDynamicRangeAmplification() const = 0;
virtual bool IsEOS() = 0;
virtual bool IsEOS() { return false; };
};
5 changes: 0 additions & 5 deletions xbmc/cores/VideoPlayer/VideoPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3064,11 +3064,6 @@ bool CVideoPlayer::CanSeek()

void CVideoPlayer::Seek(bool bPlus, bool bLargeStep, bool bChapterOverride)
{
if( m_playSpeed == DVD_PLAYSPEED_PAUSE && bPlus && !bLargeStep)
{
if (m_VideoPlayerVideo->StepFrame())
return;
}
if (!m_State.canseek)
return;

Expand Down
12 changes: 0 additions & 12 deletions xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -580,18 +580,6 @@ void CVideoPlayerAudio::Flush(bool sync)
m_dvdAudio.AbortAddPackets();
}

void CVideoPlayerAudio::WaitForBuffers()
{
// make sure there are no more packets available
m_messageQueue.WaitUntilEmpty();

// make sure almost all has been rendered
// leave 500ms to avound buffer underruns
double delay = m_dvdAudio.GetCacheTime();
if(delay > 0.5)
Sleep((int)(1000 * (delay - 0.5)));
}

bool CVideoPlayerAudio::AcceptsData() const
{
bool full = m_messageQueue.IsFull();
Expand Down
2 changes: 0 additions & 2 deletions xbmc/cores/VideoPlayer/VideoPlayerAudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class CVideoPlayerAudio : public CThread, public IDVDStreamPlayerAudio
void Flush(bool sync);

// waits until all available data has been rendered
void WaitForBuffers();
bool AcceptsData() const;
bool HasData() const { return m_messageQueue.GetDataSize() > 0; }
int GetLevel() const { return m_messageQueue.GetLevel(); }
Expand All @@ -72,7 +71,6 @@ class CVideoPlayerAudio : public CThread, public IDVDStreamPlayerAudio
double GetCurrentPts() { CSingleLock lock(m_info_section); return m_info.pts; }

bool IsStalled() const { return m_stalled; }
bool IsEOS() { return false; }
bool IsPassthrough() const;

protected:
Expand Down
6 changes: 0 additions & 6 deletions xbmc/cores/VideoPlayer/VideoPlayerVideo.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ class CVideoPlayerVideo : public CThread, public IDVDStreamPlayerVideo
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; }
Expand All @@ -109,10 +107,6 @@ class CVideoPlayerVideo : public CThread, public IDVDStreamPlayerVideo
void ProcessOverlays(DVDVideoPicture* pSource, double pts);
void OpenStream(CDVDStreamInfo &hint, CDVDVideoCodec* codec);

// 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);
Expand Down

0 comments on commit b1b1657

Please sign in to comment.