diff options
author | Geoffrey McRae <gnif@xbmc.org> | 2012-04-25 15:36:17 +1200 |
---|---|---|
committer | Jonathan Marshall <jmarshall@never.you.mind> | 2012-05-10 09:40:50 +1200 |
commit | 461207b8cd4fc74543a66df5b9229e5ae38f4eea (patch) | |
tree | 747a09a8289411fe6d1dc17f6ab343b11ad9d5f3 | |
parent | 08b78c8fee881cc782060dc3966a8ee9a8398244 (diff) |
[AE] paplayer: drop ReadSamples/HasFloatData from codecs
-rw-r--r-- | xbmc/cores/paplayer/ICodec.h | 10 | ||||
-rw-r--r-- | xbmc/cores/paplayer/MP3codec.cpp | 7 | ||||
-rw-r--r-- | xbmc/cores/paplayer/MP3codec.h | 2 | ||||
-rw-r--r-- | xbmc/cores/paplayer/WAVcodec.cpp | 17 | ||||
-rw-r--r-- | xbmc/cores/paplayer/WAVcodec.h | 3 |
5 files changed, 0 insertions, 39 deletions
diff --git a/xbmc/cores/paplayer/ICodec.h b/xbmc/cores/paplayer/ICodec.h index 0629fbe52a..405533d0ec 100644 --- a/xbmc/cores/paplayer/ICodec.h +++ b/xbmc/cores/paplayer/ICodec.h @@ -74,14 +74,6 @@ public: // the data has been exhausted, and READ_ERROR on error. virtual int ReadPCM(BYTE *pBuffer, int size, int *actualsize)=0; - // ReadSamples() - // Decodes audio into floats (normalized to 1) into pBuffer up to numsamples samples. - // The actual amount of returned samples is given in actualsamples. Samples are - // total samples (ie distributed over channels). - // Returns READ_SUCCESS on success. Returns READ_EOF when the data has been exhausted, - // and READ_ERROR on error. - virtual int ReadSamples(float *pBuffer, int numsamples, int *actualsamples) { return READ_ERROR; }; - // CanInit() // Should return true if the codec can be initialized // eg. check if a dll needed for the codec exists @@ -97,8 +89,6 @@ public: virtual bool IsCaching() const {return false;} virtual int GetCacheLevel() const {return -1;} - // true if we can retrieve normalized float data immediately - virtual bool HasFloatData() const { return false; } int64_t m_TotalTime; // time in ms int m_SampleRate; diff --git a/xbmc/cores/paplayer/MP3codec.cpp b/xbmc/cores/paplayer/MP3codec.cpp index 02f191bcc2..a7de09b70a 100644 --- a/xbmc/cores/paplayer/MP3codec.cpp +++ b/xbmc/cores/paplayer/MP3codec.cpp @@ -206,13 +206,6 @@ int64_t MP3Codec::Seek(int64_t iSeekTime) return iSeekTime; } -int MP3Codec::ReadSamples(float *pBuffer, int numsamples, int *actualsamples) -{ - int result = ReadPCM((BYTE *)pBuffer, numsamples * sizeof(float), actualsamples); - *actualsamples /= sizeof(float); - return result; -} - int MP3Codec::Read(int size, bool init) { int inputBufferToRead = (int)(m_InputBufferSize - m_InputBufferPos); diff --git a/xbmc/cores/paplayer/MP3codec.h b/xbmc/cores/paplayer/MP3codec.h index ad5ef6f5c4..bf2f6b5bf2 100644 --- a/xbmc/cores/paplayer/MP3codec.h +++ b/xbmc/cores/paplayer/MP3codec.h @@ -61,10 +61,8 @@ public: virtual bool CanSeek(); virtual int64_t Seek(int64_t iSeekTime); virtual int ReadPCM(BYTE *pBuffer, int size, int *actualsize); - virtual int ReadSamples(float *pBuffer, int numsamples, int *actualsamples); virtual bool CanInit(); virtual bool SkipNext(); - virtual bool HasFloatData() const { return m_BitsPerSampleInternal == 32; }; private: /* TODO decoder functions */ diff --git a/xbmc/cores/paplayer/WAVcodec.cpp b/xbmc/cores/paplayer/WAVcodec.cpp index d164b5f0ed..9c512838b2 100644 --- a/xbmc/cores/paplayer/WAVcodec.cpp +++ b/xbmc/cores/paplayer/WAVcodec.cpp @@ -48,7 +48,6 @@ WAVCodec::WAVCodec() m_SampleRate = 0; m_Channels = 0; m_BitsPerSample = 0; - m_bHasFloat = false; m_iDataStart=0; m_iDataLen=0; m_Bitrate = 0; @@ -115,7 +114,6 @@ bool WAVCodec::Init(const CStdString &strFile, unsigned int filecache) case WAVE_FORMAT_PCM: CLog::Log(LOGINFO, "WAVCodec::Init - WAVE_FORMAT_PCM detected"); m_ChannelMask = 0; - m_bHasFloat = false; break; case WAVE_FORMAT_IEEE_FLOAT: @@ -127,7 +125,6 @@ bool WAVCodec::Init(const CStdString &strFile, unsigned int filecache) } m_ChannelMask = 0; - m_bHasFloat = true; break; case WAVE_FORMAT_EXTENSIBLE: @@ -145,7 +142,6 @@ bool WAVCodec::Init(const CStdString &strFile, unsigned int filecache) if (memcmp(&wfx.SubFormat, &KSDATAFORMAT_SUBTYPE_PCM, sizeof(GUID)) == 0) { CLog::Log(LOGINFO, "WAVCodec::Init - SubFormat KSDATAFORMAT_SUBTYPE_PCM Detected"); - m_bHasFloat = false; } else if (memcmp(&wfx.SubFormat, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT, sizeof(GUID)) == 0) { @@ -155,7 +151,6 @@ bool WAVCodec::Init(const CStdString &strFile, unsigned int filecache) CLog::Log(LOGERROR, "WAVCodec::Init - Only 32bit Float is supported"); return false; } - m_bHasFloat = true; } else { @@ -263,18 +258,6 @@ int WAVCodec::ReadPCM(BYTE *pBuffer, int size, int *actualsize) return READ_ERROR; } -int WAVCodec::ReadSamples(float *pBuffer, int numsamples, int *actualsamples) -{ - int ret = READ_ERROR; - *actualsamples = 0; - if (m_bHasFloat) - { - ret = ReadPCM((BYTE*)pBuffer, numsamples * (m_BitsPerSample >> 3), actualsamples); - *actualsamples /= (m_BitsPerSample >> 3); - } - return ret; -} - bool WAVCodec::CanInit() { return true; diff --git a/xbmc/cores/paplayer/WAVcodec.h b/xbmc/cores/paplayer/WAVcodec.h index e8e239070b..6c2e165d9b 100644 --- a/xbmc/cores/paplayer/WAVcodec.h +++ b/xbmc/cores/paplayer/WAVcodec.h @@ -34,12 +34,9 @@ public: virtual void DeInit(); virtual int64_t Seek(int64_t iSeekTime); virtual int ReadPCM(BYTE *pBuffer, int size, int *actualsize); - virtual int ReadSamples(float *pBuffer, int numsamples, int *actualsamples); virtual bool CanInit(); - virtual bool HasFloatData() const { return m_bHasFloat; } private: - bool m_bHasFloat; uint32_t m_iDataStart; uint32_t m_iDataLen; DWORD m_ChannelMask; |