diff --git a/projects/RPi/patches/xbmc/xbmc-001-newclock4.patch b/projects/RPi/patches/xbmc/xbmc-001-newclock4.patch index cff8e65250..d422469274 100644 --- a/projects/RPi/patches/xbmc/xbmc-001-newclock4.patch +++ b/projects/RPi/patches/xbmc/xbmc-001-newclock4.patch @@ -1,7 +1,7 @@ -From 49e50d0dff0fa782df37bdca4a614b03ed67644d Mon Sep 17 00:00:00 2001 +From 0fb175f191f1d348b0fb2c5ae4301b7e26cd38b6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 18:19:32 +0100 -Subject: [PATCH 01/96] [rbp/omxplayer] When opening a stream don't try to +Subject: [PATCH 01/88] [rbp/omxplayer] When opening a stream don't try to update gui so often --- @@ -25,10 +25,10 @@ index e7cfcdd..20b99ad 100644 g_windowManager.ProcessRenderLoop(false); if (allowCancel && dialog->IsCanceled()) -From 8ff9303a1a3e8b8dd3b0d3f99a5650ee9bb581ef Mon Sep 17 00:00:00 2001 +From e2be18e9c1d63873a4b194e5888571d0f59bd1eb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 29 Apr 2014 15:23:22 +0100 -Subject: [PATCH 02/96] [ffmpeg] Speed up wtv index creation +Subject: [PATCH 02/88] [ffmpeg] Speed up wtv index creation The index creation is O(N^2) with number of entries (typically thousands). On a Pi this can take more than 60 seconds to execute for a recording of a few hours. @@ -114,10 +114,10 @@ index 0000000..4ac5636 + } + } -From 033648baa9403d1449ffdad361fd19c9400c0788 Mon Sep 17 00:00:00 2001 +From 5f39c4a49b854f0edadf73a4f8f05ac3d48ed053 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:49:17 +1300 -Subject: [PATCH 03/96] adds GetTvShowSeasons +Subject: [PATCH 03/88] adds GetTvShowSeasons --- xbmc/video/VideoDatabase.cpp | 30 ++++++++++++++++++++++++------ @@ -193,10 +193,10 @@ index 78259ed..cbb26b7 100644 bool GetArtTypes(const MediaType &mediaType, std::vector &artTypes); -From ec30e3c1bc728994b7f870d7db0d4626aefcbcb6 Mon Sep 17 00:00:00 2001 +From 6698d8aa78b855e60b16a176277354cb759676a5 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:50:10 +1300 -Subject: [PATCH 04/96] move AddSeason() public. +Subject: [PATCH 04/88] move AddSeason() public. --- xbmc/video/VideoDatabase.h | 2 +- @@ -223,10 +223,10 @@ index cbb26b7..1a79c00 100644 /*! \brief Adds a path to the tvshow link table. \param idShow the id of the show. -From 0b5876825e9445cdbb9a9991373061458ed321a5 Mon Sep 17 00:00:00 2001 +From a437f73647103824d808572a8cb274a9d18dd402 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:48:24 +1300 -Subject: [PATCH 05/96] adds GetArt function to (video) scraper, allowing art +Subject: [PATCH 05/88] adds GetArt function to (video) scraper, allowing art to be fetched given the video identifier. --- @@ -341,10 +341,10 @@ index 22ac229..75bc341 100644 enum LOOKUP_STATE { DO_NOTHING = 0, FIND_MOVIE = 1, -From 1dae91faea1b1bac60fd238359192a228f51fc71 Mon Sep 17 00:00:00 2001 +From fc5835d26ec5a89a4870a4797e19047b1492f2f7 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:53:14 +1300 -Subject: [PATCH 06/96] refresh season art if a new season is found that isn't +Subject: [PATCH 06/88] refresh season art if a new season is found that isn't recorded in the database yet. Fixes #14339 --- @@ -448,10 +448,10 @@ index 92883e7..47d5ed4 100644 bool ProcessItemByVideoInfoTag(const CFileItem *item, EPISODELIST &episodeList); -From 70d8e64b3871ea7f46d7ff1c49c38cf90a54848d Mon Sep 17 00:00:00 2001 +From 45467aa1dbcbce0e31bd9266480ef2e29c332d00 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:53:34 +1300 -Subject: [PATCH 07/96] REMOVEME: updated thetvdb.com scraper to support art +Subject: [PATCH 07/88] REMOVEME: updated thetvdb.com scraper to support art updates --- @@ -559,10 +559,10 @@ index f27e4fc..bdf329f 100644 -From 5c25d92482a853132a1a68eec2e59ec2b12d9060 Mon Sep 17 00:00:00 2001 +From e6e425270f311de3202cb4cd9a3684fe6dc59ca0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 2 Aug 2014 17:48:04 +0100 -Subject: [PATCH 08/96] [omx] Report decoded image name +Subject: [PATCH 08/88] [omx] Report decoded image name --- xbmc/cores/omxplayer/OMXImage.cpp | 1 + @@ -581,10 +581,10 @@ index 3fbea3b..57f69c5 100644 else { -From e216015ef5643e0c08973834e71e9335304774a9 Mon Sep 17 00:00:00 2001 +From 76836bef384f9076800b4d28f236990f8207948e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 14 Dec 2013 16:55:05 +0000 -Subject: [PATCH 09/96] logging: Add microsecond timer to log messages +Subject: [PATCH 09/88] logging: Add microsecond timer to log messages --- xbmc/utils/log.cpp | 17 +++++++++++++++-- @@ -637,10 +637,10 @@ index 4e51166..3c405ab 100644 levelNames[logLevel]) + strData; -From fd04ee6d0906ad50796b87863304fa6c0cb50cdc Mon Sep 17 00:00:00 2001 +From 75e494302ff1480f5aa2a0347e384116086a05be Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 8 Mar 2014 15:36:06 +0000 -Subject: [PATCH 12/96] [hifiberry] Hack: force it to be recognised as IEC958 +Subject: [PATCH 12/88] [hifiberry] Hack: force it to be recognised as IEC958 capable to enable passthrough options --- @@ -663,10 +663,10 @@ index a464b4b..7eba389 100644 info.m_displayName.substr(info.m_displayName.size()-5) == " HDMI") { -From adbafd5bf00ff778ec3690b393630583e561c4b9 Mon Sep 17 00:00:00 2001 +From a75bc8435a2d56c0e5e63b64f1f663b650e17768 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 11 Dec 2013 17:21:54 +0000 -Subject: [PATCH 13/96] Move the reference-counting of Begin and End calls from +Subject: [PATCH 13/88] Move the reference-counting of Begin and End calls from DX and GL source files into GUIFontTTF.cpp. --- @@ -1054,10 +1054,10 @@ index c0bb53a..735fb3a 100644 protected: virtual CBaseTexture* ReallocTexture(unsigned int& newHeight); -From c2f02a64f1e36d80a413dbfedf1e32f0024b3ec8 Mon Sep 17 00:00:00 2001 +From acb4a6b7e5dfdfc67b81419d2568a48a61a08d2d Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 11 Dec 2013 18:47:54 +0000 -Subject: [PATCH 14/96] Convert CGUIFontTTFBase::m_vertex to be managed as a +Subject: [PATCH 14/88] Convert CGUIFontTTFBase::m_vertex to be managed as a std::vector. Also retired CGUIFontTTFBase::m_vertex_count and @@ -1237,10 +1237,10 @@ index 97853fd..b76c6a5 100644 *vertices++ = m_vertex[i]; *vertices++ = m_vertex[i+1]; -From 2103006f25edc1c433cf798058854cc9abb5e510 Mon Sep 17 00:00:00 2001 +From ec7796db5c9145f195f7c75a8ada28bc9857a29b Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 16 Dec 2013 18:58:12 +0000 -Subject: [PATCH 15/96] CGUIFontTTFBase::RenderCharacter can now append to +Subject: [PATCH 15/88] CGUIFontTTFBase::RenderCharacter can now append to arbitrary vectors of vertices rather than only CGUIFontTTFBase::m_vertex --- @@ -1313,10 +1313,10 @@ index 5675725..a5d44f4 100644 virtual CBaseTexture* ReallocTexture(unsigned int& newHeight) = 0; -From 279defb4e05b97d633a2a5bcb65a16a0b7b430b2 Mon Sep 17 00:00:00 2001 +From 3920823d71730917234d3c4391d1c018c11d09df Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 17:18:38 +0000 -Subject: [PATCH 16/96] Add a cache of font glyph bounding box vertices. +Subject: [PATCH 16/88] Add a cache of font glyph bounding box vertices. This is implemented as a template because ultimately we will key on different parameters and store values of different types, depending upon whether we @@ -1339,7 +1339,7 @@ applicable transformation matrices permit the use of hardware clipping. create mode 100644 xbmc/guilib/GUIFontCache.h diff --git a/XBMC.xcodeproj/project.pbxproj b/XBMC.xcodeproj/project.pbxproj -index 4924acd..1d312b8 100644 +index 415d73b..1a5dc91 100644 --- a/XBMC.xcodeproj/project.pbxproj +++ b/XBMC.xcodeproj/project.pbxproj @@ -168,6 +168,9 @@ @@ -1352,7 +1352,7 @@ index 4924acd..1d312b8 100644 32C631281423A90F00F18420 /* JpegIO.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32C631261423A90F00F18420 /* JpegIO.cpp */; }; 36A9443D15821E2800727135 /* DatabaseUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 36A9443B15821E2800727135 /* DatabaseUtils.cpp */; }; 36A9444115821E7C00727135 /* SortUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 36A9443F15821E7C00727135 /* SortUtils.cpp */; }; -@@ -4011,6 +4014,8 @@ +@@ -4017,6 +4020,8 @@ 1DAFDB7B16DFDCA7007F8C68 /* PeripheralBusCEC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PeripheralBusCEC.h; sourceTree = ""; }; 1DE0443315828F4B005DDB4D /* Exception.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Exception.cpp; path = commons/Exception.cpp; sourceTree = ""; }; 1DE0443415828F4B005DDB4D /* Exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Exception.h; path = commons/Exception.h; sourceTree = ""; }; @@ -1361,7 +1361,7 @@ index 4924acd..1d312b8 100644 32C631261423A90F00F18420 /* JpegIO.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JpegIO.cpp; sourceTree = ""; }; 32C631271423A90F00F18420 /* JpegIO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JpegIO.h; sourceTree = ""; }; 36A9443B15821E2800727135 /* DatabaseUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseUtils.cpp; sourceTree = ""; }; -@@ -6518,6 +6523,8 @@ +@@ -6529,6 +6534,8 @@ 18B7C7101294222D009E7A26 /* GUIFixedListContainer.h */, 18B7C76B1294222E009E7A26 /* GUIFont.cpp */, 18B7C7111294222D009E7A26 /* GUIFont.h */, @@ -1370,7 +1370,7 @@ index 4924acd..1d312b8 100644 18B7C76C1294222E009E7A26 /* GUIFontManager.cpp */, 18B7C7121294222D009E7A26 /* GUIFontManager.h */, 18B7C76D1294222E009E7A26 /* GUIFontTTF.cpp */, -@@ -11007,6 +11014,7 @@ +@@ -11024,6 +11031,7 @@ 7C5608C70F1754930056433A /* ExternalPlayer.cpp in Sources */, F584E12E0F257C5100DB26A5 /* HTTPDirectory.cpp in Sources */, F54C51D20F1E783200D46E3C /* GUIDialogKaraokeSongSelector.cpp in Sources */, @@ -1378,7 +1378,7 @@ index 4924acd..1d312b8 100644 F54C51D50F1E784800D46E3C /* karaokelyricscdg.cpp in Sources */, F54C51D80F1E785700D46E3C /* karaokelyrics.cpp in Sources */, F54C51E50F1E787700D46E3C /* karaokelyricstextkar.cpp in Sources */, -@@ -12675,6 +12683,7 @@ +@@ -12695,6 +12703,7 @@ DFF0F45B17528350002DA3A4 /* Control.cpp in Sources */, DFF0F45C17528350002DA3A4 /* Dialog.cpp in Sources */, DFF0F45D17528350002DA3A4 /* File.cpp in Sources */, @@ -1386,7 +1386,7 @@ index 4924acd..1d312b8 100644 DFF0F45E17528350002DA3A4 /* InfoTagMusic.cpp in Sources */, DFF0F45F17528350002DA3A4 /* InfoTagVideo.cpp in Sources */, DFF0F46017528350002DA3A4 /* Keyboard.cpp in Sources */, -@@ -13473,6 +13482,7 @@ +@@ -13494,6 +13503,7 @@ E499131D174E5DAD00741B6D /* GUIVisualisationControl.cpp in Sources */, E499131E174E5DAD00741B6D /* GUIWindow.cpp in Sources */, E499131F174E5DAD00741B6D /* GUIWindowManager.cpp in Sources */, @@ -1395,10 +1395,10 @@ index 4924acd..1d312b8 100644 E4991321174E5DAD00741B6D /* imagefactory.cpp in Sources */, E4991322174E5DAD00741B6D /* IWindowManagerCallback.cpp in Sources */, diff --git a/project/VS2010Express/XBMC.vcxproj b/project/VS2010Express/XBMC.vcxproj -index 64f7d5c..1dcad9d 100644 +index ed5ad2a..bc1db7e 100644 --- a/project/VS2010Express/XBMC.vcxproj +++ b/project/VS2010Express/XBMC.vcxproj -@@ -425,6 +425,7 @@ +@@ -427,6 +427,7 @@ @@ -1406,7 +1406,7 @@ index 64f7d5c..1dcad9d 100644 -@@ -1747,6 +1748,7 @@ +@@ -1752,6 +1753,7 @@ @@ -1415,7 +1415,7 @@ index 64f7d5c..1dcad9d 100644 diff --git a/project/VS2010Express/XBMC.vcxproj.filters b/project/VS2010Express/XBMC.vcxproj.filters -index 2f3a22d..8c73472 100644 +index ca16ec8..a79aec4 100644 --- a/project/VS2010Express/XBMC.vcxproj.filters +++ b/project/VS2010Express/XBMC.vcxproj.filters @@ -991,6 +991,9 @@ @@ -1428,7 +1428,7 @@ index 2f3a22d..8c73472 100644 guilib -@@ -3885,6 +3888,9 @@ +@@ -3891,6 +3894,9 @@ guilib @@ -2033,7 +2033,7 @@ index b76c6a5..9935ea4 100644 memset(newTexture->GetPixels(), 0, m_textureHeight * newTexture->GetPitch()); if (m_texture) diff --git a/xbmc/guilib/GraphicContext.h b/xbmc/guilib/GraphicContext.h -index 6c2dcd4..bab2457 100644 +index c2a4c16..a385eb4 100644 --- a/xbmc/guilib/GraphicContext.h +++ b/xbmc/guilib/GraphicContext.h @@ -146,6 +146,7 @@ class CGraphicContext : public CCriticalSection, @@ -2076,10 +2076,10 @@ index f351c99..9036ba9 100644 + return !operator==(a, b); +} -From 0d55084579fd568f1b80ac1cacf34a0fb9bb18b0 Mon Sep 17 00:00:00 2001 +From a94b6585c65bdc8b06003fce9fc99accbb42a2cb Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 23 Jan 2014 22:24:17 +0000 -Subject: [PATCH 17/96] Lay the groundwork for hardware clipping. +Subject: [PATCH 17/88] Lay the groundwork for hardware clipping. For glScissor() to replace CGraphicContext::ClipRect, a necessary condition is that no shear or rotation is introduced between the coordinate systems @@ -2249,7 +2249,7 @@ index f7b5d9a..fdf7452 100644 #endif // GUI_SHADER_H diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp -index 38f17a7..5bffdf5 100644 +index 991ae5b..282792c 100644 --- a/xbmc/guilib/GraphicContext.cpp +++ b/xbmc/guilib/GraphicContext.cpp @@ -167,6 +167,16 @@ void CGraphicContext::ClipRect(CRect &vertex, CRect &texture, CRect *texture2) @@ -2270,7 +2270,7 @@ index 38f17a7..5bffdf5 100644 { // transform coordinates - we may have a rotation which changes the positioning of the diff --git a/xbmc/guilib/GraphicContext.h b/xbmc/guilib/GraphicContext.h -index bab2457..0a27643 100644 +index a385eb4..2904c1b 100644 --- a/xbmc/guilib/GraphicContext.h +++ b/xbmc/guilib/GraphicContext.h @@ -199,6 +199,7 @@ class CGraphicContext : public CCriticalSection, @@ -2341,10 +2341,10 @@ index 98e398a..81ee49e 100644 virtual void ResetScissors(); -From e37d5a887b667a2e7d24624f997613534c0e0dee Mon Sep 17 00:00:00 2001 +From 62be6ccfe7b9e51cc4e360cb1261ae5399aaaf93 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 23 Jan 2014 16:42:22 +0000 -Subject: [PATCH 18/96] Increase font cache hit rate by keying on the +Subject: [PATCH 18/88] Increase font cache hit rate by keying on the fractional part of m_originX and m_originY *after* they have been through the graphics context's transformation matrix, plus the scale/rotation elements of the matrix, rather than the origin in the original frame of reference plus @@ -2545,10 +2545,10 @@ index 3b93672..258dffa 100644 private: virtual bool FirstBegin() = 0; -From 8ee373e08988d25ceb21c2ae10e98b87f9d5a266 Mon Sep 17 00:00:00 2001 +From 21a1cbbbf6ebb56ed1f037470165946dc57c1df1 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 8 Jan 2014 12:16:33 +0000 -Subject: [PATCH 19/96] Rewrite of scrolling text code. +Subject: [PATCH 19/88] Rewrite of scrolling text code. No longer shuffles the string round to minimise the number of characters before the clipping rectangle; this doesn't save much on rendering time but @@ -2864,10 +2864,10 @@ index 2cda726..fbc579e 100644 private: void Process(); -From 503fed439a9fba12313d1be8b0b7e658e88cfdbf Mon Sep 17 00:00:00 2001 +From d424b7cc2480ff833644d3dfa274c7d4637d05e8 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 27 Jan 2014 23:21:10 +0000 -Subject: [PATCH 20/96] Move the application of the translation offsets into +Subject: [PATCH 20/88] Move the application of the translation offsets into the GLES code. Still all pure software at this stage. Main change is in the data types at @@ -3061,10 +3061,10 @@ index 9935ea4..18c9358 100644 memset(newTexture->GetPixels(), 0, m_textureHeight * newTexture->GetPitch()); if (m_texture) -From 5b3ae61ed5098abd289b8b725535d8b9ec0d6381 Mon Sep 17 00:00:00 2001 +From fca2bf09eb092fc78703ffa3e06fe53b1c6670e9 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 15:28:06 +0000 -Subject: [PATCH 21/96] Rather than applying the translation offsets to the +Subject: [PATCH 21/88] Rather than applying the translation offsets to the vertices, now applies them to the model view matrix from the top of the matrix stack and pushes it over to OpenGL. The vertices themselves are still all held client-side. @@ -3208,10 +3208,10 @@ index 81ee49e..d2f9cd1 100644 protected: virtual void SetVSyncImpl(bool enable) = 0; -From 57b48be5b3d9eef1cc270dde69c4c1c9efdff72f Mon Sep 17 00:00:00 2001 +From cb15fabacab40e581453f16aa48a0707f66fc7f7 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 29 Jan 2014 13:21:19 +0000 -Subject: [PATCH 22/96] Enable hardware clipping. +Subject: [PATCH 22/88] Enable hardware clipping. --- xbmc/guilib/GUIFontTTF.cpp | 4 ++-- @@ -3283,10 +3283,10 @@ index ea08bf4..b63e337 100644 glUniformMatrix4fv(modelLoc, 1, GL_FALSE, g_matrices.GetMatrix(MM_MODELVIEW)); } -From 887153a6576b1e3f95d2f153d9a6271f01e09fee Mon Sep 17 00:00:00 2001 +From 40d4f5bfb89977f8c10a403ce3fe247af5ad9069 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 15:32:51 +0000 -Subject: [PATCH 23/96] Move the vertex data across to a vertex buffer object +Subject: [PATCH 23/88] Move the vertex data across to a vertex buffer object just prior to drawing. --- @@ -3337,10 +3337,10 @@ index b63e337..b00055d 100644 // Disable the attributes used by this shader -From a37bccd4d22515a4de9a61b4e33af79927ea0ac7 Mon Sep 17 00:00:00 2001 +From a5cbcbcfa9441f572b50ca04a22a7197d591cb61 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 16:04:04 +0000 -Subject: [PATCH 24/96] Move vertex data into an OpenGL VBO when the font cache +Subject: [PATCH 24/88] Move vertex data into an OpenGL VBO when the font cache entry is populated. The font cache now stores the "name" (handle) of the VBO, rather than a vector @@ -3613,10 +3613,10 @@ index 735fb3a..6102c90 100644 protected: virtual CBaseTexture* ReallocTexture(unsigned int& newHeight); -From 0d36d495e7eb1262b0d06161a8943ed1ef643b28 Mon Sep 17 00:00:00 2001 +From a4a06da228796c5b244bcf74debe3fee530bf6eb Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 16 Jan 2014 16:29:42 +0000 -Subject: [PATCH 25/96] Switch from glDrawArrays() to glDrawElements(). +Subject: [PATCH 25/88] Switch from glDrawArrays() to glDrawElements(). This involves setting up a static VBO containing the indexes necessary to convert from quads to triangles on the fly in the GPU. @@ -3837,10 +3837,10 @@ index 6de3532..258a293 100644 if (m_display != EGL_NO_DISPLAY) -From c90ef21dd003a6c1196658a0d032ac198a653f7d Mon Sep 17 00:00:00 2001 +From c71017ac871e463931aa15b98f9c85adb4e03bed Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 1 May 2014 16:28:39 +0100 -Subject: [PATCH 26/96] Improved file buffering in CArchive +Subject: [PATCH 26/88] Improved file buffering in CArchive Even though memcpy is typically inlined by the compiler into byte/word loads and stores (at least for release builds), the frequency with which 1, 2 and 4 @@ -3900,10 +3900,10 @@ index 6ed0f8f..8506d95 100644 } else -From bc853d03bc8184161fea512bb452b22a6679b611 Mon Sep 17 00:00:00 2001 +From 80dccee914caa93facbbc614f3b4a5763a9f6685 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 10 Sep 2014 22:07:21 +0100 -Subject: [PATCH 27/96] [mmal] Allow mmal codec for dvd stills +Subject: [PATCH 27/88] [mmal] Allow mmal codec for dvd stills --- xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp | 4 ++++ @@ -3925,10 +3925,10 @@ index f139433..4183a2b 100644 { // If dvd is an mpeg2 and hint.stills -From eec94822c733c6edc59bd12ed378bfe2174cc89e Mon Sep 17 00:00:00 2001 +From 0cf6e135b6f83dd8d3ba0352e1e118749eebe997 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 2 Aug 2014 17:47:38 +0100 -Subject: [PATCH 29/96] [VideoReferenceClock] Add OMX support +Subject: [PATCH 29/88] [VideoReferenceClock] Add OMX support --- xbmc/linux/RBP.cpp | 34 ++++++++++++++++++++++++ @@ -4127,10 +4127,10 @@ index 6027031..2dabac1 100644 }; -From b7922d2ab301304719fc7e7da242fe6b426480a0 Mon Sep 17 00:00:00 2001 +From 438669fbe7069d7237fbcad6bc72fd7a8d5889ab Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 12 Aug 2014 00:03:18 +0100 -Subject: [PATCH 30/96] videoreferenceclock: Boost priority +Subject: [PATCH 30/88] videoreferenceclock: Boost priority --- xbmc/video/VideoReferenceClock.cpp | 3 +++ @@ -4151,10 +4151,10 @@ index 916a15c..c491d29 100644 //register callback m_D3dCallback.Reset(); -From bf635f797123da87f689d1e13eea17c777b8e3b7 Mon Sep 17 00:00:00 2001 +From 32863b916ebb3f59b555e8560e1763b09c1fe5b1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 5 Feb 2014 11:46:33 +0000 -Subject: [PATCH 31/96] [rbp/settings] Allow av sync type to be enabled +Subject: [PATCH 31/88] [rbp/settings] Allow av sync type to be enabled It works for dvdplayer --- @@ -4162,7 +4162,7 @@ It works for dvdplayer 1 file changed, 7 deletions(-) diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml -index 570798b..e09d974 100644 +index 319d9e5..e80ad91 100644 --- a/system/settings/rbp.xml +++ b/system/settings/rbp.xml @@ -1,13 +1,6 @@ @@ -4180,10 +4180,10 @@ index 570798b..e09d974 100644 false -From 09b792f712f51dfd179bbd3c6665f6935b8c7021 Mon Sep 17 00:00:00 2001 +From 8a3bef46ae9e92ae3e739ce8962b1c6580c3d760 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 16 Apr 2014 21:18:06 +0100 -Subject: [PATCH 33/96] [omxplayer] Don't propagate 3d flags based on supported +Subject: [PATCH 33/88] [omxplayer] Don't propagate 3d flags based on supported 3d modes --- @@ -4236,10 +4236,10 @@ index 2c25fd9..c2bd788 100644 unsigned int iDisplayWidth = width; unsigned int iDisplayHeight = height; -From d2fd6b8c82d28686585c0f36bcef8fd7dedd7b9c Mon Sep 17 00:00:00 2001 +From 461db3a5d935997a7bfcd504ef18fccba4ce52a1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:00:52 +0100 -Subject: [PATCH 34/96] [graphics] Don't set stereo mode based on resolution +Subject: [PATCH 34/88] [graphics] Don't set stereo mode based on resolution The resolution change should follow stereo mode --- @@ -4247,10 +4247,10 @@ The resolution change should follow stereo mode 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp -index 5bffdf5..4be1c8b 100644 +index 282792c..f1926de 100644 --- a/xbmc/guilib/GraphicContext.cpp +++ b/xbmc/guilib/GraphicContext.cpp -@@ -420,26 +420,29 @@ void CGraphicContext::SetVideoResolution(RESOLUTION res, bool forceUpdate) +@@ -436,26 +436,29 @@ void CGraphicContext::SetVideoResolutionInternal(RESOLUTION res, bool forceUpdat RESOLUTION_INFO info_org = CDisplaySettings::Get().GetResolutionInfo(res); RESOLUTION_INFO info_last = CDisplaySettings::Get().GetResolutionInfo(lastRes); @@ -4297,10 +4297,10 @@ index 5bffdf5..4be1c8b 100644 m_iScreenWidth = info_mod.iWidth; -From 411e77ffcbb519bdc84321fc78aff61636e7d48c Mon Sep 17 00:00:00 2001 +From 846e9d7e07c12468ef86587f5bca16c70598bb2e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:01:51 +0100 -Subject: [PATCH 35/96] [graphics] Allow switching to a more suitable 3D +Subject: [PATCH 35/88] [graphics] Allow switching to a more suitable 3D resolution --- @@ -4309,7 +4309,7 @@ Subject: [PATCH 35/96] [graphics] Allow switching to a more suitable 3D 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp -index 4be1c8b..792a77d 100644 +index f1926de..e7e8321 100644 --- a/xbmc/guilib/GraphicContext.cpp +++ b/xbmc/guilib/GraphicContext.cpp @@ -35,6 +35,7 @@ @@ -4320,7 +4320,7 @@ index 4be1c8b..792a77d 100644 using namespace std; -@@ -484,6 +485,43 @@ RESOLUTION CGraphicContext::GetVideoResolution() const +@@ -500,6 +501,43 @@ RESOLUTION CGraphicContext::GetVideoResolution() const return m_Resolution; } @@ -4364,7 +4364,7 @@ index 4be1c8b..792a77d 100644 void CGraphicContext::ResetOverscan(RESOLUTION_INFO &res) { res.Overscan.left = 0; -@@ -1021,7 +1059,7 @@ void CGraphicContext::Flip(const CDirtyRegionList& dirty) +@@ -1037,7 +1075,7 @@ void CGraphicContext::Flip(const CDirtyRegionList& dirty) if(m_stereoMode != m_nextStereoMode) { m_stereoMode = m_nextStereoMode; @@ -4374,7 +4374,7 @@ index 4be1c8b..792a77d 100644 } } diff --git a/xbmc/guilib/GraphicContext.h b/xbmc/guilib/GraphicContext.h -index 0a27643..ef5bc74 100644 +index 2904c1b..8d3774f 100644 --- a/xbmc/guilib/GraphicContext.h +++ b/xbmc/guilib/GraphicContext.h @@ -108,6 +108,7 @@ class CGraphicContext : public CCriticalSection, @@ -4386,10 +4386,10 @@ index 0a27643..ef5bc74 100644 void ResetOverscan(RESOLUTION_INFO &resinfo); void ResetScreenParameters(RESOLUTION res); -From ce7d447288d3a71c2e77caaed1e2560c6c05dea8 Mon Sep 17 00:00:00 2001 +From 6761ff32dfb4a483c355d19c7e1e01bdd39dc818 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:38:55 +0100 -Subject: [PATCH 36/96] [3D] Support switching to 3D resolutions +Subject: [PATCH 36/88] [3D] Support switching to 3D resolutions Include matching 3D flags (SBS/TAB) in the score of a resolution to switch to, to enable switching to 3d modes. Also remove the old code that treated 3D modes differently when assigning a score. @@ -4471,10 +4471,10 @@ index 83c3adb..8076e76 100644 return current; } -From 08884befedb4640d590b5899283705b02da1907a Mon Sep 17 00:00:00 2001 +From 175136d5d3871f90a0e298120cb8c6012159dbf9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 23 Apr 2014 00:05:07 +0100 -Subject: [PATCH 37/96] [graphics] Make pixel ratio for 3d modes consistent +Subject: [PATCH 37/88] [graphics] Make pixel ratio for 3d modes consistent Note: Use the stored stereo flags from lists of resolutions. Use current stereo mode for current resolution. @@ -4534,10 +4534,10 @@ index 8076e76..9118cb0 100644 continue; diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp -index 792a77d..4890711 100644 +index e7e8321..d4f0346 100644 --- a/xbmc/guilib/GraphicContext.cpp +++ b/xbmc/guilib/GraphicContext.cpp -@@ -731,32 +731,33 @@ void CGraphicContext::ApplyStateBlock() +@@ -747,32 +747,33 @@ void CGraphicContext::ApplyStateBlock() g_Windowing.ApplyStateBlock(); } @@ -4586,7 +4586,7 @@ index 792a77d..4890711 100644 info.iWidth = (info.iWidth - info.iBlanking) / 2; info.Overscan.left /= 2; info.Overscan.right = (info.Overscan.right - info.iBlanking) / 2; -@@ -774,16 +775,14 @@ void CGraphicContext::SetResInfo(RESOLUTION res, const RESOLUTION_INFO& info) +@@ -790,16 +791,14 @@ void CGraphicContext::SetResInfo(RESOLUTION res, const RESOLUTION_INFO& info) if(info.dwFlags & D3DPRESENTFLAG_MODE3DSBS) { curr.Overscan.right = info.Overscan.right * 2 + info.iBlanking; @@ -4606,7 +4606,7 @@ index 792a77d..4890711 100644 } diff --git a/xbmc/guilib/GraphicContext.h b/xbmc/guilib/GraphicContext.h -index ef5bc74..c665031 100644 +index 8d3774f..f2e122d 100644 --- a/xbmc/guilib/GraphicContext.h +++ b/xbmc/guilib/GraphicContext.h @@ -120,11 +120,15 @@ class CGraphicContext : public CCriticalSection, @@ -4677,10 +4677,10 @@ index c58c28a..bf1e589 100644 AddUniqueResolution(res2, resolutions); -From 175602084d4800b46e530bd8c7adea8ea99d29ed Mon Sep 17 00:00:00 2001 +From 58c8800edbc1a15169ff6de916dafa9fd254d2c3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 10 Aug 2014 16:45:16 +0100 -Subject: [PATCH 38/96] filesystem: Make support of browsing into archives +Subject: [PATCH 38/88] filesystem: Make support of browsing into archives optional The ability to browse, scan and play content in archives can cause problems on low powered/low memory devices. @@ -4689,20 +4689,20 @@ It also can be slow as any archive in the directory is opened and extracted. Add a settings option to enable this feature and default to disabled on Pi --- - language/English/strings.po | 10 ++++++++++ + language/English/strings.po | 9 +++++++++ system/settings/rbp.xml | 10 ++++++++++ system/settings/settings.xml | 5 +++++ xbmc/filesystem/FileDirectoryFactory.cpp | 4 ++++ - 4 files changed, 29 insertions(+) + 4 files changed, 28 insertions(+) diff --git a/language/English/strings.po b/language/English/strings.po -index b348206..2344e2b 100755 +index 1836b29..82b1279 100755 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -15941,3 +15941,13 @@ msgstr "" - msgctxt "#37031" - msgid "Specifies how Blu-rays should be opened/played back. Disc menus are not fully supported yet and may cause problems." - msgstr "" +@@ -15957,4 +15957,13 @@ msgstr "" + #: system/settings/rbp.xml + msgctxt "#38010" + msgid "GPU accelerated" + +#: system/settings/settings.xml +msgctxt "#38020" @@ -4712,9 +4712,9 @@ index b348206..2344e2b 100755 +#: system/settings/settings.xml +msgctxt "#38021" +msgid "Allow viewing and playing files in archives (e.g. zip, rar)" -+msgstr "" + msgstr "" diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml -index e09d974..9cc4fd2 100644 +index e80ad91..13e30ad 100644 --- a/system/settings/rbp.xml +++ b/system/settings/rbp.xml @@ -1,5 +1,15 @@ @@ -4779,10 +4779,10 @@ index 2fd8777..3b294cd 100644 { // XBMC Smart playlist - just XML renamed to XSP // read the name of the playlist in -From 7dc0c1974e96d896a75dbfa31b9f2ed18a262bb3 Mon Sep 17 00:00:00 2001 +From d4e2e5498836c39f6765d52f28309392621f8ea5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 11 Aug 2014 22:56:13 +0100 -Subject: [PATCH 40/96] [omxplayer] Add acceleration option to choose +Subject: [PATCH 40/88] [omxplayer] Add acceleration option to choose omxplayer/dvdplayer automatically --- @@ -4792,10 +4792,10 @@ Subject: [PATCH 40/96] [omxplayer] Add acceleration option to choose 3 files changed, 77 insertions(+) diff --git a/language/English/strings.po b/language/English/strings.po -index 2344e2b..556b6f5 100755 +index 82b1279..aee9a3a 100755 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -15951,3 +15951,13 @@ msgstr "" +@@ -15967,3 +15967,13 @@ msgstr "" msgctxt "#38021" msgid "Allow viewing and playing files in archives (e.g. zip, rar)" msgstr "" @@ -4906,10 +4906,10 @@ index 21d5f7c..713739b 100644 // allow renderer to switch to fullscreen if requested m_dvdPlayerVideo->EnableFullscreen(m_PlayerOptions.fullscreen); -From be17982bcc32d0584cade6f25329249bd57d9c76 Mon Sep 17 00:00:00 2001 +From 7dc5ca6ed6eb20cf63964badd122773dbcfea03c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 12 Aug 2014 16:51:18 +0100 -Subject: [PATCH 41/96] AE: Add some logging for suspend/resume +Subject: [PATCH 41/88] AE: Add some logging for suspend/resume --- xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 5 +++++ @@ -4917,10 +4917,10 @@ Subject: [PATCH 41/96] AE: Add some logging for suspend/resume 2 files changed, 7 insertions(+) diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -index 91da985..0eda1d2 100644 +index 0e4d8da..64775c0 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -@@ -347,6 +347,7 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) +@@ -348,6 +348,7 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) switch (signal) { case CActiveAEControlProtocol::INIT: @@ -4928,7 +4928,7 @@ index 91da985..0eda1d2 100644 m_extError = false; m_sink.EnumerateSinkList(false); LoadSettings(); -@@ -432,6 +433,7 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) +@@ -433,6 +434,7 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) m_extDeferData = true; return; case CActiveAEControlProtocol::SUSPEND: @@ -4936,7 +4936,7 @@ index 91da985..0eda1d2 100644 UnconfigureSink(); m_stats.SetSuspended(true); m_state = AE_TOP_CONFIGURED_SUSPEND; -@@ -657,6 +659,7 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) +@@ -658,6 +660,7 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) CLog::Log(LOGDEBUG,"CActiveAE - display reset event"); displayReset = true; case CActiveAEControlProtocol::INIT: @@ -4944,7 +4944,7 @@ index 91da985..0eda1d2 100644 m_extError = false; if (!displayReset) { -@@ -2334,12 +2337,14 @@ void CActiveAE::Shutdown() +@@ -2339,12 +2342,14 @@ void CActiveAE::Shutdown() bool CActiveAE::Suspend() { @@ -4980,10 +4980,10 @@ index 9e98207..4f85dc7 100644 } -From a29695ffd849b2e33fe8822cf38ea671ac18d4e1 Mon Sep 17 00:00:00 2001 +From 2766a736638a7ed216ec315f0f341b2a4684034d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 9 Jul 2014 22:45:43 +0100 -Subject: [PATCH 42/96] [rbp] Make cachemembuffersize default depend on memory +Subject: [PATCH 42/88] [rbp] Make cachemembuffersize default depend on memory size --- @@ -5022,10 +5022,10 @@ index 11376fc..b67fbb1 100644 response[sizeof(response) - 1] = '\0'; CLog::Log(LOGNOTICE, "Config:\n%s", response); diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index ba97f5f..4463f3b 100644 +index 6109cec..2959ae8 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp -@@ -363,7 +363,12 @@ void CAdvancedSettings::Initialize() +@@ -364,7 +364,12 @@ void CAdvancedSettings::Initialize() m_measureRefreshrate = false; @@ -5039,20 +5039,20 @@ index ba97f5f..4463f3b 100644 // the following setting determines the readRate of a player data // as multiply of the default data read rate -From 754f643cd9189d0c4cefb5edea32f5c353a41576 Mon Sep 17 00:00:00 2001 +From 72392bd0153806e1e500d5e6d1ed1adefbb102c2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 16 Jun 2014 19:06:00 +0100 -Subject: [PATCH 44/96] [experimental] Disable quiet-noise generation +Subject: [PATCH 44/88] [experimental] Disable quiet-noise generation --- xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp -index 488a0df..d9f4a43 100644 +index c6272cc..9111593 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp -@@ -870,6 +870,7 @@ void CActiveAESink::SwapInit(CSampleBuffer* samples) +@@ -871,6 +871,7 @@ void CActiveAESink::SwapInit(CSampleBuffer* samples) void CActiveAESink::GenerateNoise() { @@ -5060,19 +5060,19 @@ index 488a0df..d9f4a43 100644 int nb_floats = m_sampleOfSilence.pkt->max_nb_samples; nb_floats *= m_sampleOfSilence.pkt->config.channels; -@@ -907,6 +908,7 @@ void CActiveAESink::GenerateNoise() - (uint8_t**)&noise, m_sampleOfSilence.pkt->max_nb_samples, 1.0); +@@ -909,6 +910,7 @@ void CActiveAESink::GenerateNoise() _aligned_free(noise); + delete resampler; +#endif } void CActiveAESink::SetSilenceTimer() -From a0d34fc1be4923566f99b541a8039d618e04973c Mon Sep 17 00:00:00 2001 +From 76de204c4a1eb8c0f4ec665042d6971cd7fcf975 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 30 May 2014 14:58:43 +0100 -Subject: [PATCH 45/96] [settings] Experiment: Report DESKTOP resolution in +Subject: [PATCH 45/88] [settings] Experiment: Report DESKTOP resolution in video settings --- @@ -5094,10 +5094,10 @@ index 6902f83..50c5f97 100644 StringUtils::Format("%dx%d%s", resolution->width, resolution->height, ModeFlagsToString(resolution->flags, false).c_str()), -From b10888a905308f9765fbb5613509477a89f17c2a Mon Sep 17 00:00:00 2001 +From dd67fb4e0413eab25b5f3bc77bc2d772625f2506 Mon Sep 17 00:00:00 2001 From: macrule Date: Thu, 11 Apr 2013 18:24:42 +0200 -Subject: [PATCH 46/96] Added some vc_tv_* functions that were missing in +Subject: [PATCH 46/88] Added some vc_tv_* functions that were missing in DllBCM. --- @@ -5132,10 +5132,10 @@ index b92fdb8..9c7e293 100644 HDMI_INTERLACED_T scan_mode, EDID_MODE_MATCH_FLAG_T match_flags) { return ::vc_tv_hdmi_power_on_best(width, height, frame_rate, scan_mode, match_flags); }; -From 23164e439c6aec03a1143352df510739d7d113c3 Mon Sep 17 00:00:00 2001 +From b7d184caa2f8e10ff1a8574405bfa957867d7a2c Mon Sep 17 00:00:00 2001 From: macrule Date: Thu, 11 Apr 2013 18:29:03 +0200 -Subject: [PATCH 47/96] Added private utility function to map a float display +Subject: [PATCH 47/88] Added private utility function to map a float display aspect, to the respective SDTV_ASPECT_* enum value. --- @@ -5173,10 +5173,10 @@ index bf1e589..518a87d 100644 bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &resolutions) -From f55fa23bbd8bc6f02eebfcb2114c4ad7df6db443 Mon Sep 17 00:00:00 2001 +From 83f9763d93eb1189c353cf861d196bc4009f1c0f Mon Sep 17 00:00:00 2001 From: macrule Date: Thu, 11 Apr 2013 19:50:58 +0200 -Subject: [PATCH 48/96] Changed SDTV resolutions to be treated similarly to +Subject: [PATCH 48/88] Changed SDTV resolutions to be treated similarly to HDMI resolutions in SetNativeResolution. This means that the SDTV interface is powered up and set to the right mode. @@ -5273,10 +5273,10 @@ index 59401f5..a0acb1a 100644 int m_width; int m_height; -From 1898236a5ba39eba98a28ff2d052fa2f64d73033 Mon Sep 17 00:00:00 2001 +From 5ff25c07d6213a3f8b722909e1d29cec34fc67b7 Mon Sep 17 00:00:00 2001 From: macrule Date: Thu, 11 Apr 2013 19:54:59 +0200 -Subject: [PATCH 49/96] Added methods SuspendVideoOutput() and +Subject: [PATCH 49/88] Added methods SuspendVideoOutput() and ResumeVideoOutput() to CRBP class, which can be used to power down the Raspberry PI's video interface, and restore it at a later point. @@ -5340,10 +5340,10 @@ index 9dc39d5..ca36082 100644 CEGLNativeTypeRaspberryPI::CEGLNativeTypeRaspberryPI() { -From 7f71141476bc98f1fa283885a5492591566b21f0 Mon Sep 17 00:00:00 2001 +From aec31972c715b6946656ad6402258cb15f542bbe Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 11 Aug 2013 15:03:36 +0100 -Subject: [PATCH 50/96] PowerManager (and its IPowerSyscall instance) now gets +Subject: [PATCH 50/88] PowerManager (and its IPowerSyscall instance) now gets called from CApplication::OnKey() and can process and suppress key presses. This is a requirement to implement a virtual sleep state. @@ -5355,7 +5355,7 @@ Subject: [PATCH 50/96] PowerManager (and its IPowerSyscall instance) now gets 4 files changed, 23 insertions(+) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index b456d77..830cd06 100644 +index 10903bf..8e63e25 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -2332,6 +2332,13 @@ bool CApplication::OnKey(const CKey& key) @@ -5436,10 +5436,10 @@ index 0b1f10a..e42b143 100644 void OnSleep(); void OnWake(); -From df9650c85f0dd94c2d478fafe4b48f5218f199ab Mon Sep 17 00:00:00 2001 +From c4d68d2b3060b755f616557839e8b7d3abd1f890 Mon Sep 17 00:00:00 2001 From: macrule Date: Wed, 17 Apr 2013 13:23:01 +0200 -Subject: [PATCH 51/96] Added CPowerSyscallVirtualSleep class, which acts as a +Subject: [PATCH 51/88] Added CPowerSyscallVirtualSleep class, which acts as a base class for devices that have no native standby mode, and need to fake it in some way. @@ -5615,10 +5615,10 @@ index 0000000..ef6e682 + +#endif // _POWER_SYSCALL_VIRTUAL_SLEEP_H_ -From a03a0f128ed9e22cdf2f9c452397b5152824fc7c Mon Sep 17 00:00:00 2001 +From 4f198e9cfec4a2e261c558226ae39bf531cbdb3d Mon Sep 17 00:00:00 2001 From: macrule Date: Wed, 17 Apr 2013 13:24:22 +0200 -Subject: [PATCH 52/96] Added power management support for the Raspberry Pi. +Subject: [PATCH 52/88] Added power management support for the Raspberry Pi. Since it doesn't support true standby, we fake it by turning video on or off, and ignoring remote inputs during the standby phase. @@ -5764,10 +5764,10 @@ index 0000000..fd1d67c + +#endif // _RASPBERRY_PI_POWER_SYSCALL_H_ -From 30f46c9e46526b600713577e35486025ed73b4de Mon Sep 17 00:00:00 2001 +From b0b217f0878b0470d6b52a2b38044c5c78196342 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Mar 2014 16:16:29 +0000 -Subject: [PATCH 53/96] [power] hack - don't kill lirc or cec +Subject: [PATCH 53/88] [power] hack - don't kill lirc or cec --- xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 37 +++++++++++++++++++++++ @@ -5851,10 +5851,10 @@ index 2d8c750..901f449 100644 CBuiltins::Execute("LIRC.Start"); #endif -From 3f4a95a8af22f0e969b57f8f9ae316c74ebf5a08 Mon Sep 17 00:00:00 2001 +From c6da6fa95b75e8103141d1ae6460a91562d1b5b1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Mar 2014 16:47:54 +0000 -Subject: [PATCH 54/96] [power] hack - wake on any action +Subject: [PATCH 54/88] [power] hack - wake on any action --- xbmc/powermanagement/PowerSyscallVirtualSleep.cpp | 6 +++--- @@ -5883,10 +5883,10 @@ index 6a1e47b..a717a09 100644 if(VirtualWake()) { -From cd9e2b1d251e8f0249d1b9f94719aaa861c6aefe Mon Sep 17 00:00:00 2001 +From 178e9a2a4515847c60c42e9a7faa31940924a6ae Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Mar 2014 17:30:07 +0000 -Subject: [PATCH 55/96] [power] hack - Make suspend toggle suspend state +Subject: [PATCH 55/88] [power] hack - Make suspend toggle suspend state --- xbmc/powermanagement/PowerSyscallVirtualSleep.cpp | 5 +++++ @@ -5909,10 +5909,10 @@ index a717a09..d39c3ed 100644 return false; } -From c417113dbe1336bcdbf12906dd9c7cb9f326c3b1 Mon Sep 17 00:00:00 2001 +From 6f0f5289e4d100848caba3d5e9728a8257273368 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 4 Mar 2014 19:33:44 +0000 -Subject: [PATCH 56/96] [power] Add back in powerdown and reboot +Subject: [PATCH 56/88] [power] Add back in powerdown and reboot --- .../linux/RaspberryPIPowerSyscall.cpp | 34 ++++++++++++++++++++++ @@ -5990,10 +5990,10 @@ index fd1d67c..062132e 100644 virtual bool CanReboot() { return true; } -From d18d1218401657ef87798429f4074b5a5150cbc0 Mon Sep 17 00:00:00 2001 +From 23d1437daeadcca45975cc39c1b830e839a8309c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 26 Apr 2014 17:27:52 +0100 -Subject: [PATCH 57/96] [cec] Don't suspend pi on tv switch off - it can't wake +Subject: [PATCH 57/88] [cec] Don't suspend pi on tv switch off - it can't wake up --- @@ -6014,10 +6014,10 @@ index a906628..9b5271a 100644 -From 9ad1caae1c30c2649ff8508a28a98f5dedad561c Mon Sep 17 00:00:00 2001 +From 9fe228d21a28daff0a7444a6ae36bf092931018b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 18 Aug 2014 19:09:32 +0100 -Subject: [PATCH 58/96] rbp: Use new dispmanx function for vsync callbacks +Subject: [PATCH 58/88] rbp: Use new dispmanx function for vsync callbacks --- xbmc/linux/RBP.cpp | 85 ++++++++++++++----------- @@ -6229,10 +6229,10 @@ index ca36082..4b74ea0 100644 } DLOG("CEGLNativeTypeRaspberryPI::DestroyDispmaxWindow\n"); -From c2e9d60bbf3fb6c0ffc6eb1adc41c230f43c6cbc Mon Sep 17 00:00:00 2001 +From fe17b7692bd6141a191b89dfcb2c056da01e9181 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 19 Aug 2014 17:56:45 +0100 -Subject: [PATCH 59/96] Revert "rbp: Use new dispmanx function for vsync +Subject: [PATCH 59/88] Revert "rbp: Use new dispmanx function for vsync callbacks" This reverts commit afbf8fbceaa6649fb4a6bbd9a1cee6087590412b. @@ -6446,10 +6446,10 @@ index 4b74ea0..ca36082 100644 } DLOG("CEGLNativeTypeRaspberryPI::DestroyDispmaxWindow\n"); -From bce81e35ce82f088c667ab1c2d7115b7b992a838 Mon Sep 17 00:00:00 2001 +From 609deee8db8195bf7bfc5b242e5ab99f53782721 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 27 Jun 2014 00:01:05 +0100 -Subject: [PATCH 60/96] [rbp] Resume video output on startup +Subject: [PATCH 60/88] [rbp] Resume video output on startup --- xbmc/linux/RBP.cpp | 3 +++ @@ -6470,10 +6470,10 @@ index 2ff6078..34e0108 100644 m_omx_image_init = true; return true; -From 281e4a09aa3422361a97eb47ccf20428ae30cfd0 Mon Sep 17 00:00:00 2001 +From 3e1a03218ec3f36542bd1309144ae6f525e73b24 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 16 Aug 2014 21:01:42 +0100 -Subject: [PATCH 61/96] omxrender: Hacks to reduce GUI rendering rate when +Subject: [PATCH 61/88] omxrender: Hacks to reduce GUI rendering rate when playing video --- @@ -6483,10 +6483,10 @@ Subject: [PATCH 61/96] omxrender: Hacks to reduce GUI rendering rate when 3 files changed, 60 insertions(+) diff --git a/language/English/strings.po b/language/English/strings.po -index 556b6f5..c92fe6f 100755 +index aee9a3a..996f682 100755 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -15961,3 +15961,30 @@ msgstr "" +@@ -15977,3 +15977,30 @@ msgstr "" msgctxt "#37034" msgid "Uses codec information and audio setting to choose dvdplayer or omxplayer as appropriate" msgstr "" @@ -6518,7 +6518,7 @@ index 556b6f5..c92fe6f 100755 +msgid "24 fps" +msgstr "" diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml -index 9cc4fd2..97eb3e3c 100644 +index 13e30ad..e721d31 100644 --- a/system/settings/rbp.xml +++ b/system/settings/rbp.xml @@ -25,6 +25,22 @@ @@ -6545,7 +6545,7 @@ index 9cc4fd2..97eb3e3c 100644 diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index 830cd06..abab4cf 100644 +index 8e63e25..9c74cbd 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -2180,6 +2180,23 @@ void CApplication::Render() @@ -6573,10 +6573,10 @@ index 830cd06..abab4cf 100644 int vsync_mode = CSettings::Get().GetInt("videoscreen.vsync"); -From 2f1ec7ee2fb0e1c6ac7640f7bfe9c0fd6b8374b0 Mon Sep 17 00:00:00 2001 +From de90d423fe10286ae4eef2f3501f04cd2aa63cf4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 9 Sep 2014 12:04:26 +0100 -Subject: [PATCH 62/96] egl: Treat unknown display aspect ratio as square pixel +Subject: [PATCH 62/88] egl: Treat unknown display aspect ratio as square pixel --- xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 4 ++-- @@ -6605,10 +6605,10 @@ index ca36082..1529045 100644 SetResolutionString(m_desktopRes); -From 5af7895e5efb5566797093b6689ea295eeb2ef47 Mon Sep 17 00:00:00 2001 +From 40f5a6ec1e609050700e235e106df623bcccaeb8 Mon Sep 17 00:00:00 2001 From: anaconda Date: Thu, 11 Sep 2014 21:30:43 +0200 -Subject: [PATCH 63/96] Disable textbox autoscrolling while on screensaver. +Subject: [PATCH 63/88] Disable textbox autoscrolling while on screensaver. --- xbmc/guilib/GUITextBox.cpp | 3 ++- @@ -6636,10 +6636,10 @@ index b7ef051..ba68fad 100644 if (m_lastRenderTime) m_autoScrollDelayTime += currentTime - m_lastRenderTime; -From 2380d18c82ead3a18ed30775b66c6a207797d9f4 Mon Sep 17 00:00:00 2001 +From 12830030ed4f1d7864bb3bb43d98d44526b011e0 Mon Sep 17 00:00:00 2001 From: anaconda Date: Sat, 13 Sep 2014 19:49:01 +0200 -Subject: [PATCH 64/96] SQUASH: only if dim or black +Subject: [PATCH 64/88] SQUASH: only if dim or black --- xbmc/Application.cpp | 7 +++++++ @@ -6648,10 +6648,10 @@ Subject: [PATCH 64/96] SQUASH: only if dim or black 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index abab4cf..63c525b 100644 +index 9c74cbd..b2d56cd 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -5815,3 +5815,10 @@ void CApplication::CloseNetworkShares() +@@ -5813,3 +5813,10 @@ void CApplication::CloseNetworkShares() CSFTPSessionManager::DisconnectAllSessions(); #endif } @@ -6663,10 +6663,10 @@ index abab4cf..63c525b 100644 + return ""; +} diff --git a/xbmc/Application.h b/xbmc/Application.h -index b788471..ed19b79 100644 +index 4157891..f807a98 100644 --- a/xbmc/Application.h +++ b/xbmc/Application.h -@@ -356,6 +356,8 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs +@@ -373,6 +373,8 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs void SetLoggingIn(bool loggingIn) { m_loggingIn = loggingIn; } @@ -6691,35 +6691,33 @@ index ba68fad..e149418 100644 if (m_lastRenderTime) m_autoScrollDelayTime += currentTime - m_lastRenderTime; -From 25801ec15384f4345c12f46db10b53adc8050687 Mon Sep 17 00:00:00 2001 +From a56767138ba6566ebdf52a76cfe1294e27d79795 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 16 Sep 2014 00:52:02 +0100 -Subject: [PATCH 65/96] [PiSink] Initial dual audio support +Subject: [PATCH 65/88] [PiSink] Initial dual audio support --- - system/settings/rbp.xml | 7 - + system/settings/rbp.xml | 5 - xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp | 219 ++++++++++++++++++++++++------ xbmc/cores/AudioEngine/Sinks/AESinkPi.h | 5 + xbmc/cores/omxplayer/OMXAudio.cpp | 12 +- - 4 files changed, 186 insertions(+), 57 deletions(-) + 4 files changed, 186 insertions(+), 55 deletions(-) diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml -index 97eb3e3c..3c372bf 100644 +index e721d31..2996c29 100644 --- a/system/settings/rbp.xml +++ b/system/settings/rbp.xml -@@ -79,13 +79,6 @@ - +@@ -80,11 +80,6 @@ -- + - - 2 - false - - -- - - + + 101 diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp index 7af2078..89684e4 100644 @@ -7103,10 +7101,10 @@ index 4f85dc7..e96713c 100644 // force out layout to stereo if input is not multichannel - it gives the receiver a chance to upmix -From 99f0d55934d68a07f41c1484d6803f4a77a1befd Mon Sep 17 00:00:00 2001 +From 4d78c4ddad578458e99e90eef4c746ef5567643d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 18 Sep 2014 14:24:56 +0100 -Subject: [PATCH 66/96] [omxplayer] Only enable audio clock master when A/V +Subject: [PATCH 66/88] [omxplayer] Only enable audio clock master when A/V sync method is set to audio clock --- @@ -7137,10 +7135,10 @@ index e96713c..036552a 100644 OMX_CONFIG_BOOLEANTYPE configBool; OMX_INIT_STRUCTURE(configBool); -From c16e014f8e02ba0d3baef3af8a0085a2070a8d8a Mon Sep 17 00:00:00 2001 +From fa419f5d488a49d1a45f290213ee6204668482bd Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 18 Aug 2014 19:09:32 +0100 -Subject: [PATCH 67/96] rbp: Use new dispmanx function for vsync callbacks +Subject: [PATCH 67/88] rbp: Use new dispmanx function for vsync callbacks [rbp] Enable vsync handler all the time --- @@ -7373,10 +7371,10 @@ index 1529045..b6bf1fc 100644 } DLOG("CEGLNativeTypeRaspberryPI::DestroyDispmaxWindow\n"); -From c6dd9406aca31e289b8b7ef769631c998c2783a5 Mon Sep 17 00:00:00 2001 +From 38716528fd3836091adaf141c8b30cd455ad3ac2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 18 Sep 2014 23:14:31 +0100 -Subject: [PATCH 68/96] Revert "rbp: Use new dispmanx function for vsync +Subject: [PATCH 68/88] Revert "rbp: Use new dispmanx function for vsync callbacks" This reverts commit e56163da23b6a844e7eee076e4583bce606f788b. @@ -7610,10 +7608,10 @@ index b6bf1fc..1529045 100644 } DLOG("CEGLNativeTypeRaspberryPI::DestroyDispmaxWindow\n"); -From 4c69b23df58526ca45295d5de0bf08b9749777de Mon Sep 17 00:00:00 2001 +From c82c26a3a043883ba32b20473ef2a424bedb18b2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 19 Sep 2014 11:54:49 +0100 -Subject: [PATCH 69/96] [dvdplayer/rbp] Add pi specific option to maintain +Subject: [PATCH 69/88] [dvdplayer/rbp] Add pi specific option to maintain vsync with pll adjustment New A/V sync option in settings/video/playback to do "Adjust PLL". @@ -7632,10 +7630,10 @@ Needed updated firmware 7 files changed, 76 insertions(+), 3 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index c92fe6f..36adeec 100755 +index 996f682..7a27549 100755 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -15988,3 +15988,8 @@ msgstr "" +@@ -16004,3 +16004,8 @@ msgstr "" msgctxt "#38005" msgid "24 fps" msgstr "" @@ -7645,7 +7643,7 @@ index c92fe6f..36adeec 100755 +msgid "Adjust PLL" +msgstr "" diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml -index 3c372bf..9ecae65 100644 +index 2996c29..79853a8 100644 --- a/system/settings/rbp.xml +++ b/system/settings/rbp.xml @@ -11,6 +11,26 @@ @@ -7676,10 +7674,10 @@ index 3c372bf..9ecae65 100644 false diff --git a/xbmc/cores/AudioEngine/Utils/AEUtil.h b/xbmc/cores/AudioEngine/Utils/AEUtil.h -index 1e61c50..039cd69 100644 +index 782a9ba..3e0390c 100644 --- a/xbmc/cores/AudioEngine/Utils/AEUtil.h +++ b/xbmc/cores/AudioEngine/Utils/AEUtil.h -@@ -53,7 +53,8 @@ enum AVSync +@@ -57,7 +57,8 @@ enum AVSync { SYNC_DISCON = 0, SYNC_SKIPDUP, @@ -7811,10 +7809,10 @@ index f947acc..606c24f 100644 void SuspendVideoOutput(); void ResumeVideoOutput(); -From 62a1fd16f5662949f084854a6f3ad17461753b22 Mon Sep 17 00:00:00 2001 +From 4085c67b535627e1723ca8d7f82f3cdeaa67f54e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 21 Sep 2014 18:31:31 +0100 -Subject: [PATCH 70/96] hack: revert squash: don't update originaldts when +Subject: [PATCH 70/88] hack: revert squash: don't update originaldts when marked as invalid --- @@ -7834,10 +7832,10 @@ index 713739b..b88adb4 100644 } else -From d21ffcd0335bd2400a1c757068340dada280c8c2 Mon Sep 17 00:00:00 2001 +From 5a175022f112ed4f1d66598a3cc36831f0793b8e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 27 Sep 2014 15:27:04 +0100 -Subject: [PATCH 71/96] [omxplayer] Don't sync up to passthrough audio packets +Subject: [PATCH 71/88] [omxplayer] Don't sync up to passthrough audio packets - let GPU handle it --- @@ -7865,10 +7863,10 @@ index 036552a..ce35b07 100644 unsigned pitch = (m_Passthrough || m_HWDecode) ? 1:(m_BitsPerSample >> 3) * m_InputChannels; unsigned int demuxer_samples = len / pitch; -From b962c21460b2b86cc8542e79483c424b68cb6518 Mon Sep 17 00:00:00 2001 +From a266d4d3f5b8b20bd6ad2f18cadc6460b63edb74 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 27 Sep 2014 15:32:37 +0100 -Subject: [PATCH 72/96] [dvdplayer] exerimental: don't raise priority of audio +Subject: [PATCH 72/88] [dvdplayer] exerimental: don't raise priority of audio thread --- @@ -7892,10 +7890,10 @@ index b88adb4..31dda29 100644 } -From 71f2334af064f4ff334eefc6584cf6c2c3e242c8 Mon Sep 17 00:00:00 2001 +From 8bf6e87fc6a72e35fbae5e0f076c67bf3be954e5 Mon Sep 17 00:00:00 2001 From: da-anda Date: Sun, 17 Aug 2014 21:09:59 +0200 -Subject: [PATCH 73/96] handle stereoscopic mode of videos in mixed playlists +Subject: [PATCH 73/88] handle stereoscopic mode of videos in mixed playlists --- language/English/strings.po | 2 +- @@ -7903,10 +7901,10 @@ Subject: [PATCH 73/96] handle stereoscopic mode of videos in mixed playlists 2 files changed, 49 insertions(+), 29 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index 36adeec..5233784 100755 +index 7a27549..dd46ea5 100755 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -15616,7 +15616,7 @@ msgstr "" +@@ -15628,7 +15628,7 @@ msgstr "" #. Description of setting "Videos -> Playback -> Disable stereoscopic mode when playback is stopped" with label #36526 #: system/settings/settings.xml msgctxt "#36538" @@ -8063,10 +8061,10 @@ index 35ba597..b013942 100644 case 2: // Mono SetStereoMode( RENDER_STEREO_MODE_MONO ); -From 63deb783e93287b865d207fb2091d7378ae4dc04 Mon Sep 17 00:00:00 2001 +From a411c11e4cc4dd9a0fafe83f7886c88e4eb29c65 Mon Sep 17 00:00:00 2001 From: da-anda Date: Sat, 16 Aug 2014 11:20:54 +0200 -Subject: [PATCH 74/96] remember user selected 3D modes between videos until +Subject: [PATCH 74/88] remember user selected 3D modes between videos until playback ended --- @@ -8283,10 +8281,10 @@ index c1dfb93..cb54bd0 100644 -From f63ab21a07a35bc5e4073558041c383a72ef1c6e Mon Sep 17 00:00:00 2001 +From bae79caf7d0aabff2e681cab22830c8192657bb0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 28 Sep 2014 17:35:31 +0100 -Subject: [PATCH 75/96] [renderer] Avoid warning for too few buffers with +Subject: [PATCH 75/88] [renderer] Avoid warning for too few buffers with bypass renderer Bypass renderer doesn't use a video render queue, so shouldn't generate a warning message @@ -8309,10 +8307,10 @@ index 1ecdc16..cc3a76b 100644 m_pRenderer->SetBufferSize(m_QueueSize); -From 4811fcd1dae042e484754b44a62b30fff71b3658 Mon Sep 17 00:00:00 2001 +From aaa268df687880936e1c0d9456b7e7670cf814e9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 28 Sep 2014 19:28:17 +0100 -Subject: [PATCH 76/96] [mmalcodec] Introduce a preroll period to buffer up +Subject: [PATCH 76/88] [mmalcodec] Introduce a preroll period to buffer up frames on startup --- @@ -8396,10 +8394,10 @@ index b4aa571..a2da46b 100644 MMAL_COMPONENT_T *m_dec; MMAL_PORT_T *m_dec_input; -From 0ba3cad7df33ee0392772c49e2a82cab888bc431 Mon Sep 17 00:00:00 2001 +From 0ac7bd7de554636f538192fb24158493022d9b11 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 11 Apr 2014 16:12:27 +0100 -Subject: [PATCH 77/96] [omxplayer] Add ability to log more timestamp info in +Subject: [PATCH 77/88] [omxplayer] Add ability to log more timestamp info in extra debug settings --- @@ -8412,7 +8410,7 @@ Subject: [PATCH 77/96] [omxplayer] Add ability to log more timestamp info in 6 files changed, 24 insertions(+), 12 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index 5233784..8c97c0a 100755 +index dd46ea5..d699647 100755 --- a/language/English/strings.po +++ b/language/English/strings.po @@ -2886,6 +2886,11 @@ msgctxt "#679" @@ -8526,10 +8524,10 @@ index c2bd788..5c4a515 100644 || m_speed < 0) { diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index 4463f3b..a0a0205 100644 +index 2959ae8..c9f9c94 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp -@@ -1386,6 +1386,9 @@ void CAdvancedSettings::SettingOptionsLoggingComponentsFiller(const CSetting *se +@@ -1388,6 +1388,9 @@ void CAdvancedSettings::SettingOptionsLoggingComponentsFiller(const CSetting *se #ifdef HAVE_LIBCEC list.push_back(std::make_pair(g_localizeStrings.Get(679), LOGCEC)); #endif @@ -8540,10 +8538,10 @@ index 4463f3b..a0a0205 100644 void CAdvancedSettings::setExtraLogLevel(const std::vector &components) -From 555343a47656340e2a36ae70f841ae1cad25d82a Mon Sep 17 00:00:00 2001 +From 5dafcbd232750aa408bcec39e5f91b60acb23ad6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 23:13:55 +0100 -Subject: [PATCH 78/96] [omxplayer] Add ability to dump out audio/video data +Subject: [PATCH 78/88] [omxplayer] Add ability to dump out audio/video data for later debugging --- @@ -8555,7 +8553,7 @@ Subject: [PATCH 78/96] [omxplayer] Add ability to dump out audio/video data 5 files changed, 112 insertions(+) diff --git a/language/English/strings.po b/language/English/strings.po -index 8c97c0a..6ce5175 100755 +index d699647..856d371 100755 --- a/language/English/strings.po +++ b/language/English/strings.po @@ -2891,6 +2891,16 @@ msgctxt "#697" @@ -8770,10 +8768,10 @@ index 0363aaa..6cfb148 100644 if (omx_err != OMX_ErrorNone) { diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index a0a0205..298cc5d 100644 +index c9f9c94..00d5e61 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp -@@ -1389,6 +1389,10 @@ void CAdvancedSettings::SettingOptionsLoggingComponentsFiller(const CSetting *se +@@ -1391,6 +1391,10 @@ void CAdvancedSettings::SettingOptionsLoggingComponentsFiller(const CSetting *se #ifdef TARGET_RASPBERRY_PI list.push_back(std::make_pair(g_localizeStrings.Get(697), LOGOMXPLAYER)); #endif @@ -8785,10 +8783,10 @@ index a0a0205..298cc5d 100644 void CAdvancedSettings::setExtraLogLevel(const std::vector &components) -From a468cfb5145c41cad294f95c26078f1241528878 Mon Sep 17 00:00:00 2001 +From 83e540011c95472c0e41e9d3d9a69afb75a20472 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 Oct 2014 16:34:51 +0100 -Subject: [PATCH 79/96] [mmalcodec] squash: Avoid preroll when using trickplay +Subject: [PATCH 79/88] [mmalcodec] squash: Avoid preroll when using trickplay --- xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp | 5 +++++ @@ -8883,10 +8881,10 @@ index a2da46b..4f81bbd 100644 MMAL_COMPONENT_T *m_dec; -From b82d48580d1ad13659239787e955268be5c99ef9 Mon Sep 17 00:00:00 2001 +From b1066eb16576a94e979243c89320e90246ca3b21 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 Oct 2014 22:45:09 +0100 -Subject: [PATCH 80/96] [mmalrenderer] Add choice of 3 deinterlace schemes +Subject: [PATCH 80/88] [mmalrenderer] Add choice of 3 deinterlace schemes --- xbmc/cores/VideoRenderers/MMALRenderer.cpp | 4 ++++ @@ -9005,2771 +9003,10 @@ index 6cfb148..37765b1 100644 image_filter.eImageFilter = OMX_ImageFilterDeInterlaceFast; else -From 15bcbab5207cb7321147d6e8b436ddecb08432fa Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sat, 4 Oct 2014 22:41:42 +0100 -Subject: [PATCH 81/96] [AE] Rename ActiveAEResample to ActiveAEResampleFFMPEG - ---- - .../Engines/ActiveAE/ActiveAEResample.cpp | 388 --------------------- - .../Engines/ActiveAE/ActiveAEResample.h | 65 ---- - .../Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp | 388 +++++++++++++++++++++ - .../Engines/ActiveAE/ActiveAEResampleFFMPEG.h | 65 ++++ - xbmc/cores/AudioEngine/Makefile.in | 2 +- - 5 files changed, 454 insertions(+), 454 deletions(-) - delete mode 100644 xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp - delete mode 100644 xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.h - create mode 100644 xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp - create mode 100644 xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.h - -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp -deleted file mode 100644 -index d7e0e0f..0000000 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp -+++ /dev/null -@@ -1,388 +0,0 @@ --/* -- * Copyright (C) 2010-2013 Team XBMC -- * http://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 -- * . -- * -- */ -- --#include "ActiveAEResample.h" --#include "utils/log.h" -- --extern "C" { --#include "libavutil/channel_layout.h" --#include "libavutil/opt.h" --#include "libswresample/swresample.h" --} -- --using namespace ActiveAE; -- --CActiveAEResample::CActiveAEResample() --{ -- m_pContext = NULL; -- m_loaded = true; --} -- --CActiveAEResample::~CActiveAEResample() --{ -- if (m_pContext) -- swr_free(&m_pContext); --} -- --bool CActiveAEResample::Init(uint64_t dst_chan_layout, int dst_channels, int dst_rate, AVSampleFormat dst_fmt, int dst_bits, int dst_dither, uint64_t src_chan_layout, int src_channels, int src_rate, AVSampleFormat src_fmt, int src_bits, int src_dither, bool upmix, bool normalize, CAEChannelInfo *remapLayout, AEQuality quality) --{ -- if (!m_loaded) -- return false; -- -- m_dst_chan_layout = dst_chan_layout; -- m_dst_channels = dst_channels; -- m_dst_rate = dst_rate; -- m_dst_fmt = dst_fmt; -- m_dst_bits = dst_bits; -- m_dst_dither_bits = dst_dither; -- m_src_chan_layout = src_chan_layout; -- m_src_channels = src_channels; -- m_src_rate = src_rate; -- m_src_fmt = src_fmt; -- m_src_bits = src_bits; -- m_src_dither_bits = src_dither; -- -- if (m_dst_chan_layout == 0) -- m_dst_chan_layout = av_get_default_channel_layout(m_dst_channels); -- if (m_src_chan_layout == 0) -- m_src_chan_layout = av_get_default_channel_layout(m_src_channels); -- -- m_pContext = swr_alloc_set_opts(NULL, m_dst_chan_layout, m_dst_fmt, m_dst_rate, -- m_src_chan_layout, m_src_fmt, m_src_rate, -- 0, NULL); -- -- if(!m_pContext) -- { -- CLog::Log(LOGERROR, "CActiveAEResample::Init - create context failed"); -- return false; -- } -- -- if(quality == AE_QUALITY_HIGH) -- { -- av_opt_set_double(m_pContext, "cutoff", 1.0, 0); -- av_opt_set_int(m_pContext,"filter_size", 256, 0); -- } -- else if(quality == AE_QUALITY_MID) -- { -- // 0.97 is default cutoff so use (1.0 - 0.97) / 2.0 + 0.97 -- av_opt_set_double(m_pContext, "cutoff", 0.985, 0); -- av_opt_set_int(m_pContext,"filter_size", 64, 0); -- } -- else if(quality == AE_QUALITY_LOW) -- { -- av_opt_set_double(m_pContext, "cutoff", 0.97, 0); -- av_opt_set_int(m_pContext,"filter_size", 32, 0); -- } -- -- if (m_dst_fmt == AV_SAMPLE_FMT_S32 || m_dst_fmt == AV_SAMPLE_FMT_S32P) -- { -- av_opt_set_int(m_pContext, "output_sample_bits", m_dst_bits, 0); -- } -- -- // tell resampler to clamp float values -- // not required for sink stage (remapLayout == true) -- if ((m_dst_fmt == AV_SAMPLE_FMT_FLT || m_dst_fmt == AV_SAMPLE_FMT_FLTP) && -- (m_src_fmt == AV_SAMPLE_FMT_FLT || m_src_fmt == AV_SAMPLE_FMT_FLTP) && -- !remapLayout && normalize) -- { -- av_opt_set_double(m_pContext, "rematrix_maxval", 1.0, 0); -- } -- -- if (remapLayout) -- { -- // one-to-one mapping of channels -- // remapLayout is the layout of the sink, if the channel is in our src layout -- // the channel is mapped by setting coef 1.0 -- memset(m_rematrix, 0, sizeof(m_rematrix)); -- m_dst_chan_layout = 0; -- for (unsigned int out=0; outCount(); out++) -- { -- m_dst_chan_layout += (uint64_t) (1 << out); -- int idx = GetAVChannelIndex((*remapLayout)[out], m_src_chan_layout); -- if (idx >= 0) -- { -- m_rematrix[out][idx] = 1.0; -- } -- } -- -- av_opt_set_int(m_pContext, "out_channel_count", m_dst_channels, 0); -- av_opt_set_int(m_pContext, "out_channel_layout", m_dst_chan_layout, 0); -- -- if (swr_set_matrix(m_pContext, (const double*)m_rematrix, AE_CH_MAX) < 0) -- { -- CLog::Log(LOGERROR, "CActiveAEResample::Init - setting channel matrix failed"); -- return false; -- } -- } -- // stereo upmix -- else if (upmix && m_src_channels == 2 && m_dst_channels > 2) -- { -- memset(m_rematrix, 0, sizeof(m_rematrix)); -- for (int out=0; out> 8 = 0 1 1 1 = SNE24NE -- else if (m_dst_bits != 32 && (m_dst_dither_bits + m_dst_bits) != 32) -- { -- int planes = av_sample_fmt_is_planar(m_dst_fmt) ? m_dst_channels : 1; -- int samples = ret * m_dst_channels / planes; -- for (int i=0; i> (32 - m_dst_bits - m_dst_dither_bits); -- buf++; -- } -- } -- } -- } -- return ret; --} -- --int64_t CActiveAEResample::GetDelay(int64_t base) --{ -- return swr_get_delay(m_pContext, base); --} -- --int CActiveAEResample::GetBufferedSamples() --{ -- return av_rescale_rnd(swr_get_delay(m_pContext, m_src_rate), -- m_dst_rate, m_src_rate, AV_ROUND_UP); --} -- --int CActiveAEResample::CalcDstSampleCount(int src_samples, int dst_rate, int src_rate) --{ -- return av_rescale_rnd(src_samples, dst_rate, src_rate, AV_ROUND_UP); --} -- --int CActiveAEResample::GetSrcBufferSize(int samples) --{ -- return av_samples_get_buffer_size(NULL, m_src_channels, samples, m_src_fmt, 1); --} -- --int CActiveAEResample::GetDstBufferSize(int samples) --{ -- return av_samples_get_buffer_size(NULL, m_dst_channels, samples, m_dst_fmt, 1); --} -- --uint64_t CActiveAEResample::GetAVChannelLayout(CAEChannelInfo &info) --{ -- uint64_t channelLayout = 0; -- if (info.HasChannel(AE_CH_FL)) channelLayout |= AV_CH_FRONT_LEFT; -- if (info.HasChannel(AE_CH_FR)) channelLayout |= AV_CH_FRONT_RIGHT; -- if (info.HasChannel(AE_CH_FC)) channelLayout |= AV_CH_FRONT_CENTER; -- if (info.HasChannel(AE_CH_LFE)) channelLayout |= AV_CH_LOW_FREQUENCY; -- if (info.HasChannel(AE_CH_BL)) channelLayout |= AV_CH_BACK_LEFT; -- if (info.HasChannel(AE_CH_BR)) channelLayout |= AV_CH_BACK_RIGHT; -- if (info.HasChannel(AE_CH_FLOC)) channelLayout |= AV_CH_FRONT_LEFT_OF_CENTER; -- if (info.HasChannel(AE_CH_FROC)) channelLayout |= AV_CH_FRONT_RIGHT_OF_CENTER; -- if (info.HasChannel(AE_CH_BC)) channelLayout |= AV_CH_BACK_CENTER; -- if (info.HasChannel(AE_CH_SL)) channelLayout |= AV_CH_SIDE_LEFT; -- if (info.HasChannel(AE_CH_SR)) channelLayout |= AV_CH_SIDE_RIGHT; -- if (info.HasChannel(AE_CH_TC)) channelLayout |= AV_CH_TOP_CENTER; -- if (info.HasChannel(AE_CH_TFL)) channelLayout |= AV_CH_TOP_FRONT_LEFT; -- if (info.HasChannel(AE_CH_TFC)) channelLayout |= AV_CH_TOP_FRONT_CENTER; -- if (info.HasChannel(AE_CH_TFR)) channelLayout |= AV_CH_TOP_FRONT_RIGHT; -- if (info.HasChannel(AE_CH_TBL)) channelLayout |= AV_CH_TOP_BACK_LEFT; -- if (info.HasChannel(AE_CH_TBC)) channelLayout |= AV_CH_TOP_BACK_CENTER; -- if (info.HasChannel(AE_CH_TBR)) channelLayout |= AV_CH_TOP_BACK_RIGHT; -- -- return channelLayout; --} -- --//CAEChannelInfo CActiveAEResample::GetAEChannelLayout(uint64_t layout) --//{ --// CAEChannelInfo channelLayout; --// channelLayout.Reset(); --// --// if (layout & AV_CH_FRONT_LEFT ) channelLayout += AE_CH_FL ; --// if (layout & AV_CH_FRONT_RIGHT ) channelLayout += AE_CH_FR ; --// if (layout & AV_CH_FRONT_CENTER ) channelLayout += AE_CH_FC ; --// if (layout & AV_CH_LOW_FREQUENCY ) channelLayout += AE_CH_LFE ; --// if (layout & AV_CH_BACK_LEFT ) channelLayout += AE_CH_BL ; --// if (layout & AV_CH_BACK_RIGHT ) channelLayout += AE_CH_BR ; --// if (layout & AV_CH_FRONT_LEFT_OF_CENTER ) channelLayout += AE_CH_FLOC; --// if (layout & AV_CH_FRONT_RIGHT_OF_CENTER) channelLayout += AE_CH_FROC; --// if (layout & AV_CH_BACK_CENTER ) channelLayout += AE_CH_BC ; --// if (layout & AV_CH_SIDE_LEFT ) channelLayout += AE_CH_SL ; --// if (layout & AV_CH_SIDE_RIGHT ) channelLayout += AE_CH_SR ; --// if (layout & AV_CH_TOP_CENTER ) channelLayout += AE_CH_TC ; --// if (layout & AV_CH_TOP_FRONT_LEFT ) channelLayout += AE_CH_TFL ; --// if (layout & AV_CH_TOP_FRONT_CENTER ) channelLayout += AE_CH_TFC ; --// if (layout & AV_CH_TOP_FRONT_RIGHT ) channelLayout += AE_CH_TFR ; --// if (layout & AV_CH_TOP_BACK_LEFT ) channelLayout += AE_CH_BL ; --// if (layout & AV_CH_TOP_BACK_CENTER ) channelLayout += AE_CH_BC ; --// if (layout & AV_CH_TOP_BACK_RIGHT ) channelLayout += AE_CH_BR ; --// --// return channelLayout; --//} -- --AVSampleFormat CActiveAEResample::GetAVSampleFormat(AEDataFormat format) --{ -- if (format == AE_FMT_U8) return AV_SAMPLE_FMT_U8; -- else if (format == AE_FMT_S16NE) return AV_SAMPLE_FMT_S16; -- else if (format == AE_FMT_S32NE) return AV_SAMPLE_FMT_S32; -- else if (format == AE_FMT_S24NE4) return AV_SAMPLE_FMT_S32; -- else if (format == AE_FMT_S24NE4MSB)return AV_SAMPLE_FMT_S32; -- else if (format == AE_FMT_S24NE3) return AV_SAMPLE_FMT_S32; -- else if (format == AE_FMT_FLOAT) return AV_SAMPLE_FMT_FLT; -- else if (format == AE_FMT_DOUBLE) return AV_SAMPLE_FMT_DBL; -- -- else if (format == AE_FMT_U8P) return AV_SAMPLE_FMT_U8P; -- else if (format == AE_FMT_S16NEP) return AV_SAMPLE_FMT_S16P; -- else if (format == AE_FMT_S32NEP) return AV_SAMPLE_FMT_S32P; -- else if (format == AE_FMT_S24NE4P) return AV_SAMPLE_FMT_S32P; -- else if (format == AE_FMT_S24NE4MSBP)return AV_SAMPLE_FMT_S32P; -- else if (format == AE_FMT_S24NE3P) return AV_SAMPLE_FMT_S32P; -- else if (format == AE_FMT_FLOATP) return AV_SAMPLE_FMT_FLTP; -- else if (format == AE_FMT_DOUBLEP) return AV_SAMPLE_FMT_DBLP; -- -- if (AE_IS_PLANAR(format)) -- return AV_SAMPLE_FMT_FLTP; -- else -- return AV_SAMPLE_FMT_FLT; --} -- --uint64_t CActiveAEResample::GetAVChannel(enum AEChannel aechannel) --{ -- switch (aechannel) -- { -- case AE_CH_FL: return AV_CH_FRONT_LEFT; -- case AE_CH_FR: return AV_CH_FRONT_RIGHT; -- case AE_CH_FC: return AV_CH_FRONT_CENTER; -- case AE_CH_LFE: return AV_CH_LOW_FREQUENCY; -- case AE_CH_BL: return AV_CH_BACK_LEFT; -- case AE_CH_BR: return AV_CH_BACK_RIGHT; -- case AE_CH_FLOC: return AV_CH_FRONT_LEFT_OF_CENTER; -- case AE_CH_FROC: return AV_CH_FRONT_RIGHT_OF_CENTER; -- case AE_CH_BC: return AV_CH_BACK_CENTER; -- case AE_CH_SL: return AV_CH_SIDE_LEFT; -- case AE_CH_SR: return AV_CH_SIDE_RIGHT; -- case AE_CH_TC: return AV_CH_TOP_CENTER; -- case AE_CH_TFL: return AV_CH_TOP_FRONT_LEFT; -- case AE_CH_TFC: return AV_CH_TOP_FRONT_CENTER; -- case AE_CH_TFR: return AV_CH_TOP_FRONT_RIGHT; -- case AE_CH_TBL: return AV_CH_TOP_BACK_LEFT; -- case AE_CH_TBC: return AV_CH_TOP_BACK_CENTER; -- case AE_CH_TBR: return AV_CH_TOP_BACK_RIGHT; -- default: -- return 0; -- } --} -- --int CActiveAEResample::GetAVChannelIndex(enum AEChannel aechannel, uint64_t layout) --{ -- return av_get_channel_layout_channel_index(layout, GetAVChannel(aechannel)); --} -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.h -deleted file mode 100644 -index a471e02..0000000 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.h -+++ /dev/null -@@ -1,65 +0,0 @@ --#pragma once --/* -- * Copyright (C) 2010-2013 Team XBMC -- * http://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 -- * . -- * -- */ -- --#include "cores/AudioEngine/Utils/AEChannelInfo.h" --#include "cores/AudioEngine/Utils/AEAudioFormat.h" --#include "cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h" --#include "cores/AudioEngine/Interfaces/AE.h" -- --extern "C" { --#include "libavutil/avutil.h" --#include "libswresample/swresample.h" --} -- --namespace ActiveAE --{ -- --class CActiveAEResample --{ --public: -- CActiveAEResample(); -- virtual ~CActiveAEResample(); -- bool Init(uint64_t dst_chan_layout, int dst_channels, int dst_rate, AVSampleFormat dst_fmt, int dst_bits, int dst_dither, uint64_t src_chan_layout, int src_channels, int src_rate, AVSampleFormat src_fmt, int src_bits, int src_dither, bool upmix, bool normalize, CAEChannelInfo *remapLayout, AEQuality quality); -- int Resample(uint8_t **dst_buffer, int dst_samples, uint8_t **src_buffer, int src_samples, double ratio); -- int64_t GetDelay(int64_t base); -- int GetBufferedSamples(); -- int CalcDstSampleCount(int src_samples, int dst_rate, int src_rate); -- int GetSrcBufferSize(int samples); -- int GetDstBufferSize(int samples); -- static uint64_t GetAVChannelLayout(CAEChannelInfo &info); --// static CAEChannelInfo GetAEChannelLayout(uint64_t layout); -- static AVSampleFormat GetAVSampleFormat(AEDataFormat format); -- static uint64_t GetAVChannel(enum AEChannel aechannel); -- int GetAVChannelIndex(enum AEChannel aechannel, uint64_t layout); -- --protected: -- bool m_loaded; -- uint64_t m_src_chan_layout, m_dst_chan_layout; -- int m_src_rate, m_dst_rate; -- int m_src_channels, m_dst_channels; -- AVSampleFormat m_src_fmt, m_dst_fmt; -- int m_src_bits, m_dst_bits; -- int m_src_dither_bits, m_dst_dither_bits; -- SwrContext *m_pContext; -- double m_rematrix[AE_CH_MAX][AE_CH_MAX]; --}; -- --} -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp -new file mode 100644 -index 0000000..d7e0e0f ---- /dev/null -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp -@@ -0,0 +1,388 @@ -+/* -+ * Copyright (C) 2010-2013 Team XBMC -+ * http://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 -+ * . -+ * -+ */ -+ -+#include "ActiveAEResample.h" -+#include "utils/log.h" -+ -+extern "C" { -+#include "libavutil/channel_layout.h" -+#include "libavutil/opt.h" -+#include "libswresample/swresample.h" -+} -+ -+using namespace ActiveAE; -+ -+CActiveAEResample::CActiveAEResample() -+{ -+ m_pContext = NULL; -+ m_loaded = true; -+} -+ -+CActiveAEResample::~CActiveAEResample() -+{ -+ if (m_pContext) -+ swr_free(&m_pContext); -+} -+ -+bool CActiveAEResample::Init(uint64_t dst_chan_layout, int dst_channels, int dst_rate, AVSampleFormat dst_fmt, int dst_bits, int dst_dither, uint64_t src_chan_layout, int src_channels, int src_rate, AVSampleFormat src_fmt, int src_bits, int src_dither, bool upmix, bool normalize, CAEChannelInfo *remapLayout, AEQuality quality) -+{ -+ if (!m_loaded) -+ return false; -+ -+ m_dst_chan_layout = dst_chan_layout; -+ m_dst_channels = dst_channels; -+ m_dst_rate = dst_rate; -+ m_dst_fmt = dst_fmt; -+ m_dst_bits = dst_bits; -+ m_dst_dither_bits = dst_dither; -+ m_src_chan_layout = src_chan_layout; -+ m_src_channels = src_channels; -+ m_src_rate = src_rate; -+ m_src_fmt = src_fmt; -+ m_src_bits = src_bits; -+ m_src_dither_bits = src_dither; -+ -+ if (m_dst_chan_layout == 0) -+ m_dst_chan_layout = av_get_default_channel_layout(m_dst_channels); -+ if (m_src_chan_layout == 0) -+ m_src_chan_layout = av_get_default_channel_layout(m_src_channels); -+ -+ m_pContext = swr_alloc_set_opts(NULL, m_dst_chan_layout, m_dst_fmt, m_dst_rate, -+ m_src_chan_layout, m_src_fmt, m_src_rate, -+ 0, NULL); -+ -+ if(!m_pContext) -+ { -+ CLog::Log(LOGERROR, "CActiveAEResample::Init - create context failed"); -+ return false; -+ } -+ -+ if(quality == AE_QUALITY_HIGH) -+ { -+ av_opt_set_double(m_pContext, "cutoff", 1.0, 0); -+ av_opt_set_int(m_pContext,"filter_size", 256, 0); -+ } -+ else if(quality == AE_QUALITY_MID) -+ { -+ // 0.97 is default cutoff so use (1.0 - 0.97) / 2.0 + 0.97 -+ av_opt_set_double(m_pContext, "cutoff", 0.985, 0); -+ av_opt_set_int(m_pContext,"filter_size", 64, 0); -+ } -+ else if(quality == AE_QUALITY_LOW) -+ { -+ av_opt_set_double(m_pContext, "cutoff", 0.97, 0); -+ av_opt_set_int(m_pContext,"filter_size", 32, 0); -+ } -+ -+ if (m_dst_fmt == AV_SAMPLE_FMT_S32 || m_dst_fmt == AV_SAMPLE_FMT_S32P) -+ { -+ av_opt_set_int(m_pContext, "output_sample_bits", m_dst_bits, 0); -+ } -+ -+ // tell resampler to clamp float values -+ // not required for sink stage (remapLayout == true) -+ if ((m_dst_fmt == AV_SAMPLE_FMT_FLT || m_dst_fmt == AV_SAMPLE_FMT_FLTP) && -+ (m_src_fmt == AV_SAMPLE_FMT_FLT || m_src_fmt == AV_SAMPLE_FMT_FLTP) && -+ !remapLayout && normalize) -+ { -+ av_opt_set_double(m_pContext, "rematrix_maxval", 1.0, 0); -+ } -+ -+ if (remapLayout) -+ { -+ // one-to-one mapping of channels -+ // remapLayout is the layout of the sink, if the channel is in our src layout -+ // the channel is mapped by setting coef 1.0 -+ memset(m_rematrix, 0, sizeof(m_rematrix)); -+ m_dst_chan_layout = 0; -+ for (unsigned int out=0; outCount(); out++) -+ { -+ m_dst_chan_layout += (uint64_t) (1 << out); -+ int idx = GetAVChannelIndex((*remapLayout)[out], m_src_chan_layout); -+ if (idx >= 0) -+ { -+ m_rematrix[out][idx] = 1.0; -+ } -+ } -+ -+ av_opt_set_int(m_pContext, "out_channel_count", m_dst_channels, 0); -+ av_opt_set_int(m_pContext, "out_channel_layout", m_dst_chan_layout, 0); -+ -+ if (swr_set_matrix(m_pContext, (const double*)m_rematrix, AE_CH_MAX) < 0) -+ { -+ CLog::Log(LOGERROR, "CActiveAEResample::Init - setting channel matrix failed"); -+ return false; -+ } -+ } -+ // stereo upmix -+ else if (upmix && m_src_channels == 2 && m_dst_channels > 2) -+ { -+ memset(m_rematrix, 0, sizeof(m_rematrix)); -+ for (int out=0; out> 8 = 0 1 1 1 = SNE24NE -+ else if (m_dst_bits != 32 && (m_dst_dither_bits + m_dst_bits) != 32) -+ { -+ int planes = av_sample_fmt_is_planar(m_dst_fmt) ? m_dst_channels : 1; -+ int samples = ret * m_dst_channels / planes; -+ for (int i=0; i> (32 - m_dst_bits - m_dst_dither_bits); -+ buf++; -+ } -+ } -+ } -+ } -+ return ret; -+} -+ -+int64_t CActiveAEResample::GetDelay(int64_t base) -+{ -+ return swr_get_delay(m_pContext, base); -+} -+ -+int CActiveAEResample::GetBufferedSamples() -+{ -+ return av_rescale_rnd(swr_get_delay(m_pContext, m_src_rate), -+ m_dst_rate, m_src_rate, AV_ROUND_UP); -+} -+ -+int CActiveAEResample::CalcDstSampleCount(int src_samples, int dst_rate, int src_rate) -+{ -+ return av_rescale_rnd(src_samples, dst_rate, src_rate, AV_ROUND_UP); -+} -+ -+int CActiveAEResample::GetSrcBufferSize(int samples) -+{ -+ return av_samples_get_buffer_size(NULL, m_src_channels, samples, m_src_fmt, 1); -+} -+ -+int CActiveAEResample::GetDstBufferSize(int samples) -+{ -+ return av_samples_get_buffer_size(NULL, m_dst_channels, samples, m_dst_fmt, 1); -+} -+ -+uint64_t CActiveAEResample::GetAVChannelLayout(CAEChannelInfo &info) -+{ -+ uint64_t channelLayout = 0; -+ if (info.HasChannel(AE_CH_FL)) channelLayout |= AV_CH_FRONT_LEFT; -+ if (info.HasChannel(AE_CH_FR)) channelLayout |= AV_CH_FRONT_RIGHT; -+ if (info.HasChannel(AE_CH_FC)) channelLayout |= AV_CH_FRONT_CENTER; -+ if (info.HasChannel(AE_CH_LFE)) channelLayout |= AV_CH_LOW_FREQUENCY; -+ if (info.HasChannel(AE_CH_BL)) channelLayout |= AV_CH_BACK_LEFT; -+ if (info.HasChannel(AE_CH_BR)) channelLayout |= AV_CH_BACK_RIGHT; -+ if (info.HasChannel(AE_CH_FLOC)) channelLayout |= AV_CH_FRONT_LEFT_OF_CENTER; -+ if (info.HasChannel(AE_CH_FROC)) channelLayout |= AV_CH_FRONT_RIGHT_OF_CENTER; -+ if (info.HasChannel(AE_CH_BC)) channelLayout |= AV_CH_BACK_CENTER; -+ if (info.HasChannel(AE_CH_SL)) channelLayout |= AV_CH_SIDE_LEFT; -+ if (info.HasChannel(AE_CH_SR)) channelLayout |= AV_CH_SIDE_RIGHT; -+ if (info.HasChannel(AE_CH_TC)) channelLayout |= AV_CH_TOP_CENTER; -+ if (info.HasChannel(AE_CH_TFL)) channelLayout |= AV_CH_TOP_FRONT_LEFT; -+ if (info.HasChannel(AE_CH_TFC)) channelLayout |= AV_CH_TOP_FRONT_CENTER; -+ if (info.HasChannel(AE_CH_TFR)) channelLayout |= AV_CH_TOP_FRONT_RIGHT; -+ if (info.HasChannel(AE_CH_TBL)) channelLayout |= AV_CH_TOP_BACK_LEFT; -+ if (info.HasChannel(AE_CH_TBC)) channelLayout |= AV_CH_TOP_BACK_CENTER; -+ if (info.HasChannel(AE_CH_TBR)) channelLayout |= AV_CH_TOP_BACK_RIGHT; -+ -+ return channelLayout; -+} -+ -+//CAEChannelInfo CActiveAEResample::GetAEChannelLayout(uint64_t layout) -+//{ -+// CAEChannelInfo channelLayout; -+// channelLayout.Reset(); -+// -+// if (layout & AV_CH_FRONT_LEFT ) channelLayout += AE_CH_FL ; -+// if (layout & AV_CH_FRONT_RIGHT ) channelLayout += AE_CH_FR ; -+// if (layout & AV_CH_FRONT_CENTER ) channelLayout += AE_CH_FC ; -+// if (layout & AV_CH_LOW_FREQUENCY ) channelLayout += AE_CH_LFE ; -+// if (layout & AV_CH_BACK_LEFT ) channelLayout += AE_CH_BL ; -+// if (layout & AV_CH_BACK_RIGHT ) channelLayout += AE_CH_BR ; -+// if (layout & AV_CH_FRONT_LEFT_OF_CENTER ) channelLayout += AE_CH_FLOC; -+// if (layout & AV_CH_FRONT_RIGHT_OF_CENTER) channelLayout += AE_CH_FROC; -+// if (layout & AV_CH_BACK_CENTER ) channelLayout += AE_CH_BC ; -+// if (layout & AV_CH_SIDE_LEFT ) channelLayout += AE_CH_SL ; -+// if (layout & AV_CH_SIDE_RIGHT ) channelLayout += AE_CH_SR ; -+// if (layout & AV_CH_TOP_CENTER ) channelLayout += AE_CH_TC ; -+// if (layout & AV_CH_TOP_FRONT_LEFT ) channelLayout += AE_CH_TFL ; -+// if (layout & AV_CH_TOP_FRONT_CENTER ) channelLayout += AE_CH_TFC ; -+// if (layout & AV_CH_TOP_FRONT_RIGHT ) channelLayout += AE_CH_TFR ; -+// if (layout & AV_CH_TOP_BACK_LEFT ) channelLayout += AE_CH_BL ; -+// if (layout & AV_CH_TOP_BACK_CENTER ) channelLayout += AE_CH_BC ; -+// if (layout & AV_CH_TOP_BACK_RIGHT ) channelLayout += AE_CH_BR ; -+// -+// return channelLayout; -+//} -+ -+AVSampleFormat CActiveAEResample::GetAVSampleFormat(AEDataFormat format) -+{ -+ if (format == AE_FMT_U8) return AV_SAMPLE_FMT_U8; -+ else if (format == AE_FMT_S16NE) return AV_SAMPLE_FMT_S16; -+ else if (format == AE_FMT_S32NE) return AV_SAMPLE_FMT_S32; -+ else if (format == AE_FMT_S24NE4) return AV_SAMPLE_FMT_S32; -+ else if (format == AE_FMT_S24NE4MSB)return AV_SAMPLE_FMT_S32; -+ else if (format == AE_FMT_S24NE3) return AV_SAMPLE_FMT_S32; -+ else if (format == AE_FMT_FLOAT) return AV_SAMPLE_FMT_FLT; -+ else if (format == AE_FMT_DOUBLE) return AV_SAMPLE_FMT_DBL; -+ -+ else if (format == AE_FMT_U8P) return AV_SAMPLE_FMT_U8P; -+ else if (format == AE_FMT_S16NEP) return AV_SAMPLE_FMT_S16P; -+ else if (format == AE_FMT_S32NEP) return AV_SAMPLE_FMT_S32P; -+ else if (format == AE_FMT_S24NE4P) return AV_SAMPLE_FMT_S32P; -+ else if (format == AE_FMT_S24NE4MSBP)return AV_SAMPLE_FMT_S32P; -+ else if (format == AE_FMT_S24NE3P) return AV_SAMPLE_FMT_S32P; -+ else if (format == AE_FMT_FLOATP) return AV_SAMPLE_FMT_FLTP; -+ else if (format == AE_FMT_DOUBLEP) return AV_SAMPLE_FMT_DBLP; -+ -+ if (AE_IS_PLANAR(format)) -+ return AV_SAMPLE_FMT_FLTP; -+ else -+ return AV_SAMPLE_FMT_FLT; -+} -+ -+uint64_t CActiveAEResample::GetAVChannel(enum AEChannel aechannel) -+{ -+ switch (aechannel) -+ { -+ case AE_CH_FL: return AV_CH_FRONT_LEFT; -+ case AE_CH_FR: return AV_CH_FRONT_RIGHT; -+ case AE_CH_FC: return AV_CH_FRONT_CENTER; -+ case AE_CH_LFE: return AV_CH_LOW_FREQUENCY; -+ case AE_CH_BL: return AV_CH_BACK_LEFT; -+ case AE_CH_BR: return AV_CH_BACK_RIGHT; -+ case AE_CH_FLOC: return AV_CH_FRONT_LEFT_OF_CENTER; -+ case AE_CH_FROC: return AV_CH_FRONT_RIGHT_OF_CENTER; -+ case AE_CH_BC: return AV_CH_BACK_CENTER; -+ case AE_CH_SL: return AV_CH_SIDE_LEFT; -+ case AE_CH_SR: return AV_CH_SIDE_RIGHT; -+ case AE_CH_TC: return AV_CH_TOP_CENTER; -+ case AE_CH_TFL: return AV_CH_TOP_FRONT_LEFT; -+ case AE_CH_TFC: return AV_CH_TOP_FRONT_CENTER; -+ case AE_CH_TFR: return AV_CH_TOP_FRONT_RIGHT; -+ case AE_CH_TBL: return AV_CH_TOP_BACK_LEFT; -+ case AE_CH_TBC: return AV_CH_TOP_BACK_CENTER; -+ case AE_CH_TBR: return AV_CH_TOP_BACK_RIGHT; -+ default: -+ return 0; -+ } -+} -+ -+int CActiveAEResample::GetAVChannelIndex(enum AEChannel aechannel, uint64_t layout) -+{ -+ return av_get_channel_layout_channel_index(layout, GetAVChannel(aechannel)); -+} -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.h -new file mode 100644 -index 0000000..a471e02 ---- /dev/null -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.h -@@ -0,0 +1,65 @@ -+#pragma once -+/* -+ * Copyright (C) 2010-2013 Team XBMC -+ * http://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 -+ * . -+ * -+ */ -+ -+#include "cores/AudioEngine/Utils/AEChannelInfo.h" -+#include "cores/AudioEngine/Utils/AEAudioFormat.h" -+#include "cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h" -+#include "cores/AudioEngine/Interfaces/AE.h" -+ -+extern "C" { -+#include "libavutil/avutil.h" -+#include "libswresample/swresample.h" -+} -+ -+namespace ActiveAE -+{ -+ -+class CActiveAEResample -+{ -+public: -+ CActiveAEResample(); -+ virtual ~CActiveAEResample(); -+ bool Init(uint64_t dst_chan_layout, int dst_channels, int dst_rate, AVSampleFormat dst_fmt, int dst_bits, int dst_dither, uint64_t src_chan_layout, int src_channels, int src_rate, AVSampleFormat src_fmt, int src_bits, int src_dither, bool upmix, bool normalize, CAEChannelInfo *remapLayout, AEQuality quality); -+ int Resample(uint8_t **dst_buffer, int dst_samples, uint8_t **src_buffer, int src_samples, double ratio); -+ int64_t GetDelay(int64_t base); -+ int GetBufferedSamples(); -+ int CalcDstSampleCount(int src_samples, int dst_rate, int src_rate); -+ int GetSrcBufferSize(int samples); -+ int GetDstBufferSize(int samples); -+ static uint64_t GetAVChannelLayout(CAEChannelInfo &info); -+// static CAEChannelInfo GetAEChannelLayout(uint64_t layout); -+ static AVSampleFormat GetAVSampleFormat(AEDataFormat format); -+ static uint64_t GetAVChannel(enum AEChannel aechannel); -+ int GetAVChannelIndex(enum AEChannel aechannel, uint64_t layout); -+ -+protected: -+ bool m_loaded; -+ uint64_t m_src_chan_layout, m_dst_chan_layout; -+ int m_src_rate, m_dst_rate; -+ int m_src_channels, m_dst_channels; -+ AVSampleFormat m_src_fmt, m_dst_fmt; -+ int m_src_bits, m_dst_bits; -+ int m_src_dither_bits, m_dst_dither_bits; -+ SwrContext *m_pContext; -+ double m_rematrix[AE_CH_MAX][AE_CH_MAX]; -+}; -+ -+} -diff --git a/xbmc/cores/AudioEngine/Makefile.in b/xbmc/cores/AudioEngine/Makefile.in -index 581249e..7e9b415 100644 ---- a/xbmc/cores/AudioEngine/Makefile.in -+++ b/xbmc/cores/AudioEngine/Makefile.in -@@ -30,7 +30,7 @@ SRCS += Engines/ActiveAE/ActiveAE.cpp - SRCS += Engines/ActiveAE/ActiveAESink.cpp - SRCS += Engines/ActiveAE/ActiveAEStream.cpp - SRCS += Engines/ActiveAE/ActiveAESound.cpp --SRCS += Engines/ActiveAE/ActiveAEResample.cpp -+SRCS += Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp - SRCS += Engines/ActiveAE/ActiveAEBuffer.cpp - - ifeq (@USE_ANDROID@,1) - -From bf25defc12be2108df18dea848ea316bab7d8535 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sat, 4 Oct 2014 22:51:26 +0100 -Subject: [PATCH 82/96] [AE] Move utility functions to AEUtil - ---- - .../AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 4 +- - .../Engines/ActiveAE/ActiveAEBuffer.cpp | 20 ++-- - .../Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp | 114 +-------------------- - .../Engines/ActiveAE/ActiveAEResampleFFMPEG.h | 8 -- - .../AudioEngine/Engines/ActiveAE/ActiveAESink.cpp | 4 +- - .../Engines/ActiveAE/ActiveAEStream.cpp | 12 +-- - xbmc/cores/AudioEngine/Utils/AEUtil.cpp | 87 ++++++++++++++++ - xbmc/cores/AudioEngine/Utils/AEUtil.h | 9 ++ - xbmc/cores/paplayer/DVDPlayerCodec.cpp | 8 +- - 9 files changed, 122 insertions(+), 144 deletions(-) - -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -index 0eda1d2..e30f105 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -@@ -2676,10 +2676,10 @@ bool CActiveAE::ResampleSound(CActiveAESound *sound) - - orig_config = sound->GetSound(true)->config; - -- dst_config.channel_layout = CActiveAEResample::GetAVChannelLayout(m_internalFormat.m_channelLayout); -+ dst_config.channel_layout = CAEUtil::GetAVChannelLayout(m_internalFormat.m_channelLayout); - dst_config.channels = m_internalFormat.m_channelLayout.Count(); - dst_config.sample_rate = m_internalFormat.m_sampleRate; -- dst_config.fmt = CActiveAEResample::GetAVSampleFormat(m_internalFormat.m_dataFormat); -+ dst_config.fmt = CAEUtil::GetAVSampleFormat(m_internalFormat.m_dataFormat); - dst_config.bits_per_sample = CAEUtil::DataFormatToUsedBits(m_internalFormat.m_dataFormat); - dst_config.dither_bits = CAEUtil::DataFormatToDitherBits(m_internalFormat.m_dataFormat); - -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp -index 9e834c6..15bd898 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp -@@ -107,12 +107,12 @@ bool CActiveAEBufferPool::Create(unsigned int totaltime) - { - CSampleBuffer *buffer; - SampleConfig config; -- config.fmt = CActiveAEResample::GetAVSampleFormat(m_format.m_dataFormat); -+ config.fmt = CAEUtil::GetAVSampleFormat(m_format.m_dataFormat); - config.bits_per_sample = CAEUtil::DataFormatToUsedBits(m_format.m_dataFormat); - config.dither_bits = CAEUtil::DataFormatToDitherBits(m_format.m_dataFormat); - config.channels = m_format.m_channelLayout.Count(); - config.sample_rate = m_format.m_sampleRate; -- config.channel_layout = CActiveAEResample::GetAVChannelLayout(m_format.m_channelLayout); -+ config.channel_layout = CAEUtil::GetAVChannelLayout(m_format.m_channelLayout); - - unsigned int time = 0; - unsigned int buffertime = (m_format.m_frames*1000) / m_format.m_sampleRate; -@@ -172,16 +172,16 @@ bool CActiveAEBufferPoolResample::Create(unsigned int totaltime, bool remap, boo - m_changeResampler) - { - m_resampler = new CActiveAEResample(); -- m_resampler->Init(CActiveAEResample::GetAVChannelLayout(m_format.m_channelLayout), -+ m_resampler->Init(CAEUtil::GetAVChannelLayout(m_format.m_channelLayout), - m_format.m_channelLayout.Count(), - m_format.m_sampleRate, -- CActiveAEResample::GetAVSampleFormat(m_format.m_dataFormat), -+ CAEUtil::GetAVSampleFormat(m_format.m_dataFormat), - CAEUtil::DataFormatToUsedBits(m_format.m_dataFormat), - CAEUtil::DataFormatToDitherBits(m_format.m_dataFormat), -- CActiveAEResample::GetAVChannelLayout(m_inputFormat.m_channelLayout), -+ CAEUtil::GetAVChannelLayout(m_inputFormat.m_channelLayout), - m_inputFormat.m_channelLayout.Count(), - m_inputFormat.m_sampleRate, -- CActiveAEResample::GetAVSampleFormat(m_inputFormat.m_dataFormat), -+ CAEUtil::GetAVSampleFormat(m_inputFormat.m_dataFormat), - CAEUtil::DataFormatToUsedBits(m_inputFormat.m_dataFormat), - CAEUtil::DataFormatToDitherBits(m_inputFormat.m_dataFormat), - upmix, -@@ -200,16 +200,16 @@ void CActiveAEBufferPoolResample::ChangeResampler() - delete m_resampler; - - m_resampler = new CActiveAEResample(); -- m_resampler->Init(CActiveAEResample::GetAVChannelLayout(m_format.m_channelLayout), -+ m_resampler->Init(CAEUtil::GetAVChannelLayout(m_format.m_channelLayout), - m_format.m_channelLayout.Count(), - m_format.m_sampleRate, -- CActiveAEResample::GetAVSampleFormat(m_format.m_dataFormat), -+ CAEUtil::GetAVSampleFormat(m_format.m_dataFormat), - CAEUtil::DataFormatToUsedBits(m_format.m_dataFormat), - CAEUtil::DataFormatToDitherBits(m_format.m_dataFormat), -- CActiveAEResample::GetAVChannelLayout(m_inputFormat.m_channelLayout), -+ CAEUtil::GetAVChannelLayout(m_inputFormat.m_channelLayout), - m_inputFormat.m_channelLayout.Count(), - m_inputFormat.m_sampleRate, -- CActiveAEResample::GetAVSampleFormat(m_inputFormat.m_dataFormat), -+ CAEUtil::GetAVSampleFormat(m_inputFormat.m_dataFormat), - CAEUtil::DataFormatToUsedBits(m_inputFormat.m_dataFormat), - CAEUtil::DataFormatToDitherBits(m_inputFormat.m_dataFormat), - m_stereoUpmix, -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp -index d7e0e0f..de08de9 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp -@@ -18,7 +18,7 @@ - * - */ - --#include "ActiveAEResample.h" -+#include "cores/AudioEngine/Utils/AEUtil.h" - #include "utils/log.h" - - extern "C" { -@@ -115,7 +115,7 @@ bool CActiveAEResample::Init(uint64_t dst_chan_layout, int dst_channels, int dst - for (unsigned int out=0; outCount(); out++) - { - m_dst_chan_layout += (uint64_t) (1 << out); -- int idx = GetAVChannelIndex((*remapLayout)[out], m_src_chan_layout); -+ int idx = CAEUtil::GetAVChannelIndex((*remapLayout)[out], m_src_chan_layout); - if (idx >= 0) - { - m_rematrix[out][idx] = 1.0; -@@ -276,113 +276,3 @@ int CActiveAEResample::GetDstBufferSize(int samples) - { - return av_samples_get_buffer_size(NULL, m_dst_channels, samples, m_dst_fmt, 1); - } -- --uint64_t CActiveAEResample::GetAVChannelLayout(CAEChannelInfo &info) --{ -- uint64_t channelLayout = 0; -- if (info.HasChannel(AE_CH_FL)) channelLayout |= AV_CH_FRONT_LEFT; -- if (info.HasChannel(AE_CH_FR)) channelLayout |= AV_CH_FRONT_RIGHT; -- if (info.HasChannel(AE_CH_FC)) channelLayout |= AV_CH_FRONT_CENTER; -- if (info.HasChannel(AE_CH_LFE)) channelLayout |= AV_CH_LOW_FREQUENCY; -- if (info.HasChannel(AE_CH_BL)) channelLayout |= AV_CH_BACK_LEFT; -- if (info.HasChannel(AE_CH_BR)) channelLayout |= AV_CH_BACK_RIGHT; -- if (info.HasChannel(AE_CH_FLOC)) channelLayout |= AV_CH_FRONT_LEFT_OF_CENTER; -- if (info.HasChannel(AE_CH_FROC)) channelLayout |= AV_CH_FRONT_RIGHT_OF_CENTER; -- if (info.HasChannel(AE_CH_BC)) channelLayout |= AV_CH_BACK_CENTER; -- if (info.HasChannel(AE_CH_SL)) channelLayout |= AV_CH_SIDE_LEFT; -- if (info.HasChannel(AE_CH_SR)) channelLayout |= AV_CH_SIDE_RIGHT; -- if (info.HasChannel(AE_CH_TC)) channelLayout |= AV_CH_TOP_CENTER; -- if (info.HasChannel(AE_CH_TFL)) channelLayout |= AV_CH_TOP_FRONT_LEFT; -- if (info.HasChannel(AE_CH_TFC)) channelLayout |= AV_CH_TOP_FRONT_CENTER; -- if (info.HasChannel(AE_CH_TFR)) channelLayout |= AV_CH_TOP_FRONT_RIGHT; -- if (info.HasChannel(AE_CH_TBL)) channelLayout |= AV_CH_TOP_BACK_LEFT; -- if (info.HasChannel(AE_CH_TBC)) channelLayout |= AV_CH_TOP_BACK_CENTER; -- if (info.HasChannel(AE_CH_TBR)) channelLayout |= AV_CH_TOP_BACK_RIGHT; -- -- return channelLayout; --} -- --//CAEChannelInfo CActiveAEResample::GetAEChannelLayout(uint64_t layout) --//{ --// CAEChannelInfo channelLayout; --// channelLayout.Reset(); --// --// if (layout & AV_CH_FRONT_LEFT ) channelLayout += AE_CH_FL ; --// if (layout & AV_CH_FRONT_RIGHT ) channelLayout += AE_CH_FR ; --// if (layout & AV_CH_FRONT_CENTER ) channelLayout += AE_CH_FC ; --// if (layout & AV_CH_LOW_FREQUENCY ) channelLayout += AE_CH_LFE ; --// if (layout & AV_CH_BACK_LEFT ) channelLayout += AE_CH_BL ; --// if (layout & AV_CH_BACK_RIGHT ) channelLayout += AE_CH_BR ; --// if (layout & AV_CH_FRONT_LEFT_OF_CENTER ) channelLayout += AE_CH_FLOC; --// if (layout & AV_CH_FRONT_RIGHT_OF_CENTER) channelLayout += AE_CH_FROC; --// if (layout & AV_CH_BACK_CENTER ) channelLayout += AE_CH_BC ; --// if (layout & AV_CH_SIDE_LEFT ) channelLayout += AE_CH_SL ; --// if (layout & AV_CH_SIDE_RIGHT ) channelLayout += AE_CH_SR ; --// if (layout & AV_CH_TOP_CENTER ) channelLayout += AE_CH_TC ; --// if (layout & AV_CH_TOP_FRONT_LEFT ) channelLayout += AE_CH_TFL ; --// if (layout & AV_CH_TOP_FRONT_CENTER ) channelLayout += AE_CH_TFC ; --// if (layout & AV_CH_TOP_FRONT_RIGHT ) channelLayout += AE_CH_TFR ; --// if (layout & AV_CH_TOP_BACK_LEFT ) channelLayout += AE_CH_BL ; --// if (layout & AV_CH_TOP_BACK_CENTER ) channelLayout += AE_CH_BC ; --// if (layout & AV_CH_TOP_BACK_RIGHT ) channelLayout += AE_CH_BR ; --// --// return channelLayout; --//} -- --AVSampleFormat CActiveAEResample::GetAVSampleFormat(AEDataFormat format) --{ -- if (format == AE_FMT_U8) return AV_SAMPLE_FMT_U8; -- else if (format == AE_FMT_S16NE) return AV_SAMPLE_FMT_S16; -- else if (format == AE_FMT_S32NE) return AV_SAMPLE_FMT_S32; -- else if (format == AE_FMT_S24NE4) return AV_SAMPLE_FMT_S32; -- else if (format == AE_FMT_S24NE4MSB)return AV_SAMPLE_FMT_S32; -- else if (format == AE_FMT_S24NE3) return AV_SAMPLE_FMT_S32; -- else if (format == AE_FMT_FLOAT) return AV_SAMPLE_FMT_FLT; -- else if (format == AE_FMT_DOUBLE) return AV_SAMPLE_FMT_DBL; -- -- else if (format == AE_FMT_U8P) return AV_SAMPLE_FMT_U8P; -- else if (format == AE_FMT_S16NEP) return AV_SAMPLE_FMT_S16P; -- else if (format == AE_FMT_S32NEP) return AV_SAMPLE_FMT_S32P; -- else if (format == AE_FMT_S24NE4P) return AV_SAMPLE_FMT_S32P; -- else if (format == AE_FMT_S24NE4MSBP)return AV_SAMPLE_FMT_S32P; -- else if (format == AE_FMT_S24NE3P) return AV_SAMPLE_FMT_S32P; -- else if (format == AE_FMT_FLOATP) return AV_SAMPLE_FMT_FLTP; -- else if (format == AE_FMT_DOUBLEP) return AV_SAMPLE_FMT_DBLP; -- -- if (AE_IS_PLANAR(format)) -- return AV_SAMPLE_FMT_FLTP; -- else -- return AV_SAMPLE_FMT_FLT; --} -- --uint64_t CActiveAEResample::GetAVChannel(enum AEChannel aechannel) --{ -- switch (aechannel) -- { -- case AE_CH_FL: return AV_CH_FRONT_LEFT; -- case AE_CH_FR: return AV_CH_FRONT_RIGHT; -- case AE_CH_FC: return AV_CH_FRONT_CENTER; -- case AE_CH_LFE: return AV_CH_LOW_FREQUENCY; -- case AE_CH_BL: return AV_CH_BACK_LEFT; -- case AE_CH_BR: return AV_CH_BACK_RIGHT; -- case AE_CH_FLOC: return AV_CH_FRONT_LEFT_OF_CENTER; -- case AE_CH_FROC: return AV_CH_FRONT_RIGHT_OF_CENTER; -- case AE_CH_BC: return AV_CH_BACK_CENTER; -- case AE_CH_SL: return AV_CH_SIDE_LEFT; -- case AE_CH_SR: return AV_CH_SIDE_RIGHT; -- case AE_CH_TC: return AV_CH_TOP_CENTER; -- case AE_CH_TFL: return AV_CH_TOP_FRONT_LEFT; -- case AE_CH_TFC: return AV_CH_TOP_FRONT_CENTER; -- case AE_CH_TFR: return AV_CH_TOP_FRONT_RIGHT; -- case AE_CH_TBL: return AV_CH_TOP_BACK_LEFT; -- case AE_CH_TBC: return AV_CH_TOP_BACK_CENTER; -- case AE_CH_TBR: return AV_CH_TOP_BACK_RIGHT; -- default: -- return 0; -- } --} -- --int CActiveAEResample::GetAVChannelIndex(enum AEChannel aechannel, uint64_t layout) --{ -- return av_get_channel_layout_channel_index(layout, GetAVChannel(aechannel)); --} -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.h -index a471e02..f9bdfec 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.h -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.h -@@ -19,9 +19,6 @@ - * - */ - --#include "cores/AudioEngine/Utils/AEChannelInfo.h" --#include "cores/AudioEngine/Utils/AEAudioFormat.h" --#include "cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h" - #include "cores/AudioEngine/Interfaces/AE.h" - - extern "C" { -@@ -44,11 +41,6 @@ class CActiveAEResample - int CalcDstSampleCount(int src_samples, int dst_rate, int src_rate); - int GetSrcBufferSize(int samples); - int GetDstBufferSize(int samples); -- static uint64_t GetAVChannelLayout(CAEChannelInfo &info); --// static CAEChannelInfo GetAEChannelLayout(uint64_t layout); -- static AVSampleFormat GetAVSampleFormat(AEDataFormat format); -- static uint64_t GetAVChannel(enum AEChannel aechannel); -- int GetAVChannelIndex(enum AEChannel aechannel, uint64_t layout); - - protected: - bool m_loaded; -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp -index d9f4a43..6d4d3b1 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp -@@ -754,10 +754,10 @@ void CActiveAESink::OpenSink() - - // init sample of silence - SampleConfig config; -- config.fmt = CActiveAEResample::GetAVSampleFormat(m_sinkFormat.m_dataFormat); -+ config.fmt = CAEUtil::GetAVSampleFormat(m_sinkFormat.m_dataFormat); - config.bits_per_sample = CAEUtil::DataFormatToUsedBits(m_sinkFormat.m_dataFormat); - config.dither_bits = CAEUtil::DataFormatToDitherBits(m_sinkFormat.m_dataFormat); -- config.channel_layout = CActiveAEResample::GetAVChannelLayout(m_sinkFormat.m_channelLayout); -+ config.channel_layout = CAEUtil::GetAVChannelLayout(m_sinkFormat.m_channelLayout); - config.channels = m_sinkFormat.m_channelLayout.Count(); - config.sample_rate = m_sinkFormat.m_sampleRate; - -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp -index 7acc0d0..e9a292f 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp -@@ -94,7 +94,7 @@ void CActiveAEStream::InitRemapper() - for(unsigned int i=0; iGetAVChannelIndex(m_format.m_channelLayout[j], avLayout); -+ idx = CAEUtil::GetAVChannelIndex(m_format.m_channelLayout[j], avLayout); - if (idx == (int)i) - { - ffmpegLayout += m_format.m_channelLayout[j]; -@@ -134,7 +134,7 @@ void CActiveAEStream::InitRemapper() - { - for(unsigned int j=0; jGetAVChannelIndex(m_format.m_channelLayout[j], avLayout); -+ idx = CAEUtil::GetAVChannelIndex(m_format.m_channelLayout[j], avLayout); - if (idx == (int)i) - { - remapLayout += ffmpegLayout[j]; -@@ -147,13 +147,13 @@ void CActiveAEStream::InitRemapper() - m_remapper->Init(avLayout, - m_format.m_channelLayout.Count(), - m_format.m_sampleRate, -- CActiveAEResample::GetAVSampleFormat(m_format.m_dataFormat), -+ CAEUtil::GetAVSampleFormat(m_format.m_dataFormat), - CAEUtil::DataFormatToUsedBits(m_format.m_dataFormat), - CAEUtil::DataFormatToDitherBits(m_format.m_dataFormat), - avLayout, - m_format.m_channelLayout.Count(), - m_format.m_sampleRate, -- CActiveAEResample::GetAVSampleFormat(m_format.m_dataFormat), -+ CAEUtil::GetAVSampleFormat(m_format.m_dataFormat), - CAEUtil::DataFormatToUsedBits(m_format.m_dataFormat), - CAEUtil::DataFormatToDitherBits(m_format.m_dataFormat), - false, -diff --git a/xbmc/cores/AudioEngine/Utils/AEUtil.cpp b/xbmc/cores/AudioEngine/Utils/AEUtil.cpp -index 44cf256..f535512 100644 ---- a/xbmc/cores/AudioEngine/Utils/AEUtil.cpp -+++ b/xbmc/cores/AudioEngine/Utils/AEUtil.cpp -@@ -25,6 +25,10 @@ - #include "utils/log.h" - #include "utils/TimeUtils.h" - -+extern "C" { -+#include "libavutil/channel_layout.h" -+} -+ - using namespace std; - - /* declare the rng seed and initialize it */ -@@ -526,3 +530,86 @@ bool CAEUtil::S16NeedsByteSwap(AEDataFormat in, AEDataFormat out) - - return in != out; - } -+ -+uint64_t CAEUtil::GetAVChannelLayout(CAEChannelInfo &info) -+{ -+ uint64_t channelLayout = 0; -+ if (info.HasChannel(AE_CH_FL)) channelLayout |= AV_CH_FRONT_LEFT; -+ if (info.HasChannel(AE_CH_FR)) channelLayout |= AV_CH_FRONT_RIGHT; -+ if (info.HasChannel(AE_CH_FC)) channelLayout |= AV_CH_FRONT_CENTER; -+ if (info.HasChannel(AE_CH_LFE)) channelLayout |= AV_CH_LOW_FREQUENCY; -+ if (info.HasChannel(AE_CH_BL)) channelLayout |= AV_CH_BACK_LEFT; -+ if (info.HasChannel(AE_CH_BR)) channelLayout |= AV_CH_BACK_RIGHT; -+ if (info.HasChannel(AE_CH_FLOC)) channelLayout |= AV_CH_FRONT_LEFT_OF_CENTER; -+ if (info.HasChannel(AE_CH_FROC)) channelLayout |= AV_CH_FRONT_RIGHT_OF_CENTER; -+ if (info.HasChannel(AE_CH_BC)) channelLayout |= AV_CH_BACK_CENTER; -+ if (info.HasChannel(AE_CH_SL)) channelLayout |= AV_CH_SIDE_LEFT; -+ if (info.HasChannel(AE_CH_SR)) channelLayout |= AV_CH_SIDE_RIGHT; -+ if (info.HasChannel(AE_CH_TC)) channelLayout |= AV_CH_TOP_CENTER; -+ if (info.HasChannel(AE_CH_TFL)) channelLayout |= AV_CH_TOP_FRONT_LEFT; -+ if (info.HasChannel(AE_CH_TFC)) channelLayout |= AV_CH_TOP_FRONT_CENTER; -+ if (info.HasChannel(AE_CH_TFR)) channelLayout |= AV_CH_TOP_FRONT_RIGHT; -+ if (info.HasChannel(AE_CH_TBL)) channelLayout |= AV_CH_TOP_BACK_LEFT; -+ if (info.HasChannel(AE_CH_TBC)) channelLayout |= AV_CH_TOP_BACK_CENTER; -+ if (info.HasChannel(AE_CH_TBR)) channelLayout |= AV_CH_TOP_BACK_RIGHT; -+ -+ return channelLayout; -+} -+ -+AVSampleFormat CAEUtil::GetAVSampleFormat(AEDataFormat format) -+{ -+ if (format == AE_FMT_U8) return AV_SAMPLE_FMT_U8; -+ else if (format == AE_FMT_S16NE) return AV_SAMPLE_FMT_S16; -+ else if (format == AE_FMT_S32NE) return AV_SAMPLE_FMT_S32; -+ else if (format == AE_FMT_S24NE4) return AV_SAMPLE_FMT_S32; -+ else if (format == AE_FMT_S24NE4MSB)return AV_SAMPLE_FMT_S32; -+ else if (format == AE_FMT_S24NE3) return AV_SAMPLE_FMT_S32; -+ else if (format == AE_FMT_FLOAT) return AV_SAMPLE_FMT_FLT; -+ else if (format == AE_FMT_DOUBLE) return AV_SAMPLE_FMT_DBL; -+ -+ else if (format == AE_FMT_U8P) return AV_SAMPLE_FMT_U8P; -+ else if (format == AE_FMT_S16NEP) return AV_SAMPLE_FMT_S16P; -+ else if (format == AE_FMT_S32NEP) return AV_SAMPLE_FMT_S32P; -+ else if (format == AE_FMT_S24NE4P) return AV_SAMPLE_FMT_S32P; -+ else if (format == AE_FMT_S24NE4MSBP)return AV_SAMPLE_FMT_S32P; -+ else if (format == AE_FMT_S24NE3P) return AV_SAMPLE_FMT_S32P; -+ else if (format == AE_FMT_FLOATP) return AV_SAMPLE_FMT_FLTP; -+ else if (format == AE_FMT_DOUBLEP) return AV_SAMPLE_FMT_DBLP; -+ -+ if (AE_IS_PLANAR(format)) -+ return AV_SAMPLE_FMT_FLTP; -+ else -+ return AV_SAMPLE_FMT_FLT; -+} -+ -+uint64_t CAEUtil::GetAVChannel(enum AEChannel aechannel) -+{ -+ switch (aechannel) -+ { -+ case AE_CH_FL: return AV_CH_FRONT_LEFT; -+ case AE_CH_FR: return AV_CH_FRONT_RIGHT; -+ case AE_CH_FC: return AV_CH_FRONT_CENTER; -+ case AE_CH_LFE: return AV_CH_LOW_FREQUENCY; -+ case AE_CH_BL: return AV_CH_BACK_LEFT; -+ case AE_CH_BR: return AV_CH_BACK_RIGHT; -+ case AE_CH_FLOC: return AV_CH_FRONT_LEFT_OF_CENTER; -+ case AE_CH_FROC: return AV_CH_FRONT_RIGHT_OF_CENTER; -+ case AE_CH_BC: return AV_CH_BACK_CENTER; -+ case AE_CH_SL: return AV_CH_SIDE_LEFT; -+ case AE_CH_SR: return AV_CH_SIDE_RIGHT; -+ case AE_CH_TC: return AV_CH_TOP_CENTER; -+ case AE_CH_TFL: return AV_CH_TOP_FRONT_LEFT; -+ case AE_CH_TFC: return AV_CH_TOP_FRONT_CENTER; -+ case AE_CH_TFR: return AV_CH_TOP_FRONT_RIGHT; -+ case AE_CH_TBL: return AV_CH_TOP_BACK_LEFT; -+ case AE_CH_TBC: return AV_CH_TOP_BACK_CENTER; -+ case AE_CH_TBR: return AV_CH_TOP_BACK_RIGHT; -+ default: -+ return 0; -+ } -+} -+ -+int CAEUtil::GetAVChannelIndex(enum AEChannel aechannel, uint64_t layout) -+{ -+ return av_get_channel_layout_channel_index(layout, GetAVChannel(aechannel)); -+} -diff --git a/xbmc/cores/AudioEngine/Utils/AEUtil.h b/xbmc/cores/AudioEngine/Utils/AEUtil.h -index 039cd69..3e0390c 100644 ---- a/xbmc/cores/AudioEngine/Utils/AEUtil.h -+++ b/xbmc/cores/AudioEngine/Utils/AEUtil.h -@@ -23,6 +23,10 @@ - #include "PlatformDefs.h" - #include - -+extern "C" { -+#include "libavutil/samplefmt.h" -+} -+ - #ifdef TARGET_WINDOWS - #if _M_IX86_FP>0 && !defined(__SSE__) - #define __SSE__ -@@ -221,4 +225,9 @@ class CAEUtil - static void FloatRand4(const float min, const float max, float result[4], __m128 *sseresult = NULL); - - static bool S16NeedsByteSwap(AEDataFormat in, AEDataFormat out); -+ -+ static uint64_t GetAVChannelLayout(CAEChannelInfo &info); -+ static AVSampleFormat GetAVSampleFormat(AEDataFormat format); -+ static uint64_t GetAVChannel(enum AEChannel aechannel); -+ static int GetAVChannelIndex(enum AEChannel aechannel, uint64_t layout); - }; -diff --git a/xbmc/cores/paplayer/DVDPlayerCodec.cpp b/xbmc/cores/paplayer/DVDPlayerCodec.cpp -index c619b32..a85a7bc 100644 ---- a/xbmc/cores/paplayer/DVDPlayerCodec.cpp -+++ b/xbmc/cores/paplayer/DVDPlayerCodec.cpp -@@ -235,16 +235,16 @@ bool DVDPlayerCodec::Init(const std::string &strFile, unsigned int filecache) - { - m_needConvert = true; - m_pResampler = new ActiveAE::CActiveAEResample(); -- m_pResampler->Init(ActiveAE::CActiveAEResample::GetAVChannelLayout(m_ChannelInfo), -+ m_pResampler->Init(CAEUtil::GetAVChannelLayout(m_ChannelInfo), - m_ChannelInfo.Count(), - m_SampleRate, -- ActiveAE::CActiveAEResample::GetAVSampleFormat(AE_FMT_FLOAT), -+ CAEUtil::GetAVSampleFormat(AE_FMT_FLOAT), - CAEUtil::DataFormatToUsedBits(AE_FMT_FLOAT), - CAEUtil::DataFormatToDitherBits(AE_FMT_FLOAT), -- ActiveAE::CActiveAEResample::GetAVChannelLayout(m_ChannelInfo), -+ CAEUtil::GetAVChannelLayout(m_ChannelInfo), - m_ChannelInfo.Count(), - m_SampleRate, -- ActiveAE::CActiveAEResample::GetAVSampleFormat(m_DataFormat), -+ CAEUtil::GetAVSampleFormat(m_DataFormat), - CAEUtil::DataFormatToUsedBits(m_DataFormat), - CAEUtil::DataFormatToDitherBits(m_DataFormat), - false, - -From 91916182e9ea47016b5e4e2828abb14b4d14b505 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sat, 4 Oct 2014 22:52:07 +0100 -Subject: [PATCH 83/96] [AE] Add factory for AEResampler - ---- - xbmc/cores/AudioEngine/AEResampleFactory.cpp | 32 +++++++++++++++ - xbmc/cores/AudioEngine/AEResampleFactory.h | 35 ++++++++++++++++ - .../AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 3 +- - xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h | 4 +- - .../Engines/ActiveAE/ActiveAEBuffer.cpp | 5 ++- - .../AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h | 4 +- - .../Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp | 31 +++++++------- - .../Engines/ActiveAE/ActiveAEResampleFFMPEG.h | 13 +++--- - .../AudioEngine/Engines/ActiveAE/ActiveAESink.cpp | 8 ++-- - .../AudioEngine/Engines/ActiveAE/ActiveAESink.h | 3 +- - .../AudioEngine/Engines/ActiveAE/ActiveAESound.h | 1 - - .../Engines/ActiveAE/ActiveAEStream.cpp | 3 +- - .../AudioEngine/Engines/ActiveAE/ActiveAEStream.h | 2 +- - xbmc/cores/AudioEngine/Interfaces/AEResample.h | 47 ++++++++++++++++++++++ - xbmc/cores/AudioEngine/Makefile.in | 2 + - xbmc/cores/paplayer/DVDPlayerCodec.cpp | 4 +- - xbmc/cores/paplayer/DVDPlayerCodec.h | 4 +- - 17 files changed, 164 insertions(+), 37 deletions(-) - create mode 100644 xbmc/cores/AudioEngine/AEResampleFactory.cpp - create mode 100644 xbmc/cores/AudioEngine/AEResampleFactory.h - create mode 100644 xbmc/cores/AudioEngine/Interfaces/AEResample.h - -diff --git a/xbmc/cores/AudioEngine/AEResampleFactory.cpp b/xbmc/cores/AudioEngine/AEResampleFactory.cpp -new file mode 100644 -index 0000000..d135054 ---- /dev/null -+++ b/xbmc/cores/AudioEngine/AEResampleFactory.cpp -@@ -0,0 +1,32 @@ -+/* -+ * Copyright (C) 2010-2013 Team XBMC -+ * http://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 -+ * . -+ * -+ */ -+ -+#include "AEResampleFactory.h" -+#include "cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.h" -+ -+namespace ActiveAE -+{ -+ -+IAEResample *CAEResampleFactory::Create() -+{ -+ return new CActiveAEResampleFFMPEG(); -+} -+ -+} -diff --git a/xbmc/cores/AudioEngine/AEResampleFactory.h b/xbmc/cores/AudioEngine/AEResampleFactory.h -new file mode 100644 -index 0000000..10b551e ---- /dev/null -+++ b/xbmc/cores/AudioEngine/AEResampleFactory.h -@@ -0,0 +1,35 @@ -+#pragma once -+/* -+ * Copyright (C) 2010-2013 Team XBMC -+ * http://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 -+ * . -+ * -+ */ -+ -+#include "cores/AudioEngine/Interfaces/AEResample.h" -+ -+class IAEResample; -+ -+namespace ActiveAE -+{ -+ -+class CAEResampleFactory -+{ -+public: -+ static IAEResample *Create(); -+}; -+ -+} -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -index e30f105..a854ab3 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -@@ -24,6 +24,7 @@ using namespace ActiveAE; - #include "ActiveAESound.h" - #include "ActiveAEStream.h" - #include "cores/AudioEngine/Utils/AEUtil.h" -+#include "cores/AudioEngine/AEResampleFactory.h" - #include "cores/AudioEngine/Encoders/AEEncoderFFmpeg.h" - - #include "settings/Settings.h" -@@ -2683,7 +2684,7 @@ bool CActiveAE::ResampleSound(CActiveAESound *sound) - dst_config.bits_per_sample = CAEUtil::DataFormatToUsedBits(m_internalFormat.m_dataFormat); - dst_config.dither_bits = CAEUtil::DataFormatToDitherBits(m_internalFormat.m_dataFormat); - -- CActiveAEResample *resampler = new CActiveAEResample(); -+ IAEResample *resampler = CAEResampleFactory::Create(); - resampler->Init(dst_config.channel_layout, - dst_config.channels, - dst_config.sample_rate, -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h -index de94850..1d12c1b 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h -@@ -23,10 +23,12 @@ - #include "threads/Thread.h" - - #include "ActiveAESink.h" --#include "ActiveAEResample.h" -+#include "cores/AudioEngine/Interfaces/AEResample.h" - #include "cores/AudioEngine/Interfaces/AEStream.h" - #include "cores/AudioEngine/Interfaces/AESound.h" - #include "cores/AudioEngine/AEFactory.h" -+#include "cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h" -+ - #include "guilib/DispResource.h" - #include - -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp -index 15bd898..e40ac2e 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp -@@ -22,6 +22,7 @@ - #include "cores/AudioEngine/AEFactory.h" - #include "cores/AudioEngine/Engines/ActiveAE/ActiveAE.h" - #include "cores/AudioEngine/Utils/AEUtil.h" -+#include "cores/AudioEngine/AEResampleFactory.h" - - using namespace ActiveAE; - -@@ -171,7 +172,7 @@ bool CActiveAEBufferPoolResample::Create(unsigned int totaltime, bool remap, boo - m_inputFormat.m_dataFormat != m_format.m_dataFormat || - m_changeResampler) - { -- m_resampler = new CActiveAEResample(); -+ m_resampler = CAEResampleFactory::Create(); - m_resampler->Init(CAEUtil::GetAVChannelLayout(m_format.m_channelLayout), - m_format.m_channelLayout.Count(), - m_format.m_sampleRate, -@@ -199,7 +200,7 @@ void CActiveAEBufferPoolResample::ChangeResampler() - { - delete m_resampler; - -- m_resampler = new CActiveAEResample(); -+ m_resampler = CAEResampleFactory::Create(); - m_resampler->Init(CAEUtil::GetAVChannelLayout(m_format.m_channelLayout), - m_format.m_channelLayout.Count(), - m_format.m_sampleRate, -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h -index b0912be..961db98 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h -@@ -89,7 +89,7 @@ class CActiveAEBufferPool - std::deque m_freeSamples; - }; - --class CActiveAEResample; -+class IAEResample; - - class CActiveAEBufferPoolResample : public CActiveAEBufferPool - { -@@ -105,7 +105,7 @@ class CActiveAEBufferPoolResample : public CActiveAEBufferPool - std::deque m_inputSamples; - std::deque m_outputSamples; - CSampleBuffer *m_procSample; -- CActiveAEResample *m_resampler; -+ IAEResample *m_resampler; - uint8_t *m_planes[16]; - bool m_fillPackets; - bool m_drain; -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp -index de08de9..26f0140 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp -@@ -19,6 +19,7 @@ - */ - - #include "cores/AudioEngine/Utils/AEUtil.h" -+#include "ActiveAEResampleFFMPEG.h" - #include "utils/log.h" - - extern "C" { -@@ -29,19 +30,19 @@ extern "C" { - - using namespace ActiveAE; - --CActiveAEResample::CActiveAEResample() -+CActiveAEResampleFFMPEG::CActiveAEResampleFFMPEG() - { - m_pContext = NULL; - m_loaded = true; - } - --CActiveAEResample::~CActiveAEResample() -+CActiveAEResampleFFMPEG::~CActiveAEResampleFFMPEG() - { - if (m_pContext) - swr_free(&m_pContext); - } - --bool CActiveAEResample::Init(uint64_t dst_chan_layout, int dst_channels, int dst_rate, AVSampleFormat dst_fmt, int dst_bits, int dst_dither, uint64_t src_chan_layout, int src_channels, int src_rate, AVSampleFormat src_fmt, int src_bits, int src_dither, bool upmix, bool normalize, CAEChannelInfo *remapLayout, AEQuality quality) -+bool CActiveAEResampleFFMPEG::Init(uint64_t dst_chan_layout, int dst_channels, int dst_rate, AVSampleFormat dst_fmt, int dst_bits, int dst_dither, uint64_t src_chan_layout, int src_channels, int src_rate, AVSampleFormat src_fmt, int src_bits, int src_dither, bool upmix, bool normalize, CAEChannelInfo *remapLayout, AEQuality quality) - { - if (!m_loaded) - return false; -@@ -70,7 +71,7 @@ bool CActiveAEResample::Init(uint64_t dst_chan_layout, int dst_channels, int dst - - if(!m_pContext) - { -- CLog::Log(LOGERROR, "CActiveAEResample::Init - create context failed"); -+ CLog::Log(LOGERROR, "CActiveAEResampleFFMPEG::Init - create context failed"); - return false; - } - -@@ -127,7 +128,7 @@ bool CActiveAEResample::Init(uint64_t dst_chan_layout, int dst_channels, int dst - - if (swr_set_matrix(m_pContext, (const double*)m_rematrix, AE_CH_MAX) < 0) - { -- CLog::Log(LOGERROR, "CActiveAEResample::Init - setting channel matrix failed"); -+ CLog::Log(LOGERROR, "CActiveAEResampleFFMPEG::Init - setting channel matrix failed"); - return false; - } - } -@@ -165,20 +166,20 @@ bool CActiveAEResample::Init(uint64_t dst_chan_layout, int dst_channels, int dst - - if (swr_set_matrix(m_pContext, (const double*)m_rematrix, AE_CH_MAX) < 0) - { -- CLog::Log(LOGERROR, "CActiveAEResample::Init - setting channel matrix failed"); -+ CLog::Log(LOGERROR, "CActiveAEResampleFFMPEG::Init - setting channel matrix failed"); - return false; - } - } - - if(swr_init(m_pContext) < 0) - { -- CLog::Log(LOGERROR, "CActiveAEResample::Init - init resampler failed"); -+ CLog::Log(LOGERROR, "CActiveAEResampleFFMPEG::Init - init resampler failed"); - return false; - } - return true; - } - --int CActiveAEResample::Resample(uint8_t **dst_buffer, int dst_samples, uint8_t **src_buffer, int src_samples, double ratio) -+int CActiveAEResampleFFMPEG::Resample(uint8_t **dst_buffer, int dst_samples, uint8_t **src_buffer, int src_samples, double ratio) - { - if (ratio != 1.0) - { -@@ -186,7 +187,7 @@ int CActiveAEResample::Resample(uint8_t **dst_buffer, int dst_samples, uint8_t * - (dst_samples*ratio-dst_samples)*m_dst_rate/m_src_rate, - dst_samples*m_dst_rate/m_src_rate) < 0) - { -- CLog::Log(LOGERROR, "CActiveAEResample::Resample - set compensation failed"); -+ CLog::Log(LOGERROR, "CActiveAEResampleFFMPEG::Resample - set compensation failed"); - return 0; - } - } -@@ -194,7 +195,7 @@ int CActiveAEResample::Resample(uint8_t **dst_buffer, int dst_samples, uint8_t * - int ret = swr_convert(m_pContext, dst_buffer, dst_samples, (const uint8_t**)src_buffer, src_samples); - if (ret < 0) - { -- CLog::Log(LOGERROR, "CActiveAEResample::Resample - resample failed"); -+ CLog::Log(LOGERROR, "CActiveAEResampleFFMPEG::Resample - resample failed"); - return 0; - } - -@@ -251,28 +252,28 @@ int CActiveAEResample::Resample(uint8_t **dst_buffer, int dst_samples, uint8_t * - return ret; - } - --int64_t CActiveAEResample::GetDelay(int64_t base) -+int64_t CActiveAEResampleFFMPEG::GetDelay(int64_t base) - { - return swr_get_delay(m_pContext, base); - } - --int CActiveAEResample::GetBufferedSamples() -+int CActiveAEResampleFFMPEG::GetBufferedSamples() - { - return av_rescale_rnd(swr_get_delay(m_pContext, m_src_rate), - m_dst_rate, m_src_rate, AV_ROUND_UP); - } - --int CActiveAEResample::CalcDstSampleCount(int src_samples, int dst_rate, int src_rate) -+int CActiveAEResampleFFMPEG::CalcDstSampleCount(int src_samples, int dst_rate, int src_rate) - { - return av_rescale_rnd(src_samples, dst_rate, src_rate, AV_ROUND_UP); - } - --int CActiveAEResample::GetSrcBufferSize(int samples) -+int CActiveAEResampleFFMPEG::GetSrcBufferSize(int samples) - { - return av_samples_get_buffer_size(NULL, m_src_channels, samples, m_src_fmt, 1); - } - --int CActiveAEResample::GetDstBufferSize(int samples) -+int CActiveAEResampleFFMPEG::GetDstBufferSize(int samples) - { - return av_samples_get_buffer_size(NULL, m_dst_channels, samples, m_dst_fmt, 1); - } -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.h -index f9bdfec..1b35f59 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.h -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.h -@@ -20,20 +20,23 @@ - */ - - #include "cores/AudioEngine/Interfaces/AE.h" -+#include "cores/AudioEngine/Interfaces/AEResample.h" - - extern "C" { --#include "libavutil/avutil.h" --#include "libswresample/swresample.h" -+#include "libavutil/samplefmt.h" - } - -+struct SwrContext; -+ - namespace ActiveAE - { - --class CActiveAEResample -+class CActiveAEResampleFFMPEG : public IAEResample - { - public: -- CActiveAEResample(); -- virtual ~CActiveAEResample(); -+ const char *GetName() { return "ActiveAEResampleFFMPEG"; } -+ CActiveAEResampleFFMPEG(); -+ virtual ~CActiveAEResampleFFMPEG(); - bool Init(uint64_t dst_chan_layout, int dst_channels, int dst_rate, AVSampleFormat dst_fmt, int dst_bits, int dst_dither, uint64_t src_chan_layout, int src_channels, int src_rate, AVSampleFormat src_fmt, int src_bits, int src_dither, bool upmix, bool normalize, CAEChannelInfo *remapLayout, AEQuality quality); - int Resample(uint8_t **dst_buffer, int dst_samples, uint8_t **src_buffer, int src_samples, double ratio); - int64_t GetDelay(int64_t base); -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp -index 6d4d3b1..9111593 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp -@@ -24,6 +24,7 @@ - #include "cores/AudioEngine/Utils/AEUtil.h" - #include "utils/EndianSwap.h" - #include "ActiveAE.h" -+#include "cores/AudioEngine/AEResampleFactory.h" - - #include "settings/Settings.h" - -@@ -890,8 +891,8 @@ void CActiveAESink::GenerateNoise() - } - - SampleConfig config = m_sampleOfSilence.pkt->config; -- CActiveAEResample resampler; -- resampler.Init(config.channel_layout, -+ IAEResample *resampler = CAEResampleFactory::Create(); -+ resampler->Init(config.channel_layout, - config.channels, - config.sample_rate, - config.fmt, -@@ -904,10 +905,11 @@ void CActiveAESink::GenerateNoise() - CAEUtil::DataFormatToUsedBits(m_sinkFormat.m_dataFormat), - CAEUtil::DataFormatToDitherBits(m_sinkFormat.m_dataFormat), - false, false, NULL, AE_QUALITY_UNKNOWN); -- resampler.Resample(m_sampleOfSilence.pkt->data, m_sampleOfSilence.pkt->max_nb_samples, -+ resampler->Resample(m_sampleOfSilence.pkt->data, m_sampleOfSilence.pkt->max_nb_samples, - (uint8_t**)&noise, m_sampleOfSilence.pkt->max_nb_samples, 1.0); - - _aligned_free(noise); -+ delete resampler; - #endif - } - -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.h -index 0650a70..6edfe11 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.h -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.h -@@ -25,7 +25,8 @@ - #include "cores/AudioEngine/Interfaces/AE.h" - #include "cores/AudioEngine/Interfaces/AESink.h" - #include "cores/AudioEngine/AESinkFactory.h" --#include "cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.h" -+#include "cores/AudioEngine/Interfaces/AEResample.h" -+#include "cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h" - - namespace ActiveAE - { -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESound.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESound.h -index 01aafe3..53823fe 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESound.h -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESound.h -@@ -20,7 +20,6 @@ - */ - - #include "cores/AudioEngine/Interfaces/AESound.h" --#include "cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.h" - #include "filesystem/File.h" - - class DllAvUtil; -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp -index e9a292f..96bce12 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp -@@ -25,6 +25,7 @@ - - #include "cores/AudioEngine/AEFactory.h" - #include "cores/AudioEngine/Utils/AEUtil.h" -+#include "cores/AudioEngine/AEResampleFactory.h" - - #include "ActiveAE.h" - #include "ActiveAEStream.h" -@@ -106,7 +107,7 @@ void CActiveAEStream::InitRemapper() - { - CLog::Log(LOGDEBUG, "CActiveAEStream::%s - initialize remapper", __FUNCTION__); - -- m_remapper = new CActiveAEResample(); -+ m_remapper = CAEResampleFactory::Create(); - uint64_t avLayout = CAEUtil::GetAVChannelLayout(m_format.m_channelLayout); - - // build layout according to ffmpeg channel order -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.h -index 70e8107..09fda0f 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.h -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.h -@@ -98,7 +98,7 @@ class CActiveAEStream : public IAEStream - int m_leftoverBytes; - CSampleBuffer *m_currentBuffer; - CSoundPacket *m_remapBuffer; -- CActiveAEResample *m_remapper; -+ IAEResample *m_remapper; - int m_clockId; - - // only accessed by engine -diff --git a/xbmc/cores/AudioEngine/Interfaces/AEResample.h b/xbmc/cores/AudioEngine/Interfaces/AEResample.h -new file mode 100644 -index 0000000..cef43de ---- /dev/null -+++ b/xbmc/cores/AudioEngine/Interfaces/AEResample.h -@@ -0,0 +1,47 @@ -+#pragma once -+/* -+ * Copyright (C) 2010-2013 Team XBMC -+ * http://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 -+ * . -+ * -+ */ -+ -+#include "cores/AudioEngine/Interfaces/AE.h" -+ -+extern "C" { -+#include "libavutil/samplefmt.h" -+} -+ -+namespace ActiveAE -+{ -+ -+class IAEResample -+{ -+public: -+ /* return the name of this sync for logging */ -+ virtual const char *GetName() = 0; -+ IAEResample() {} -+ virtual ~IAEResample() {} -+ virtual bool Init(uint64_t dst_chan_layout, int dst_channels, int dst_rate, AVSampleFormat dst_fmt, int dst_bits, int dst_dither, uint64_t src_chan_layout, int src_channels, int src_rate, AVSampleFormat src_fmt, int src_bits, int src_dither, bool upmix, bool normalize, CAEChannelInfo *remapLayout, AEQuality quality) = 0; -+ virtual int Resample(uint8_t **dst_buffer, int dst_samples, uint8_t **src_buffer, int src_samples, double ratio) = 0; -+ virtual int64_t GetDelay(int64_t base) = 0; -+ virtual int GetBufferedSamples() = 0; -+ virtual int CalcDstSampleCount(int src_samples, int dst_rate, int src_rate) = 0; -+ virtual int GetSrcBufferSize(int samples) = 0; -+ virtual int GetDstBufferSize(int samples) = 0; -+}; -+ -+} -diff --git a/xbmc/cores/AudioEngine/Makefile.in b/xbmc/cores/AudioEngine/Makefile.in -index 7e9b415..b58db3e 100644 ---- a/xbmc/cores/AudioEngine/Makefile.in -+++ b/xbmc/cores/AudioEngine/Makefile.in -@@ -26,6 +26,8 @@ SRCS += Sinks/AESinkProfiler.cpp - - SRCS += Sinks/AESinkPi.cpp - -+SRCS += AEResampleFactory.cpp -+ - SRCS += Engines/ActiveAE/ActiveAE.cpp - SRCS += Engines/ActiveAE/ActiveAESink.cpp - SRCS += Engines/ActiveAE/ActiveAEStream.cpp -diff --git a/xbmc/cores/paplayer/DVDPlayerCodec.cpp b/xbmc/cores/paplayer/DVDPlayerCodec.cpp -index a85a7bc..fd7716b 100644 ---- a/xbmc/cores/paplayer/DVDPlayerCodec.cpp -+++ b/xbmc/cores/paplayer/DVDPlayerCodec.cpp -@@ -20,7 +20,7 @@ - - #include "DVDPlayerCodec.h" - #include "cores/AudioEngine/Utils/AEUtil.h" --#include "cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.h" -+#include "cores/AudioEngine/AEResampleFactory.h" - - #include "cores/dvdplayer/DVDInputStreams/DVDFactoryInputStream.h" - #include "cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.h" -@@ -234,7 +234,7 @@ bool DVDPlayerCodec::Init(const std::string &strFile, unsigned int filecache) - if (NeedConvert(m_DataFormat)) - { - m_needConvert = true; -- m_pResampler = new ActiveAE::CActiveAEResample(); -+ m_pResampler = ActiveAE::CAEResampleFactory::Create(); - m_pResampler->Init(CAEUtil::GetAVChannelLayout(m_ChannelInfo), - m_ChannelInfo.Count(), - m_SampleRate, -diff --git a/xbmc/cores/paplayer/DVDPlayerCodec.h b/xbmc/cores/paplayer/DVDPlayerCodec.h -index 469e2ff..576fb97 100644 ---- a/xbmc/cores/paplayer/DVDPlayerCodec.h -+++ b/xbmc/cores/paplayer/DVDPlayerCodec.h -@@ -29,7 +29,7 @@ - - namespace ActiveAE - { -- class CActiveAEResample; -+ class IAEResample; - }; - - class DVDPlayerCodec : public ICodec -@@ -71,7 +71,7 @@ class DVDPlayerCodec : public ICodec - bool m_bInited; - bool m_bCanSeek; - -- ActiveAE::CActiveAEResample *m_pResampler; -+ ActiveAE::IAEResample *m_pResampler; - uint8_t *m_audioPlanes[8]; - int m_planes; - bool m_needConvert; - -From 7b81a7be2947eefbac1d285fe2b360658dfd08f0 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 30 Dec 2013 12:02:14 +0000 -Subject: [PATCH 84/96] [rbp] Hardware accelerated resampling - -This replaces the format conversion, up/down mixing and resampling code from ActiveAE with a GPU accelerated version. -Should significantly reduce CPU when using paplayer or dvdplayer. - -Requires updated firmware ---- - xbmc/cores/AudioEngine/AEResampleFactory.cpp | 3 + - .../Engines/ActiveAE/ActiveAEResamplePi.cpp | 563 +++++++++++++++++++++ - .../Engines/ActiveAE/ActiveAEResamplePi.h | 59 +++ - xbmc/cores/AudioEngine/Makefile.in | 1 + - 4 files changed, 626 insertions(+) - create mode 100644 xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp - create mode 100644 xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h - -diff --git a/xbmc/cores/AudioEngine/AEResampleFactory.cpp b/xbmc/cores/AudioEngine/AEResampleFactory.cpp -index d135054..fee947c 100644 ---- a/xbmc/cores/AudioEngine/AEResampleFactory.cpp -+++ b/xbmc/cores/AudioEngine/AEResampleFactory.cpp -@@ -20,6 +20,9 @@ - - #include "AEResampleFactory.h" - #include "cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.h" -+#if defined(TARGET_RASPBERRY_PI) -+ #include "cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h" -+#endif - - namespace ActiveAE - { -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -new file mode 100644 -index 0000000..a50b5ad ---- /dev/null -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -@@ -0,0 +1,563 @@ -+/* -+ * Copyright (C) 2010-2013 Team XBMC -+ * http://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 -+ * . -+ * -+ */ -+ -+#include "system.h" -+ -+#if defined(TARGET_RASPBERRY_PI) -+ -+#include "cores/AudioEngine/Utils/AEUtil.h" -+#include "ActiveAEResamplePi.h" -+#include "settings/Settings.h" -+#include "utils/log.h" -+#include "linux/RBP.h" -+ -+extern "C" { -+#include "libavutil/channel_layout.h" -+#include "libavutil/opt.h" -+#include "libswresample/swresample.h" -+} -+ -+//#define DEBUG_VERBOSE -+ -+#define CLASSNAME "CActiveAEResamplePi" -+ -+#define BUFFERSIZE (32*1024*2*8) -+ -+//#define BENCHMARKING -+#ifdef BENCHMARKING -+#define LOGTIMEINIT(f) \ -+ struct timespec now; \ -+ uint64_t Start, End; \ -+ clock_gettime(CLOCK_MONOTONIC, &now); \ -+ Start = ((int64_t)now.tv_sec * 1000000000L) + now.tv_nsec; \ -+ const char *_filename = f; -+ -+#define LOGTIME(n) \ -+ clock_gettime(CLOCK_MONOTONIC, &now); \ -+ End = ((int64_t)now.tv_sec * 1000000000L) + now.tv_nsec; \ -+ CLog::Log(LOGNOTICE, "ActiveAE::%s %d - resample %s took %.0fms", __FUNCTION__, n, _filename, (End-Start)*1e-6); \ -+ Start=End; -+#else -+#define LOGTIMEINIT(f) -+#define LOGTIME(n) -+#endif -+ -+using namespace ActiveAE; -+ -+CActiveAEResamplePi::CActiveAEResamplePi() -+{ -+ CLog::Log(LOGINFO, "%s::%s", CLASSNAME, __func__); -+ -+ m_Initialized = false; -+ m_last_src_fmt = AV_SAMPLE_FMT_NONE; -+ m_last_dst_fmt = AV_SAMPLE_FMT_NONE; -+ m_last_src_channels = 0; -+ m_last_dst_channels = 0; -+ m_encoded_buffer = NULL; -+} -+ -+CActiveAEResamplePi::~CActiveAEResamplePi() -+{ -+ CLog::Log(LOGINFO, "%s::%s", CLASSNAME, __func__); -+ DeInit(); -+} -+ -+void CActiveAEResamplePi::DeInit() -+{ -+ CLog::Log(LOGDEBUG, "%s:%s", CLASSNAME, __func__); -+ if (m_Initialized) -+ { -+ m_omx_mixer.FlushAll(); -+ m_omx_mixer.Deinitialize(); -+ m_Initialized = false; -+ } -+} -+ -+static int format_to_bits(AVSampleFormat fmt) -+{ -+ switch (fmt) -+ { -+ case AV_SAMPLE_FMT_U8: -+ case AV_SAMPLE_FMT_U8P: -+ return 8; -+ case AV_SAMPLE_FMT_S16: -+ case AV_SAMPLE_FMT_S16P: -+ return 16; -+ case AV_SAMPLE_FMT_S32: -+ case AV_SAMPLE_FMT_S32P: -+ case AV_SAMPLE_FMT_FLT: -+ case AV_SAMPLE_FMT_FLTP: -+ return 32; -+ default: -+ assert(0); -+ } -+ return 0; -+} -+ -+bool CActiveAEResamplePi::Init(uint64_t dst_chan_layout, int dst_channels, int dst_rate, AVSampleFormat dst_fmt, int dst_bits, int dst_dither, uint64_t src_chan_layout, int src_channels, int src_rate, AVSampleFormat src_fmt, int src_bits, int src_dither, bool upmix, bool normalize, CAEChannelInfo *remapLayout, AEQuality quality) -+{ -+ LOGTIMEINIT("x"); -+ -+ CLog::Log(LOGINFO, "%s::%s remap:%p chan:%d->%d rate:%d->%d format:%d->%d bits:%d->%d norm:%d upmix:%d", CLASSNAME, __func__, remapLayout, src_channels, dst_channels, src_rate, dst_rate, src_fmt, dst_fmt, src_bits, dst_bits, normalize, upmix); -+ -+ // replace passed in number of bits with correct ones -+ src_bits = format_to_bits(src_fmt); -+ dst_bits = format_to_bits(dst_fmt); -+ -+ m_dst_chan_layout = dst_chan_layout; -+ m_dst_channels = dst_channels; -+ m_dst_rate = dst_rate; -+ m_dst_fmt = dst_fmt; -+ m_dst_bits = dst_bits; -+ m_src_chan_layout = src_chan_layout; -+ m_src_channels = src_channels; -+ m_src_rate = src_rate; -+ m_src_fmt = src_fmt; -+ m_src_bits = src_bits; -+ -+ if (m_dst_chan_layout == 0) -+ m_dst_chan_layout = av_get_default_channel_layout(m_dst_channels); -+ if (m_src_chan_layout == 0) -+ m_src_chan_layout = av_get_default_channel_layout(m_src_channels); -+ -+ OMX_CONFIG_BRCMAUDIODOWNMIXCOEFFICIENTS8x8 mix; -+ OMX_INIT_STRUCTURE(mix); -+ -+ assert(sizeof(mix.coeff)/sizeof(mix.coeff[0]) == 64); -+ -+ LOGTIME(1); -+// this code is just uses ffmpeg to produce the 8x8 mixing matrix -+{ -+ // dummy sample rate and format, as we only care about channel mapping -+ SwrContext *m_pContext = swr_alloc_set_opts(NULL, m_dst_chan_layout, AV_SAMPLE_FMT_FLT, 48000, -+ m_src_chan_layout, AV_SAMPLE_FMT_FLT, 48000, 0, NULL); -+ if (!m_pContext) -+ { -+ CLog::Log(LOGERROR, "CActiveAEResamplePi::Init - create context failed"); -+ return false; -+ } -+ // tell resampler to clamp float values -+ // not required for sink stage (remapLayout == true) -+ if (!remapLayout && normalize) -+ { -+ av_opt_set_double(m_pContext, "rematrix_maxval", 1.0, 0); -+ } -+ -+ if (remapLayout) -+ { -+ // one-to-one mapping of channels -+ // remapLayout is the layout of the sink, if the channel is in our src layout -+ // the channel is mapped by setting coef 1.0 -+ double m_rematrix[AE_CH_MAX][AE_CH_MAX]; -+ memset(m_rematrix, 0, sizeof(m_rematrix)); -+ m_dst_chan_layout = 0; -+ for (unsigned int out=0; outCount(); out++) -+ { -+ m_dst_chan_layout += (uint64_t) (1 << out); -+ int idx = CAEUtil::GetAVChannelIndex((*remapLayout)[out], m_src_chan_layout); -+ if (idx >= 0) -+ { -+ m_rematrix[out][idx] = 1.0; -+ } -+ } -+ -+ av_opt_set_int(m_pContext, "out_channel_count", m_dst_channels, 0); -+ av_opt_set_int(m_pContext, "out_channel_layout", m_dst_chan_layout, 0); -+ -+ if (swr_set_matrix(m_pContext, (const double*)m_rematrix, AE_CH_MAX) < 0) -+ { -+ CLog::Log(LOGERROR, "CActiveAEResamplePi::Init - setting channel matrix failed"); -+ return false; -+ } -+ } -+ // stereo upmix -+ else if (upmix && m_src_channels == 2 && m_dst_channels > 2) -+ { -+ double m_rematrix[AE_CH_MAX][AE_CH_MAX]; -+ memset(m_rematrix, 0, sizeof(m_rematrix)); -+ for (int out=0; out 192000 || dst_rate > 192000) -+ src_rate >>= 1, dst_rate >>= 1; -+ -+ OMX_INIT_STRUCTURE(m_pcm_input); -+ m_pcm_input.nPortIndex = m_omx_mixer.GetInputPort(); -+ m_pcm_input.eNumData = OMX_NumericalDataSigned; -+ m_pcm_input.eEndian = OMX_EndianLittle; -+ m_pcm_input.bInterleaved = OMX_TRUE; -+ m_pcm_input.nBitPerSample = m_src_bits; -+ // 0x8000 = float, 0x10000 = planar -+ uint32_t flags = 0; -+ if (m_src_fmt == AV_SAMPLE_FMT_FLT || m_src_fmt == AV_SAMPLE_FMT_FLTP) -+ flags |= 0x8000; -+ if (m_src_fmt >= AV_SAMPLE_FMT_U8P) -+ flags |= 0x10000; -+ m_pcm_input.ePCMMode = flags == 0 ? OMX_AUDIO_PCMModeLinear : (OMX_AUDIO_PCMMODETYPE)flags; -+ m_pcm_input.nChannels = src_channels; -+ m_pcm_input.nSamplingRate = src_rate; -+ -+ omx_err = m_omx_mixer.SetParameter(OMX_IndexParamAudioPcm, &m_pcm_input); -+ if (omx_err != OMX_ErrorNone) -+ CLog::Log(LOGERROR, "%s::%s - error m_omx_mixer in SetParameter omx_err(0x%08x)", CLASSNAME, __func__, omx_err); -+ -+ OMX_INIT_STRUCTURE(m_pcm_output); -+ m_pcm_output.nPortIndex = m_omx_mixer.GetOutputPort(); -+ m_pcm_output.eNumData = OMX_NumericalDataSigned; -+ m_pcm_output.eEndian = OMX_EndianLittle; -+ m_pcm_output.bInterleaved = OMX_TRUE; -+ m_pcm_output.nBitPerSample = m_dst_bits; -+ flags = 0; -+ if (m_dst_fmt == AV_SAMPLE_FMT_FLT || m_dst_fmt == AV_SAMPLE_FMT_FLTP) -+ flags |= 0x8000; -+ if (m_dst_fmt >= AV_SAMPLE_FMT_U8P) -+ flags |= 0x10000; -+ m_pcm_output.ePCMMode = flags == 0 ? OMX_AUDIO_PCMModeLinear : (OMX_AUDIO_PCMMODETYPE)flags; -+ m_pcm_output.nChannels = dst_channels; -+ m_pcm_output.nSamplingRate = dst_rate; -+ -+ omx_err = m_omx_mixer.SetParameter(OMX_IndexParamAudioPcm, &m_pcm_output); -+ if (omx_err != OMX_ErrorNone) -+ CLog::Log(LOGERROR, "%s::%s - error m_omx_mixer out SetParameter omx_err(0x%08x)", CLASSNAME, __func__, omx_err); -+ -+ LOGTIME(4); -+ -+ mix.nPortIndex = m_omx_mixer.GetInputPort(); -+ omx_err = m_omx_mixer.SetConfig(OMX_IndexConfigBrcmAudioDownmixCoefficients8x8, &mix); -+ if (omx_err != OMX_ErrorNone) -+ { -+ CLog::Log(LOGERROR, "%s::%s - error setting mixer OMX_IndexConfigBrcmAudioDownmixCoefficients, error 0x%08x\n", -+ CLASSNAME, __func__, omx_err); -+ return false; -+ } -+ -+ // set up the number/size of buffers for decoder input -+ OMX_PARAM_PORTDEFINITIONTYPE port_param; -+ OMX_INIT_STRUCTURE(port_param); -+ port_param.nPortIndex = m_omx_mixer.GetInputPort(); -+ -+ omx_err = m_omx_mixer.GetParameter(OMX_IndexParamPortDefinition, &port_param); -+ if (omx_err != OMX_ErrorNone) -+ CLog::Log(LOGERROR, "%s:%s - error get OMX_IndexParamPortDefinition (input) omx_err(0x%08x)", CLASSNAME, __func__, omx_err); -+ -+ port_param.nBufferCountActual = std::max((unsigned int)port_param.nBufferCountMin, (unsigned int)1); -+ port_param.nBufferSize = BUFFERSIZE; -+ -+ omx_err = m_omx_mixer.SetParameter(OMX_IndexParamPortDefinition, &port_param); -+ if (omx_err != OMX_ErrorNone) -+ CLog::Log(LOGERROR, "%s:%s - error set OMX_IndexParamPortDefinition (input) omx_err(0x%08x)", CLASSNAME, __func__, omx_err); -+ -+ LOGTIME(5); -+ -+ omx_err = m_omx_mixer.AllocInputBuffers(); -+ if (omx_err != OMX_ErrorNone) -+ CLog::Log(LOGERROR, "%s:%s - Error alloc buffers 0x%08x", CLASSNAME, __func__, omx_err); -+ -+ LOGTIME(6); -+ -+ // set up the number/size of buffers for decoder output -+ OMX_INIT_STRUCTURE(port_param); -+ port_param.nPortIndex = m_omx_mixer.GetOutputPort(); -+ -+ omx_err = m_omx_mixer.GetParameter(OMX_IndexParamPortDefinition, &port_param); -+ if (omx_err != OMX_ErrorNone) -+ CLog::Log(LOGERROR, "%s:%s - error get OMX_IndexParamPortDefinition (input) omx_err(0x%08x)", CLASSNAME, __func__, omx_err); -+ -+ port_param.nBufferCountActual = std::max((unsigned int)port_param.nBufferCountMin, (unsigned int)1); -+ port_param.nBufferSize = BUFFERSIZE; -+ -+ omx_err = m_omx_mixer.SetParameter(OMX_IndexParamPortDefinition, &port_param); -+ if (omx_err != OMX_ErrorNone) -+ CLog::Log(LOGERROR, "%s:%s - error set OMX_IndexParamPortDefinition (input) omx_err(0x%08x)", CLASSNAME, __func__, omx_err); -+ -+ LOGTIME(7); -+ -+ omx_err = m_omx_mixer.AllocOutputBuffers(); -+ if (omx_err != OMX_ErrorNone) -+ CLog::Log(LOGERROR, "%s:%s - Error alloc buffers 0x%08x", CLASSNAME, __func__, omx_err); -+ -+ LOGTIME(8); -+ -+ omx_err = m_omx_mixer.SetStateForComponent(OMX_StateExecuting); -+ if (omx_err != OMX_ErrorNone) -+ CLog::Log(LOGERROR, "%s:%s - m_omx_mixer OMX_StateExecuting omx_err(0x%08x)", CLASSNAME, __func__, omx_err); -+ -+ LOGTIME(9); -+ -+ m_Initialized = true; -+ -+ return true; -+} -+ -+ -+static void copy_planes(uint8_t **dst_buffer, int d_pitch, int d_planes, int d_samplesize, int offset, uint8_t *src_buffer, int src_samples) -+{ -+ int planesize = src_samples * d_samplesize / d_planes; -+ for (int i=0; i < d_planes; i++) -+ memcpy(dst_buffer[i] + offset * d_pitch, src_buffer + i * planesize, planesize); -+} -+ -+int CActiveAEResamplePi::Resample(uint8_t **dst_buffer, int dst_samples, uint8_t **src_buffer, int src_samples, double ratio) -+{ -+ #ifdef DEBUG_VERBOSE -+ CLog::Log(LOGINFO, "%s::%s samples:%d->%d (%.2f)", CLASSNAME, __func__, src_samples, dst_samples, ratio); -+ #endif -+ if (!m_Initialized) -+ return 0; -+ OMX_ERRORTYPE omx_err = OMX_ErrorNone; -+ -+ const int s_planes = m_src_fmt >= AV_SAMPLE_FMT_U8P ? m_src_channels : 1; -+ const int d_planes = m_dst_fmt >= AV_SAMPLE_FMT_U8P ? m_dst_channels : 1; -+ const int s_chans = m_src_fmt >= AV_SAMPLE_FMT_U8P ? 1 : m_src_channels; -+ const int d_chans = m_dst_fmt >= AV_SAMPLE_FMT_U8P ? 1 : m_dst_channels; -+ const int s_pitch = s_chans * m_src_bits >> 3; -+ const int d_pitch = d_chans * m_dst_bits >> 3; -+ -+ const int s_samplesize = m_src_channels * m_src_bits >> 3; -+ const int d_samplesize = m_dst_channels * m_dst_bits >> 3; -+ const int max_src_samples = BUFFERSIZE / s_samplesize; -+ const int max_dst_samples = (long long)(BUFFERSIZE / d_samplesize) * m_src_rate / (m_dst_rate + m_src_rate-1); -+ -+ int sent = 0; -+ int received = 0; -+ -+ if (m_encoded_buffer && m_encoded_buffer->nFilledLen) -+ { -+ int samples_available = m_encoded_buffer->nFilledLen / d_samplesize - m_encoded_buffer->nOffset; -+ int samples = std::min(samples_available, dst_samples - received); -+ copy_planes(dst_buffer, d_pitch, d_planes, d_samplesize, received, (uint8_t *)m_encoded_buffer->pBuffer + m_encoded_buffer->nOffset * d_pitch, samples); -+ received += samples; -+ samples_available -= samples; -+ if (samples_available > 0) -+ m_encoded_buffer->nOffset += samples; -+ else -+ m_encoded_buffer = NULL; -+ } -+ assert(!m_encoded_buffer); -+ while (sent < src_samples) -+ { -+ OMX_BUFFERHEADERTYPE *omx_buffer = NULL; -+ -+ omx_buffer = m_omx_mixer.GetInputBuffer(1000); -+ if (omx_buffer == NULL) -+ return false; -+ -+ int send = std::min(std::min(max_dst_samples, max_src_samples), src_samples - sent); -+ -+ omx_buffer->nOffset = 0; -+ omx_buffer->nFlags = OMX_BUFFERFLAG_EOS; -+ omx_buffer->nFilledLen = send * s_samplesize; -+ -+ assert(omx_buffer->nFilledLen > 0 && omx_buffer->nFilledLen <= omx_buffer->nAllocLen); -+ -+ if (omx_buffer->nFilledLen) -+ { -+ int planesize = omx_buffer->nFilledLen / s_planes; -+ for (int i=0; i < s_planes; i++) -+ memcpy((uint8_t *)omx_buffer->pBuffer + i * planesize, src_buffer[i] + sent * s_pitch, planesize); -+ sent += send; -+ } -+ -+ omx_err = m_omx_mixer.EmptyThisBuffer(omx_buffer); -+ if (omx_err != OMX_ErrorNone) -+ { -+ CLog::Log(LOGERROR, "%s::%s OMX_EmptyThisBuffer() failed with result(0x%x)", CLASSNAME, __func__, omx_err); -+ return false; -+ } -+ -+ m_encoded_buffer = m_omx_mixer.GetOutputBuffer(); -+ -+ if (!m_encoded_buffer) -+ { -+ CLog::Log(LOGERROR, "%s::%s no output buffer", CLASSNAME, __func__); -+ return false; -+ } -+ omx_err = m_omx_mixer.FillThisBuffer(m_encoded_buffer); -+ if (omx_err != OMX_ErrorNone) -+ return false; -+ -+ omx_err = m_omx_mixer.WaitForOutputDone(1000); -+ if (omx_err != OMX_ErrorNone) -+ { -+ CLog::Log(LOGERROR, "%s::%s m_omx_mixer.WaitForOutputDone result(0x%x)", CLASSNAME, __func__, omx_err); -+ return false; -+ } -+ assert(m_encoded_buffer->nFilledLen > 0 && m_encoded_buffer->nFilledLen <= m_encoded_buffer->nAllocLen); -+ -+ if (m_omx_mixer.BadState()) -+ { -+ CLog::Log(LOGERROR, "%s::%s m_omx_mixer.BadState", CLASSNAME, __func__); -+ return false; -+ } -+ -+ if (m_encoded_buffer->nFilledLen) -+ { -+ int samples_available = m_encoded_buffer->nFilledLen / d_samplesize; -+ int samples = std::min(samples_available, dst_samples - received); -+ copy_planes(dst_buffer, d_pitch, d_planes, d_samplesize, received, (uint8_t *)m_encoded_buffer->pBuffer, samples); -+ received += samples; -+ samples_available -= samples; -+ if (samples_available > 0) -+ m_encoded_buffer->nOffset += samples; -+ else -+ m_encoded_buffer = NULL; -+ } -+ } -+ #ifdef DEBUG_VERBOSE -+ CLog::Log(LOGINFO, "%s::%s format:%d->%d rate:%d->%d chan:%d->%d samples %d->%d (%f) %d =%d", CLASSNAME, __func__, -+ (int)m_src_fmt, (int)m_dst_fmt, m_src_rate, m_dst_rate, m_src_channels, m_dst_channels, src_samples, dst_samples, ratio, m_Initialized, received); -+ #endif -+ assert(received <= dst_samples); -+ return received; -+} -+ -+int64_t CActiveAEResamplePi::GetDelay(int64_t base) -+{ -+ int ret = m_dst_rate ? 1000 * GetBufferedSamples() / m_dst_rate : 0; -+ #ifdef DEBUG_VERBOSE -+ CLog::Log(LOGINFO, "%s::%s = %d", CLASSNAME, __func__, ret); -+ #endif -+ return ret; -+} -+ -+int CActiveAEResamplePi::GetBufferedSamples() -+{ -+ int samples = 0; -+ if (m_encoded_buffer) -+ { -+ const int d_samplesize = m_dst_channels * m_dst_bits >> 3; -+ samples = m_encoded_buffer->nFilledLen / d_samplesize - m_encoded_buffer->nOffset; -+ } -+ #ifdef DEBUG_VERBOSE -+ CLog::Log(LOGINFO, "%s::%s = %d", CLASSNAME, __func__, samples); -+ #endif -+ return samples; -+} -+ -+int CActiveAEResamplePi::CalcDstSampleCount(int src_samples, int dst_rate, int src_rate) -+{ -+ int ret = ((long long)src_samples * dst_rate + src_rate-1) / src_rate; -+ #ifdef DEBUG_VERBOSE -+ CLog::Log(LOGINFO, "%s::%s = %d", CLASSNAME, __func__, ret); -+ #endif -+ return ret; -+} -+ -+int CActiveAEResamplePi::GetSrcBufferSize(int samples) -+{ -+ int ret = 0; -+ #ifdef DEBUG_VERBOSE -+ CLog::Log(LOGINFO, "%s::%s = %d", CLASSNAME, __func__, ret); -+ #endif -+ return ret; -+} -+ -+int CActiveAEResamplePi::GetDstBufferSize(int samples) -+{ -+ int ret = CalcDstSampleCount(samples, m_dst_rate, m_src_rate); -+ #ifdef DEBUG_VERBOSE -+ CLog::Log(LOGINFO, "%s::%s = %d", CLASSNAME, __func__, ret); -+ #endif -+ return ret; -+} -+ -+#endif -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h -new file mode 100644 -index 0000000..643ca6f ---- /dev/null -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h -@@ -0,0 +1,59 @@ -+#pragma once -+/* -+ * Copyright (C) 2010-2013 Team XBMC -+ * http://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 -+ * . -+ * -+ */ -+ -+#include "cores/AudioEngine/Interfaces/AEResample.h" -+#include "linux/OMXCore.h" -+ -+namespace ActiveAE -+{ -+ -+class CActiveAEResamplePi : public IAEResample -+{ -+public: -+ const char *GetName() { return "ActiveAEResamplePi"; } -+ CActiveAEResamplePi(); -+ virtual ~CActiveAEResamplePi(); -+ bool Init(uint64_t dst_chan_layout, int dst_channels, int dst_rate, AVSampleFormat dst_fmt, int dst_bits, int dst_dither, uint64_t src_chan_layout, int src_channels, int src_rate, AVSampleFormat src_fmt, int src_bits, int src_dither, bool upmix, bool normalize, CAEChannelInfo *remapLayout, AEQuality quality); -+ int Resample(uint8_t **dst_buffer, int dst_samples, uint8_t **src_buffer, int src_samples, double ratio); -+ int64_t GetDelay(int64_t base); -+ int GetBufferedSamples(); -+ int CalcDstSampleCount(int src_samples, int dst_rate, int src_rate); -+ int GetSrcBufferSize(int samples); -+ int GetDstBufferSize(int samples); -+ -+protected: -+ void DeInit(); -+ uint64_t m_src_chan_layout, m_dst_chan_layout; -+ int m_src_rate, m_dst_rate; -+ int m_src_channels, m_dst_channels; -+ AVSampleFormat m_src_fmt, m_dst_fmt; -+ int m_src_bits, m_dst_bits; -+ -+ OMX_AUDIO_PARAM_PCMMODETYPE m_pcm_input; -+ OMX_AUDIO_PARAM_PCMMODETYPE m_pcm_output; -+ COMXCoreComponent m_omx_mixer; -+ bool m_Initialized; -+ AVSampleFormat m_last_src_fmt, m_last_dst_fmt; -+ int m_last_src_channels, m_last_dst_channels; -+ OMX_BUFFERHEADERTYPE *m_encoded_buffer; -+}; -+ -+} -diff --git a/xbmc/cores/AudioEngine/Makefile.in b/xbmc/cores/AudioEngine/Makefile.in -index b58db3e..efb44cc 100644 ---- a/xbmc/cores/AudioEngine/Makefile.in -+++ b/xbmc/cores/AudioEngine/Makefile.in -@@ -33,6 +33,7 @@ SRCS += Engines/ActiveAE/ActiveAESink.cpp - SRCS += Engines/ActiveAE/ActiveAEStream.cpp - SRCS += Engines/ActiveAE/ActiveAESound.cpp - SRCS += Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp -+SRCS += Engines/ActiveAE/ActiveAEResamplePi.cpp - SRCS += Engines/ActiveAE/ActiveAEBuffer.cpp - - ifeq (@USE_ANDROID@,1) - -From f22ac0bf6cc8b0c7b424559acefa1f2597fef47d Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 3 Oct 2014 18:14:04 +0100 -Subject: [PATCH 85/96] settings: Add acceleration option for resampling - ---- - language/English/strings.po | 10 ++++++++++ - system/settings/rbp.xml | 7 +++++++ - xbmc/cores/AudioEngine/AEResampleFactory.cpp | 5 +++++ - 3 files changed, 22 insertions(+) - -diff --git a/language/English/strings.po b/language/English/strings.po -index 6ce5175..d37e835 100755 ---- a/language/English/strings.po -+++ b/language/English/strings.po -@@ -16008,3 +16008,13 @@ msgstr "" - msgctxt "#38006" - msgid "Adjust PLL" - msgstr "" -+ -+#: system/settings/rbp.xml -+msgctxt "#38010" -+msgid "Use accelerated resampling" -+msgstr "" -+ -+#: system/settings/rbp.xml -+msgctxt "#38011" -+msgid "This setting reduces CPU by handling audio resampling on the GPU" -+msgstr "" -diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml -index 9ecae65..a7a0e50 100644 ---- a/system/settings/rbp.xml -+++ b/system/settings/rbp.xml -@@ -61,6 +61,13 @@ - - - -+ -+ -+ 2 -+ true -+ -+ -+ - - - -diff --git a/xbmc/cores/AudioEngine/AEResampleFactory.cpp b/xbmc/cores/AudioEngine/AEResampleFactory.cpp -index fee947c..65afa6a 100644 ---- a/xbmc/cores/AudioEngine/AEResampleFactory.cpp -+++ b/xbmc/cores/AudioEngine/AEResampleFactory.cpp -@@ -18,6 +18,7 @@ - * - */ - -+#include "settings/Settings.h" - #include "AEResampleFactory.h" - #include "cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.h" - #if defined(TARGET_RASPBERRY_PI) -@@ -29,6 +30,10 @@ namespace ActiveAE - - IAEResample *CAEResampleFactory::Create() - { -+#if defined(TARGET_RASPBERRY_PI) -+ if (CSettings::Get().GetBool("videoplayer.resamplepi")) -+ return new CActiveAEResamplePi(); -+#endif - return new CActiveAEResampleFFMPEG(); - } - - -From b2455ddd489e52c9801ea51198a86dd6bdba3d99 Mon Sep 17 00:00:00 2001 +From ef73ce6916594207a6e910cb943d7f2973365df6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 24 Sep 2014 23:13:52 +0100 -Subject: [PATCH 86/96] [audio] Add settings option to boost centre channel +Subject: [PATCH 81/88] [audio] Add settings option to boost centre channel when downmixing This allows a dB volume increase to be added to centre channel. @@ -11787,13 +9024,14 @@ Should work with Pi Sink (dvdplayer/paplayer) and omxplayer 5 files changed, 45 insertions(+) diff --git a/language/English/strings.po b/language/English/strings.po -index d37e835..4ba7fc6 100755 +index 856d371..3da0a86 100755 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -16009,6 +16009,20 @@ msgctxt "#38006" +@@ -16024,3 +16024,17 @@ msgstr "" + msgctxt "#38006" msgid "Adjust PLL" msgstr "" - ++ +#: system/settings/settings.xml +msgctxt "#38007" +msgid "Boost centre channel when downmixing" @@ -11807,10 +9045,6 @@ index d37e835..4ba7fc6 100755 +#: system/settings/settings.xml +msgctxt "#38009" +msgid "%i dB" -+ - #: system/settings/rbp.xml - msgctxt "#38010" - msgid "Use accelerated resampling" diff --git a/system/settings/settings.xml b/system/settings/settings.xml index f4fcb7c..cd2bea6 100644 --- a/system/settings/settings.xml @@ -11860,10 +9094,10 @@ index 26f0140..2e3ef91 100644 if (remapLayout) { diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -index a50b5ad..afb46ec 100644 +index 6565cdb..a50cd70 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -@@ -159,6 +159,12 @@ bool CActiveAEResamplePi::Init(uint64_t dst_chan_layout, int dst_channels, int d +@@ -160,6 +160,12 @@ bool CActiveAEResamplePi::Init(uint64_t dst_chan_layout, int dst_channels, int d { av_opt_set_double(m_pContext, "rematrix_maxval", 1.0, 0); } @@ -11894,10 +9128,10 @@ index 22ee423..db2968f 100644 // stereo upmix if (upmix && m_src_channels == 2 && m_dst_channels > 2) -From 4a567ffd89765fe5c65b84b2bc6c869460da67d6 Mon Sep 17 00:00:00 2001 +From 923296874b60c37352c3605b7cd2b50530414a7a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 3 Oct 2014 18:38:07 +0100 -Subject: [PATCH 87/96] [omxcore] Skip out of flush on error +Subject: [PATCH 82/88] [omxcore] Skip out of flush on error --- xbmc/linux/OMXCore.cpp | 4 ++-- @@ -11926,10 +9160,10 @@ index 4ae29ba..4caa304 100644 OMX_ERRORTYPE omx_err = OMX_ErrorNone; -From 7ef49044e6da8f68978ca746c25b591996be08b1 Mon Sep 17 00:00:00 2001 +From fc2f230c5a2bb3baef275f5d61e1a16cc49380e5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 3 Oct 2014 18:40:06 +0100 -Subject: [PATCH 88/96] [SinkPi] Handle multichannel layout more like OMXAudio +Subject: [PATCH 83/88] [SinkPi] Handle multichannel layout more like OMXAudio --- xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp | 14 +++++++------- @@ -11988,27 +9222,27 @@ index 89684e4..fd9a03d 100644 m_format = format; m_sinkbuffer_sec_per_byte = 1.0 / (double)(m_format.m_frameSize * m_format.m_sampleRate); -From b1fb8bf8548d647c66500dd314ccfb8adc708b3c Mon Sep 17 00:00:00 2001 +From d535a9edff8b08243aaf69ffb10a2b630a27aabd Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 5 Oct 2014 14:05:25 +0100 -Subject: [PATCH 89/96] [PiSink] Allow audio output latency to be set in +Subject: [PATCH 84/88] [PiSink] Allow audio output latency to be set in settings --- language/English/strings.po | 15 +++++++++++++++ - system/settings/rbp.xml | 14 ++++++++++++++ + system/settings/rbp.xml | 12 ++++++++++++ xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp | 13 ++++++++----- xbmc/cores/AudioEngine/Sinks/AESinkPi.h | 1 + - 4 files changed, 38 insertions(+), 5 deletions(-) + 4 files changed, 36 insertions(+), 5 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index 4ba7fc6..91765f2 100755 +index 3da0a86..1bc647f 100755 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -16032,3 +16032,18 @@ msgstr "" - msgctxt "#38011" - msgid "This setting reduces CPU by handling audio resampling on the GPU" - msgstr "" +@@ -16038,3 +16038,18 @@ msgstr "" + #: system/settings/settings.xml + msgctxt "#38009" + msgid "%i dB" + +#: system/settings/rbp.xml +msgctxt "#38012" @@ -12025,14 +9259,13 @@ index 4ba7fc6..91765f2 100755 +msgid "%i ms" +msgstr "" diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml -index a7a0e50..b83f8a8 100644 +index 79853a8..b8e6e59 100644 --- a/system/settings/rbp.xml +++ b/system/settings/rbp.xml -@@ -106,6 +106,20 @@ - - - -+ +@@ -103,6 +103,18 @@ + + 101 + + + 3 + 100 @@ -12045,10 +9278,9 @@ index a7a0e50..b83f8a8 100644 + 38014 + + -+ + - diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp index fd9a03d..484ce14 100644 --- a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp @@ -12121,167 +9353,10 @@ index 5c57999..cac5051 100644 bool m_Initialized; uint32_t m_submitted; -From 94a8749996583b8d7582e5ab141723f833745cb3 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sun, 5 Oct 2014 14:24:49 +0100 -Subject: [PATCH 90/96] [resamplepi] Move gpu accleration into resample quality - setting - ---- - language/English/strings.po | 7 +------ - system/settings/rbp.xml | 10 +++------- - xbmc/cores/AudioEngine/AEFactory.cpp | 2 ++ - xbmc/cores/AudioEngine/AEResampleFactory.cpp | 2 +- - xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 4 ++++ - xbmc/cores/AudioEngine/Interfaces/AE.h | 3 ++- - 6 files changed, 13 insertions(+), 15 deletions(-) - -diff --git a/language/English/strings.po b/language/English/strings.po -index 91765f2..b2461f7 100755 ---- a/language/English/strings.po -+++ b/language/English/strings.po -@@ -16025,12 +16025,7 @@ msgid "%i dB" - - #: system/settings/rbp.xml - msgctxt "#38010" --msgid "Use accelerated resampling" --msgstr "" -- --#: system/settings/rbp.xml --msgctxt "#38011" --msgid "This setting reduces CPU by handling audio resampling on the GPU" -+msgid "GPU accelerated" - msgstr "" - - #: system/settings/rbp.xml -diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml -index b83f8a8..b8e6e59 100644 ---- a/system/settings/rbp.xml -+++ b/system/settings/rbp.xml -@@ -61,13 +61,6 @@ - - - -- -- -- 2 -- true -- -- -- - - - -@@ -107,6 +100,9 @@ - - - -+ -+ 101 -+ - - 3 - 100 -diff --git a/xbmc/cores/AudioEngine/AEFactory.cpp b/xbmc/cores/AudioEngine/AEFactory.cpp -index ebc9c6e..1ce8434 100644 ---- a/xbmc/cores/AudioEngine/AEFactory.cpp -+++ b/xbmc/cores/AudioEngine/AEFactory.cpp -@@ -328,6 +328,8 @@ void CAEFactory::SettingOptionsAudioQualityLevelsFiller(const CSetting *setting, - list.push_back(std::make_pair(g_localizeStrings.Get(13508), AE_QUALITY_HIGH)); - if(AE->SupportsQualityLevel(AE_QUALITY_REALLYHIGH)) - list.push_back(std::make_pair(g_localizeStrings.Get(13509), AE_QUALITY_REALLYHIGH)); -+ if(AE->SupportsQualityLevel(AE_QUALITY_GPU)) -+ list.push_back(std::make_pair(g_localizeStrings.Get(38010), AE_QUALITY_GPU)); - } - - void CAEFactory::SettingOptionsAudioStreamsilenceFiller(const CSetting *setting, std::vector< std::pair > &list, int ¤t, void *data) -diff --git a/xbmc/cores/AudioEngine/AEResampleFactory.cpp b/xbmc/cores/AudioEngine/AEResampleFactory.cpp -index 65afa6a..c24d9b0 100644 ---- a/xbmc/cores/AudioEngine/AEResampleFactory.cpp -+++ b/xbmc/cores/AudioEngine/AEResampleFactory.cpp -@@ -31,7 +31,7 @@ namespace ActiveAE - IAEResample *CAEResampleFactory::Create() - { - #if defined(TARGET_RASPBERRY_PI) -- if (CSettings::Get().GetBool("videoplayer.resamplepi")) -+ if (CSettings::Get().GetInt("audiooutput.processquality") == AE_QUALITY_GPU) - return new CActiveAEResamplePi(); - #endif - return new CActiveAEResampleFFMPEG(); -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -index a854ab3..64775c0 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -@@ -2273,6 +2273,10 @@ bool CActiveAE::SupportsQualityLevel(enum AEQuality level) - { - if (level == AE_QUALITY_LOW || level == AE_QUALITY_MID || level == AE_QUALITY_HIGH) - return true; -+#if defined(TARGET_RASPBERRY_PI) -+ if (level == AE_QUALITY_GPU) -+ return true; -+#endif - - return false; - } -diff --git a/xbmc/cores/AudioEngine/Interfaces/AE.h b/xbmc/cores/AudioEngine/Interfaces/AE.h -index 353fcaa..c66fa61 100644 ---- a/xbmc/cores/AudioEngine/Interfaces/AE.h -+++ b/xbmc/cores/AudioEngine/Interfaces/AE.h -@@ -58,8 +58,9 @@ enum AEQuality - AE_QUALITY_HIGH = 50, /* Best sound processing quality */ - - /* Optional quality levels */ -- AE_QUALITY_REALLYHIGH = 100 /* Uncompromised optional quality level, -+ AE_QUALITY_REALLYHIGH = 100, /* Uncompromised optional quality level, - usually with unmeasurable and unnoticeable improvement */ -+ AE_QUALITY_GPU = 101, /* GPU acceleration */ - }; - - /** - -From 21c95205d184639dff460ac4c79f45d8a8c1baa7 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 6 Oct 2014 21:27:02 +0100 -Subject: [PATCH 91/96] [resamplepi] Remove unused variabled - ---- - xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp | 4 ---- - xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h | 2 -- - 2 files changed, 6 deletions(-) - -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -index afb46ec..a4bb15e 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -@@ -66,10 +66,6 @@ CActiveAEResamplePi::CActiveAEResamplePi() - CLog::Log(LOGINFO, "%s::%s", CLASSNAME, __func__); - - m_Initialized = false; -- m_last_src_fmt = AV_SAMPLE_FMT_NONE; -- m_last_dst_fmt = AV_SAMPLE_FMT_NONE; -- m_last_src_channels = 0; -- m_last_dst_channels = 0; - m_encoded_buffer = NULL; - } - -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h -index 643ca6f..b6fc644 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h -@@ -51,8 +51,6 @@ class CActiveAEResamplePi : public IAEResample - OMX_AUDIO_PARAM_PCMMODETYPE m_pcm_output; - COMXCoreComponent m_omx_mixer; - bool m_Initialized; -- AVSampleFormat m_last_src_fmt, m_last_dst_fmt; -- int m_last_src_channels, m_last_dst_channels; - OMX_BUFFERHEADERTYPE *m_encoded_buffer; - }; - - -From 1c678794f22e28636fecff58d3b34abf61b1dd3b Mon Sep 17 00:00:00 2001 +From 65e9f504ac1fc8177430eacfb8af8edf117a315e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 6 Oct 2014 21:29:41 +0100 -Subject: [PATCH 92/96] [AE] Don't submit data to resampler when more than one +Subject: [PATCH 85/88] [AE] Don't submit data to resampler when more than one frame is buffered --- @@ -12302,540 +9377,10 @@ index e40ac2e..9e42385 100644 bool hasInput = !m_inputSamples.empty(); -From e63c5067550dbf80313ed177317c074cab9529cf Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 6 Oct 2014 21:31:55 +0100 -Subject: [PATCH 93/96] [ResamplePi] Allow resample ratio to vary continuously - -We weren't respecting the ratio paramater to resampler which is used when in video clock with audio resample as the sync method. -This means the resample method was behaving like drop/dupe. - -Requires updated firmware ---- - .../Engines/ActiveAE/ActiveAEResamplePi.cpp | 92 ++++++++++++++-------- - .../Engines/ActiveAE/ActiveAEResamplePi.h | 2 + - 2 files changed, 59 insertions(+), 35 deletions(-) - -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -index a4bb15e..77abb61 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -@@ -67,6 +67,8 @@ CActiveAEResamplePi::CActiveAEResamplePi() - - m_Initialized = false; - m_encoded_buffer = NULL; -+ m_offset = 0; -+ m_ratio = 0.0; - } - - CActiveAEResamplePi::~CActiveAEResamplePi() -@@ -127,6 +129,7 @@ bool CActiveAEResamplePi::Init(uint64_t dst_chan_layout, int dst_channels, int d - m_src_rate = src_rate; - m_src_fmt = src_fmt; - m_src_bits = src_bits; -+ m_offset = 0; - - if (m_dst_chan_layout == 0) - m_dst_chan_layout = av_get_default_channel_layout(m_dst_channels); -@@ -278,6 +281,18 @@ bool CActiveAEResamplePi::Init(uint64_t dst_chan_layout, int dst_channels, int d - - LOGTIME(3); - -+ if (CSettings::Get().GetBool("videoplayer.usedisplayasclock") && CSettings::Get().GetInt("videoplayer.synctype") == SYNC_RESAMPLE) -+ { -+ OMX_PARAM_U32TYPE scaleType; -+ OMX_INIT_STRUCTURE(scaleType); -+ -+ scaleType.nPortIndex = m_omx_mixer.GetInputPort(); -+ scaleType.nU32 = (1 << 16); -+ omx_err = m_omx_mixer.SetConfig(OMX_IndexParamBrcmTimeScale, &scaleType); -+ if (omx_err != OMX_ErrorNone) -+ CLog::Log(LOGERROR, "%s::%s - error m_omx_mixer Failed to set OMX_IndexParamBrcmTimeScale omx_err(0x%08x)", CLASSNAME, __func__, omx_err); -+ m_ratio = 1.0; -+ } - // audio_mixer only supports up to 192kHz, however as long as ratio of samplerates remains the same we can lie - while (src_rate > 192000 || dst_rate > 192000) - src_rate >>= 1, dst_rate >>= 1; -@@ -391,11 +406,10 @@ bool CActiveAEResamplePi::Init(uint64_t dst_chan_layout, int dst_channels, int d - } - - --static void copy_planes(uint8_t **dst_buffer, int d_pitch, int d_planes, int d_samplesize, int offset, uint8_t *src_buffer, int src_samples) -+static void copy_planes(uint8_t **dst_buffer, int d_pitch, int d_planes, int d_samplesize, int offset, uint8_t *src_buffer, int src_samples, int planesize) - { -- int planesize = src_samples * d_samplesize / d_planes; - for (int i=0; i < d_planes; i++) -- memcpy(dst_buffer[i] + offset * d_pitch, src_buffer + i * planesize, planesize); -+ memcpy(dst_buffer[i] + offset * d_pitch, src_buffer + i * planesize, src_samples * d_samplesize / d_planes); - } - - int CActiveAEResamplePi::Resample(uint8_t **dst_buffer, int dst_samples, uint8_t **src_buffer, int src_samples, double ratio) -@@ -407,6 +421,19 @@ int CActiveAEResamplePi::Resample(uint8_t **dst_buffer, int dst_samples, uint8_t - return 0; - OMX_ERRORTYPE omx_err = OMX_ErrorNone; - -+ if (m_ratio != 0.0 && ratio != m_ratio) -+ { -+ OMX_PARAM_U32TYPE scaleType; -+ OMX_INIT_STRUCTURE(scaleType); -+ -+ scaleType.nPortIndex = m_omx_mixer.GetInputPort(); -+ scaleType.nU32 = (1 << 16) / ratio; -+ omx_err = m_omx_mixer.SetConfig(OMX_IndexParamBrcmTimeScale, &scaleType); -+ if (omx_err != OMX_ErrorNone) -+ CLog::Log(LOGERROR, "%s::%s - error m_omx_mixer Failed to set OMX_IndexParamBrcmTimeScale omx_err(0x%08x)", CLASSNAME, __func__, omx_err); -+ m_ratio = ratio; -+ } -+ - const int s_planes = m_src_fmt >= AV_SAMPLE_FMT_U8P ? m_src_channels : 1; - const int d_planes = m_dst_fmt >= AV_SAMPLE_FMT_U8P ? m_dst_channels : 1; - const int s_chans = m_src_fmt >= AV_SAMPLE_FMT_U8P ? 1 : m_src_channels; -@@ -422,27 +449,33 @@ int CActiveAEResamplePi::Resample(uint8_t **dst_buffer, int dst_samples, uint8_t - int sent = 0; - int received = 0; - -- if (m_encoded_buffer && m_encoded_buffer->nFilledLen) -- { -- int samples_available = m_encoded_buffer->nFilledLen / d_samplesize - m_encoded_buffer->nOffset; -- int samples = std::min(samples_available, dst_samples - received); -- copy_planes(dst_buffer, d_pitch, d_planes, d_samplesize, received, (uint8_t *)m_encoded_buffer->pBuffer + m_encoded_buffer->nOffset * d_pitch, samples); -- received += samples; -- samples_available -= samples; -- if (samples_available > 0) -- m_encoded_buffer->nOffset += samples; -- else -- m_encoded_buffer = NULL; -- } -- assert(!m_encoded_buffer); -- while (sent < src_samples) -+ while (1) - { -- OMX_BUFFERHEADERTYPE *omx_buffer = NULL; -+ if (m_encoded_buffer && m_encoded_buffer->nFilledLen) -+ { -+ int samples_available = m_encoded_buffer->nFilledLen / d_samplesize - m_offset; -+ int samples = std::min(samples_available, dst_samples - received); -+ copy_planes(dst_buffer, d_pitch, d_planes, d_samplesize, received, (uint8_t *)m_encoded_buffer->pBuffer + m_offset * d_pitch, samples, m_encoded_buffer->nFilledLen / d_planes); -+ received += samples; -+ m_offset += samples; -+ if (m_offset == m_encoded_buffer->nFilledLen / d_samplesize) -+ { -+ m_offset = 0; -+ m_encoded_buffer = NULL; -+ } -+ else if (m_offset > m_encoded_buffer->nFilledLen / d_samplesize) assert(0); -+ else assert(sent == src_samples); -+ } - -- omx_buffer = m_omx_mixer.GetInputBuffer(1000); -+ if (sent >= src_samples) -+ break; -+ -+ OMX_BUFFERHEADERTYPE *omx_buffer = m_omx_mixer.GetInputBuffer(1000); - if (omx_buffer == NULL) -+ { -+ CLog::Log(LOGERROR, "%s::%s m_omx_mixer.GetInputBuffer failed to get buffer", CLASSNAME, __func__); - return false; -- -+ } - int send = std::min(std::min(max_dst_samples, max_src_samples), src_samples - sent); - - omx_buffer->nOffset = 0; -@@ -490,22 +523,11 @@ int CActiveAEResamplePi::Resample(uint8_t **dst_buffer, int dst_samples, uint8_t - CLog::Log(LOGERROR, "%s::%s m_omx_mixer.BadState", CLASSNAME, __func__); - return false; - } -- -- if (m_encoded_buffer->nFilledLen) -- { -- int samples_available = m_encoded_buffer->nFilledLen / d_samplesize; -- int samples = std::min(samples_available, dst_samples - received); -- copy_planes(dst_buffer, d_pitch, d_planes, d_samplesize, received, (uint8_t *)m_encoded_buffer->pBuffer, samples); -- received += samples; -- samples_available -= samples; -- if (samples_available > 0) -- m_encoded_buffer->nOffset += samples; -- else -- m_encoded_buffer = NULL; -- } -+ if (sent < src_samples) -+ CLog::Log(LOGERROR, "%s::%s More data to send %d/%d", CLASSNAME, __func__, sent, src_samples); - } - #ifdef DEBUG_VERBOSE -- CLog::Log(LOGINFO, "%s::%s format:%d->%d rate:%d->%d chan:%d->%d samples %d->%d (%f) %d =%d", CLASSNAME, __func__, -+ CLog::Log(LOGINFO, "%s::%s format:%d->%d rate:%d->%d chan:%d->%d samples %d->%d (%f) %d", CLASSNAME, __func__, - (int)m_src_fmt, (int)m_dst_fmt, m_src_rate, m_dst_rate, m_src_channels, m_dst_channels, src_samples, dst_samples, ratio, m_Initialized, received); - #endif - assert(received <= dst_samples); -@@ -527,7 +549,7 @@ int CActiveAEResamplePi::GetBufferedSamples() - if (m_encoded_buffer) - { - const int d_samplesize = m_dst_channels * m_dst_bits >> 3; -- samples = m_encoded_buffer->nFilledLen / d_samplesize - m_encoded_buffer->nOffset; -+ samples = m_encoded_buffer->nFilledLen / d_samplesize - m_offset; - } - #ifdef DEBUG_VERBOSE - CLog::Log(LOGINFO, "%s::%s = %d", CLASSNAME, __func__, samples); -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h -index b6fc644..b3b1f9b 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h -@@ -52,6 +52,8 @@ class CActiveAEResamplePi : public IAEResample - COMXCoreComponent m_omx_mixer; - bool m_Initialized; - OMX_BUFFERHEADERTYPE *m_encoded_buffer; -+ unsigned int m_offset; -+ double m_ratio; - }; - - } - -From 24c7e439a826ad0883dd5e9e07d469e2129c2368 Mon Sep 17 00:00:00 2001 -From: Karlson2k -Date: Thu, 9 Oct 2014 19:34:43 +0400 -Subject: [PATCH 94/96] CacheStrategy: remove usage of emulated win32 - functions, switch to internal VFS - ---- - xbmc/filesystem/CacheStrategy.cpp | 129 +++++++++++++++++++------------------- - xbmc/filesystem/CacheStrategy.h | 13 ++-- - 2 files changed, 69 insertions(+), 73 deletions(-) - -diff --git a/xbmc/filesystem/CacheStrategy.cpp b/xbmc/filesystem/CacheStrategy.cpp -index 095d3fb..acc86af 100644 ---- a/xbmc/filesystem/CacheStrategy.cpp -+++ b/xbmc/filesystem/CacheStrategy.cpp -@@ -20,17 +20,21 @@ - - #include "threads/SystemClock.h" - #include "CacheStrategy.h" --#ifdef TARGET_POSIX --#include "PlatformInclude.h" --#endif -+#include "IFile.h" - #include "Util.h" - #include "utils/log.h" - #include "threads/SingleLock.h" - #include "utils/TimeUtils.h" - #include "SpecialProtocol.h" --#ifdef TARGET_WINDOWS - #include "PlatformDefs.h" //for PRIdS, PRId64 --#endif -+#include "URL.h" -+#if defined(TARGET_POSIX) -+#include "posix/PosixFile.h" -+#define CacheLocalFile CPosixFile -+#elif defined(TARGET_WINDOWS) -+#include "win32/Win32File.h" -+#define CacheLocalFile CWin32File -+#endif // TARGET_WINDOWS - - using namespace XFILE; - -@@ -58,8 +62,8 @@ void CCacheStrategy::ClearEndOfInput() - } - - CSimpleFileCache::CSimpleFileCache() -- : m_hCacheFileRead(NULL) -- , m_hCacheFileWrite(NULL) -+ : m_cacheFileRead(new CacheLocalFile()) -+ , m_cacheFileWrite(new CacheLocalFile()) - , m_hDataAvailEvent(NULL) - , m_nStartPosition(0) - , m_nWritePosition(0) -@@ -69,6 +73,8 @@ CSimpleFileCache::CSimpleFileCache() - CSimpleFileCache::~CSimpleFileCache() - { - Close(); -+ delete m_cacheFileRead; -+ delete m_cacheFileWrite; - } - - int CSimpleFileCache::Open() -@@ -77,38 +83,26 @@ int CSimpleFileCache::Open() - - m_hDataAvailEvent = new CEvent; - -- std::string fileName = CSpecialProtocol::TranslatePath(CUtil::GetNextFilename("special://temp/filecache%03d.cache", 999)); -- if(fileName.empty()) -+ m_filename = CSpecialProtocol::TranslatePath(CUtil::GetNextFilename("special://temp/filecache%03d.cache", 999)); -+ if (m_filename.empty()) - { - CLog::Log(LOGERROR, "%s - Unable to generate a new filename", __FUNCTION__); - Close(); - return CACHE_RC_ERROR; - } - -- m_hCacheFileWrite = CreateFile(fileName.c_str() -- , GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_DELETE -- , NULL -- , CREATE_ALWAYS -- , FILE_ATTRIBUTE_NORMAL -- , NULL); -+ CURL fileURL(m_filename); - -- if(m_hCacheFileWrite == INVALID_HANDLE_VALUE) -+ if (!m_cacheFileWrite->OpenForWrite(fileURL, false)) - { -- CLog::Log(LOGERROR, "%s - failed to create file %s with error code %d", __FUNCTION__, fileName.c_str(), GetLastError()); -+ CLog::LogF(LOGERROR, "failed to create file \"%s\" for writing", m_filename.c_str()); - Close(); - return CACHE_RC_ERROR; - } - -- m_hCacheFileRead = CreateFile(fileName.c_str() -- , GENERIC_READ, FILE_SHARE_WRITE -- , NULL -- , OPEN_EXISTING -- , FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE -- , NULL); -- -- if(m_hCacheFileRead == INVALID_HANDLE_VALUE) -+ if (!m_cacheFileRead->Open(fileURL)) - { -- CLog::Log(LOGERROR, "%s - failed to open file %s with error code %d", __FUNCTION__, fileName.c_str(), GetLastError()); -+ CLog::LogF(LOGERROR, "failed to open file \"%s\" for reading", m_filename.c_str()); - Close(); - return CACHE_RC_ERROR; - } -@@ -123,33 +117,35 @@ void CSimpleFileCache::Close() - - m_hDataAvailEvent = NULL; - -- if (m_hCacheFileWrite) -- CloseHandle(m_hCacheFileWrite); -- -- m_hCacheFileWrite = NULL; -+ m_cacheFileWrite->Close(); -+ m_cacheFileRead->Close(); - -- if (m_hCacheFileRead) -- CloseHandle(m_hCacheFileRead); -+ if (!m_cacheFileRead->Delete(CURL(m_filename))) -+ CLog::LogF(LOGWARNING, "failed to delete temporary file \"%s\"", m_filename.c_str()); - -- m_hCacheFileRead = NULL; -+ m_filename.clear(); - } - - int CSimpleFileCache::WriteToCache(const char *pBuffer, size_t iSize) - { -- DWORD iWritten=0; -- if (!WriteFile(m_hCacheFileWrite, pBuffer, iSize, &iWritten, NULL)) -+ size_t written = 0; -+ while (iSize > 0) - { -- CLog::Log(LOGERROR, "%s - failed to write to file. err: %u", -- __FUNCTION__, GetLastError()); -- return CACHE_RC_ERROR; -+ const ssize_t lastWritten = m_cacheFileWrite->Write(pBuffer, (iSize > SSIZE_MAX) ? SSIZE_MAX : iSize); -+ if (lastWritten <= 0) -+ { -+ CLog::LogF(LOGERROR, "failed to write to file"); -+ return CACHE_RC_ERROR; -+ } -+ m_nWritePosition += lastWritten; -+ iSize -= lastWritten; -+ written += lastWritten; - } - -- m_nWritePosition += iWritten; -- - // when reader waits for data it will wait on the event. - m_hDataAvailEvent->Set(); - -- return iWritten; -+ return written; - } - - int64_t CSimpleFileCache::GetAvailableRead() -@@ -160,24 +156,31 @@ int64_t CSimpleFileCache::GetAvailableRead() - int CSimpleFileCache::ReadFromCache(char *pBuffer, size_t iMaxSize) - { - int64_t iAvailable = GetAvailableRead(); -- if ( iAvailable <= 0 ) { -+ if ( iAvailable <= 0 ) - return m_bEndOfInput? 0 : CACHE_RC_WOULD_BLOCK; -- } - -- if (iMaxSize > (size_t)iAvailable) -- iMaxSize = (size_t)iAvailable; -+ size_t toRead = ((int64_t)iMaxSize > iAvailable) ? (size_t)iAvailable : iMaxSize; - -- DWORD iRead = 0; -- if (!ReadFile(m_hCacheFileRead, pBuffer, iMaxSize, &iRead, NULL)) { -- CLog::Log(LOGERROR,"CSimpleFileCache::ReadFromCache - failed to read %" PRIdS" bytes.", iMaxSize); -- return CACHE_RC_ERROR; -+ size_t readBytes = 0; -+ while (toRead > 0) -+ { -+ const ssize_t lastRead = m_cacheFileRead->Read(pBuffer, (toRead > SSIZE_MAX) ? SSIZE_MAX : toRead); -+ if (lastRead == 0) -+ break; -+ if (lastRead < 0) -+ { -+ CLog::LogF(LOGERROR, "failed to read from file"); -+ return CACHE_RC_ERROR; -+ } -+ m_nReadPosition += lastRead; -+ toRead -= lastRead; -+ readBytes += lastRead; - } -- m_nReadPosition += iRead; - -- if (iRead > 0) -+ if (readBytes > 0) - m_space.Set(); - -- return iRead; -+ return readBytes; - } - - int64_t CSimpleFileCache::WaitForData(unsigned int iMinAvail, unsigned int iMillis) -@@ -215,13 +218,13 @@ int64_t CSimpleFileCache::Seek(int64_t iFilePosition) - return CACHE_RC_ERROR; - } - -- LARGE_INTEGER pos; -- pos.QuadPart = iTarget; -- -- if(!SetFilePointerEx(m_hCacheFileRead, pos, NULL, FILE_BEGIN)) -+ m_nReadPosition = m_cacheFileRead->Seek(iTarget, SEEK_SET); -+ if (m_nReadPosition != iTarget) -+ { -+ CLog::LogF(LOGERROR, "can't seek file"); - return CACHE_RC_ERROR; -+ } - -- m_nReadPosition = iTarget; - m_space.Set(); - - return iFilePosition; -@@ -229,21 +232,15 @@ int64_t CSimpleFileCache::Seek(int64_t iFilePosition) - - void CSimpleFileCache::Reset(int64_t iSourcePosition, bool clearAnyway) - { -- LARGE_INTEGER pos; - if (!clearAnyway && IsCachedPosition(iSourcePosition)) - { -- pos.QuadPart = m_nReadPosition = iSourcePosition - m_nStartPosition; -- SetFilePointerEx(m_hCacheFileRead, pos, NULL, FILE_BEGIN); -+ m_nReadPosition = m_cacheFileRead->Seek(iSourcePosition - m_nStartPosition, SEEK_SET); - return; - } - -- pos.QuadPart = 0; -- -- SetFilePointerEx(m_hCacheFileWrite, pos, NULL, FILE_BEGIN); -- SetFilePointerEx(m_hCacheFileRead, pos, NULL, FILE_BEGIN); - m_nStartPosition = iSourcePosition; -- m_nReadPosition = 0; -- m_nWritePosition = 0; -+ m_nWritePosition = m_cacheFileWrite->Seek(0, SEEK_SET); -+ m_nReadPosition = m_cacheFileRead->Seek(0, SEEK_SET); - } - - void CSimpleFileCache::EndOfInput() -diff --git a/xbmc/filesystem/CacheStrategy.h b/xbmc/filesystem/CacheStrategy.h -index 9c2c28b..9ea7274 100644 ---- a/xbmc/filesystem/CacheStrategy.h -+++ b/xbmc/filesystem/CacheStrategy.h -@@ -23,11 +23,7 @@ - #define XFILECACHESTRATEGY_H - - #include --#ifdef TARGET_POSIX --#include "PlatformDefs.h" --#include "XHandlePublic.h" --#include "XFileUtils.h" --#endif -+#include - #include "threads/CriticalSection.h" - #include "threads/Event.h" - -@@ -38,6 +34,8 @@ namespace XFILE { - #define CACHE_RC_WOULD_BLOCK -2 - #define CACHE_RC_TIMEOUT -3 - -+class IFile; // forward declaration -+ - class CCacheStrategy{ - public: - CCacheStrategy(); -@@ -95,8 +93,9 @@ class CSimpleFileCache : public CCacheStrategy { - int64_t GetAvailableRead(); - - protected: -- HANDLE m_hCacheFileRead; -- HANDLE m_hCacheFileWrite; -+ std::string m_filename; -+ IFile* m_cacheFileRead; -+ IFile* m_cacheFileWrite; - CEvent* m_hDataAvailEvent; - volatile int64_t m_nStartPosition; - volatile int64_t m_nWritePosition; - -From 1e29484fe28738a61ec1fd5098287cd90c66a467 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sat, 11 Oct 2014 22:45:15 +0100 -Subject: [PATCH 95/96] [ResamplePi] Fix for 24bit audio - ---- - .../AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp | 12 +++++++----- - xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h | 1 + - 2 files changed, 8 insertions(+), 5 deletions(-) - -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -index 77abb61..a50cd70 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -@@ -113,22 +113,24 @@ bool CActiveAEResamplePi::Init(uint64_t dst_chan_layout, int dst_channels, int d - { - LOGTIMEINIT("x"); - -- CLog::Log(LOGINFO, "%s::%s remap:%p chan:%d->%d rate:%d->%d format:%d->%d bits:%d->%d norm:%d upmix:%d", CLASSNAME, __func__, remapLayout, src_channels, dst_channels, src_rate, dst_rate, src_fmt, dst_fmt, src_bits, dst_bits, normalize, upmix); -- -- // replace passed in number of bits with correct ones -- src_bits = format_to_bits(src_fmt); -- dst_bits = format_to_bits(dst_fmt); -+ CLog::Log(LOGINFO, "%s::%s remap:%p chan:%d->%d rate:%d->%d format:%d->%d bits:%d->%d dither:%d->%d norm:%d upmix:%d", CLASSNAME, __func__, remapLayout, src_channels, dst_channels, src_rate, dst_rate, src_fmt, dst_fmt, src_bits, dst_bits, src_dither, dst_dither, normalize, upmix); - -+ if (!src_bits) -+ src_bits = format_to_bits(src_fmt); -+ if (!dst_bits) -+ dst_bits = format_to_bits(dst_fmt); - m_dst_chan_layout = dst_chan_layout; - m_dst_channels = dst_channels; - m_dst_rate = dst_rate; - m_dst_fmt = dst_fmt; - m_dst_bits = dst_bits; -+ m_dst_dither_bits = dst_dither; - m_src_chan_layout = src_chan_layout; - m_src_channels = src_channels; - m_src_rate = src_rate; - m_src_fmt = src_fmt; - m_src_bits = src_bits; -+ m_src_dither_bits = src_dither; - m_offset = 0; - - if (m_dst_chan_layout == 0) -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h -index b3b1f9b..5c5f9ce 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h -@@ -46,6 +46,7 @@ class CActiveAEResamplePi : public IAEResample - int m_src_channels, m_dst_channels; - AVSampleFormat m_src_fmt, m_dst_fmt; - int m_src_bits, m_dst_bits; -+ int m_src_dither_bits, m_dst_dither_bits; - - OMX_AUDIO_PARAM_PCMMODETYPE m_pcm_input; - OMX_AUDIO_PARAM_PCMMODETYPE m_pcm_output; - -From 4ca242401cb559f0ba3e8b6d3bd87f460e887101 Mon Sep 17 00:00:00 2001 +From 897693bca9cc30d2346ab65efe7677f18e52df24 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Oct 2014 22:37:52 +0100 -Subject: [PATCH 96/96] [rbp] Fix for orientation handling of Pi textures +Subject: [PATCH 86/88] [rbp] Fix for orientation handling of Pi textures There were a number of "off by one" errors in the orientations when using accelerated jpeg<->textures on the Pi. This mostly worked out, but was the root cause of this issue: @@ -12976,3 +9521,70 @@ index 3950b3f..a17bfba 100644 return true; } } + +From 7ce67eff4bd7884f01df5018c6db57c32a74ee4f Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sat, 18 Oct 2014 14:41:39 +0100 +Subject: [PATCH 87/88] [omxplayer] Restore flush/accurate seek flags to fix + issue with edl skipping + +--- + xbmc/cores/dvdplayer/DVDPlayer.cpp | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp +index 676b35270a..c3f9b6a 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayer.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp +@@ -2176,7 +2176,7 @@ void CDVDPlayer::CheckAutoSceneSkip() + /* + * Seeking is NOT flushed so any content up to the demux point is retained when playing forwards. + */ +- m_messenger.Put(new CDVDMsgPlayerSeek(seek, true, false, true, false, true)); ++ m_messenger.Put(new CDVDMsgPlayerSeek(seek, true, m_omxplayer_mode, true, false, true)); + /* + * Seek doesn't always work reliably. Last physical seek time is recorded to prevent looping + * if there was an error with seeking and it landed somewhere unexpected, perhaps back in the +@@ -2194,7 +2194,7 @@ void CDVDPlayer::CheckAutoSceneSkip() + /* + * Seeking is NOT flushed so any content up to the demux point is retained when playing forwards. + */ +- m_messenger.Put(new CDVDMsgPlayerSeek(cut.end + 1, true, false, true, false, true)); ++ m_messenger.Put(new CDVDMsgPlayerSeek(cut.end + 1, true, m_omxplayer_mode, true, false, true)); + /* + * Each commercial break is only skipped once so poorly detected commercial breaks can be + * manually re-entered. Start and end are recorded to prevent looping and to allow seeking back +@@ -3479,7 +3479,7 @@ void CDVDPlayer::UpdateClockMaster() + void CDVDPlayer::FlushBuffers(bool queued, double pts, bool accurate) + { + double startpts; +- if(accurate) ++ if(accurate && !m_omxplayer_mode) + startpts = pts; + else + startpts = DVD_NOPTS_VALUE; + +From 469f6cd8487d2af728d76bacd8a20bca730d17b6 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sat, 18 Oct 2014 18:13:43 +0100 +Subject: [PATCH 88/88] [mmal] Exit preroll when we have some decoded frames + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +index 42c62db..0498ec7 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +@@ -925,6 +925,10 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) + } + else + m_preroll = false; ++ ++ if (m_preroll && m_output_ready.size() >= GetAllowedReferences()) ++ m_preroll = false; ++ + if (!m_output_ready.empty() && !m_preroll) + { + #if defined(MMAL_DEBUG_VERBOSE)