diff options
author | huceke <ebsi4711@gmail.com> | 2013-06-02 04:35:08 -0700 |
---|---|---|
committer | huceke <ebsi4711@gmail.com> | 2013-06-02 04:35:08 -0700 |
commit | 51b2f9320250985b73e6d514e216d553ac2ed547 (patch) | |
tree | c84fcf0b1a3086d1385e8aaa1192f1e6b88b858e | |
parent | 9d92eaefb01ae7c8aa8ba06e20a0697957ac5cf9 (diff) | |
parent | 25ca3fa761aeec7cfad840ad3ac4733278a434c5 (diff) |
Merge pull request #2799 from popcornmix/cosmetics
[rbp/omxplayer] [Cosmetics] Remove unused code
-rw-r--r-- | xbmc/cores/omxplayer/OMXAudio.cpp | 47 | ||||
-rw-r--r-- | xbmc/cores/omxplayer/OMXAudio.h | 5 | ||||
-rw-r--r-- | xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 9 | ||||
-rw-r--r-- | xbmc/cores/omxplayer/OMXPlayerVideo.h | 2 | ||||
-rw-r--r-- | xbmc/cores/omxplayer/OMXVideo.cpp | 31 | ||||
-rw-r--r-- | xbmc/cores/omxplayer/OMXVideo.h | 4 | ||||
-rw-r--r-- | xbmc/linux/OMXClock.cpp | 265 | ||||
-rw-r--r-- | xbmc/linux/OMXClock.h | 10 |
8 files changed, 3 insertions, 370 deletions
diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp index 0f37eabe5d..cf75726b87 100644 --- a/xbmc/cores/omxplayer/OMXAudio.cpp +++ b/xbmc/cores/omxplayer/OMXAudio.cpp @@ -94,8 +94,6 @@ const float downmixing_coefficients_8[OMX_AUDIO_MAXCHANNELS] = { COMXAudio::COMXAudio() : m_pCallback (NULL ), m_Initialized (false ), - m_Pause (false ), - m_CanPause (false ), m_CurrentVolume (0 ), m_drc (0 ), m_Passthrough (false ), @@ -626,47 +624,6 @@ void COMXAudio::Flush() } //*********************************************************************************************** -bool COMXAudio::Pause() -{ - if (!m_Initialized) - return -1; - - if(m_Pause) return true; - m_Pause = true; - - m_omx_decoder.SetStateForComponent(OMX_StatePause); - - return true; -} - -//*********************************************************************************************** -bool COMXAudio::Resume() -{ - if (!m_Initialized) - return -1; - - if(!m_Pause) return true; - m_Pause = false; - - m_omx_decoder.SetStateForComponent(OMX_StateExecuting); - - return true; -} - -//*********************************************************************************************** -bool COMXAudio::Stop() -{ - if (!m_Initialized) - return -1; - - Flush(); - - m_Pause = false; - - return true; -} - -//*********************************************************************************************** long COMXAudio::GetCurrentVolume() const { return m_CurrentVolume; @@ -1011,7 +968,7 @@ void COMXAudio::SubmitEOS() { CSingleLock lock (m_critSection); - if(!m_Initialized || m_Pause) + if(!m_Initialized) return; OMX_ERRORTYPE omx_err = OMX_ErrorNone; @@ -1039,7 +996,7 @@ void COMXAudio::SubmitEOS() bool COMXAudio::IsEOS() { - if(!m_Initialized || m_Pause) + if(!m_Initialized) return true; unsigned int latency = GetAudioRenderingLatency(); CSingleLock lock (m_critSection); diff --git a/xbmc/cores/omxplayer/OMXAudio.h b/xbmc/cores/omxplayer/OMXAudio.h index 5ab3a21c95..83a91dcd8b 100644 --- a/xbmc/cores/omxplayer/OMXAudio.h +++ b/xbmc/cores/omxplayer/OMXAudio.h @@ -68,9 +68,6 @@ public: unsigned int AddPackets(const void* data, unsigned int len, double dts, double pts); unsigned int GetSpace(); bool Deinitialize(); - bool Pause(); - bool Stop(); - bool Resume(); long GetCurrentVolume() const; void Mute(bool bMute); @@ -101,8 +98,6 @@ public: private: IAudioCallback* m_pCallback; bool m_Initialized; - bool m_Pause; - bool m_CanPause; float m_CurrentVolume; long m_drc; bool m_Passthrough; diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp index 5b10304297..1d9b04e824 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp @@ -74,7 +74,6 @@ OMXPlayerVideo::OMXPlayerVideo(OMXClock *av_clock, { m_av_clock = av_clock; m_pOverlayContainer = pOverlayContainer; - m_pTempOverlayPicture = NULL; m_open = false; m_stream_id = -1; m_fFrameRate = 25.0f; @@ -164,12 +163,6 @@ bool OMXPlayerVideo::CloseStream(bool bWaitForBuffers) m_speed = DVD_PLAYSPEED_NORMAL; m_started = false; - if (m_pTempOverlayPicture) - { - CDVDCodecUtils::FreePicture(m_pTempOverlayPicture); - m_pTempOverlayPicture = NULL; - } - m_av_clock->Lock(); m_av_clock->OMXStop(false); m_omxVideo.Close(); @@ -467,7 +460,7 @@ void OMXPlayerVideo::Process() #ifdef _DEBUG CLog::Log(LOGINFO, "Video: dts:%.0f pts:%.0f size:%d (s:%d f:%d d:%d l:%d) s:%d %d/%d late:%d\n", pPacket->dts, pPacket->pts, - (int)pPacket->iSize, m_started, m_flush, bPacketDrop, m_stalled, m_speed, 0, 0, m_av_clock->OMXLateCount(1)); + (int)pPacket->iSize, m_started, m_flush, bPacketDrop, m_stalled, m_speed, 0, 0, 0); #endif if (m_messageQueue.GetDataSize() == 0 || m_speed < 0) diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.h b/xbmc/cores/omxplayer/OMXPlayerVideo.h index 860c85c1e1..9c8a1d1d78 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.h +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.h @@ -81,8 +81,6 @@ protected: BitstreamStats m_videoStats; - DVDVideoPicture* m_pTempOverlayPicture; - void ProcessOverlays(double pts); virtual void OnStartup(); diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp index 93b2443884..0e99ac2ccb 100644 --- a/xbmc/cores/omxplayer/OMXVideo.cpp +++ b/xbmc/cores/omxplayer/OMXVideo.cpp @@ -64,7 +64,6 @@ COMXVideo::COMXVideo() : m_video_codec_name("") { m_is_open = false; - m_Pause = false; m_extradata = NULL; m_extrasize = 0; m_video_convert = false; @@ -803,36 +802,6 @@ void COMXVideo::Reset(void) } /////////////////////////////////////////////////////////////////////////////////////////// -bool COMXVideo::Pause() -{ - if(m_omx_render.GetComponent() == NULL) - return false; - - if(m_Pause) return true; - m_Pause = true; - - m_omx_sched.SetStateForComponent(OMX_StatePause); - m_omx_render.SetStateForComponent(OMX_StatePause); - - return true; -} - -/////////////////////////////////////////////////////////////////////////////////////////// -bool COMXVideo::Resume() -{ - if(m_omx_render.GetComponent() == NULL) - return false; - - if(!m_Pause) return true; - m_Pause = false; - - m_omx_sched.SetStateForComponent(OMX_StateExecuting); - m_omx_render.SetStateForComponent(OMX_StateExecuting); - - return true; -} - -/////////////////////////////////////////////////////////////////////////////////////////// void COMXVideo::SetVideoRect(const CRect& SrcRect, const CRect& DestRect) { if(!m_is_open) diff --git a/xbmc/cores/omxplayer/OMXVideo.h b/xbmc/cores/omxplayer/OMXVideo.h index 93612acbcb..9ea37c5dd5 100644 --- a/xbmc/cores/omxplayer/OMXVideo.h +++ b/xbmc/cores/omxplayer/OMXVideo.h @@ -56,8 +56,6 @@ public: int Decode(uint8_t *pData, int iSize, double dts, double pts); void Reset(void); void SetDropState(bool bDrop); - bool Pause(); - bool Resume(); std::string GetDecoderName() { return m_video_codec_name; }; void SetVideoRect(const CRect& SrcRect, const CRect& DestRect); int GetInputBufferSize(); @@ -86,8 +84,6 @@ protected: COMXCoreTunel m_omx_tunnel_image_fx; bool m_is_open; - bool m_Pause; - uint8_t *m_extradata; int m_extrasize; diff --git a/xbmc/linux/OMXClock.cpp b/xbmc/linux/OMXClock.cpp index 1b849188a2..44750c2601 100644 --- a/xbmc/linux/OMXClock.cpp +++ b/xbmc/linux/OMXClock.cpp @@ -342,7 +342,6 @@ bool OMXClock::OMXSetReferenceClock(bool lock /* = true */) bool OMXClock::OMXInitialize(bool has_video, bool has_audio) { - OMX_ERRORTYPE omx_err = OMX_ErrorNone; std::string componentName = ""; m_has_video = has_video; @@ -359,21 +358,6 @@ bool OMXClock::OMXInitialize(bool has_video, bool has_audio) m_omx_clock.DisableAllPorts(); - /* - if(!OMXSetReferenceClock(false)) - return false; - - OMX_TIME_CONFIG_CLOCKSTATETYPE clock; - OMX_INIT_STRUCTURE(clock); - - clock.eState = OMX_TIME_ClockStateWaitingForStartTime; - clock.nOffset = ToOMXTime(-1000LL * OMX_PRE_ROLL); - - omx_err = m_omx_clock.SetConfig(OMX_IndexConfigTimeClockState, &clock); - if(omx_err != OMX_ErrorNone) - CLog::Log(LOGWARNING, "OMXClock::OMXInitialize setting OMX_IndexConfigTimeClockState\n"); - */ - return true; } @@ -387,33 +371,6 @@ void OMXClock::OMXDeinitialize() m_omx_speed = DVD_PLAYSPEED_NORMAL; } -bool OMXClock::OMXStatePause(bool lock /* = true */) -{ - if(m_omx_clock.GetComponent() == NULL) - return false; - - if(lock) - Lock(); - - if(m_omx_clock.GetState() != OMX_StatePause) - { - OMX_ERRORTYPE omx_err = OMX_ErrorNone; - omx_err = m_omx_clock.SetStateForComponent(OMX_StatePause); - if (omx_err != OMX_ErrorNone) - { - CLog::Log(LOGERROR, "OMXClock::StatePause m_omx_clock.SetStateForComponent\n"); - if(lock) - UnLock(); - return false; - } - } - - if(lock) - UnLock(); - - return true; -} - bool OMXClock::OMXStateExecute(bool lock /* = true */) { if(m_omx_clock.GetComponent() == NULL) @@ -439,44 +396,6 @@ bool OMXClock::OMXStateExecute(bool lock /* = true */) } } - /* - if(m_has_audio) - { - omx_err = m_omx_clock.EnablePort(m_omx_clock.GetInputPort(), true); - if(omx_err != OMX_ErrorNone) - { - CLog::Log(LOGERROR, "OMXClock::StateExecute - Error enable port %d on component %s omx_err(0x%08x)", - m_omx_clock.GetInputPort(), m_omx_clock.GetName().c_str(), (int)omx_err); - } - } - - if(m_has_video) - { - omx_err = m_omx_clock.EnablePort(m_omx_clock.GetInputPort() + 1, true); - if(omx_err != OMX_ErrorNone) - { - CLog::Log(LOGERROR, "OMXClock::StateExecute - Error enable port %d on component %s omx_err(0x%08x)", - m_omx_clock.GetInputPort(), m_omx_clock.GetName().c_str(), (int)omx_err); - } - } - - OMX_TIME_CONFIG_CLOCKSTATETYPE clock; - OMX_INIT_STRUCTURE(clock); - - clock.eState = OMX_TIME_ClockStateWaitingForStartTime; - clock.nStartTime = ToOMXTime(0LL); - clock.nOffset = ToOMXTime(-1000LL * OMX_PRE_ROLL); - clock.nWaitMask = 0; - - omx_err = m_omx_clock.SetConfig(OMX_IndexConfigTimeClockState, &clock); - if(omx_err != OMX_ErrorNone) - { - CLog::Log(LOGERROR, "OMXClock::OMXStateExecute error setting OMX_IndexConfigTimeClockState\n"); - } - */ - - //OMXStart(lock); - if(lock) UnLock(); @@ -678,38 +597,6 @@ bool OMXClock::OMXReset(bool lock /* = true */) return true; } -double OMXClock::OMXWallTime(bool lock /* = true */) -{ - if(m_omx_clock.GetComponent() == NULL) - return 0; - - if(lock) - Lock(); - - OMX_ERRORTYPE omx_err = OMX_ErrorNone; - double pts = 0; - - OMX_TIME_CONFIG_TIMESTAMPTYPE timeStamp; - OMX_INIT_STRUCTURE(timeStamp); - timeStamp.nPortIndex = m_omx_clock.GetInputPort(); - - omx_err = m_omx_clock.GetConfig(OMX_IndexConfigTimeCurrentWallTime, &timeStamp); - if(omx_err != OMX_ErrorNone) - { - CLog::Log(LOGERROR, "OMXClock::WallTime error getting OMX_IndexConfigTimeCurrentWallTime\n"); - if(lock) - UnLock(); - return 0; - } - - pts = FromOMXTime(timeStamp.nTimestamp); - - if(lock) - UnLock(); - - return pts; -} - double OMXClock::OMXMediaTime(bool fixPreroll /* true */ , bool lock /* = true */) { if(m_omx_clock.GetComponent() == NULL) @@ -791,38 +678,6 @@ bool OMXClock::OMXMediaTime(double pts, bool fixPreroll /* = true*/, bool lock / return true; } -// gets count of late frames, indicating underrun has occurred -int OMXClock::OMXLateCount(int port /* true */ , bool lock /* = true */) -{ - if(m_omx_clock.GetComponent() == NULL) - return 0; - - if(lock) - Lock(); - - OMX_ERRORTYPE omx_err = OMX_ErrorNone; - - OMX_PARAM_U32TYPE late; - OMX_INIT_STRUCTURE(late); - late.nPortIndex = m_omx_clock.GetInputPort()+port; - - omx_err = m_omx_clock.GetConfig(OMX_IndexConfigBrcmClockMissCount, &late); - if(omx_err != OMX_ErrorNone) - { - CLog::Log(LOGERROR, "OMXClock::OMXLateCount error getting OMX_IndexConfigBrcmClockMissCount(%d)\n", port); - if(lock) - UnLock(); - return 0; - } - - //CLog::Log(LOGINFO, "OMXClock::OMXLateCount(%d)=%d", port, late.nU32); - - if(lock) - UnLock(); - - return late.nU32; -} - bool OMXClock::OMXPause(bool lock /* = true */) { if(m_omx_clock.GetComponent() == NULL) @@ -889,104 +744,6 @@ bool OMXClock::OMXResume(bool lock /* = true */) return true; } -bool OMXClock::OMXUpdateClock(double pts, bool lock /* = true */) -{ - if(m_omx_clock.GetComponent() == NULL) - return false; - - if(lock) - Lock(); - - OMX_ERRORTYPE omx_err = OMX_ErrorNone; - OMX_TIME_CONFIG_TIMESTAMPTYPE ts; - OMX_INIT_STRUCTURE(ts); - - ts.nPortIndex = OMX_ALL; - ts.nTimestamp = ToOMXTime((uint64_t)pts); - - CLog::Log(LOGDEBUG, "OMXClock::OMXUpdateClock %f", pts / DVD_TIME_BASE); - - if(m_has_audio) - { - omx_err = m_omx_clock.SetConfig(OMX_IndexConfigTimeCurrentAudioReference, &ts); - if(omx_err != OMX_ErrorNone) - CLog::Log(LOGERROR, "OMXClock::OMXUpdateClock error setting OMX_IndexConfigTimeCurrentAudioReference\n"); - } - else - { - omx_err = m_omx_clock.SetConfig(OMX_IndexConfigTimeCurrentVideoReference, &ts); - if(omx_err != OMX_ErrorNone) - CLog::Log(LOGERROR, "OMXClock::OMXUpdateClock error setting OMX_IndexConfigTimeCurrentVideoReference\n"); - } - - if(lock) - UnLock(); - - return true; -} - -bool OMXClock::OMXWaitStart(double pts, bool lock /* = true */) -{ - if(m_omx_clock.GetComponent() == NULL) - return false; - - if(lock) - Lock(); - - OMX_ERRORTYPE omx_err = OMX_ErrorNone; - OMX_TIME_CONFIG_CLOCKSTATETYPE clock; - OMX_INIT_STRUCTURE(clock); - - clock.eState = OMX_TIME_ClockStateWaitingForStartTime; - clock.nOffset = ToOMXTime(-1000LL * OMX_PRE_ROLL); - OMXSetClockPorts(&clock); - clock.nStartTime = ToOMXTime((uint64_t)pts); - - omx_err = m_omx_clock.SetConfig(OMX_IndexConfigTimeClockState, &clock); - if(omx_err != OMX_ErrorNone) - { - CLog::Log(LOGERROR, "OMXClock::OMXWaitStart error setting OMX_IndexConfigTimeClockState\n"); - if(lock) - UnLock(); - return false; - } - - if(lock) - UnLock(); - - return true; -} - -void OMXClock::OMXHandleBackward(bool lock /* = true */) -{ - /* - if(m_omx_clock.GetComponent() == NULL) - return; - - if(lock) - Lock(); - - if(m_omx_speed < 0) - { - OMX_ERRORTYPE omx_err = OMX_ErrorNone; - OMX_TIME_CONFIG_CLOCKSTATETYPE clock; - OMX_INIT_STRUCTURE(clock); - - clock.eState = OMX_TIME_ClockStateRunning; - clock.nOffset = ToOMXTime(-1000LL * OMX_PRE_ROLL); - - omx_err = m_omx_clock.SetConfig(OMX_IndexConfigTimeClockState, &clock); - if(omx_err != OMX_ErrorNone) - { - CLog::Log(LOGERROR, "OMXClock::OMXHandleBackward error setting OMX_IndexConfigTimeClockState\n"); - } - } - - if(lock) - UnLock(); - */ -} - bool OMXClock::OMXSetSpeed(int speed, bool lock /* = true */) { if(m_omx_clock.GetComponent() == NULL) @@ -1022,17 +779,6 @@ bool OMXClock::OMXSetSpeed(int speed, bool lock /* = true */) return true; } -void OMXClock::AddTimespecs(struct timespec &time, long millisecs) -{ - time.tv_sec += millisecs / 1000; - time.tv_nsec += (millisecs % 1000) * 1000000; - if (time.tv_nsec > 1000000000) - { - time.tv_sec += 1; - time.tv_nsec -= 1000000000; - } -} - bool OMXClock::HDMIClockSync(bool lock /* = true */) { if(m_omx_clock.GetComponent() == NULL) @@ -1081,17 +827,6 @@ int64_t OMXClock::CurrentHostFrequency(void) return( (int64_t)1000000000L ); } -void OMXClock::AddTimeSpecNano(struct timespec &time, uint64_t nanoseconds) -{ - time.tv_sec += nanoseconds / 1000000000; - time.tv_nsec += (nanoseconds % 1000000000); - if (time.tv_nsec > 1000000000) - { - time.tv_sec += 1; - time.tv_nsec -= 1000000000; - } -} - int OMXClock::GetRefreshRate(double* interval) { if(!interval) diff --git a/xbmc/linux/OMXClock.h b/xbmc/linux/OMXClock.h index a969e176c8..2651360816 100644 --- a/xbmc/linux/OMXClock.h +++ b/xbmc/linux/OMXClock.h @@ -114,23 +114,15 @@ public: bool OMXStop(bool lock = true); bool OMXStart(bool lock = true); bool OMXReset(bool lock = true); - double OMXWallTime(bool lock = true); double OMXMediaTime(bool fixPreroll = true, bool lock = true); bool OMXMediaTime(double pts, bool fixPreroll = true, bool lock = true); - int OMXLateCount(int port, bool lock = true); bool OMXPause(bool lock = true); bool OMXResume(bool lock = true); - bool OMXUpdateClock(double pts, bool lock = true); - bool OMXWaitStart(double pts, bool lock = true); - void OMXHandleBackward(bool lock = true); bool OMXSetSpeed(int speed, bool lock = true); int OMXPlaySpeed() { return m_omx_speed; }; - int OMXGetPlaySpeed() { return m_omx_speed; }; COMXCoreComponent *GetOMXClock(); - bool OMXStatePause(bool lock = true); bool OMXStateExecute(bool lock = true); void OMXStateIdle(bool lock = true); - static void AddTimespecs(struct timespec &time, long millisecs); bool HDMIClockSync(bool lock = true); static int64_t CurrentHostCounter(void); static int64_t CurrentHostFrequency(void); @@ -142,8 +134,6 @@ public: bool AudioStart() { return m_audio_start; }; void VideoStart(bool video_start); void AudioStart(bool audio_start); - static void AddTimeSpecNano(struct timespec &time, uint64_t nanoseconds); - void OMXAudioBufferStart(); void OMXAudioBufferStop(); bool OMXAudioBuffer() { return m_audio_buffer; }; |