diff options
author | Arne Morten Kvarving <spiff@xbmc.org> | 2012-10-08 13:58:29 -0700 |
---|---|---|
committer | Arne Morten Kvarving <spiff@xbmc.org> | 2012-10-08 13:58:29 -0700 |
commit | 7942c1e09ebabcbf5d6436776470ffbeba3217c9 (patch) | |
tree | e198ace507f55a607df4c865b0249b78f2d6e11f | |
parent | 79ed7ae85bb1f79bf826c923e87c629ed295ecfa (diff) | |
parent | b8aca9884f7aa4675b7be479ab0b9d2f6738038b (diff) |
Merge pull request #1571 from Memphiz/bxaremove
[PAPlayer] Remove BXACodec and use DVDPlayerCodec instead
-rw-r--r-- | XBMC-ATV2.xcodeproj/project.pbxproj | 6 | ||||
-rw-r--r-- | XBMC-IOS.xcodeproj/project.pbxproj | 6 | ||||
-rw-r--r-- | XBMC.xcodeproj/project.pbxproj | 6 | ||||
-rw-r--r-- | project/VS2010Express/XBMC.vcxproj | 2 | ||||
-rw-r--r-- | project/VS2010Express/XBMC.vcxproj.filters | 6 | ||||
-rw-r--r-- | xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp | 2 | ||||
-rw-r--r-- | xbmc/cores/paplayer/BXAcodec.cpp | 126 | ||||
-rw-r--r-- | xbmc/cores/paplayer/BXAcodec.h | 74 | ||||
-rw-r--r-- | xbmc/cores/paplayer/CodecFactory.cpp | 13 | ||||
-rw-r--r-- | xbmc/cores/paplayer/Makefile.in | 1 | ||||
-rw-r--r-- | xbmc/network/AirTunesServer.cpp | 9 |
11 files changed, 16 insertions, 235 deletions
diff --git a/XBMC-ATV2.xcodeproj/project.pbxproj b/XBMC-ATV2.xcodeproj/project.pbxproj index 99a2bb7253..e02d1ce8bc 100644 --- a/XBMC-ATV2.xcodeproj/project.pbxproj +++ b/XBMC-ATV2.xcodeproj/project.pbxproj @@ -104,7 +104,6 @@ DF33C2A415509C1B0046CDCB /* XbmcContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF33C2A215509C1B0046CDCB /* XbmcContext.cpp */; }; DF33C2AE15509C5A0046CDCB /* ilog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF33C2AB15509C5A0046CDCB /* ilog.cpp */; }; DF34890913FD96390026A711 /* GUIAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF34890713FD96390026A711 /* GUIAction.cpp */; }; - DF44852F140064F40069344B /* BXAcodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF44852D140064F40069344B /* BXAcodec.cpp */; }; DF4485351400651B0069344B /* PipesManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF4485321400651B0069344B /* PipesManager.cpp */; }; DF4485381400654A0069344B /* AirTunesServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF4485361400654A0069344B /* AirTunesServer.cpp */; }; DF527780151BAFD600B5B63B /* WebSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF527777151BAFD600B5B63B /* WebSocket.cpp */; }; @@ -1258,8 +1257,6 @@ DF33C2AC15509C5A0046CDCB /* ilog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ilog.h; sourceTree = "<group>"; }; DF34890713FD96390026A711 /* GUIAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIAction.cpp; sourceTree = "<group>"; }; DF34890813FD96390026A711 /* GUIAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIAction.h; sourceTree = "<group>"; }; - DF44852D140064F40069344B /* BXAcodec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BXAcodec.cpp; sourceTree = "<group>"; }; - DF44852E140064F40069344B /* BXAcodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BXAcodec.h; sourceTree = "<group>"; }; DF4485321400651B0069344B /* PipesManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PipesManager.cpp; sourceTree = "<group>"; }; DF4485331400651B0069344B /* PipesManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PipesManager.h; sourceTree = "<group>"; }; DF4485361400654A0069344B /* AirTunesServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AirTunesServer.cpp; sourceTree = "<group>"; }; @@ -4484,8 +4481,6 @@ F56C7305131EC151000AD0F6 /* ASAPCodec.h */, F56C730C131EC151000AD0F6 /* AudioDecoder.cpp */, F56C730D131EC151000AD0F6 /* AudioDecoder.h */, - DF44852D140064F40069344B /* BXAcodec.cpp */, - DF44852E140064F40069344B /* BXAcodec.h */, F56C730E131EC151000AD0F6 /* CachingCodec.h */, F56C730F131EC151000AD0F6 /* CDDAcodec.cpp */, F56C7310131EC151000AD0F6 /* CDDAcodec.h */, @@ -7390,7 +7385,6 @@ 18968DE814155E1D005BA742 /* ApplicationOperations.cpp in Sources */, DFCFC53D1413F7F70004D0BF /* AFPDirectory.cpp in Sources */, 32D6D47C1423A9D8003641AC /* JpegIO.cpp in Sources */, - DF44852F140064F40069344B /* BXAcodec.cpp in Sources */, DF4485351400651B0069344B /* PipesManager.cpp in Sources */, DF4485381400654A0069344B /* AirTunesServer.cpp in Sources */, DF98D9A81434F4B400A6EBE1 /* SkinVariable.cpp in Sources */, diff --git a/XBMC-IOS.xcodeproj/project.pbxproj b/XBMC-IOS.xcodeproj/project.pbxproj index d2c9c8a3c8..a12037c377 100644 --- a/XBMC-IOS.xcodeproj/project.pbxproj +++ b/XBMC-IOS.xcodeproj/project.pbxproj @@ -105,7 +105,6 @@ DF2E329415509B2C000F5772 /* XbmcContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF2E329215509B2C000F5772 /* XbmcContext.cpp */; }; DF33C29415509BF50046CDCB /* ilog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF33C29115509BF50046CDCB /* ilog.cpp */; }; DF3488F813FD961A0026A711 /* GUIAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF3488F613FD961A0026A711 /* GUIAction.cpp */; }; - DF44856C140065C60069344B /* BXAcodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF44856A140065C60069344B /* BXAcodec.cpp */; }; DF448572140065E10069344B /* PipesManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF44856F140065E10069344B /* PipesManager.cpp */; }; DF4485751400662D0069344B /* AirTunesServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF4485731400662D0069344B /* AirTunesServer.cpp */; }; DF527757151BAF8200B5B63B /* WebSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF52774E151BAF8200B5B63B /* WebSocket.cpp */; }; @@ -1264,8 +1263,6 @@ DF33C29215509BF50046CDCB /* ilog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ilog.h; sourceTree = "<group>"; }; DF3488F613FD961A0026A711 /* GUIAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIAction.cpp; sourceTree = "<group>"; }; DF3488F713FD961A0026A711 /* GUIAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIAction.h; sourceTree = "<group>"; }; - DF44856A140065C60069344B /* BXAcodec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BXAcodec.cpp; sourceTree = "<group>"; }; - DF44856B140065C60069344B /* BXAcodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BXAcodec.h; sourceTree = "<group>"; }; DF44856F140065E10069344B /* PipesManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PipesManager.cpp; sourceTree = "<group>"; }; DF448570140065E10069344B /* PipesManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PipesManager.h; sourceTree = "<group>"; }; DF4485731400662D0069344B /* AirTunesServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AirTunesServer.cpp; sourceTree = "<group>"; }; @@ -4871,8 +4868,6 @@ F56C8307131F42E7000AD0F6 /* ASAPCodec.h */, F56C830E131F42E7000AD0F6 /* AudioDecoder.cpp */, F56C830F131F42E7000AD0F6 /* AudioDecoder.h */, - DF44856A140065C60069344B /* BXAcodec.cpp */, - DF44856B140065C60069344B /* BXAcodec.h */, F56C8310131F42E7000AD0F6 /* CachingCodec.h */, F56C8311131F42E7000AD0F6 /* CDDAcodec.cpp */, F56C8312131F42E7000AD0F6 /* CDDAcodec.h */, @@ -7420,7 +7415,6 @@ 18968DDE14155E01005BA742 /* ApplicationOperations.cpp in Sources */, DFCFC52A1413F7D60004D0BF /* AFPDirectory.cpp in Sources */, 3291892B1423A9B700E878CD /* JpegIO.cpp in Sources */, - DF44856C140065C60069344B /* BXAcodec.cpp in Sources */, DF448572140065E10069344B /* PipesManager.cpp in Sources */, DF4485751400662D0069344B /* AirTunesServer.cpp in Sources */, DF98D9991434F49500A6EBE1 /* SkinVariable.cpp in Sources */, diff --git a/XBMC.xcodeproj/project.pbxproj b/XBMC.xcodeproj/project.pbxproj index 9807366c74..f20a32326a 100644 --- a/XBMC.xcodeproj/project.pbxproj +++ b/XBMC.xcodeproj/project.pbxproj @@ -381,7 +381,6 @@ DF34898213FDAAF60026A711 /* HttpParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF34898113FDAAF60026A711 /* HttpParser.cpp */; }; DF448457140048A60069344B /* AirTunesServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF448455140048A60069344B /* AirTunesServer.cpp */; }; DF44845E140048C80069344B /* PipesManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF44845B140048C80069344B /* PipesManager.cpp */; }; - DF4484EE140054530069344B /* BXAcodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF4484EC140054530069344B /* BXAcodec.cpp */; }; DF5276E1151BAEDA00B5B63B /* Base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF52769A151BAEDA00B5B63B /* Base64.cpp */; }; DF5276E2151BAEDA00B5B63B /* HttpResponse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF52769C151BAEDA00B5B63B /* HttpResponse.cpp */; }; DF527734151BAF4C00B5B63B /* WebSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DF52772B151BAF4C00B5B63B /* WebSocket.cpp */; }; @@ -1865,8 +1864,6 @@ DF448456140048A60069344B /* AirTunesServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AirTunesServer.h; sourceTree = "<group>"; }; DF44845B140048C80069344B /* PipesManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PipesManager.cpp; sourceTree = "<group>"; }; DF44845C140048C80069344B /* PipesManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PipesManager.h; sourceTree = "<group>"; }; - DF4484EC140054530069344B /* BXAcodec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BXAcodec.cpp; sourceTree = "<group>"; }; - DF4484ED140054530069344B /* BXAcodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BXAcodec.h; sourceTree = "<group>"; }; DF52769A151BAEDA00B5B63B /* Base64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Base64.cpp; sourceTree = "<group>"; }; DF52769B151BAEDA00B5B63B /* Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Base64.h; sourceTree = "<group>"; }; DF52769C151BAEDA00B5B63B /* HttpResponse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HttpResponse.cpp; sourceTree = "<group>"; }; @@ -5149,8 +5146,6 @@ 88ACB01D0DCF409E0083CFDF /* ASAPCodec.h */, E38E15E30D25F9FA00618676 /* AudioDecoder.cpp */, E38E15E40D25F9FA00618676 /* AudioDecoder.h */, - DF4484EC140054530069344B /* BXAcodec.cpp */, - DF4484ED140054530069344B /* BXAcodec.h */, E38E15E50D25F9FA00618676 /* CachingCodec.h */, E38E15E60D25F9FA00618676 /* CDDAcodec.cpp */, E38E15E70D25F9FA00618676 /* CDDAcodec.h */, @@ -7458,7 +7453,6 @@ 32C631281423A90F00F18420 /* JpegIO.cpp in Sources */, DF448457140048A60069344B /* AirTunesServer.cpp in Sources */, DF44845E140048C80069344B /* PipesManager.cpp in Sources */, - DF4484EE140054530069344B /* BXAcodec.cpp in Sources */, DF98D98C1434F47D00A6EBE1 /* SkinVariable.cpp in Sources */, F5E10537140AA38100175026 /* PeripheralBusUSB.cpp in Sources */, F5E10538140AA38100175026 /* PeripheralBus.cpp in Sources */, diff --git a/project/VS2010Express/XBMC.vcxproj b/project/VS2010Express/XBMC.vcxproj index 6ca75f0d7c..b3b359ef66 100644 --- a/project/VS2010Express/XBMC.vcxproj +++ b/project/VS2010Express/XBMC.vcxproj @@ -398,7 +398,6 @@ <ClCompile Include="..\..\xbmc\cores\dvdplayer\DVDDemuxers\DVDDemuxPVRClient.cpp" /> <ClCompile Include="..\..\xbmc\cores\dvdplayer\DVDInputStreams\DVDInputStreamBluray.cpp" /> <ClCompile Include="..\..\xbmc\cores\dvdplayer\DVDInputStreams\DVDInputStreamPVRManager.cpp" /> - <ClCompile Include="..\..\xbmc\cores\paplayer\BXAcodec.cpp" /> <ClCompile Include="..\..\xbmc\cores\paplayer\PCMCodec.cpp" /> <ClCompile Include="..\..\xbmc\cores\VideoRenderers\RenderCapture.cpp" /> <ClCompile Include="..\..\xbmc\cores\VideoRenderers\VideoShaders\WinVideoFilter.cpp" /> @@ -1942,7 +1941,6 @@ <ClInclude Include="..\..\xbmc\cores\dvdplayer\DVDDemuxers\DVDDemuxPVRClient.h" /> <ClInclude Include="..\..\xbmc\cores\dvdplayer\DVDInputStreams\DVDInputStreamBluray.h" /> <ClInclude Include="..\..\xbmc\cores\dvdplayer\DVDInputStreams\DVDInputStreamPVRManager.h" /> - <ClInclude Include="..\..\xbmc\cores\paplayer\BXAcodec.h" /> <ClInclude Include="..\..\xbmc\cores\VideoRenderers\RenderCapture.h" /> <ClInclude Include="..\..\xbmc\cores\VideoRenderers\VideoShaders\WinVideoFilter.h" /> <ClInclude Include="..\..\xbmc\CueDocument.h" /> diff --git a/project/VS2010Express/XBMC.vcxproj.filters b/project/VS2010Express/XBMC.vcxproj.filters index e7e4b41e18..749352eb36 100644 --- a/project/VS2010Express/XBMC.vcxproj.filters +++ b/project/VS2010Express/XBMC.vcxproj.filters @@ -1993,9 +1993,6 @@ <ClCompile Include="..\..\xbmc\guilib\JpegIO.cpp"> <Filter>guilib</Filter> </ClCompile> - <ClCompile Include="..\..\xbmc\cores\paplayer\BXAcodec.cpp"> - <Filter>cores\paplayer</Filter> - </ClCompile> <ClCompile Include="..\..\xbmc\interfaces\info\SkinVariable.cpp"> <Filter>interfaces\info</Filter> </ClCompile> @@ -4906,9 +4903,6 @@ <ClInclude Include="..\..\xbmc\guilib\JpegIO.h"> <Filter>guilib</Filter> </ClInclude> - <ClInclude Include="..\..\xbmc\cores\paplayer\BXAcodec.h"> - <Filter>cores\paplayer</Filter> - </ClInclude> <ClInclude Include="..\..\xbmc\interfaces\info\SkinVariable.h"> <Filter>interfaces\info</Filter> </ClInclude> diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp index 802f947294..ecc536a4f1 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp @@ -43,6 +43,8 @@ CDVDDemux* CDVDFactoryDemuxer::CreateDemuxer(CDVDInputStream* pInputStream) // Try to open the AirTunes demuxer if (pInputStream->IsStreamType(DVDSTREAM_TYPE_FILE) && pInputStream->GetContent().compare("audio/x-xbmc-pcm") == 0 ) { + // audio/x-xbmc-pcm this is the used codec for AirTunes + // (apples audio only streaming) auto_ptr<CDVDDemuxBXA> demuxer(new CDVDDemuxBXA()); if(demuxer->Open(pInputStream)) return demuxer.release(); diff --git a/xbmc/cores/paplayer/BXAcodec.cpp b/xbmc/cores/paplayer/BXAcodec.cpp deleted file mode 100644 index c8b2b0c192..0000000000 --- a/xbmc/cores/paplayer/BXAcodec.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (C) 2005-2012 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - -#include "system.h" -#include "BXAcodec.h" -#include "utils/EndianSwap.h" -#include "cores/AudioEngine/Utils/AEUtil.h" - -BXACodec::BXACodec() -{ - m_SampleRate = 0; - m_Channels = 0; - m_BitsPerSample = 0; - m_Bitrate = 0; - m_CodecName = "XBMC PCM"; -} - -BXACodec::~BXACodec() -{ - DeInit(); -} - -bool BXACodec::Init(const CStdString &strFile, unsigned int filecache) -{ - if (!m_file.Open(strFile)) - return false; - - // read header - BXA_FmtHeader bxah; - m_file.Read(&bxah, sizeof(BXA_FmtHeader)); - - // file valid? - if (strncmp(bxah.fourcc, "BXA ", 4) != 0 || bxah.type != BXA_PACKET_TYPE_FMT) - { - return false; - } - - m_SampleRate = bxah.sampleRate; - m_Channels = bxah.channels; - m_BitsPerSample = bxah.bitsPerSample; - m_TotalTime = bxah.durationMs; - m_Bitrate = bxah.sampleRate * bxah.channels * bxah.bitsPerSample; - m_DataFormat = AE_FMT_S16LE; - - if (m_SampleRate == 0 || m_Channels == 0 || m_BitsPerSample == 0) - { - return false; - } - - return true; -} - -void BXACodec::DeInit() -{ - m_file.Close(); -} - -int64_t BXACodec::Seek(int64_t iSeekTime) -{ - return iSeekTime; -} - -template <class T> -class MiniScopedArray -{ -public: - MiniScopedArray(int size) {m_arr = new T[size];} - ~MiniScopedArray() {delete[] m_arr;} - T* raw_data() {return m_arr;} -private: - T* m_arr; -}; - -int BXACodec::ReadPCM(BYTE *pBuffer, int size, int *actualsize) -{ - *actualsize=0; - - int iAmountRead; - //unsigned char data[size]; - MiniScopedArray<char> data(size); - iAmountRead = m_file.Read(data.raw_data(), size); - if (iAmountRead > 0) - { - *actualsize=iAmountRead; - memcpy(pBuffer, data.raw_data(), iAmountRead <= size ? iAmountRead : size); - return READ_SUCCESS; - } - - *actualsize = 0; - return READ_EOF; -} - -bool BXACodec::CanInit() -{ - return true; -} - -CAEChannelInfo BXACodec::GetChannelInfo() -{ - static enum AEChannel map[2][3] = { - {AE_CH_FC, AE_CH_NULL}, - {AE_CH_FL, AE_CH_FR , AE_CH_NULL} - }; - - if (m_Channels > 2) - return CAEUtil::GuessChLayout(m_Channels); - - return CAEChannelInfo(map[m_Channels - 1]); -} diff --git a/xbmc/cores/paplayer/BXAcodec.h b/xbmc/cores/paplayer/BXAcodec.h deleted file mode 100644 index 9ec6e609da..0000000000 --- a/xbmc/cores/paplayer/BXAcodec.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2005-2012 Team XBMC - * http://www.xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - -#pragma once - -#include "ICodec.h" -#include "filesystem/File.h" -#include "CachingCodec.h" -#ifdef _WIN32 -#define __attribute__(dummy_val) -#else -#include <config.h> -#endif - -#ifdef _WIN32 -#pragma pack(push) -#pragma pack(1) -#endif - -typedef struct -{ - char fourcc[4]; - uint32_t type; - uint32_t channels; - uint32_t sampleRate; - uint32_t bitsPerSample; - uint64_t durationMs; -} __attribute__((__packed__)) BXA_FmtHeader; - -typedef struct -{ - char fourcc[4]; - uint32_t type; - uint32_t length; -} __attribute__((__packed__)) BXA_DataHeader; - -#ifdef _WIN32 -#pragma pack(pop) -#endif - -#define BXA_PACKET_TYPE_FMT 1 -#define BXA_PACKET_TYPE_DATA 2 - -class BXACodec : public CachingCodec -{ -public: - BXACodec(); - virtual ~BXACodec(); - - virtual bool Init(const CStdString &strFile, unsigned int filecache); - virtual void DeInit(); - virtual int64_t Seek(int64_t iSeekTime); - virtual int ReadPCM(BYTE *pBuffer, int size, int *actualsize); - virtual bool CanInit(); - virtual CAEChannelInfo GetChannelInfo(); -}; - diff --git a/xbmc/cores/paplayer/CodecFactory.cpp b/xbmc/cores/paplayer/CodecFactory.cpp index 9f34d16c55..f1ce58034f 100644 --- a/xbmc/cores/paplayer/CodecFactory.cpp +++ b/xbmc/cores/paplayer/CodecFactory.cpp @@ -40,7 +40,6 @@ #endif #include "URL.h" #include "DVDPlayerCodec.h" -#include "BXAcodec.h" #include "PCMCodec.h" ICodec* CodecFactory::CreateCodec(const CStdString& strFileType) @@ -139,9 +138,15 @@ ICodec* CodecFactory::CreateCodecDemux(const CStdString& strFile, const CStdStri else if( strContent.Equals("application/ogg") || strContent.Equals("audio/ogg")) return CreateOGGCodec(strFile,filecache); else if (strContent.Equals("audio/x-xbmc-pcm")) - return (ICodec*)new BXACodec(); - else if (strContent.Equals("audio/flac") || strContent.Equals("audio/x-flac") || strContent.Equals("application/x-flac")) - return new FLACCodec(); + { + // audio/x-xbmc-pcm this is the used codec for AirTunes + // (apples audio only streaming) + DVDPlayerCodec *dvdcodec = new DVDPlayerCodec(); + dvdcodec->SetContentType(strContent); + return dvdcodec; + } + else if (strContent.Equals("audio/flac") || strContent.Equals("audio/x-flac") || strContent.Equals("application/x-flac")) + return new FLACCodec(); if (urlFile.GetProtocol() == "lastfm" || urlFile.GetProtocol() == "shout") { diff --git a/xbmc/cores/paplayer/Makefile.in b/xbmc/cores/paplayer/Makefile.in index bc523a90e0..31cc8bd7b0 100644 --- a/xbmc/cores/paplayer/Makefile.in +++ b/xbmc/cores/paplayer/Makefile.in @@ -9,7 +9,6 @@ endif SRCS = ADPCMCodec.cpp SRCS += AudioDecoder.cpp -SRCS += BXAcodec.cpp SRCS += CDDAcodec.cpp SRCS += CodecFactory.cpp SRCS += DVDPlayerCodec.cpp diff --git a/xbmc/network/AirTunesServer.cpp b/xbmc/network/AirTunesServer.cpp index 66f2ceff56..42287a0c97 100644 --- a/xbmc/network/AirTunesServer.cpp +++ b/xbmc/network/AirTunesServer.cpp @@ -35,7 +35,8 @@ #include "ApplicationMessenger.h" #include "filesystem/PipeFile.h" #include "Application.h" -#include "cores/paplayer/BXAcodec.h" +#include "cores/dvdplayer/DVDDemuxers/DVDDemuxBXA.h" +#include "filesystem/File.h" #include "music/tags/MusicInfoTag.h" #include "FileItem.h" #include "GUIInfoManager.h" @@ -160,7 +161,7 @@ void* CAirTunesServer::AudioOutputFunctions::audio_init(void *cls, int bits, int pipe->OpenForWrite(XFILE::PipesManager::GetInstance().GetUniquePipeName()); pipe->SetOpenThreashold(300); - BXA_FmtHeader header; + Demux_BXA_FmtHeader header; strncpy(header.fourcc, "BXA ", 4); header.type = BXA_PACKET_TYPE_FMT; header.bitsPerSample = bits; @@ -328,9 +329,9 @@ ao_device* CAirTunesServer::AudioOutputFunctions::ao_open_live(int driver_id, ao device->pipe->OpenForWrite(XFILE::PipesManager::GetInstance().GetUniquePipeName()); device->pipe->SetOpenThreashold(300); - BXA_FmtHeader header; + Demux_BXA_FmtHeader header; strncpy(header.fourcc, "BXA ", 4); - header.type = BXA_PACKET_TYPE_FMT; + header.type = BXA_PACKET_TYPE_FMT_DEMUX; header.bitsPerSample = format->bits; header.channels = format->channels; header.sampleRate = format->rate; |