diff --git a/packages/mediacenter/kodi/patches/kodi-999.99-buildfix.patch b/packages/mediacenter/kodi/patches/kodi-999.99-buildfix.patch new file mode 100644 index 0000000000..b0cb92442d --- /dev/null +++ b/packages/mediacenter/kodi/patches/kodi-999.99-buildfix.patch @@ -0,0 +1,12 @@ +diff -Naur kodi-15.0-rc1-9ff25f8/configure.ac kodi-15.0-rc1-9ff25f8.patch/configure.ac +--- kodi-15.0-rc1-9ff25f8/configure.ac 2015-07-02 23:35:21.000000000 +0200 ++++ kodi-15.0-rc1-9ff25f8.patch/configure.ac 2015-07-04 08:15:52.284856500 +0200 +@@ -1051,7 +1051,7 @@ + AC_DEFINE([HAVE_LIBEGL],[1],["Define to 1 if you have the `EGL' library (-lEGL)."]) + AC_DEFINE([HAVE_LIBGLESV2],[1],["Define to 1 if you have the `GLESv2' library (-lGLESv2)."]) + AC_MSG_RESULT(== WARNING: OpenGLES support is assumed.) +- LIBS="$LIBS -lEGL -lGLESv2 -lbcm_host -lvcos -lvchiq_arm -lmmal -lmmal_core -lmmal_util" ++ LIBS="$LIBS -lEGL -lGLESv2 -lbcm_host -lvcos -lvchiq_arm -lmmal -lmmal_core -lmmal_util -lvcsm" + else + AC_CHECK_LIB([EGL], [main],, AC_MSG_ERROR($missing_library)) + AC_CHECK_LIB([GLESv2],[main],, AC_MSG_ERROR($missing_library)) diff --git a/projects/RPi/patches/kodi/kodi-001-isengard-rpb-backports.patch b/projects/RPi/patches/kodi/kodi-001-isengard-rpb-backports.patch index c60b9d9c25..e1ec4be1b1 100644 --- a/projects/RPi/patches/kodi/kodi-001-isengard-rpb-backports.patch +++ b/projects/RPi/patches/kodi/kodi-001-isengard-rpb-backports.patch @@ -1,7 +1,7 @@ -From 334f38e87d0f4d071929f26a73db4075f5a40a86 Mon Sep 17 00:00:00 2001 +From d4dbab9f0c3bc4ab02ba312ba0d4aa9f41371fdf Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 18:19:32 +0100 -Subject: [PATCH 01/51] [rbp/omxplayer] When opening a stream don't try to +Subject: [PATCH 01/58] [rbp/omxplayer] When opening a stream don't try to update gui so often --- @@ -25,10 +25,10 @@ index 2faceea..889d7a2 100644 g_windowManager.ProcessRenderLoop(false); if (allowCancel && dialog->IsCanceled()) -From 7ddf4d5ef049c6ab43814ea9946347fd8e13e36c Mon Sep 17 00:00:00 2001 +From 1ecf22c5b4c919e3aed5274c67f748bbae86fbf0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 8 Mar 2014 15:36:06 +0000 -Subject: [PATCH 03/51] [hifiberry] Hack: force it to be recognised as IEC958 +Subject: [PATCH 03/58] [hifiberry] Hack: force it to be recognised as IEC958 capable to enable passthrough options --- @@ -51,10 +51,10 @@ index e22db7a..0120bd5 100644 info.m_displayName.substr(info.m_displayName.size()-5) == " HDMI") { -From 9d64e65d1de3cd2c18fdb95bc7d7825f42602ad9 Mon Sep 17 00:00:00 2001 +From ac054e5b5efd9ec9205598f9b7549a8e953272fd Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 1 May 2014 16:28:39 +0100 -Subject: [PATCH 04/51] Improved file buffering in CArchive +Subject: [PATCH 04/58] 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 @@ -114,10 +114,10 @@ index 6ed0f8f..8506d95 100644 } else -From 11c32ec255761eb3763fa4b2bf7f4a261238e102 Mon Sep 17 00:00:00 2001 +From 1a7d63a938850a884f08bd3af66808bef91b7588 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 12 Aug 2014 00:31:36 +0100 -Subject: [PATCH 05/51] [omxcodec] Don't force software codec with dvds +Subject: [PATCH 05/58] [omxcodec] Don't force software codec with dvds --- xbmc/cores/dvdplayer/DVDPlayer.cpp | 2 ++ @@ -138,10 +138,10 @@ index 82b5baa..70b1ac3 100644 else if (m_pInputStream && m_pInputStream->IsStreamType(DVDSTREAM_TYPE_PVRMANAGER)) { -From 9a08c47d230a839bc32bf6c81c3d54bb8692b248 Mon Sep 17 00:00:00 2001 +From 47e9b3430cd67a4e9e17de65df96f9c0dbb7c39c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 10 Aug 2014 16:45:16 +0100 -Subject: [PATCH 06/51] filesystem: Make support of browsing into archives +Subject: [PATCH 06/58] 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. @@ -159,7 +159,7 @@ We'll let people who don't use archives disable it manually 3 files changed, 18 insertions(+) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 97039ca..9614036 100644 +index ff32bfd..5345dc2 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -16582,6 +16582,15 @@ msgstr "" @@ -224,10 +224,10 @@ index 5af92e7..568a1a8 100644 { // XBMC Smart playlist - just XML renamed to XSP // read the name of the playlist in -From 52ba2eb2daaeba3eaa7213b2f370f11b73ebdd51 Mon Sep 17 00:00:00 2001 +From e863fd0253902d92c56ed85e589bffadc98b245f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 27 Oct 2014 13:06:57 +0000 -Subject: [PATCH 08/51] [rbp] Make cachemembuffersize default depend on memory +Subject: [PATCH 08/58] [rbp] Make cachemembuffersize default depend on memory size --- @@ -329,10 +329,10 @@ index 2e3282c..d1606a2 100644 } -From b14ed34e6cf3a147e4e93161c60ff804b6a77286 Mon Sep 17 00:00:00 2001 +From 06bd0674846783738e6b81f351ba49bb633c473b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 30 May 2014 14:58:43 +0100 -Subject: [PATCH 10/51] [settings] Experiment: Report DESKTOP resolution in +Subject: [PATCH 10/58] [settings] Experiment: Report DESKTOP resolution in video settings --- @@ -354,10 +354,10 @@ index 4376463..fc4e5ea 100644 StringUtils::Format("%dx%d%s", resolution->width, resolution->height, ModeFlagsToString(resolution->flags, false).c_str()), -From 975844c8114a270ab8c97925806b41a09600a90e Mon Sep 17 00:00:00 2001 +From c2b0eafa1ed07258aa09a24a443d4535db8b3a1e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 9 Sep 2014 12:04:26 +0100 -Subject: [PATCH 11/51] egl: Treat unknown display aspect ratio as square pixel +Subject: [PATCH 11/58] egl: Treat unknown display aspect ratio as square pixel --- xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 4 ++-- @@ -386,10 +386,10 @@ index bda7430..68fc647 100644 SetResolutionString(m_desktopRes); -From 873e875a8538a1c5219054f30a80d90877d0d301 Mon Sep 17 00:00:00 2001 +From 5f1821e4d8157a890c795744841dcb895a1349b4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 19 Sep 2014 11:54:49 +0100 -Subject: [PATCH 12/51] [dvdplayer/rbp] Add pi specific option to maintain +Subject: [PATCH 12/58] [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". @@ -414,7 +414,7 @@ Needed updated firmware 9 files changed, 91 insertions(+), 7 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 9614036..36b8c5d 100644 +index 5345dc2..6d08156 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -6321,7 +6321,22 @@ msgctxt "#13459" @@ -681,10 +681,10 @@ index 7df1bf7..732b69d 100644 float m_audioPlayCountMinimumPercent; bool m_dvdplayerIgnoreDTSinWAV; -From 0323acdf71a6bf8d66ff569403e8fc0412291325 Mon Sep 17 00:00:00 2001 +From 6ead5d132f5d43c6ea3063c5fcd1c7d3b23eca18 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 24 Sep 2014 23:13:52 +0100 -Subject: [PATCH 13/51] [audio] Add settings option to boost centre channel +Subject: [PATCH 13/58] [audio] Add settings option to boost centre channel when downmixing This allows a dB volume increase to be added to centre channel. @@ -702,7 +702,7 @@ Should work with Pi Sink (dvdplayer/paplayer) and omxplayer 5 files changed, 45 insertions(+) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 36b8c5d..c1148e8 100644 +index 6d08156..6e36b42 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -16650,3 +16650,17 @@ msgctxt "#38006" @@ -772,7 +772,7 @@ index e4ddf9e..34d0152 100644 if (remapLayout) { diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -index 7807149..759ba7b 100644 +index 78071493..759ba7b 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp @@ -164,6 +164,12 @@ bool CActiveAEResamplePi::Init(uint64_t dst_chan_layout, int dst_channels, int d @@ -806,10 +806,10 @@ index f99c0e6..1911189 100644 // stereo upmix if (upmix && m_src_channels == 2 && m_dst_channels > 2) -From 8dada388745328d01b186ede90c64be0b571a936 Mon Sep 17 00:00:00 2001 +From aca0d43f243143b6776e1cc8ef259197d2bee97a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 27 Oct 2014 15:23:51 +0000 -Subject: [PATCH 14/51] [rbp] Default extract thumbnails to false +Subject: [PATCH 14/58] [rbp] Default extract thumbnails to false It can take 80 seconds for a single file on a Pi. It can cause crashes with out-of-memory errors. It genereates a lot of support issues. Best to default to disabled and let users enable it if they must @@ -839,10 +839,10 @@ index 50fe36a..a54a4c4 100644
-From cf3e013db35eda90e5e2f337d8355312ce0e5955 Mon Sep 17 00:00:00 2001 +From 35f0f171ab8a9c37b2ebb5aca81b2242834fda72 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 15 Nov 2014 12:03:34 +0000 -Subject: [PATCH 19/51] [dvdplayer] Add lock for player creation +Subject: [PATCH 19/58] [dvdplayer] Add lock for player creation --- xbmc/cores/dvdplayer/DVDPlayer.cpp | 3 +++ @@ -878,7 +878,7 @@ index 70b1ac3..b41c8f0 100644 std::string retVal; diff --git a/xbmc/cores/dvdplayer/DVDPlayer.h b/xbmc/cores/dvdplayer/DVDPlayer.h -index 2a4aea5..f74e71d 100644 +index ab6a228..32e76c1 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.h +++ b/xbmc/cores/dvdplayer/DVDPlayer.h @@ -557,4 +557,5 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer @@ -888,10 +888,10 @@ index 2a4aea5..f74e71d 100644 + CCriticalSection m_players_lock; }; -From 5d3ab1cf45b4eca6f524b4555e3f103e27467a49 Mon Sep 17 00:00:00 2001 +From 51e261109f6a8d1cb0e96bdaa56a01aa7077633f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 24 Nov 2014 22:07:25 +0000 -Subject: [PATCH 20/51] [dvdplayervideo] Prod decoder when in stills mode +Subject: [PATCH 20/58] [dvdplayervideo] Prod decoder when in stills mode An asynchronous hardware decoder doesn't only produce output pictures when new packets arrive. In dvd stills mode give it a chance to return pictures that weren't ready when frame was decoded. @@ -900,7 +900,7 @@ In dvd stills mode give it a chance to return pictures that weren't ready when f 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 656c937..bdc3edb 100644 +index f1a7e60..9be8aae 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -314,7 +314,8 @@ void CDVDPlayerVideo::Process() @@ -968,10 +968,10 @@ index 656c937..bdc3edb 100644 if (pMsg->IsType(CDVDMsg::GENERAL_SYNCHRONIZE)) -From 25d43d2d6bdf9de85a30161aa1c7e0260b4de33b Mon Sep 17 00:00:00 2001 +From deb376b5dad3cef8f86cef69aab9a4280bac9b21 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 27 Nov 2014 16:31:56 +0000 -Subject: [PATCH 21/51] [languageinvoker] Reduce priority of python threads +Subject: [PATCH 21/58] [languageinvoker] Reduce priority of python threads --- xbmc/interfaces/generic/LanguageInvokerThread.cpp | 5 +++++ @@ -994,10 +994,10 @@ index fcdd063..16f0c89 100644 } -From 126cddbf807d68c42e07d24c733d65abb687b500 Mon Sep 17 00:00:00 2001 +From 7351fa296cd1740f04c6c5a2047c11e3b607f700 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 14 Dec 2013 16:55:05 +0000 -Subject: [PATCH 22/51] logging: Add microsecond timer to log messages +Subject: [PATCH 22/58] logging: Add microsecond timer to log messages --- xbmc/utils/log.cpp | 17 +++++++++++++++-- @@ -1050,10 +1050,10 @@ index 3443f12..31c4a99 100644 levelNames[logLevel]) + strData; -From cfe6214efcc206c97cf8eb6b224c0a8d63981c77 Mon Sep 17 00:00:00 2001 +From c2bc1032b22f6214ffbbbecb29e3538f9790f016 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 29 Nov 2014 15:25:16 +0000 -Subject: [PATCH 23/51] [rbp] hack: wait for splash to complete before changing +Subject: [PATCH 23/58] [rbp] hack: wait for splash to complete before changing hdmi mode --- @@ -1127,10 +1127,10 @@ index 68fc647..c80114e 100644 if(!m_fixedMode && GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) -From 1610df489966e26604392af08d40a2a2eacad8db Mon Sep 17 00:00:00 2001 +From 58ed12b2f7dd77fc57b3ddbff8fbaa04a0172716 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 11 Dec 2014 17:00:57 +0000 -Subject: [PATCH 24/51] Fix for UI not showing both extractflags and +Subject: [PATCH 24/58] Fix for UI not showing both extractflags and extractthumb --- @@ -1139,7 +1139,7 @@ Subject: [PATCH 24/51] Fix for UI not showing both extractflags and 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index b6b48b4..6c3a220 100644 +index 788a831..a794cd8 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -11015,7 +11015,7 @@ msgstr "" @@ -1194,10 +1194,10 @@ index 09c3d10..1059b09 100644 -From 07f3c28448d28cf7347394dca6e6a1faeaa7e3ec Mon Sep 17 00:00:00 2001 +From 6f0adae04039766326ebb5a735433dac07787a0f Mon Sep 17 00:00:00 2001 From: anaconda Date: Thu, 11 Sep 2014 21:30:43 +0200 -Subject: [PATCH 25/51] Disable autoscrolling while on screensaver and while +Subject: [PATCH 25/58] Disable autoscrolling while on screensaver and while opening streams. --- @@ -1210,10 +1210,10 @@ Subject: [PATCH 25/51] Disable autoscrolling while on screensaver and while 6 files changed, 24 insertions(+), 3 deletions(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index ffc7ad3..f35871a 100644 +index 697f278..a2a7fd2 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -4993,3 +4993,13 @@ bool CApplication::NotifyActionListeners(const CAction &action) const +@@ -4996,3 +4996,13 @@ bool CApplication::NotifyActionListeners(const CAction &action) const return false; } @@ -1328,10 +1328,10 @@ index 0d5b3f7..6d23024 100644 if (m_lastRenderTime) m_autoScrollDelayTime += currentTime - m_lastRenderTime; -From 5acd81c2d630bbe83763c5463cc26aae862a87b4 Mon Sep 17 00:00:00 2001 +From 9b85c054f66cb5efde618d34198bd533f16f26d5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 13 Dec 2014 18:35:20 +0000 -Subject: [PATCH 26/51] [demuxer] Avoid memcpy on every demuxer packet +Subject: [PATCH 26/58] [demuxer] Avoid memcpy on every demuxer packet Avoids an unnecessary memcpy on every demuxer packet which for high bitrate videos can be significant. @@ -1426,10 +1426,10 @@ index ab298b2..10c5ee0 100644 } catch(...) { -From 80367ca635d7fd6ba3e278fe4c4f2a9275f5c358 Mon Sep 17 00:00:00 2001 +From cb5bcc331593fa2d2088c0a0f8f72aefce1030e2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 15 Feb 2015 14:06:12 +0000 -Subject: [PATCH 27/51] [mmal] Allow mmal codec for dvd stills +Subject: [PATCH 27/58] [mmal] Allow mmal codec for dvd stills --- xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp | 7 +++++++ @@ -1461,10 +1461,10 @@ index 4c363cf..b90237b 100644 { // If dvd is an mpeg2 and hint.stills -From 959665eaf7160c8adb2d0f2e862e1e8ef5df2419 Mon Sep 17 00:00:00 2001 +From 3873604d5ef7443bdfc33603c979495fe8a0f17c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 31 Mar 2015 17:31:47 +0100 -Subject: [PATCH 28/51] [mmalrenderer] Add SetCodecControl function and prefer +Subject: [PATCH 28/58] [mmalrenderer] Add SetCodecControl function and prefer to return pictures when renderer is low (disabled) --- @@ -1535,10 +1535,10 @@ index 51a64d1..bde8c06 100644 CCriticalSection m_sharedSection; MMAL_COMPONENT_T *m_dec; -From aa0a393eb9fc52c4aa791042dd521d16f8852567 Mon Sep 17 00:00:00 2001 +From 8f077b7937e519bbe44a02c3559808672696903e Mon Sep 17 00:00:00 2001 From: anaconda Date: Wed, 25 Feb 2015 18:22:21 +0100 -Subject: [PATCH 29/51] Load OSD dialogs on startup. +Subject: [PATCH 29/58] Load OSD dialogs on startup. Fixes skipped frames the first time they're loaded in memory on less powered devices, like a Raspberry Pi, when using DVDPlayer. @@ -1633,10 +1633,10 @@ index 9f25fa5..3ece45b 100644 CGUIDialogVideoSettings::~CGUIDialogVideoSettings() { } -From cd731d75ce08cb29dc73de665830a4597db691a9 Mon Sep 17 00:00:00 2001 +From 2c96de41d5df402113fb6f675c5c6766ad48b267 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 7 Mar 2015 22:46:21 +0000 -Subject: [PATCH 30/51] configure: Add raspberry-pi2 platform +Subject: [PATCH 30/58] configure: Add raspberry-pi2 platform --- configure.ac | 14 +++++++-- @@ -1648,7 +1648,7 @@ Subject: [PATCH 30/51] configure: Add raspberry-pi2 platform 6 files changed, 44 insertions(+), 22 deletions(-) diff --git a/configure.ac b/configure.ac -index 96be96f..7e924a2 100644 +index 71883d2..6beec97 100644 --- a/configure.ac +++ b/configure.ac @@ -744,8 +744,17 @@ case $use_platform in @@ -1810,449 +1810,10 @@ index cdc2fe4..379bd1d 100644 set(CMAKE_SYSTEM_NAME Linux) endif() -From a6e8bc8e2784775522dce233f0f9dc0bde7fca44 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 16 Apr 2014 21:18:06 +0100 -Subject: [PATCH 31/51] [omxplayer] Don't propagate 3d flags based on supported - 3d modes - ---- - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 29 +++-------------------------- - 1 file changed, 3 insertions(+), 26 deletions(-) - -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index 212a89b..dd509ea 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -752,40 +752,17 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f - uint32_t video_width = CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth; - uint32_t video_height = CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight; - -- unsigned flags = 0; - ERenderFormat format = RENDER_FMT_BYPASS; - -+ /* figure out steremode expected based on user settings and hints */ -+ unsigned flags = GetStereoModeFlags(GetStereoMode()); -+ - if(m_bAllowFullscreen) - { - flags |= CONF_FLAGS_FULLSCREEN; - m_bAllowFullscreen = false; // only allow on first configure - } - -- flags |= GetStereoModeFlags(GetStereoMode()); -- -- if(flags & CONF_FLAGS_STEREO_MODE_SBS) -- { -- if(g_Windowing.Support3D(video_width, video_height, D3DPRESENTFLAG_MODE3DSBS)) -- CLog::Log(LOGNOTICE, "3DSBS movie found"); -- else -- { -- flags &= ~CONF_FLAGS_STEREO_MODE_MASK(~0); -- CLog::Log(LOGNOTICE, "3DSBS movie found but not supported"); -- } -- } -- else if(flags & CONF_FLAGS_STEREO_MODE_TAB) -- { -- if(g_Windowing.Support3D(video_width, video_height, D3DPRESENTFLAG_MODE3DTB)) -- CLog::Log(LOGNOTICE, "3DTB movie found"); -- else -- { -- flags &= ~CONF_FLAGS_STEREO_MODE_MASK(~0); -- CLog::Log(LOGNOTICE, "3DTB movie found but not supported"); -- } -- } -- else -- CLog::Log(LOGNOTICE, "not a 3D movie"); -- - unsigned int iDisplayWidth = width; - unsigned int iDisplayHeight = height; - - -From 46641c44cbf4832f8dc2e09de13c90ec263c7eb0 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 17 Apr 2014 13:01:51 +0100 -Subject: [PATCH 32/51] [graphics] Allow switching to a more suitable 3D - resolution - ---- - xbmc/guilib/GraphicContext.cpp | 40 +++++++++++++++++++++++++++++++++++++++- - xbmc/guilib/GraphicContext.h | 1 + - 2 files changed, 40 insertions(+), 1 deletion(-) - -diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp -index bd7dff9..ed7316a 100644 ---- a/xbmc/guilib/GraphicContext.cpp -+++ b/xbmc/guilib/GraphicContext.cpp -@@ -32,6 +32,7 @@ - #include "input/InputManager.h" - #include "GUIWindowManager.h" - #include "video/VideoReferenceClock.h" -+#include - - using namespace std; - -@@ -499,6 +500,43 @@ RESOLUTION CGraphicContext::GetVideoResolution() const - return m_Resolution; - } - -+RESOLUTION CGraphicContext::Get3DVideoResolution(RESOLUTION resolution, RENDER_STEREO_MODE mode) const -+{ -+ RESOLUTION best = resolution; -+ RESOLUTION_INFO curr = CDisplaySettings::Get().GetResolutionInfo(best); -+ // Find closest refresh rate -+ for (size_t i = (int)RES_DESKTOP; i < CDisplaySettings::Get().ResolutionInfoSize(); i++) -+ { -+ const RESOLUTION_INFO info = CDisplaySettings::Get().GetResolutionInfo((RESOLUTION)i); -+ -+ //discard resolutions that are not the same width and height (and interlaced/3D flags) -+ //or have a too low refreshrate -+ if (info.iScreenWidth != curr.iScreenWidth -+ || info.iScreenHeight != curr.iScreenHeight -+ || info.iScreen != curr.iScreen -+ || (info.dwFlags & D3DPRESENTFLAG_INTERLACED) != (curr.dwFlags & D3DPRESENTFLAG_INTERLACED) -+ || fabs(info.fRefreshRate - curr.fRefreshRate) >= FLT_EPSILON) -+ continue; -+ -+ if (mode == RENDER_STEREO_MODE_SPLIT_VERTICAL && info.dwFlags & D3DPRESENTFLAG_MODE3DSBS) -+ { -+ best = (RESOLUTION)i; -+ break; -+ } -+ else if (mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL && info.dwFlags & D3DPRESENTFLAG_MODE3DTB) -+ { -+ best = (RESOLUTION)i; -+ break; -+ } -+ else if ((mode == RENDER_STEREO_MODE_OFF || mode == RENDER_STEREO_MODE_MONO) && !(info.dwFlags & (D3DPRESENTFLAG_MODE3DSBS|D3DPRESENTFLAG_MODE3DTB))) -+ { -+ best = (RESOLUTION)i; -+ break; -+ } -+ } -+ return best; -+} -+ - void CGraphicContext::ResetOverscan(RESOLUTION_INFO &res) - { - res.Overscan.left = 0; -@@ -1042,7 +1080,7 @@ void CGraphicContext::Flip(const CDirtyRegionList& dirty) - if(m_stereoMode != m_nextStereoMode) - { - m_stereoMode = m_nextStereoMode; -- SetVideoResolution(GetVideoResolution(), true); -+ SetVideoResolution(Get3DVideoResolution(m_Resolution, m_stereoMode), true); - g_windowManager.SendMessage(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_RENDERER_RESET); - } - } -diff --git a/xbmc/guilib/GraphicContext.h b/xbmc/guilib/GraphicContext.h -index a8fd03e..8501e58 100644 ---- a/xbmc/guilib/GraphicContext.h -+++ b/xbmc/guilib/GraphicContext.h -@@ -108,6 +108,7 @@ class CGraphicContext : public CCriticalSection, - bool IsValidResolution(RESOLUTION res); - void SetVideoResolution(RESOLUTION res, bool forceUpdate = false); - RESOLUTION GetVideoResolution() const; -+ RESOLUTION Get3DVideoResolution(RESOLUTION resolution, RENDER_STEREO_MODE mode) const; - void ResetOverscan(RESOLUTION res, OVERSCAN &overscan); - void ResetOverscan(RESOLUTION_INFO &resinfo); - void ResetScreenParameters(RESOLUTION res); - -From 55a4a727c1c8d0ca28deb1a8ca2c6ffa6a4eb0aa Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 17 Apr 2014 13:38:55 +0100 -Subject: [PATCH 33/51] [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. ---- - xbmc/cores/VideoRenderers/BaseRenderer.cpp | 47 +++++++++++------------------- - 1 file changed, 17 insertions(+), 30 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.cpp b/xbmc/cores/VideoRenderers/BaseRenderer.cpp -index bfafab7..84e6261 100644 ---- a/xbmc/cores/VideoRenderers/BaseRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/BaseRenderer.cpp -@@ -222,10 +222,14 @@ void CBaseRenderer::FindResolutionFromFpsMatch(float fps, float& weight) - RESOLUTION CBaseRenderer::FindClosestResolution(float fps, float multiplier, RESOLUTION current, float& weight) - { - RESOLUTION_INFO curr = g_graphicsContext.GetResInfo(current); -+ unsigned int stereo_mode = CONF_FLAGS_STEREO_MODE_MASK(m_iFlags); - - float fRefreshRate = fps; - -- float last_diff = fRefreshRate; -+ int c_weight = MathUtils::round_int(RefreshWeight(curr.fRefreshRate, fRefreshRate * multiplier) * 1000.0); -+ if (!(stereo_mode == CONF_FLAGS_STEREO_MODE_SBS) != !(curr.dwFlags & D3DPRESENTFLAG_MODE3DSBS) || -+ !(stereo_mode == CONF_FLAGS_STEREO_MODE_TAB) != !(curr.dwFlags & D3DPRESENTFLAG_MODE3DTB)) -+ c_weight += 1000; - - // Find closest refresh rate - for (size_t i = (int)RES_DESKTOP; i < CDisplaySettings::Get().ResolutionInfoSize(); i++) -@@ -241,40 +245,23 @@ RESOLUTION CBaseRenderer::FindClosestResolution(float fps, float multiplier, RES - || info.fRefreshRate < (fRefreshRate * multiplier / 1.001) - 0.001) - continue; - -- // For 3D choose the closest refresh rate -- if(CONF_FLAGS_STEREO_MODE_MASK(m_iFlags)) -- { -- float diff = (info.fRefreshRate - fRefreshRate); -- if(diff < 0) -- diff *= -1.0f; -+ int i_weight = MathUtils::round_int(RefreshWeight(info.fRefreshRate, fRefreshRate * multiplier) * 1000.0); - -- if(diff < last_diff) -- { -- last_diff = diff; -- current = (RESOLUTION)i; -- curr = info; -- } -- } -- else -- { -- int c_weight = MathUtils::round_int(RefreshWeight(curr.fRefreshRate, fRefreshRate * multiplier) * 1000.0); -- int i_weight = MathUtils::round_int(RefreshWeight(info.fRefreshRate, fRefreshRate * multiplier) * 1000.0); -+ if (!(stereo_mode == CONF_FLAGS_STEREO_MODE_SBS) != !(info.dwFlags & D3DPRESENTFLAG_MODE3DSBS) || -+ !(stereo_mode == CONF_FLAGS_STEREO_MODE_TAB) != !(info.dwFlags & D3DPRESENTFLAG_MODE3DTB)) -+ i_weight += 1000; - -- // Closer the better, prefer higher refresh rate if the same -- if ((i_weight < c_weight) -- || (i_weight == c_weight && info.fRefreshRate > curr.fRefreshRate)) -- { -- current = (RESOLUTION)i; -- curr = info; -- } -+ // Closer the better, prefer higher refresh rate if the same -+ if ((i_weight < c_weight) -+ || (i_weight == c_weight && info.fRefreshRate > curr.fRefreshRate)) -+ { -+ current = (RESOLUTION)i; -+ curr = info; -+ c_weight = i_weight; - } - } - -- // For 3D overwrite weight -- if(CONF_FLAGS_STEREO_MODE_MASK(m_iFlags)) -- weight = 0; -- else -- weight = RefreshWeight(curr.fRefreshRate, fRefreshRate * multiplier); -+ weight = RefreshWeight(curr.fRefreshRate, fRefreshRate * multiplier); - - return current; - } - -From 568e84b69fc126735e0c9e298d3fa7d2eea0aae2 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 23 Apr 2014 00:05:07 +0100 -Subject: [PATCH 34/51] [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. ---- - xbmc/cores/VideoRenderers/BaseRenderer.cpp | 10 +++---- - xbmc/guilib/GraphicContext.cpp | 37 ++++++++++++------------- - xbmc/guilib/GraphicContext.h | 12 ++++++-- - xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 8 ------ - 4 files changed, 32 insertions(+), 35 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.cpp b/xbmc/cores/VideoRenderers/BaseRenderer.cpp -index 84e6261..f82f37f 100644 ---- a/xbmc/cores/VideoRenderers/BaseRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/BaseRenderer.cpp -@@ -119,7 +119,7 @@ bool CBaseRenderer::FindResolutionFromOverride(float fps, float& weight, bool fa - - for (size_t j = (int)RES_DESKTOP; j < CDisplaySettings::Get().ResolutionInfoSize(); j++) - { -- RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)j); -+ RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)j, g_graphicsContext.GetStereoMode((RESOLUTION)j)); - - if (info.iScreenWidth == curr.iScreenWidth - && info.iScreenHeight == curr.iScreenHeight -@@ -179,7 +179,7 @@ void CBaseRenderer::FindResolutionFromFpsMatch(float fps, float& weight) - //get the resolution with the refreshrate closest to 60 hertz - for (size_t i = (int)RES_DESKTOP; i < CDisplaySettings::Get().ResolutionInfoSize(); i++) - { -- RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)i); -+ RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)i, g_graphicsContext.GetStereoMode((RESOLUTION)i)); - - if (MathUtils::round_int(info.fRefreshRate) == 60 - && info.iScreenWidth == curr.iScreenWidth -@@ -200,7 +200,7 @@ void CBaseRenderer::FindResolutionFromFpsMatch(float fps, float& weight) - CLog::Log(LOGDEBUG, "60 hertz refreshrate not available, choosing highest"); - for (size_t i = (int)RES_DESKTOP; i < CDisplaySettings::Get().ResolutionInfoSize(); i++) - { -- RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)i); -+ RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)i, g_graphicsContext.GetStereoMode((RESOLUTION)i)); - - if (info.fRefreshRate > curr.fRefreshRate - && info.iScreenWidth == curr.iScreenWidth -@@ -234,14 +234,14 @@ RESOLUTION CBaseRenderer::FindClosestResolution(float fps, float multiplier, RES - // Find closest refresh rate - for (size_t i = (int)RES_DESKTOP; i < CDisplaySettings::Get().ResolutionInfoSize(); i++) - { -- const RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)i); -+ const RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)i, g_graphicsContext.GetStereoMode((RESOLUTION)i)); - - //discard resolutions that are not the same width and height (and interlaced/3D flags) - //or have a too low refreshrate - if (info.iScreenWidth != curr.iScreenWidth - || info.iScreenHeight != curr.iScreenHeight - || info.iScreen != curr.iScreen -- || (info.dwFlags & D3DPRESENTFLAG_MODEMASK) != (curr.dwFlags & D3DPRESENTFLAG_MODEMASK) -+ || (info.dwFlags & D3DPRESENTFLAG_INTERLACED) != (curr.dwFlags & D3DPRESENTFLAG_INTERLACED) - || info.fRefreshRate < (fRefreshRate * multiplier / 1.001) - 0.001) - continue; - -diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp -index ed7316a..f591b9c 100644 ---- a/xbmc/guilib/GraphicContext.cpp -+++ b/xbmc/guilib/GraphicContext.cpp -@@ -746,32 +746,33 @@ void CGraphicContext::ApplyStateBlock() - g_Windowing.ApplyStateBlock(); - } - --const RESOLUTION_INFO CGraphicContext::GetResInfo(RESOLUTION res) const -+RENDER_STEREO_MODE CGraphicContext::GetStereoMode(RESOLUTION res) const - { - RESOLUTION_INFO info = CDisplaySettings::Get().GetResolutionInfo(res); -+ return (info.dwFlags & D3DPRESENTFLAG_MODE3DTB) ? RENDER_STEREO_MODE_SPLIT_HORIZONTAL : -+ (info.dwFlags & D3DPRESENTFLAG_MODE3DSBS) ? RENDER_STEREO_MODE_SPLIT_VERTICAL : RENDER_STEREO_MODE_OFF; -+} - -- if(m_stereoMode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) -+const RESOLUTION_INFO CGraphicContext::GetResInfo(RESOLUTION res, RENDER_STEREO_MODE stereoMode) const -+{ -+ RESOLUTION_INFO info = CDisplaySettings::Get().GetResolutionInfo(res); -+ -+ if(stereoMode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) - { -- if((info.dwFlags & D3DPRESENTFLAG_MODE3DTB) == 0) -- { -- info.fPixelRatio /= 2; -- info.iBlanking = 0; -- info.dwFlags |= D3DPRESENTFLAG_MODE3DTB; -- } -+ info.fPixelRatio /= 2; -+ info.iBlanking = 0; -+ info.dwFlags |= D3DPRESENTFLAG_MODE3DTB; - info.iHeight = (info.iHeight - info.iBlanking) / 2; - info.Overscan.top /= 2; - info.Overscan.bottom = (info.Overscan.bottom - info.iBlanking) / 2; - info.iSubtitles = (info.iSubtitles - info.iBlanking) / 2; - } - -- if(m_stereoMode == RENDER_STEREO_MODE_SPLIT_VERTICAL) -+ if(stereoMode == RENDER_STEREO_MODE_SPLIT_VERTICAL) - { -- if((info.dwFlags & D3DPRESENTFLAG_MODE3DSBS) == 0) -- { -- info.fPixelRatio *= 2; -- info.iBlanking = 0; -- info.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; -- } -+ info.fPixelRatio *= 2; -+ info.iBlanking = 0; -+ info.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; - info.iWidth = (info.iWidth - info.iBlanking) / 2; - info.Overscan.left /= 2; - info.Overscan.right = (info.Overscan.right - info.iBlanking) / 2; -@@ -795,16 +796,14 @@ void CGraphicContext::SetResInfo(RESOLUTION res, const RESOLUTION_INFO& info) - if(info.dwFlags & D3DPRESENTFLAG_MODE3DSBS) - { - curr.Overscan.right = info.Overscan.right * 2 + info.iBlanking; -- if((curr.dwFlags & D3DPRESENTFLAG_MODE3DSBS) == 0) -- curr.fPixelRatio /= 2.0; -+ curr.fPixelRatio /= 2.0; - } - - if(info.dwFlags & D3DPRESENTFLAG_MODE3DTB) - { - curr.Overscan.bottom = info.Overscan.bottom * 2 + info.iBlanking; - curr.iSubtitles = info.iSubtitles * 2 + info.iBlanking; -- if((curr.dwFlags & D3DPRESENTFLAG_MODE3DTB) == 0) -- curr.fPixelRatio *= 2.0; -+ curr.fPixelRatio *= 2.0; - } - } - -diff --git a/xbmc/guilib/GraphicContext.h b/xbmc/guilib/GraphicContext.h -index 8501e58..0c53cae 100644 ---- a/xbmc/guilib/GraphicContext.h -+++ b/xbmc/guilib/GraphicContext.h -@@ -120,11 +120,15 @@ class CGraphicContext : public CCriticalSection, - void GetAllowedResolutions(std::vector &res); - - // output scaling -+ const RESOLUTION_INFO GetResInfo(RESOLUTION res) const -+ { -+ return GetResInfo(res, GetStereoMode()); -+ } - const RESOLUTION_INFO GetResInfo() const - { - return GetResInfo(m_Resolution); - } -- const RESOLUTION_INFO GetResInfo(RESOLUTION res) const; -+ const RESOLUTION_INFO GetResInfo(RESOLUTION res, RENDER_STEREO_MODE stereo_mode) const; - void SetResInfo(RESOLUTION res, const RESOLUTION_INFO& info); - - /* \brief Get UI scaling information from a given resolution to the screen resolution. -@@ -161,9 +165,11 @@ class CGraphicContext : public CCriticalSection, - void RestoreOrigin(); - void SetCameraPosition(const CPoint &camera); - void SetStereoView(RENDER_STEREO_VIEW view); -- RENDER_STEREO_VIEW GetStereoView() { return m_stereoView; } -+ RENDER_STEREO_VIEW GetStereoView() const { return m_stereoView; } - void SetStereoMode(RENDER_STEREO_MODE mode) { m_nextStereoMode = mode; } -- RENDER_STEREO_MODE GetStereoMode() { return m_stereoMode; } -+ RENDER_STEREO_MODE GetStereoMode() const { return m_stereoMode; } -+ RENDER_STEREO_MODE GetStereoMode(RESOLUTION res) const; -+ - void RestoreCameraPosition(); - /*! \brief Set a region in which to clip all rendering - Anything that is rendered after setting a clip region will be clipped so that no part renders -diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -index c80114e..80c05d2 100644 ---- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -+++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -@@ -499,15 +499,9 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r - m_desktopRes.fPixelRatio = tv_state.display.hdmi.display_options.aspect == 0 ? 1.0f : get_display_aspect_ratio((HDMI_ASPECT_T)tv_state.display.hdmi.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); - // Also add 3D flags - if (tv_state.display.hdmi.format_3d == HDMI_3D_FORMAT_SBS_HALF) -- { - m_desktopRes.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; -- m_desktopRes.fPixelRatio *= 2.0; -- } - else if (tv_state.display.hdmi.format_3d == HDMI_3D_FORMAT_TB_HALF) -- { - m_desktopRes.dwFlags |= D3DPRESENTFLAG_MODE3DTB; -- m_desktopRes.fPixelRatio *= 0.5; -- } - HDMI_PROPERTY_PARAM_T property; - property.property = HDMI_PROPERTY_PIXEL_CLOCK_TYPE; - vc_tv_hdmi_get_property(&property); -@@ -650,7 +644,6 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v - RESOLUTION_INFO res2 = res; - res2.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; - res2.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res2.iScreenWidth / (float)res2.iScreenHeight); -- res2.fPixelRatio *= 2.0f; - res2.iSubtitles = (int)(0.965 * res2.iHeight); - - AddUniqueResolution(res2, resolutions); -@@ -666,7 +659,6 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v - RESOLUTION_INFO res2 = res; - res2.dwFlags |= D3DPRESENTFLAG_MODE3DTB; - res2.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res2.iScreenWidth / (float)res2.iScreenHeight); -- res2.fPixelRatio *= 0.5f; - res2.iSubtitles = (int)(0.965 * res2.iHeight); - - AddUniqueResolution(res2, resolutions); - -From 0c9da02efd32493162bbe0080ce08fc75d024ad2 Mon Sep 17 00:00:00 2001 +From ecf7d1b7364dd7cb121825168aa51a6b14946614 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 10 Mar 2015 17:05:18 +0000 -Subject: [PATCH 35/51] [players] Add settings option to enable MVC support +Subject: [PATCH 31/58] [players] Add settings option to enable MVC support --- addons/resource.language.en_gb/resources/strings.po | 10 ++++++++++ @@ -2262,7 +1823,7 @@ Subject: [PATCH 35/51] [players] Add settings option to enable MVC support 4 files changed, 27 insertions(+) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 6c3a220..f5b7c42 100644 +index a794cd8..acb6372 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -16680,6 +16680,16 @@ msgctxt "#38052" @@ -2333,10 +1894,10 @@ index e4f6d86..5d324f4 100644 case AV_CODEC_ID_MPEG4: // (role name) video_decoder.mpeg4 -From 397a5d0b70abe0922387a0afd8beb4842a56e9b0 Mon Sep 17 00:00:00 2001 +From 7c831c1cf47b62ee6ea8d57457b4b5ee35f29882 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 14 Mar 2015 12:38:08 +0000 -Subject: [PATCH 36/51] [mmalrenderer] Switch to using transform flags for 3d +Subject: [PATCH 32/58] [mmalrenderer] Switch to using transform flags for 3d modes --- @@ -2350,7 +1911,7 @@ Subject: [PATCH 36/51] [mmalrenderer] Switch to using transform flags for 3d 7 files changed, 75 insertions(+), 130 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index f5b7c42..4848047 100644 +index acb6372..e1b691d 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -16690,6 +16690,16 @@ msgctxt "#38111" @@ -2529,7 +2090,7 @@ index 9f1f803..6cde0c5 100644 + region.dest_rect.x, region.dest_rect.y, region.dest_rect.width, region.dest_rect.height, region.transform); } diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index dd509ea..adf9910 100644 +index 212a89b..ba17a46 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp @@ -649,9 +649,7 @@ int OMXPlayerVideo::GetFreeSpace() @@ -2687,7 +2248,7 @@ index d0634bb..86e94ce 100644 bool GetPlayerInfo(double &match, double &phase, double &pll); void SubmitEOS(); diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -index 80c05d2..ae85484 100644 +index c80114e..3816b55 100644 --- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp @@ -281,7 +281,9 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) @@ -2695,7 +2256,7 @@ index 80c05d2..ae85484 100644 HDMI_PROPERTY_PARAM_T property; property.property = HDMI_PROPERTY_3D_STRUCTURE; - if (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) -+ if (CSettings::Get().GetBool("videoplayer.framepacking")) ++ if (CSettings::Get().GetBool("videoplayer.framepacking") && CSettings::Get().GetBool("videoplayer.supportmvc")) + property.param1 = HDMI_3D_FORMAT_FRAME_PACKING; + else if (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) property.param1 = HDMI_3D_FORMAT_SBS_HALF; @@ -2716,10 +2277,10 @@ index 80c05d2..ae85484 100644 m_width, m_height, dst_rect.width, dst_rect.height, res.fRefreshRate, GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), (int)res.dwFlags, res.fPixelRatio); -From 180bad11da9d406158975f960198af9315170743 Mon Sep 17 00:00:00 2001 +From 404462b4bf655a3dd1f50f619162839f47f6efaa Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 14 Apr 2015 20:51:14 +0100 -Subject: [PATCH 39/51] [gui] Also limit GUI updates when in non full-screen +Subject: [PATCH 35/58] [gui] Also limit GUI updates when in non full-screen video mode --- @@ -2727,10 +2288,10 @@ Subject: [PATCH 39/51] [gui] Also limit GUI updates when in non full-screen 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index f35871a..dd58116 100644 +index a2a7fd2..95ec768 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -2504,7 +2504,7 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) +@@ -2507,7 +2507,7 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) #if defined(TARGET_RASPBERRY_PI) || defined(HAS_IMXVPU) // This code reduces rendering fps of the GUI layer when playing videos in fullscreen mode // it makes only sense on architectures with multiple layers @@ -2739,7 +2300,7 @@ index f35871a..dd58116 100644 fps = CSettings::Get().GetInt("videoplayer.limitguiupdate"); #endif -@@ -2517,6 +2517,8 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) +@@ -2520,6 +2520,8 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) { if (!m_skipGuiRender) g_windowManager.Process(CTimeUtils::GetFrameTime()); @@ -2749,10 +2310,761 @@ index f35871a..dd58116 100644 g_windowManager.FrameMove(); } -From a00d53ea266d3513d4785ff730d4d3ed9aace2a4 Mon Sep 17 00:00:00 2001 +From f83aef5f43795b2e08d87dc1ba8723bd7c7f09a2 Mon Sep 17 00:00:00 2001 +From: macrule +Date: Thu, 11 Apr 2013 18:24:42 +0200 +Subject: [PATCH 36/58] Added some vc_tv_* functions that were missing in + DllBCM. + +--- + xbmc/linux/DllBCM.h | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/xbmc/linux/DllBCM.h b/xbmc/linux/DllBCM.h +index b92fdb8..9c7e293 100644 +--- a/xbmc/linux/DllBCM.h ++++ b/xbmc/linux/DllBCM.h +@@ -48,6 +48,9 @@ class DllBcmHostInterface + virtual void bcm_host_init() = 0; + virtual void bcm_host_deinit() = 0; + virtual int32_t graphics_get_display_size( const uint16_t display_number, uint32_t *width, uint32_t *height) = 0; ++ virtual int vc_tv_power_off() = 0; ++ virtual int vc_tv_sdtv_power_on(SDTV_MODE_T mode, SDTV_OPTIONS_T *options) = 0; ++ virtual int vc_tv_hdmi_power_on_preferred() = 0; + virtual int vc_tv_hdmi_power_on_best(uint32_t width, uint32_t height, uint32_t frame_rate, + HDMI_INTERLACED_T scan_mode, EDID_MODE_MATCH_FLAG_T match_flags) = 0; + virtual int vc_tv_hdmi_power_on_best_3d(uint32_t width, uint32_t height, uint32_t frame_rate, +@@ -92,6 +95,12 @@ class DllBcmHost : public DllDynamic, DllBcmHostInterface + { return ::bcm_host_deinit(); }; + virtual int32_t graphics_get_display_size( const uint16_t display_number, uint32_t *width, uint32_t *height) + { return ::graphics_get_display_size(display_number, width, height); }; ++ virtual int vc_tv_power_off() ++ { return ::vc_tv_power_off(); } ++ virtual int vc_tv_sdtv_power_on(SDTV_MODE_T mode, SDTV_OPTIONS_T *options) ++ { return ::vc_tv_sdtv_power_on(mode, options); } ++ virtual int vc_tv_hdmi_power_on_preferred() ++ { return ::vc_tv_hdmi_power_on_preferred(); } + virtual int vc_tv_hdmi_power_on_best(uint32_t width, uint32_t height, uint32_t frame_rate, + 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 f72df42ab7b2987446c08230917f59391f58c1ef Mon Sep 17 00:00:00 2001 +From: macrule +Date: Thu, 11 Apr 2013 18:29:03 +0200 +Subject: [PATCH 37/58] Added private utility function to map a float display + aspect, to the respective SDTV_ASPECT_* enum value. + +--- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +index 3816b55..520bf95 100644 +--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp ++++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +@@ -60,7 +60,10 @@ + # define DLOG(fmt, args...) + #endif + ++#if defined(TARGET_RASPBERRY_PI) + static void SetResolutionString(RESOLUTION_INFO &res); ++static SDTV_ASPECT_T get_sdtv_aspect_from_display_aspect(float display_aspect); ++#endif + + CEGLNativeTypeRaspberryPI::CEGLNativeTypeRaspberryPI() + { +@@ -470,6 +473,25 @@ static void SetResolutionString(RESOLUTION_INFO &res) + res.dwFlags & D3DPRESENTFLAG_MODE3DTB ? " 3DTB" : "", + res.dwFlags & D3DPRESENTFLAG_MODE3DSBS ? " 3DSBS" : ""); + } ++ ++static SDTV_ASPECT_T get_sdtv_aspect_from_display_aspect(float display_aspect) ++{ ++ SDTV_ASPECT_T aspect; ++ const float delta = 1e-3; ++ if(fabs(get_display_aspect_ratio(SDTV_ASPECT_16_9) - display_aspect) < delta) ++ { ++ aspect = SDTV_ASPECT_16_9; ++ } ++ else if(fabs(get_display_aspect_ratio(SDTV_ASPECT_14_9) - display_aspect) < delta) ++ { ++ aspect = SDTV_ASPECT_14_9; ++ } ++ else ++ { ++ aspect = SDTV_ASPECT_4_3; ++ } ++ return aspect; ++} + #endif + + bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &resolutions) + +From dbb24dacba5c40c0d536f4f71f5ac8b3b01fab41 Mon Sep 17 00:00:00 2001 +From: macrule +Date: Thu, 11 Apr 2013 19:50:58 +0200 +Subject: [PATCH 38/58] 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. + +--- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 36 ++++++++++++++++++++----- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h | 1 - + 2 files changed, 29 insertions(+), 8 deletions(-) + +diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +index 520bf95..a1f67fd 100644 +--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp ++++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +@@ -274,7 +274,7 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) + + DestroyDispmaxWindow(); + +- if(!m_fixedMode && GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) ++ if(GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) + { + sem_init(&m_tv_synced, 0, 0); + m_DllBcmHost->vc_tv_register_callback(CallbackTvServiceCallback, this); +@@ -330,6 +330,33 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) + + m_desktopRes = res; + } ++ else if(!GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) ++ { ++ sem_init(&m_tv_synced, 0, 0); ++ m_DllBcmHost->vc_tv_register_callback(CallbackTvServiceCallback, this); ++ ++ SDTV_OPTIONS_T options; ++ options.aspect = get_sdtv_aspect_from_display_aspect((float)res.iScreenWidth / (float)res.iScreenHeight); ++ ++ int success = m_DllBcmHost->vc_tv_sdtv_power_on((SDTV_MODE_T)GETFLAGS_MODE(res.dwFlags), &options); ++ ++ if (success == 0) ++ { ++ CLog::Log(LOGDEBUG, "EGL set SDTV mode (%d,%d)=%d\n", ++ GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), success); ++ ++ sem_wait(&m_tv_synced); ++ } ++ else ++ { ++ CLog::Log(LOGERROR, "EGL failed to set SDTV mode (%d,%d)=%d\n", ++ GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), success); ++ } ++ m_DllBcmHost->vc_tv_unregister_callback(CallbackTvServiceCallback); ++ sem_destroy(&m_tv_synced); ++ ++ m_desktopRes = res; ++ } + + m_dispman_display = g_RBP.OpenDisplay(0); + +@@ -502,8 +529,6 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + if(!m_DllBcmHost) + return false; + +- m_fixedMode = false; +- + /* read initial desktop resolution before probe resolutions. + * probing will replace the desktop resolution when it finds the same one. + * we raplace it because probing will generate more detailed +@@ -552,7 +577,7 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + m_desktopRes.iHeight = tv_state.display.sdtv.height; + m_desktopRes.iScreenWidth = tv_state.display.sdtv.width; + m_desktopRes.iScreenHeight= tv_state.display.sdtv.height; +- m_desktopRes.dwFlags = D3DPRESENTFLAG_INTERLACED; ++ m_desktopRes.dwFlags = MAKEFLAGS(HDMI_RES_GROUP_INVALID, tv_state.display.sdtv.mode, 1); + m_desktopRes.fRefreshRate = (float)tv_state.display.sdtv.frame_rate; + m_desktopRes.fPixelRatio = tv_state.display.hdmi.display_options.aspect == 0 ? 1.0f : get_display_aspect_ratio((SDTV_ASPECT_T)tv_state.display.sdtv.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); + } +@@ -575,9 +600,6 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + CLog::Log(LOGDEBUG, "EGL probe resolution %s:%x\n", m_desktopRes.strMode.c_str(), m_desktopRes.dwFlags); + } + +- if(resolutions.size() < 2) +- m_fixedMode = true; +- + DLOG("CEGLNativeTypeRaspberryPI::ProbeResolutions\n"); + return true; + #else +diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h +index 59401f5..a0acb1a 100644 +--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h ++++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h +@@ -59,7 +59,6 @@ class CEGLNativeTypeRaspberryPI : public CEGLNativeType + DISPMANX_ELEMENT_HANDLE_T m_dispman_element; + TV_GET_STATE_RESP_T m_tv_state; + sem_t m_tv_synced; +- bool m_fixedMode; + RESOLUTION_INFO m_desktopRes; + int m_width; + int m_height; + +From 06f189a4535e06b3d21f89e43b7caee7dedbe0d3 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 21 Jun 2015 17:11:09 +0100 +Subject: [PATCH 39/58] Revert "[3D] don't back out from 3D handling on + resolution changes if we're switching to a different 3D mode" + +This reverts commit 3c4c236a799dab8369b4bb74ff9993bc58a61a72. +--- + xbmc/guilib/GraphicContext.cpp | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp +index bd7dff9..fc4cc95 100644 +--- a/xbmc/guilib/GraphicContext.cpp ++++ b/xbmc/guilib/GraphicContext.cpp +@@ -436,17 +436,14 @@ void CGraphicContext::SetVideoResolutionInternal(RESOLUTION res, bool forceUpdat + + RENDER_STEREO_MODE stereo_mode = m_stereoMode; + +- // if the new resolution is an actual stereo mode, switch to that +- // if the old resolution was an actual stereo mode and renderer is still in old 3D mode, switch to no 3d mode ++ // if the new mode is an actual stereo mode, switch to that ++ // if the old mode was an actual stereo mode, switch to no 3d mode + if (info_org.dwFlags & D3DPRESENTFLAG_MODE3DTB) + stereo_mode = RENDER_STEREO_MODE_SPLIT_HORIZONTAL; + else if (info_org.dwFlags & D3DPRESENTFLAG_MODE3DSBS) + stereo_mode = RENDER_STEREO_MODE_SPLIT_VERTICAL; +- else if ((info_last.dwFlags & D3DPRESENTFLAG_MODE3DTB) +- && m_stereoMode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) +- stereo_mode = RENDER_STEREO_MODE_OFF; +- else if ((info_last.dwFlags & D3DPRESENTFLAG_MODE3DSBS) +- && m_stereoMode == RENDER_STEREO_MODE_SPLIT_VERTICAL) ++ else if ((info_last.dwFlags & D3DPRESENTFLAG_MODE3DSBS) != 0 ++ || (info_last.dwFlags & D3DPRESENTFLAG_MODE3DTB) != 0) + stereo_mode = RENDER_STEREO_MODE_OFF; + + if(stereo_mode != m_stereoMode) + +From 445dce97603e36fadc97ee3d479abe6f581f6a07 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 10 Jun 2015 20:42:03 +0100 +Subject: [PATCH 40/58] [rbp] Fix zoom modes with stereoscopic videos + +--- + xbmc/cores/VideoRenderers/MMALRenderer.cpp | 12 ++++++++++-- + xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 12 ++++++++++-- + 2 files changed, 20 insertions(+), 4 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +index 6cde0c5..5fc68d2 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +@@ -621,9 +621,17 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect + CRect display(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight); + + if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) +- DestRect.x2 *= 2.0f; ++ { ++ float width = DestRect.x2 - DestRect.x1; ++ DestRect.x1 *= 2.0f; ++ DestRect.x2 = DestRect.x1 + 2.0f * width; ++ } + else if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) +- DestRect.y2 *= 2.0f; ++ { ++ float height = DestRect.y2 - DestRect.y1; ++ DestRect.y1 *= 2.0f; ++ DestRect.y2 = DestRect.y1 + 2.0f * height; ++ } + + if (gui != display) + { +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +index ba17a46..298eaff 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +@@ -690,9 +690,17 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec + CRect display(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight); + + if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) +- DestRect.x2 *= 2.0f; ++ { ++ float width = DestRect.x2 - DestRect.x1; ++ DestRect.x1 *= 2.0f; ++ DestRect.x2 = DestRect.x1 + 2.0f * width; ++ } + else if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) +- DestRect.y2 *= 2.0f; ++ { ++ float height = DestRect.y2 - DestRect.y1; ++ DestRect.y1 *= 2.0f; ++ DestRect.y2 = DestRect.y1 + 2.0f * height; ++ } + + if (gui != display) + { + +From 84bc87e546d79c342b8a7c169f81e8521611cdb3 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 21 Jun 2015 17:42:03 +0100 +Subject: [PATCH 41/58] [WinSystemEGL] Remove unused Support3D function + +--- + xbmc/windowing/egl/WinSystemEGL.cpp | 29 ----------------------------- + xbmc/windowing/egl/WinSystemEGL.h | 1 - + 2 files changed, 30 deletions(-) + +diff --git a/xbmc/windowing/egl/WinSystemEGL.cpp b/xbmc/windowing/egl/WinSystemEGL.cpp +index c3bdb6a..c43c4d0 100644 +--- a/xbmc/windowing/egl/WinSystemEGL.cpp ++++ b/xbmc/windowing/egl/WinSystemEGL.cpp +@@ -531,35 +531,6 @@ EGLConfig CWinSystemEGL::GetEGLConfig() + return m_config; + } + +-// the logic in this function should match whether CBaseRenderer::FindClosestResolution picks a 3D mode +-bool CWinSystemEGL::Support3D(int width, int height, uint32_t mode) const +-{ +- RESOLUTION_INFO &curr = CDisplaySettings::Get().GetResolutionInfo(g_graphicsContext.GetVideoResolution()); +- +- // if we are using automatic hdmi mode switching +- if (CSettings::Get().GetInt("videoplayer.adjustrefreshrate") != ADJUST_REFRESHRATE_OFF) +- { +- int searchWidth = curr.iScreenWidth; +- int searchHeight = curr.iScreenHeight; +- +- // only search the custom resolutions +- for (unsigned int i = (int)RES_DESKTOP; i < CDisplaySettings::Get().ResolutionInfoSize(); i++) +- { +- RESOLUTION_INFO res = CDisplaySettings::Get().GetResolutionInfo(i); +- if(res.iScreenWidth == searchWidth && res.iScreenHeight == searchHeight && (res.dwFlags & mode)) +- return true; +- } +- } +- // otherwise just consider current mode +- else +- { +- if (curr.dwFlags & mode) +- return true; +- } +- +- return false; +-} +- + bool CWinSystemEGL::ClampToGUIDisplayLimits(int &width, int &height) + { + width = width > m_nWidth ? m_nWidth : width; +diff --git a/xbmc/windowing/egl/WinSystemEGL.h b/xbmc/windowing/egl/WinSystemEGL.h +index 9d4baf6..1ec4225 100644 +--- a/xbmc/windowing/egl/WinSystemEGL.h ++++ b/xbmc/windowing/egl/WinSystemEGL.h +@@ -59,7 +59,6 @@ class CWinSystemEGL : public CWinSystemBase, public CRenderSystemGLES + virtual void Register(IDispResource *resource); + virtual void Unregister(IDispResource *resource); + +- virtual bool Support3D(int width, int height, uint32_t mode) const; + virtual bool ClampToGUIDisplayLimits(int &width, int &height); + + EGLConfig GetEGLConfig(); + +From 1597e6d82c667d55a763e965cb1e6448e0fbc01e Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 16 Apr 2014 21:18:06 +0100 +Subject: [PATCH 42/58] [omxplayer] Don't propagate 3d flags based on supported + 3d modes + +--- + xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 29 +++-------------------------- + 1 file changed, 3 insertions(+), 26 deletions(-) + +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +index 298eaff..3bf7c2e 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +@@ -726,40 +726,17 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f + uint32_t video_width = CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth; + uint32_t video_height = CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight; + +- unsigned flags = 0; + ERenderFormat format = RENDER_FMT_BYPASS; + ++ /* figure out steremode expected based on user settings and hints */ ++ unsigned flags = GetStereoModeFlags(GetStereoMode()); ++ + if(m_bAllowFullscreen) + { + flags |= CONF_FLAGS_FULLSCREEN; + m_bAllowFullscreen = false; // only allow on first configure + } + +- flags |= GetStereoModeFlags(GetStereoMode()); +- +- if(flags & CONF_FLAGS_STEREO_MODE_SBS) +- { +- if(g_Windowing.Support3D(video_width, video_height, D3DPRESENTFLAG_MODE3DSBS)) +- CLog::Log(LOGNOTICE, "3DSBS movie found"); +- else +- { +- flags &= ~CONF_FLAGS_STEREO_MODE_MASK(~0); +- CLog::Log(LOGNOTICE, "3DSBS movie found but not supported"); +- } +- } +- else if(flags & CONF_FLAGS_STEREO_MODE_TAB) +- { +- if(g_Windowing.Support3D(video_width, video_height, D3DPRESENTFLAG_MODE3DTB)) +- CLog::Log(LOGNOTICE, "3DTB movie found"); +- else +- { +- flags &= ~CONF_FLAGS_STEREO_MODE_MASK(~0); +- CLog::Log(LOGNOTICE, "3DTB movie found but not supported"); +- } +- } +- else +- CLog::Log(LOGNOTICE, "not a 3D movie"); +- + unsigned int iDisplayWidth = width; + unsigned int iDisplayHeight = height; + + +From abadc22d9bed0fdf91c3a5be16dd07d8aa8d9f79 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 21 Jun 2015 18:52:28 +0100 +Subject: [PATCH 43/58] [3d] Avoid switching stereo mode based on current + display mode + +--- + xbmc/guilib/GraphicContext.cpp | 21 --------------------- + 1 file changed, 21 deletions(-) + +diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp +index fc4cc95..e18232e 100644 +--- a/xbmc/guilib/GraphicContext.cpp ++++ b/xbmc/guilib/GraphicContext.cpp +@@ -432,27 +432,6 @@ void CGraphicContext::SetVideoResolutionInternal(RESOLUTION res, bool forceUpdat + Lock(); + + RESOLUTION_INFO info_org = CDisplaySettings::Get().GetResolutionInfo(res); +- RESOLUTION_INFO info_last = CDisplaySettings::Get().GetResolutionInfo(lastRes); +- +- RENDER_STEREO_MODE stereo_mode = m_stereoMode; +- +- // if the new mode is an actual stereo mode, switch to that +- // if the old mode was an actual stereo mode, switch to no 3d mode +- if (info_org.dwFlags & D3DPRESENTFLAG_MODE3DTB) +- stereo_mode = RENDER_STEREO_MODE_SPLIT_HORIZONTAL; +- else if (info_org.dwFlags & D3DPRESENTFLAG_MODE3DSBS) +- stereo_mode = RENDER_STEREO_MODE_SPLIT_VERTICAL; +- else if ((info_last.dwFlags & D3DPRESENTFLAG_MODE3DSBS) != 0 +- || (info_last.dwFlags & D3DPRESENTFLAG_MODE3DTB) != 0) +- stereo_mode = RENDER_STEREO_MODE_OFF; +- +- if(stereo_mode != m_stereoMode) +- { +- m_stereoView = RENDER_STEREO_VIEW_OFF; +- m_stereoMode = stereo_mode; +- m_nextStereoMode = stereo_mode; +- CSettings::Get().SetInt("videoscreen.stereoscopicmode", (int)m_stereoMode); +- } + + RESOLUTION_INFO info_mod = GetResInfo(res); + + +From ecb3cd064f5df496cbf685eec4c4d680c3c79704 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 3 Jun 2015 23:13:51 +0100 +Subject: [PATCH 44/58] [rpi] Always add desktop resolution to supported list + +There was an assumption that the desktop resolution would be in the probed list, but that is sometimes not the case. +We don't add interlaced resolutions to list, but they can be the preferred resolution read from edid. See: +http://openelec.tv/forum/124-raspberry-pi/77074-forcing-interlaced-output + +Also hotplug changes causing an edid reread may cause the supported modes to change (e.g. powering on receiver) +and it is possible the previous preferred mode is no longer there + +So ensure that desktop resolution is always added to list. Also handle the case where desktop resolution is invalid on launch +(e.g. hdmi output powered off) +--- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +index a1f67fd..69ce9b7 100644 +--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp ++++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +@@ -190,7 +190,7 @@ int CEGLNativeTypeRaspberryPI::FindMatchingResolution(const RESOLUTION_INFO &res + for (int i = 0; i < (int)resolutions.size(); i++) + { + if(resolutions[i].iScreenWidth == res.iScreenWidth && resolutions[i].iScreenHeight == res.iScreenHeight && resolutions[i].fRefreshRate == res.fRefreshRate && +- (resolutions[i].dwFlags & (D3DPRESENTFLAG_MODE3DSBS|D3DPRESENTFLAG_MODE3DTB)) == (res.dwFlags & (D3DPRESENTFLAG_MODE3DSBS|D3DPRESENTFLAG_MODE3DTB))) ++ (resolutions[i].dwFlags & D3DPRESENTFLAG_MODEMASK) == (res.dwFlags & D3DPRESENTFLAG_MODEMASK)) + { + return i; + } +@@ -206,8 +206,7 @@ int CEGLNativeTypeRaspberryPI::AddUniqueResolution(RESOLUTION_INFO &res, std::ve + int i = FindMatchingResolution(res, resolutions); + if (i>=0) + { // don't replace a progressive resolution with an interlaced one of same resolution +- if (!(res.dwFlags & D3DPRESENTFLAG_INTERLACED)) +- resolutions[i] = res; ++ resolutions[i] = res; + } + else + { +@@ -569,7 +568,7 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + vc_tv_hdmi_get_property(&property); + m_desktopRes.fRefreshRate = property.param1 == HDMI_PIXEL_CLOCK_TYPE_NTSC ? tv_state.display.hdmi.frame_rate * (1000.0f/1001.0f) : tv_state.display.hdmi.frame_rate; + } +- else // sdtv ++ else if ((tv_state.state & ( VC_SDTV_NTSC | VC_SDTV_PAL )) != 0) // sdtv + { + m_desktopRes.iScreen = 0; + m_desktopRes.bFullScreen = true; +@@ -594,7 +593,6 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + GetSupportedModes(HDMI_RES_GROUP_CEA, resolutions); + GetSupportedModes(HDMI_RES_GROUP_DMT, resolutions); + +- if(resolutions.size() == 0) + { + AddUniqueResolution(m_desktopRes, resolutions); + CLog::Log(LOGDEBUG, "EGL probe resolution %s:%x\n", m_desktopRes.strMode.c_str(), m_desktopRes.dwFlags); +@@ -686,6 +684,12 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v + res.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res.iScreenWidth / (float)res.iScreenHeight); + res.iSubtitles = (int)(0.965 * res.iHeight); + ++ if (!m_desktopRes.dwFlags && prefer_group == group && prefer_mode == tv->code) ++ m_desktopRes = res; ++ ++ if (res.dwFlags & D3DPRESENTFLAG_INTERLACED) ++ continue; ++ + AddUniqueResolution(res, resolutions); + CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f) %s%s:%x\n", i, res.strMode.c_str(), res.fPixelRatio, + tv->native ? "N" : "", tv->scan_mode ? "I" : "", tv->code); + +From 71f32189c08f3001e0a00f3d21d799eb7b0ac9ba Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 21 Jun 2015 18:53:29 +0100 +Subject: [PATCH 45/58] [rbp] Drop reporting 3D modes and just use current + rendering mode to request 3D signalling + +--- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 76 +++++-------------------- + 1 file changed, 15 insertions(+), 61 deletions(-) + +diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +index 69ce9b7..25a97ad 100644 +--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp ++++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +@@ -28,6 +28,9 @@ + #include "linux/RBP.h" + #include "utils/StringUtils.h" + #include "settings/Settings.h" ++#include "guilib/GraphicContext.h" ++#include "guilib/StereoscopicsManager.h" ++#include "rendering/RenderSystem.h" + #include + + #ifndef __VIDEOCORE4__ +@@ -273,21 +276,22 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) + + DestroyDispmaxWindow(); + ++ RENDER_STEREO_MODE stereo_mode = g_graphicsContext.GetStereoMode(); + if(GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) + { + sem_init(&m_tv_synced, 0, 0); + m_DllBcmHost->vc_tv_register_callback(CallbackTvServiceCallback, this); + +- if (res.dwFlags & (D3DPRESENTFLAG_MODE3DSBS|D3DPRESENTFLAG_MODE3DTB)) ++ if (stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL || stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) + { + /* inform TV of any 3D settings. Note this property just applies to next hdmi mode change, so no need to call for 2D modes */ + HDMI_PROPERTY_PARAM_T property; + property.property = HDMI_PROPERTY_3D_STRUCTURE; + if (CSettings::Get().GetBool("videoplayer.framepacking") && CSettings::Get().GetBool("videoplayer.supportmvc")) + property.param1 = HDMI_3D_FORMAT_FRAME_PACKING; +- else if (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) ++ else if (stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) + property.param1 = HDMI_3D_FORMAT_SBS_HALF; +- else if (res.dwFlags & D3DPRESENTFLAG_MODE3DTB) ++ else if (stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) + property.param1 = HDMI_3D_FORMAT_TB_HALF; + else + property.param1 = HDMI_3D_FORMAT_NONE; +@@ -310,19 +314,17 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) + + if (success == 0) + { +- CLog::Log(LOGDEBUG, "EGL set HDMI mode (%d,%d)=%d%s%s\n", ++ CLog::Log(LOGDEBUG, "EGL set HDMI mode (%d,%d)=%d %s\n", + GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), success, +- (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) ? " SBS":"", +- (res.dwFlags & D3DPRESENTFLAG_MODE3DTB) ? " TB":""); ++ CStereoscopicsManager::Get().ConvertGuiStereoModeToString(stereo_mode)); + + sem_wait(&m_tv_synced); + } + else + { +- CLog::Log(LOGERROR, "EGL failed to set HDMI mode (%d,%d)=%d%s%s\n", ++ CLog::Log(LOGERROR, "EGL failed to set HDMI mode (%d,%d)=%d %s\n", + GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), success, +- (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) ? " SBS":"", +- (res.dwFlags & D3DPRESENTFLAG_MODE3DTB) ? " TB":""); ++ CStereoscopicsManager::Get().ConvertGuiStereoModeToString(stereo_mode)); + } + m_DllBcmHost->vc_tv_unregister_callback(CallbackTvServiceCallback); + sem_destroy(&m_tv_synced); +@@ -385,9 +387,9 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) + DISPMANX_TRANSFORM_T transform = DISPMANX_NO_ROTATE; + DISPMANX_UPDATE_HANDLE_T dispman_update = m_DllBcmHost->vc_dispmanx_update_start(0); + +- if (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) ++ if (stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) + transform = DISPMANX_STEREOSCOPIC_SBS; +- else if (res.dwFlags & D3DPRESENTFLAG_MODE3DTB) ++ else if (stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) + transform = DISPMANX_STEREOSCOPIC_TB; + else + transform = DISPMANX_STEREOSCOPIC_MONO; +@@ -494,10 +496,8 @@ static void SetResolutionString(RESOLUTION_INFO &res) + res.iWidth = gui_width; + res.iHeight = gui_height; + +- res.strMode = StringUtils::Format("%dx%d (%dx%d) @ %.2f%s%s%s - Full Screen", res.iScreenWidth, res.iScreenHeight, res.iWidth, res.iHeight, res.fRefreshRate, +- res.dwFlags & D3DPRESENTFLAG_INTERLACED ? "i" : "", +- res.dwFlags & D3DPRESENTFLAG_MODE3DTB ? " 3DTB" : "", +- res.dwFlags & D3DPRESENTFLAG_MODE3DSBS ? " 3DSBS" : ""); ++ res.strMode = StringUtils::Format("%dx%d (%dx%d) @ %.2f%s - Full Screen", res.iScreenWidth, res.iScreenHeight, res.iWidth, res.iHeight, res.fRefreshRate, ++ res.dwFlags & D3DPRESENTFLAG_INTERLACED ? "i" : ""); + } + + static SDTV_ASPECT_T get_sdtv_aspect_from_display_aspect(float display_aspect) +@@ -552,17 +552,6 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + m_desktopRes.iScreenHeight= tv_state.display.hdmi.height; + m_desktopRes.dwFlags = MAKEFLAGS(tv_state.display.hdmi.group, tv_state.display.hdmi.mode, tv_state.display.hdmi.scan_mode); + m_desktopRes.fPixelRatio = tv_state.display.hdmi.display_options.aspect == 0 ? 1.0f : get_display_aspect_ratio((HDMI_ASPECT_T)tv_state.display.hdmi.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); +- // Also add 3D flags +- if (tv_state.display.hdmi.format_3d == HDMI_3D_FORMAT_SBS_HALF) +- { +- m_desktopRes.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; +- m_desktopRes.fPixelRatio *= 2.0; +- } +- else if (tv_state.display.hdmi.format_3d == HDMI_3D_FORMAT_TB_HALF) +- { +- m_desktopRes.dwFlags |= D3DPRESENTFLAG_MODE3DTB; +- m_desktopRes.fPixelRatio *= 0.5; +- } + HDMI_PROPERTY_PARAM_T property; + property.property = HDMI_PROPERTY_PIXEL_CLOCK_TYPE; + vc_tv_hdmi_get_property(&property); +@@ -700,41 +689,6 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v + res2.fRefreshRate = (float)tv->frame_rate * (1000.0f/1001.0f); + AddUniqueResolution(res2, resolutions); + } +- +- // Also add 3D versions of modes +- if (tv->struct_3d_mask & HDMI_3D_STRUCT_SIDE_BY_SIDE_HALF_HORIZONTAL) +- { +- RESOLUTION_INFO res2 = res; +- res2.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; +- res2.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res2.iScreenWidth / (float)res2.iScreenHeight); +- res2.fPixelRatio *= 2.0f; +- res2.iSubtitles = (int)(0.965 * res2.iHeight); +- +- AddUniqueResolution(res2, resolutions); +- CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f)\n", i, res2.strMode.c_str(), res2.fPixelRatio); +- if (tv->frame_rate == 24 || tv->frame_rate == 30 || tv->frame_rate == 60) +- { +- res2.fRefreshRate = (float)tv->frame_rate * (1000.0f/1001.0f); +- AddUniqueResolution(res2, resolutions); +- } +- } +- if (tv->struct_3d_mask & HDMI_3D_STRUCT_TOP_AND_BOTTOM) +- { +- RESOLUTION_INFO res2 = res; +- res2.dwFlags |= D3DPRESENTFLAG_MODE3DTB; +- res2.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res2.iScreenWidth / (float)res2.iScreenHeight); +- res2.fPixelRatio *= 0.5f; +- res2.iSubtitles = (int)(0.965 * res2.iHeight); +- +- AddUniqueResolution(res2, resolutions); +- CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f)\n", i, res2.strMode.c_str(), res2.fPixelRatio); +- if (tv->frame_rate == 24 || tv->frame_rate == 30 || tv->frame_rate == 60) +- { +- res2.fRefreshRate = (float)tv->frame_rate * (1000.0f/1001.0f); +- AddUniqueResolution(res2, resolutions); +- } +- +- } + } + } + if (supported_modes) + +From 23e4fb99f6f4ad1cc969cc8361dc55338769419f Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 30 Jun 2015 14:08:24 +0100 +Subject: [PATCH 46/58] [rbp] Ignore video stereo mode when 3D display mode is + disabled + +--- + xbmc/cores/VideoRenderers/MMALRenderer.cpp | 4 ++++ + xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +index 5fc68d2..ce2e98d 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +@@ -589,6 +589,10 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect + bool stereo_invert = (m_iFlags & CONF_FLAGS_STEREO_CADANCE_RIGHT_LEFT) ? true : false; + RENDER_STEREO_MODE display_stereo_mode = g_graphicsContext.GetStereoMode(); + ++ // ignore video stereo mode when 3D display mode is disabled ++ if (display_stereo_mode == RENDER_STEREO_MODE_OFF) ++ video_stereo_mode = RENDER_STEREO_MODE_OFF; ++ + // fix up transposed video + if (m_renderOrientation == 90 || m_renderOrientation == 270) + { +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +index 3bf7c2e..5f6b402 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +@@ -658,6 +658,10 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec + bool stereo_invert = (flags & CONF_FLAGS_STEREO_CADANCE_RIGHT_LEFT) ? true : false; + RENDER_STEREO_MODE display_stereo_mode = g_graphicsContext.GetStereoMode(); + ++ // ignore video stereo mode when 3D display mode is disabled ++ if (display_stereo_mode == RENDER_STEREO_MODE_OFF) ++ video_stereo_mode = RENDER_STEREO_MODE_OFF; ++ + // fix up transposed video + if (m_hints.orientation == 90 || m_hints.orientation == 270) + { + +From 72e7fc2a4f0701ce47e624c5c73f457ae8db93fd Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 22 Jun 2015 16:27:15 +0100 +Subject: [PATCH 47/58] [EGL] Don't skip out when HDMI mode is considered the + same + +It might have different 3D signalling. TODO: keep track of 3D signalling +--- + xbmc/windowing/egl/WinSystemEGL.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/windowing/egl/WinSystemEGL.cpp b/xbmc/windowing/egl/WinSystemEGL.cpp +index c43c4d0..13b75b1 100644 +--- a/xbmc/windowing/egl/WinSystemEGL.cpp ++++ b/xbmc/windowing/egl/WinSystemEGL.cpp +@@ -287,7 +287,7 @@ bool CWinSystemEGL::CreateNewWindow(const std::string& name, bool fullScreen, RE + (current_resolution.dwFlags & D3DPRESENTFLAG_MODEMASK) == (res.dwFlags & D3DPRESENTFLAG_MODEMASK)) + { + CLog::Log(LOGDEBUG, "CWinSystemEGL::CreateNewWindow: No need to create a new window"); +- return true; ++//xxx return true; + } + + m_bFullScreen = fullScreen; + +From 9747f3d0ba4d3fabe46c35ceaeb74d2ee5daf547 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 21 Apr 2015 14:32:07 +0100 -Subject: [PATCH 40/51] [mmalrenderer] Add sharpness control +Subject: [PATCH 48/58] [mmalrenderer] Add sharpness control --- addons/resource.language.en_gb/resources/strings.po | 2 +- @@ -2761,7 +3073,7 @@ Subject: [PATCH 40/51] [mmalrenderer] Add sharpness control 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 5ad526e..d252240 100644 +index 6d861c1..c41b177 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -7503,7 +7503,7 @@ msgstr "" @@ -2774,7 +3086,7 @@ index 5ad526e..d252240 100644 #: xbmc/video/dialogs/GUIDialogVideoSettings.cpp diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index 6cde0c5..9bf1aed 100644 +index ce2e98d..fb92079 100644 --- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp +++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp @@ -207,6 +207,7 @@ CMMALRenderer::CMMALRenderer() @@ -2824,17 +3136,17 @@ index 1404fb3..9bced7e 100644 CCriticalSection m_sharedSection; MMAL_COMPONENT_T *m_vout; -From 38eef3259f992329214af255923b6a2ce7364921 Mon Sep 17 00:00:00 2001 +From 7995698144c5b5c44dd9f4f80f17fa7803962586 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 24 Apr 2015 13:49:51 +0100 -Subject: [PATCH 41/51] [dvdplayer] Add back required include +Subject: [PATCH 49/58] [dvdplayer] Add back required include --- xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index bdc3edb..2dad96c 100644 +index 9be8aae..ebec92d 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -33,6 +33,7 @@ @@ -2846,10 +3158,10 @@ index bdc3edb..2dad96c 100644 #include "guilib/GraphicContext.h" #include -From ec33b18ad7a9fe49b5a9a10f053bd5b9d1ea4214 Mon Sep 17 00:00:00 2001 +From 9cb45bcb661cf5de4814e304706d982352453f48 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 5 May 2015 23:58:06 +0100 -Subject: [PATCH 42/51] [screensaver] Leave GUI contents available for +Subject: [PATCH 50/58] [screensaver] Leave GUI contents available for screensaver --- @@ -2879,10 +3191,10 @@ index ba33908..17ea269 100644 // Add window to the history list (we must do this before we activate it, -From 5964fa6583235b7fce1d0c83ba4005380a7bf322 Mon Sep 17 00:00:00 2001 +From 2e8dcaa3564b564dfdd7961c1d2beabee57cb7f8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 15 May 2015 14:04:11 +0100 -Subject: [PATCH 44/51] [omxplayer] Make unsupported when ac3transcode is +Subject: [PATCH 52/58] [omxplayer] Make unsupported when ac3transcode is enabled --- @@ -2890,7 +3202,7 @@ Subject: [PATCH 44/51] [omxplayer] Make unsupported when ac3transcode is 1 file changed, 6 insertions(+) diff --git a/xbmc/cores/omxplayer/OMXHelper.cpp b/xbmc/cores/omxplayer/OMXHelper.cpp -index be54f31..373e3f2 100644 +index eff47e0..b954276 100644 --- a/xbmc/cores/omxplayer/OMXHelper.cpp +++ b/xbmc/cores/omxplayer/OMXHelper.cpp @@ -56,6 +56,12 @@ bool OMXPlayerUnsuitable(bool m_HasVideo, bool m_HasAudio, CDVDDemux* m_pDemuxer @@ -2907,10 +3219,10 @@ index be54f31..373e3f2 100644 { // find video stream -From ba0740cf8f5e163720e03516186522bbf16c25b0 Mon Sep 17 00:00:00 2001 +From 8294881aca9494a55c30f7347599779fe770c50d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 1 Jun 2015 14:14:43 +0100 -Subject: [PATCH 45/51] [omximage] Don't report failed decode of progressive +Subject: [PATCH 53/58] [omximage] Don't report failed decode of progressive jpegs as as error --- @@ -2996,10 +3308,10 @@ index a43a446..890ca88 100644 } -From 33a38607218899acba79a30dc7b9163daaf99c65 Mon Sep 17 00:00:00 2001 +From 61003a22eb36823420523a2d3df994e1222e0cea Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 25 May 2015 19:01:00 +0100 -Subject: [PATCH 46/51] [rbp] Allow settings option for timestamp preference +Subject: [PATCH 54/58] [rbp] Allow settings option for timestamp preference We currently have some files that play better with pts timestamps and some that play better with dts timestamps Provide a gui setting to allow users to adjust this behaviour until we have a better solution @@ -3011,7 +3323,7 @@ Provide a gui setting to allow users to adjust this behaviour until we have a be 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index b76e723..3c18575 100644 +index 0138e5f..2d043ec 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -16714,3 +16714,13 @@ msgstr "" @@ -3060,7 +3372,7 @@ index a583450..4a63820 100644 // set a flag so we can identify primary frames from generated frames (deinterlace) buffer->flags = MMAL_BUFFER_HEADER_FLAG_USER0; diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index adf9910..f9b9232 100644 +index 5f6b402..ce23bec 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp @@ -495,7 +495,7 @@ void OMXPlayerVideo::Process() @@ -3073,10 +3385,10 @@ index adf9910..f9b9232 100644 if (pts == DVD_NOPTS_VALUE) pts = dts; -From 792a42205d18d6d389a36101c85594884eb9b34e Mon Sep 17 00:00:00 2001 +From 9fc7a4289b865202e2b8d4ac9bc8174e1001e1ad Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 6 Jun 2015 18:44:37 +0100 -Subject: [PATCH 47/51] [rbp] Ignore pts value when m_hints.ptsinvalid set +Subject: [PATCH 55/58] [rbp] Ignore pts value when m_hints.ptsinvalid set --- xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 2 +- @@ -3097,7 +3409,7 @@ index 4a63820..f7b0b25 100644 // set a flag so we can identify primary frames from generated frames (deinterlace) buffer->flags = MMAL_BUFFER_HEADER_FLAG_USER0; diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index f9b9232..33aa88c 100644 +index ce23bec..e17fdb8 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp @@ -495,7 +495,7 @@ void OMXPlayerVideo::Process() @@ -3110,69 +3422,10 @@ index f9b9232..33aa88c 100644 if (pts == DVD_NOPTS_VALUE) pts = dts; -From 493d0d8dfac375bedb0e80c08213bb45a714a4bb Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 10 Jun 2015 20:42:03 +0100 -Subject: [PATCH 49/51] [rbp] Fix zoom modes with stereoscopic videos - ---- - xbmc/cores/VideoRenderers/MMALRenderer.cpp | 12 ++++++++++-- - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 12 ++++++++++-- - 2 files changed, 20 insertions(+), 4 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index 9bf1aed..e420834 100644 ---- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -@@ -632,9 +632,17 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect - CRect display(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight); - - if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) -- DestRect.x2 *= 2.0f; -+ { -+ float width = DestRect.x2 - DestRect.x1; -+ DestRect.x1 *= 2.0f; -+ DestRect.x2 = DestRect.x1 + 2.0f * width; -+ } - else if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) -- DestRect.y2 *= 2.0f; -+ { -+ float height = DestRect.y2 - DestRect.y1; -+ DestRect.y1 *= 2.0f; -+ DestRect.y2 = DestRect.y1 + 2.0f * height; -+ } - - if (gui != display) - { -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index 33aa88c..e008405 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -690,9 +690,17 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec - CRect display(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight); - - if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) -- DestRect.x2 *= 2.0f; -+ { -+ float width = DestRect.x2 - DestRect.x1; -+ DestRect.x1 *= 2.0f; -+ DestRect.x2 = DestRect.x1 + 2.0f * width; -+ } - else if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) -- DestRect.y2 *= 2.0f; -+ { -+ float height = DestRect.y2 - DestRect.y1; -+ DestRect.y1 *= 2.0f; -+ DestRect.y2 = DestRect.y1 + 2.0f * height; -+ } - - if (gui != display) - { - -From 8312d9234bddd5878f60a7a297e16e61d2cab255 Mon Sep 17 00:00:00 2001 +From 08b2eeaffdfdd1dc124ee3eb2f5a21b664074eca Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 6 Jun 2015 18:43:57 +0100 -Subject: [PATCH 50/51] ffmpeg: Automatic switch to software decode for GMC +Subject: [PATCH 56/58] ffmpeg: Automatic switch to software decode for GMC with more than one warp point --- @@ -3187,6 +3440,60 @@ Subject: [PATCH 50/51] ffmpeg: Automatic switch to software decode for GMC 8 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 tools/depends/target/ffmpeg/0001-mpeg4video-Signal-unsupported-GMC-with-more-than-one.patch +diff --git a/tools/depends/target/ffmpeg/0001-mpeg4video-Signal-unsupported-GMC-with-more-than-one.patch b/tools/depends/target/ffmpeg/0001-mpeg4video-Signal-unsupported-GMC-with-more-than-one.patch +new file mode 100644 +index 0000000..4cb8dd8 +--- /dev/null ++++ b/tools/depends/target/ffmpeg/0001-mpeg4video-Signal-unsupported-GMC-with-more-than-one.patch +@@ -0,0 +1,48 @@ ++From 84e9a1784bbd3182b68cefa5e5feae8da8b9e184 Mon Sep 17 00:00:00 2001 ++From: popcornmix ++Date: Fri, 5 Jun 2015 22:48:33 +0100 ++Subject: [PATCH] mpeg4video: Signal unsupported GMC with more than one warp ++ point ++ ++--- ++ libavcodec/avcodec.h | 1 + ++ libavcodec/mpeg4videodec.c | 4 ++++ ++ 2 files changed, 5 insertions(+) ++ ++diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h ++index 8c7c420..e63dc2d 100644 ++--- a/libavcodec/avcodec.h +++++ b/libavcodec/avcodec.h ++@@ -2527,6 +2527,7 @@ typedef struct AVCodecContext { ++ #define FF_BUG_DC_CLIP 4096 ++ #define FF_BUG_MS 8192 ///< Work around various bugs in Microsoft's broken decoders. ++ #define FF_BUG_TRUNCATED 16384 +++#define FF_BUG_GMC_UNSUPPORTED 32768 ++ ++ /** ++ * strictly follow the standard (MPEG4, ...). ++diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c ++index 9bf33dd..0b5d3b9 100644 ++--- a/libavcodec/mpeg4videodec.c +++++ b/libavcodec/mpeg4videodec.c ++@@ -2179,6 +2179,9 @@ int ff_mpeg4_workaround_bugs(AVCodecContext *avctx) ++ ++ if (ctx->divx_version >= 0) ++ s->workaround_bugs |= FF_BUG_HPEL_CHROMA; +++ +++ if (ctx->num_sprite_warping_points > 1) +++ s->workaround_bugs |= FF_BUG_GMC_UNSUPPORTED; ++ } ++ ++ if (s->workaround_bugs & FF_BUG_STD_QPEL) { ++@@ -2203,6 +2206,7 @@ int ff_mpeg4_workaround_bugs(AVCodecContext *avctx) ++ s->workaround_bugs, ctx->lavc_build, ctx->xvid_build, ++ ctx->divx_version, ctx->divx_build, s->divx_packed ? "p" : ""); ++ +++ avctx->workaround_bugs = s->workaround_bugs; ++ if (CONFIG_MPEG4_DECODER && ctx->xvid_build >= 0 && ++ s->codec_id == AV_CODEC_ID_MPEG4 && ++ avctx->idct_algo == FF_IDCT_AUTO) { ++-- ++1.9.1 ++ diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp index f7b0b25..3e97f1d 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp @@ -3274,7 +3581,7 @@ index c0e22a2..3849993 100644 // AUDIO int channels; diff --git a/xbmc/cores/omxplayer/OMXHelper.cpp b/xbmc/cores/omxplayer/OMXHelper.cpp -index 373e3f2..093388c 100644 +index b954276..b5ee4b6 100644 --- a/xbmc/cores/omxplayer/OMXHelper.cpp +++ b/xbmc/cores/omxplayer/OMXHelper.cpp @@ -77,7 +77,9 @@ bool OMXPlayerUnsuitable(bool m_HasVideo, bool m_HasAudio, CDVDDemux* m_pDemuxer @@ -3289,74 +3596,1069 @@ index 373e3f2..093388c 100644 else if ((hint.codec == AV_CODEC_ID_VC1 || hint.codec == AV_CODEC_ID_WMV3) && g_RBP.GetCodecWvc1()) supported = true; -From 1798b2059a7dcc34b4dcecfec56736225d2ac918 Mon Sep 17 00:00:00 2001 +From e51804ed122dd0a642104d102315787970fffb8d Mon Sep 17 00:00:00 2001 From: popcornmix -Date: Wed, 3 Jun 2015 23:13:51 +0100 -Subject: [PATCH 51/51] [rpi] Always add desktop resolution to supported list +Date: Mon, 22 Jun 2015 21:46:57 +0100 +Subject: [PATCH 57/58] [rbp] Use default resampling setting on Pi2 -There was an assumption that the desktop resolution would be in the probed list, but that is sometimes not the case. -We don't add interlaced resolutions to list, but they can be the preferred resolution read from edid. See: -http://openelec.tv/forum/124-raspberry-pi/77074-forcing-interlaced-output - -Also hotplug changes causing an edid reread may cause the supported modes to change (e.g. powering on receiver) -and it is possible the previous preferred mode is no longer there - -So ensure that desktop resolution is always added to list. Also handle the case where desktop resolution is invalid on launch -(e.g. hdmi output powered off) --- - xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 14 +++++++++----- - 1 file changed, 9 insertions(+), 5 deletions(-) + system/settings/rbp2.xml | 5 +++++ + 1 file changed, 5 insertions(+) -diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -index ae85484..a4b8a81 100644 ---- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -+++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -@@ -187,7 +187,7 @@ int CEGLNativeTypeRaspberryPI::FindMatchingResolution(const RESOLUTION_INFO &res - for (int i = 0; i < (int)resolutions.size(); i++) +diff --git a/system/settings/rbp2.xml b/system/settings/rbp2.xml +index b29a428..1c8b116 100644 +--- a/system/settings/rbp2.xml ++++ b/system/settings/rbp2.xml +@@ -28,6 +28,11 @@ + + + ++ ++ ++ 30 ++ ++ + +
+ + +From 175260bab79c330366834bd86512afc2902dba0a Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Thu, 25 Jun 2015 19:43:10 +0100 +Subject: [PATCH 58/58] [rbp] HW mouse pointer + +Updating the mouse point provokes a complete screen update which can make it feel laggy +and results in high cpu. + +Render the mouse with an overlay to avoid redrawing the normal gui. + +Requires recent firmware. +--- + xbmc/guilib/GUIWindowManager.cpp | 2 + + xbmc/linux/RBP.cpp | 254 +++++++++++++++++++++ + xbmc/linux/RBP.h | 10 + + xbmc/linux/rpi_user_vcsm.h | 460 ++++++++++++++++++++++++++++++++++++++ + xbmc/windowing/WinEventsLinux.cpp | 147 ++++++++++++ + xbmc/windowing/WinEventsLinux.h | 11 + + 6 files changed, 884 insertions(+) + create mode 100644 xbmc/linux/rpi_user_vcsm.h + +diff --git a/xbmc/guilib/GUIWindowManager.cpp b/xbmc/guilib/GUIWindowManager.cpp +index 17ea269..6965319 100644 +--- a/xbmc/guilib/GUIWindowManager.cpp ++++ b/xbmc/guilib/GUIWindowManager.cpp +@@ -193,7 +193,9 @@ void CGUIWindowManager::CreateWindows() + Add(new CGUIWindowAddonBrowser); + Add(new CGUIWindowScreensaverDim); + Add(new CGUIWindowDebugInfo); ++#ifndef TARGET_RASPBERRY_PI + Add(new CGUIWindowPointer); ++#endif + Add(new CGUIDialogYesNo); + Add(new CGUIDialogProgress); + Add(new CGUIDialogExtendedProgressBar); +diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp +index 096ea18..2c8d09b 100644 +--- a/xbmc/linux/RBP.cpp ++++ b/xbmc/linux/RBP.cpp +@@ -28,6 +28,31 @@ + + #include "cores/omxplayer/OMXImage.h" + ++#include "guilib/GraphicContext.h" ++#include "settings/DisplaySettings.h" ++ ++#include ++#include ++#include "rpi_user_vcsm.h" ++ ++#define MAJOR_NUM 100 ++#define IOCTL_MBOX_PROPERTY _IOWR(MAJOR_NUM, 0, char *) ++#define DEVICE_FILE_NAME "/dev/vcio" ++ ++typedef struct gpu_mem_ptr_s { ++ void *arm; // Pointer to memory mapped on ARM side ++ int vc_handle; // Videocore handle of relocatable memory ++ int vcsm_handle; // Handle for use by VCSM ++ int vc; // Address for use in GPU code ++ int numbytes; // Size of memory block ++ int suballoc; ++} GPU_MEM_PTR_T; ++ ++static int mbox_open(); ++static void mbox_close(int file_desc); ++static void gpu_free_internal(GPU_MEM_PTR_T *p, int mb); ++static int gpu_malloc_uncached_internal(int numbytes, GPU_MEM_PTR_T *p, int mb); ++ + CRBP::CRBP() + { + m_initialized = false; +@@ -35,6 +60,9 @@ CRBP::CRBP() + m_DllBcmHost = new DllBcmHost(); + m_OMX = new COMXCore(); + m_display = DISPMANX_NO_HANDLE; ++ m_p = NULL; ++ m_mb = mbox_open(); ++ vcsm_init(); + } + + CRBP::~CRBP() +@@ -115,7 +143,10 @@ void CRBP::LogFirmwareVerison() + DISPMANX_DISPLAY_HANDLE_T CRBP::OpenDisplay(uint32_t device) + { + if (m_display == DISPMANX_NO_HANDLE) ++ { + m_display = vc_dispmanx_display_open( 0 /*screen*/ ); ++ init_cursor(); ++ } + return m_display; + } + +@@ -124,6 +155,7 @@ void CRBP::CloseDisplay(DISPMANX_DISPLAY_HANDLE_T display) + assert(display == m_display); + vc_dispmanx_display_close(m_display); + m_display = DISPMANX_NO_HANDLE; ++ uninit_cursor(); + } + + void CRBP::GetDisplaySize(int &width, int &height) +@@ -224,6 +256,15 @@ void CRBP::Deinitialize() + m_omx_image_init = false; + m_initialized = false; + m_omx_initialized = false; ++ uninit_cursor(); ++ if (m_mb && m_p) ++ gpu_free_internal(m_p, m_mb); ++ delete m_p; ++ m_p = NULL; ++ if (m_mb) ++ mbox_close(m_mb); ++ m_mb = 0; ++ vcsm_exit(); + } + + double CRBP::AdjustHDMIClock(double adjust) +@@ -239,4 +280,217 @@ double CRBP::AdjustHDMIClock(double adjust) + } + + ++static int mbox_property(int file_desc, void *buf) ++{ ++ int ret_val = ioctl(file_desc, IOCTL_MBOX_PROPERTY, buf); ++ ++ if (ret_val < 0) { ++ printf("ioctl_set_msg failed:%d\n", ret_val); ++ } ++ return ret_val; ++} ++ ++static int mbox_open() ++{ ++ int file_desc; ++ ++ // open a char device file used for communicating with kernel mbox driver ++ file_desc = open(DEVICE_FILE_NAME, 0); ++ if (file_desc < 0) { ++ printf("Can't open device file: %s (%d)\n", DEVICE_FILE_NAME, file_desc); ++ printf("Try creating a device file with: sudo mknod %s c %d 0\n", DEVICE_FILE_NAME, MAJOR_NUM); ++ } ++ return file_desc; ++} ++ ++static void mbox_close(int file_desc) ++{ ++ close(file_desc); ++} ++ ++static unsigned mem_lock(int file_desc, unsigned handle) ++{ ++ int i=0; ++ unsigned p[32]; ++ p[i++] = 0; // size ++ p[i++] = 0x00000000; // process request ++ ++ p[i++] = 0x3000d; // (the tag id) ++ p[i++] = 4; // (size of the buffer) ++ p[i++] = 4; // (size of the data) ++ p[i++] = handle; ++ ++ p[i++] = 0x00000000; // end tag ++ p[0] = i*sizeof *p; // actual size ++ ++ mbox_property(file_desc, p); ++ return p[5]; ++} ++ ++unsigned mem_unlock(int file_desc, unsigned handle) ++{ ++ int i=0; ++ unsigned p[32]; ++ p[i++] = 0; // size ++ p[i++] = 0x00000000; // process request ++ ++ p[i++] = 0x3000e; // (the tag id) ++ p[i++] = 4; // (size of the buffer) ++ p[i++] = 4; // (size of the data) ++ p[i++] = handle; ++ ++ p[i++] = 0x00000000; // end tag ++ p[0] = i*sizeof *p; // actual size ++ ++ mbox_property(file_desc, p); ++ return p[5]; ++} ++ ++unsigned int mailbox_set_cursor_info(int file_desc, int width, int height, int format, uint32_t buffer, int hotspotx, int hotspoty) ++{ ++ int i=0; ++ unsigned int p[32]; ++ p[i++] = 0; // size ++ p[i++] = 0x00000000; // process request ++ p[i++] = 0x00008010; // set cursor state ++ p[i++] = 24; // buffer size ++ p[i++] = 24; // data size ++ ++ p[i++] = width; ++ p[i++] = height; ++ p[i++] = format; ++ p[i++] = buffer; // ptr to VC memory buffer. Doesn't work in 64bit.... ++ p[i++] = hotspotx; ++ p[i++] = hotspoty; ++ ++ p[i++] = 0x00000000; // end tag ++ p[0] = i*sizeof(*p); // actual size ++ ++ mbox_property(file_desc, p); ++ return p[5]; ++ ++} ++ ++unsigned int mailbox_set_cursor_position(int file_desc, int enabled, int x, int y) ++{ ++ int i=0; ++ unsigned p[32]; ++ p[i++] = 0; // size ++ p[i++] = 0x00000000; // process request ++ p[i++] = 0x00008011; // set cursor state ++ p[i++] = 12; // buffer size ++ p[i++] = 12; // data size ++ ++ p[i++] = enabled; ++ p[i++] = x; ++ p[i++] = y; ++ ++ p[i++] = 0x00000000; // end tag ++ p[0] = i*sizeof *p; // actual size ++ ++ mbox_property(file_desc, p); ++ return p[5]; ++} ++ ++static int gpu_malloc_uncached_internal(int numbytes, GPU_MEM_PTR_T *p, int mb) ++{ ++ //printf("%s %d\n", __func__, numbytes); ++ ++ p->numbytes = numbytes; ++ p->suballoc = 0; ++ p->vcsm_handle = vcsm_malloc_cache(numbytes, VCSM_CACHE_TYPE_NONE, (char *)"Mouse pointer"); ++ assert(p->vcsm_handle); ++ p->vc_handle = vcsm_vc_hdl_from_hdl(p->vcsm_handle); ++ assert(p->vc_handle); ++ p->arm = vcsm_lock(p->vcsm_handle); ++ assert(p->arm); ++ p->vc = mem_lock(mb, p->vc_handle); ++ assert(p->vc); ++ return 0; ++} ++ ++static void gpu_free_internal(GPU_MEM_PTR_T *p, int mb) ++{ ++ mem_unlock(mb,p->vc_handle); ++ vcsm_unlock_ptr(p->arm); ++ vcsm_free(p->vcsm_handle); ++} ++ ++#define T 0 ++#define W 0xffffffff ++#define B 0xff000000 ++ ++const static uint32_t default_cursor_pixels[] = ++{ ++ B,B,B,B,B,B,B,B,B,T,T,T,T,T,T,T, ++ B,W,W,W,W,W,W,B,T,T,T,T,T,T,T,T, ++ B,W,W,W,W,W,B,T,T,T,T,T,T,T,T,T, ++ B,W,W,W,W,B,T,T,T,T,T,T,T,T,T,T, ++ B,W,W,W,W,W,B,T,T,T,T,T,T,T,T,T, ++ B,W,W,B,W,W,W,B,T,T,T,T,T,T,T,T, ++ B,W,B,T,B,W,W,W,B,T,T,T,T,T,T,T, ++ B,B,T,T,T,B,W,W,W,B,T,T,T,T,T,T, ++ B,T,T,T,T,T,B,W,W,W,B,T,T,T,T,T, ++ T,T,T,T,T,T,T,B,W,W,W,B,T,T,T,T, ++ T,T,T,T,T,T,T,T,B,W,W,W,B,T,T,T, ++ T,T,T,T,T,T,T,T,T,B,W,W,W,B,T,T, ++ T,T,T,T,T,T,T,T,T,T,B,W,W,W,B,T, ++ T,T,T,T,T,T,T,T,T,T,T,B,W,W,W,B, ++ T,T,T,T,T,T,T,T,T,T,T,T,B,W,B,T, ++ T,T,T,T,T,T,T,T,T,T,T,T,T,B,T,T ++}; ++ ++#undef T ++#undef W ++#undef B ++ ++void CRBP::init_cursor() ++{ ++ //printf("%s\n", __func__); ++ if (!m_mb) ++ return; ++ if (!m_p) ++ { ++ m_p = new GPU_MEM_PTR_T; ++ if (m_p) ++ gpu_malloc_uncached_internal(64 * 64 * 4, m_p, m_mb); ++ } ++ if (m_mb && m_p && m_p->arm && m_p->vc) ++ set_cursor(default_cursor_pixels, 16, 16, 0, 0); ++} ++ ++void CRBP::set_cursor(const void *pixels, int width, int height, int hotspot_x, int hotspot_y) ++{ ++ if (!m_mb || !m_p || !m_p->arm || !m_p->vc || !pixels || width * height > 64 * 64) ++ return; ++ //printf("%s %dx%d %p\n", __func__, width, height, pixels); ++ memcpy(m_p->arm, pixels, width * height * 4); ++ unsigned int s = mailbox_set_cursor_info(m_mb, width, height, 0, m_p->vc, hotspot_x, hotspot_y); ++ assert(s == 0); ++} ++ ++void CRBP::update_cursor(int x, int y, bool enabled) ++{ ++ if (!m_mb || !m_p || !m_p->arm || !m_p->vc) ++ return; ++ ++ RESOLUTION res = g_graphicsContext.GetVideoResolution(); ++ CRect gui(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iWidth, CDisplaySettings::Get().GetResolutionInfo(res).iHeight); ++ CRect display(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight); ++ ++ int x2 = x * display.Width() / gui.Width(); ++ int y2 = y * display.Height() / gui.Height(); ++ ++ //printf("%s %d,%d (%d)\n", __func__, x, y, enabled); ++ mailbox_set_cursor_position(m_mb, enabled, x2, y2); ++} ++ ++void CRBP::uninit_cursor() ++{ ++ if (!m_mb || !m_p || !m_p->arm || !m_p->vc) ++ return; ++ //printf("%s\n", __func__); ++ mailbox_set_cursor_position(m_mb, 0, 0, 0); ++} ++ + #endif +diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h +index b422c89..f233a5e 100644 +--- a/xbmc/linux/RBP.h ++++ b/xbmc/linux/RBP.h +@@ -41,6 +41,8 @@ + #include "threads/CriticalSection.h" + #include "threads/Event.h" + ++struct gpu_mem_ptr_s; ++ + class CRBP + { + public: +@@ -81,6 +83,14 @@ class CRBP + CEvent m_vsync; + class DllLibOMXCore; + CCriticalSection m_critSection; ++ ++ struct gpu_mem_ptr_s *m_p; ++ int m_mb; ++public: ++ void init_cursor(); ++ void set_cursor(const void *pixels, int width, int height, int hotspot_x, int hotspot_y); ++ void update_cursor(int x, int y, bool enabled); ++ void uninit_cursor(); + }; + + extern CRBP g_RBP; +diff --git a/xbmc/linux/rpi_user_vcsm.h b/xbmc/linux/rpi_user_vcsm.h +new file mode 100644 +index 0000000..94e6e79 +--- /dev/null ++++ b/xbmc/linux/rpi_user_vcsm.h +@@ -0,0 +1,460 @@ ++/***************************************************************************** ++* Copyright 2001 - 2011 Broadcom Corporation. All rights reserved. ++* ++* This program is the proprietary software of Broadcom Corporation and/or ++* its licensors, and may only be used, duplicated, modified or distributed ++* pursuant to the terms and conditions of a separate, written license ++* agreement executed between you and Broadcom (an "Authorized License"). ++* Except as set forth in an Authorized License, Broadcom grants no license ++* (express or implied), right to use, or waiver of any kind with respect to ++* the Software, and Broadcom expressly reserves all rights in and to the ++* Software and all intellectual property rights therein. IF YOU HAVE NO ++* AUTHORIZED LICENSE, THEN YOU HAVE NO RIGHT TO USE THIS SOFTWARE IN ANY ++* WAY, AND SHOULD IMMEDIATELY NOTIFY BROADCOM AND DISCONTINUE ALL USE OF ++* THE SOFTWARE. ++* ++* Except as expressly set forth in the Authorized License, ++* 1. This program, including its structure, sequence and organization, ++* constitutes the valuable trade secrets of Broadcom, and you shall use ++* all reasonable efforts to protect the confidentiality thereof, and to ++* use this information only in connection with your use of Broadcom ++* integrated circuit products. ++* 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" ++* AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS OR ++* WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH ++* RESPECT TO THE SOFTWARE. BROADCOM SPECIFICALLY DISCLAIMS ANY AND ALL ++* IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS ++* FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, ++* QUIET ENJOYMENT, QUIET POSSESSION OR CORRESPONDENCE TO DESCRIPTION. YOU ++* ASSUME THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE. ++* 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR ITS ++* LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, ++* OR EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO ++* YOUR USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ++* ADVISED OF THE POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS ++* OF THE AMOUNT ACTUALLY PAID FOR THE SOFTWARE ITSELF OR U.S. $1, WHICHEVER ++* IS GREATER. THESE LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ++* ESSENTIAL PURPOSE OF ANY LIMITED REMEDY. ++*****************************************************************************/ ++ ++#ifndef __USER_VCSM__H__INCLUDED__ ++#define __USER_VCSM__H__INCLUDED__ ++ ++/* VideoCore Shared Memory - user interface library. ++** ++** This library provides all the necessary abstraction for any application to ++** make use of the shared memory service which is distributed accross a kernel ++** driver and a videocore service. ++** ++** It is an application design decision to choose or not to use this service. ++** ++** The logical flow of operations that a user application needs to follow when ++** using this service is: ++** ++** 1) Initialize the service. ++** 2) Allocate shared memory blocks. ++** 3) Start using the allocated blocks. ++** - In order to gain ownership on a block, lock the allocated block, ++** locking a block returns a valid address that the user application ++** can access. ++** - When finished with using the block for the current execution cycle ++** or function, and so when giving up the ownership, unlock the block. ++** 4) A block can be locked/unlocked as many times required - within or outside ++** of - a specific execution context. ++** 5) To completely release an allocated block, free it. ++** 6) If the service is no longer required, terminate it. ++** ++** ++** Some generic considerations: ++ ++** Allocating memory blocks. ++** ++** Memory blocks can be allocated in different manners depending on the cache ++** behavior desired. A given block can either be: ++ ++** - Allocated in a non cached fashion all the way through host and videocore. ++** - Allocated in a cached fashion on host OR videocore. ++** - Allocated in a cached fashion on host AND videocore. ++** ++** It is an application decision to determine how to allocate a block. Evidently ++** if the application will be doing substantial read/write accesses to a given block, ++** it is recommended to allocate the block at least in a 'host cached' fashion for ++** better results. ++** ++** ++** Locking memory blocks. ++** ++** When the memory block has been allocated in a host cached fashion, locking the ++** memory block (and so taking ownership of it) will trigger a cache invalidation. ++** ++** For the above reason and when using host cached allocation, it is important that ++** an application properly implements the lock/unlock mechanism to ensure cache will ++** stay coherent, otherwise there is no guarantee it will at all be. ++** ++** It is possible to dynamically change the host cache behavior (ie cached or non ++** cached) of a given allocation without needing to free and re-allocate the block. ++** This feature can be useful for such application which requires access to the block ++** only at certain times and not otherwise. By changing the cache behavior dynamically ++** the application can optimize performances for a given duration of use. ++** Such dynamic cache behavior remapping only applies to host cache and not videocore ++** cache. If one requires to change the videocore cache behavior, then a new block ++** must be created to replace the old one. ++** ++** On successful locking, a valid pointer is returned that the application can use ++** to access to data inside the block. There is no guarantee that the pointer will ++** stay valid following the unlock action corresponding to this lock. ++** ++** ++** Unocking memory blocks. ++** ++** When the memory block has been allocated in a host cached fashion, unlocking the ++** memory block (and so forgiving its ownership) will trigger a cache flush unless ++** explicitely asked not to flush the cache for performances reasons. ++** ++** For the above reason and when using host cached allocation, it is important that ++** an application properly implements the lock/unlock mechanism to ensure cache will ++** stay coherent, otherwise there is no guarantee it will at all be. ++** ++** ++** A complete API is defined below. ++*/ ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++/* Different status that can be dumped. ++*/ ++typedef enum ++{ ++ VCSM_STATUS_VC_WALK_ALLOC = 0, // Walks *all* the allocation on videocore. ++ // Result of the walk is seen in the videocore ++ // log. ++ VCSM_STATUS_HOST_WALK_MAP, // Walks the *full* mapping allocation on host ++ // driver (ie for all processes). Result of ++ // the walk is seen in the kernel log. ++ VCSM_STATUS_HOST_WALK_PID_MAP, // Walks the per process mapping allocation on host ++ // driver (for current process). Result of ++ // the walk is seen in the kernel log. ++ VCSM_STATUS_HOST_WALK_PID_ALLOC, // Walks the per process host allocation on host ++ // driver (for current process). Result of ++ // the walk is seen in the kernel log. ++ VCSM_STATUS_VC_MAP_ALL, // Equivalent to both VCSM_STATUS_VC_WALK_ALLOC and ++ // VCSM_STATUS_HOST_WALK_MAP. ++ // ++ VCSM_STATUS_NONE, // Must be last - invalid. ++ ++} VCSM_STATUS_T; ++ ++/* Different kind of cache behavior. ++*/ ++typedef enum ++{ ++ VCSM_CACHE_TYPE_NONE = 0, // No caching applies. ++ VCSM_CACHE_TYPE_HOST, // Allocation is cached on host (user space). ++ VCSM_CACHE_TYPE_VC, // Allocation is cached on videocore. ++ VCSM_CACHE_TYPE_HOST_AND_VC, // Allocation is cached on both host and videocore. ++ ++} VCSM_CACHE_TYPE_T; ++ ++/* Initialize the vcsm processing. ++** ++** Must be called once before attempting to do anything else. ++** ++** Returns 0 on success, -1 on error. ++*/ ++int vcsm_init( void ); ++ ++ ++/* Terminates the vcsm processing. ++** ++** Must be called vcsm services are no longer needed, it will ++** take care of removing any allocation under the current process ++** control if deemed necessary. ++*/ ++void vcsm_exit( void ); ++ ++ ++/* Queries the status of the the vcsm. ++** ++** Triggers dump of various kind of information, see the ++** different variants specified in VCSM_STATUS_T. ++** ++** Pid is optional. ++*/ ++void vcsm_status( VCSM_STATUS_T status, int pid ); ++ ++ ++/* Allocates a non-cached block of memory of size 'size' via the vcsm memory ++** allocator. ++** ++** Returns: 0 on error ++** a non-zero opaque handle on success. ++** ++** On success, the user must invoke vcsm_lock with the returned opaque ++** handle to gain access to the memory associated with the opaque handle. ++** When finished using the memory, the user calls vcsm_unlock_xx (see those ++** function definition for more details on the one that can be used). ++** ++** A well behaved application should make every attempt to lock/unlock ++** only for the duration it needs to access the memory data associated with ++** the opaque handle. ++*/ ++unsigned int vcsm_malloc( unsigned int size, char *name ); ++ ++ ++/* Allocates a cached block of memory of size 'size' via the vcsm memory ++** allocator, the type of caching requested is passed as argument of the ++** function call. ++** ++** Returns: 0 on error ++** a non-zero opaque handle on success. ++** ++** On success, the user must invoke vcsm_lock with the returned opaque ++** handle to gain access to the memory associated with the opaque handle. ++** When finished using the memory, the user calls vcsm_unlock_xx (see those ++** function definition for more details on the one that can be used). ++** ++** A well behaved application should make every attempt to lock/unlock ++** only for the duration it needs to access the memory data associated with ++** the opaque handle. ++*/ ++unsigned int vcsm_malloc_cache( unsigned int size, VCSM_CACHE_TYPE_T cache, char *name ); ++ ++ ++/* Shares an allocated block of memory via the vcsm memory allocator. ++** ++** Returns: 0 on error ++** a non-zero opaque handle on success. ++** ++** On success, the user must invoke vcsm_lock with the returned opaque ++** handle to gain access to the memory associated with the opaque handle. ++** When finished using the memory, the user calls vcsm_unlock_xx (see those ++** function definition for more details on the one that can be used). ++** ++** A well behaved application should make every attempt to lock/unlock ++** only for the duration it needs to access the memory data associated with ++** the opaque handle. ++*/ ++unsigned int vcsm_malloc_share( unsigned int handle ); ++ ++ ++/* Resizes a block of memory allocated previously by vcsm_alloc. ++** ++** Returns: 0 on success ++** -errno on error. ++** ++** The handle must be unlocked by user prior to attempting any ++** resize action. ++** ++** On error, the original size allocated against the handle ++** remains available the same way it would be following a ++** successful vcsm_malloc. ++*/ ++int vcsm_resize( unsigned int handle, unsigned int new_size ); ++ ++ ++/* Frees a block of memory that was successfully allocated by ++** a prior call the vcms_alloc. ++** ++** The handle should be considered invalid upon return from this ++** call. ++** ++** Whether any memory is actually freed up or not as the result of ++** this call will depends on many factors, if all goes well it will ++** be freed. If something goes wrong, the memory will likely end up ++** being freed up as part of the vcsm_exit process. In the end the ++** memory is guaranteed to be freed one way or another. ++*/ ++void vcsm_free( unsigned int handle ); ++ ++ ++/* Retrieves a videocore opaque handle from a mapped user address ++** pointer. The videocore handle will correspond to the actual ++** memory mapped in videocore. ++** ++** Returns: 0 on error ++** a non-zero opaque handle on success. ++** ++** Note: the videocore opaque handle is distinct from the user ++** opaque handle (allocated via vcsm_malloc) and it is only ++** significant for such application which knows what to do ++** with it, for the others it is just a number with little ++** use since nothing can be done with it (in particular ++** for safety reason it cannot be used to map anything). ++*/ ++unsigned int vcsm_vc_hdl_from_ptr( void *usr_ptr ); ++ ++ ++/* Retrieves a videocore opaque handle from a opaque handle ++** pointer. The videocore handle will correspond to the actual ++** memory mapped in videocore. ++** ++** Returns: 0 on error ++** a non-zero opaque handle on success. ++** ++** Note: the videocore opaque handle is distinct from the user ++** opaque handle (allocated via vcsm_malloc) and it is only ++** significant for such application which knows what to do ++** with it, for the others it is just a number with little ++** use since nothing can be done with it (in particular ++** for safety reason it cannot be used to map anything). ++*/ ++unsigned int vcsm_vc_hdl_from_hdl( unsigned int handle ); ++ ++ ++/* Retrieves a user opaque handle from a mapped user address ++** pointer. ++** ++** Returns: 0 on error ++** a non-zero opaque handle on success. ++*/ ++unsigned int vcsm_usr_handle( void *usr_ptr ); ++ ++ ++/* Retrieves a mapped user address from an opaque user ++** handle. ++** ++** Returns: 0 on error ++** a non-zero address on success. ++** ++** On success, the address corresponds to the pointer ++** which can access the data allocated via the vcsm_malloc ++** call. ++*/ ++void *vcsm_usr_address( unsigned int handle ); ++ ++ ++/* Locks the memory associated with this opaque handle. ++** ++** Returns: NULL on error ++** a valid pointer on success. ++** ++** A user MUST lock the handle received from vcsm_malloc ++** in order to be able to use the memory associated with it. ++** ++** On success, the pointer returned is only valid within ++** the lock content (ie until a corresponding vcsm_unlock_xx ++** is invoked). ++*/ ++void *vcsm_lock( unsigned int handle ); ++ ++ ++/* Locks the memory associated with this opaque handle. The lock ++** also gives a chance to update the *host* cache behavior of the ++** allocated buffer if so desired. The *videocore* cache behavior ++** of the allocated buffer cannot be changed by this call and such ++** attempt will be ignored. ++** ++** The system will attempt to honour the cache_update mode request, ++** the cache_result mode will provide the final answer on which cache ++** mode is really in use. Failing to change the cache mode will not ++** result in a failure to lock the buffer as it is an application ++** decision to choose what to do if (cache_result != cache_update) ++** ++** The value returned in cache_result can only be considered valid if ++** the returned pointer is non NULL. The cache_result pointer may be ++** NULL if the application does not care about the actual outcome of ++** its action with regards to the cache behavior change. ++** ++** Returns: NULL on error ++** a valid pointer on success. ++** ++** A user MUST lock the handle received from vcsm_malloc ++** in order to be able to use the memory associated with it. ++** ++** On success, the pointer returned is only valid within ++** the lock content (ie until a corresponding vcsm_unlock_xx ++** is invoked). ++*/ ++void *vcsm_lock_cache( unsigned int handle, ++ VCSM_CACHE_TYPE_T cache_update, ++ VCSM_CACHE_TYPE_T *cache_result ); ++ ++ ++/* Unlocks the memory associated with this user mapped address. ++** ++** Returns: 0 on success ++** -errno on error. ++** ++** After unlocking a mapped address, the user should no longer ++** attempt to reference it. ++*/ ++int vcsm_unlock_ptr( void *usr_ptr ); ++ ++ ++/* Unlocks the memory associated with this user mapped address. ++** Apply special processing that would override the otherwise ++** default behavior. ++** ++** If 'cache_no_flush' is specified: ++** Do not flush cache as the result of the unlock (if cache ++** flush was otherwise applicable in this case). ++** ++** Returns: 0 on success ++** -errno on error. ++** ++** After unlocking a mapped address, the user should no longer ++** attempt to reference it. ++*/ ++int vcsm_unlock_ptr_sp( void *usr_ptr, int cache_no_flush ); ++ ++ ++/* Unlocks the memory associated with this user opaque handle. ++** ++** Returns: 0 on success ++** -errno on error. ++** ++** After unlocking an opaque handle, the user should no longer ++** attempt to reference the mapped addressed once associated ++** with it. ++*/ ++int vcsm_unlock_hdl( unsigned int handle ); ++ ++ ++/* Unlocks the memory associated with this user opaque handle. ++** Apply special processing that would override the otherwise ++** default behavior. ++** ++** If 'cache_no_flush' is specified: ++** Do not flush cache as the result of the unlock (if cache ++** flush was otherwise applicable in this case). ++** ++** Returns: 0 on success ++** -errno on error. ++** ++** After unlocking an opaque handle, the user should no longer ++** attempt to reference the mapped addressed once associated ++** with it. ++*/ ++int vcsm_unlock_hdl_sp( unsigned int handle, int cache_no_flush ); ++ ++/* Clean and/or invalidate the memory associated with this user opaque handle ++** ++** Returns: non-zero on error ++** ++** structure contains a list of flush/invalidate commands. Commands are: ++** 0: nop ++** 1: invalidate given virtual range in L1/L2 ++** 2: clean given virtual range in L1/L2 ++** 3: clean+invalidate given virtual range in L1/L2 ++** 4: flush all L1/L2 ++*/ ++struct vcsm_user_clean_invalid_s { ++ struct { ++ unsigned int cmd; ++ unsigned int handle; ++ unsigned int addr; ++ unsigned int size; ++ } s[8]; ++}; ++ ++int vcsm_clean_invalid( struct vcsm_user_clean_invalid_s *s ); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* __USER_VCSM__H__INCLUDED__ */ ++ +diff --git a/xbmc/windowing/WinEventsLinux.cpp b/xbmc/windowing/WinEventsLinux.cpp +index 6f97e9e..bde7649 100644 +--- a/xbmc/windowing/WinEventsLinux.cpp ++++ b/xbmc/windowing/WinEventsLinux.cpp +@@ -30,11 +30,31 @@ + #include "utils/log.h" + #include "powermanagement/PowerManager.h" + ++#ifdef TARGET_RASPBERRY_PI ++#include "utils/TimeUtils.h" ++#include "guilib/Resolution.h" ++#include "addons/Skin.h" ++#include "utils/XMLUtils.h" ++#include "utils/StringUtils.h" ++#include "filesystem/File.h" ++#include "guilib/iimage.h" ++#include "guilib/XBTF.h" ++#include "guilib/imagefactory.h" ++#include "guilib/TextureManager.h" ++#include "linux/RBP.h" ++#include "input/InputManager.h" ++#endif ++ + bool CWinEventsLinux::m_initialized = false; + CLinuxInputDevices CWinEventsLinux::m_devices; + + CWinEventsLinux::CWinEventsLinux() + { ++#ifdef TARGET_RASPBERRY_PI ++ m_last_mouse_move_time = 0; ++ m_mouse_state = -1; ++ memset(m_cursors, 0, sizeof m_cursors); ++#endif + } + + void CWinEventsLinux::RefreshDevices() +@@ -48,19 +68,142 @@ bool CWinEventsLinux::IsRemoteLowBattery() + return false; + } + ++#ifdef TARGET_RASPBERRY_PI ++void *CWinEventsLinux::LoadImage(const std::string texturePath, int &width, int &height) ++{ ++ void *pixels = NULL; ++ // Read image into memory to use our vfs ++ XFILE::CFile file; ++ XFILE::auto_buffer buf; ++ ++ if (file.LoadFile(texturePath, buf) <= 0) ++ return NULL; ++ ++ IImage *pImage = ImageFactory::CreateLoader(texturePath); ++ if (pImage != NULL && pImage->LoadImageFromMemory((unsigned char *)buf.get(), buf.size(), width, height)) ++ { ++ width = pImage->Width(); ++ height = pImage->Height(); ++ if (width > 0 && height > 0) ++ { ++ pixels = malloc(width * height * 4); ++ if (!pixels) ++ return NULL; ++ if (!pImage->Decode((unsigned char *)pixels, width * 4, XB_FMT_A8R8G8B8)) ++ { ++ free(pixels); ++ return NULL; ++ } ++ } ++ } ++ return pixels; ++} ++ ++bool CWinEventsLinux::LoadXML(const std::string strFileName) ++{ ++ RESOLUTION_INFO m_coordsRes; // resolution that the window coordinates are in. ++ // Find appropriate skin folder + resolution to load from ++ std::string strFileNameLower = strFileName; ++ StringUtils::ToLower(strFileNameLower); ++ std::string strLowerPath = g_SkinInfo->GetSkinPath(strFileNameLower, &m_coordsRes); ++ std::string strPath = g_SkinInfo->GetSkinPath(strFileName, &m_coordsRes); ++ ++ TiXmlElement* pRootElement = NULL; ++ CXBMCTinyXML xmlDoc; ++ std::string strPathLower = strPath; ++ StringUtils::ToLower(strPathLower); ++ if (!xmlDoc.LoadFile(strPath) && !xmlDoc.LoadFile(strPathLower) && !xmlDoc.LoadFile(strLowerPath)) ++ { ++ CLog::Log(LOGERROR, "unable to load:%s, Line %d\n%s", strPath.c_str(), xmlDoc.ErrorRow(), xmlDoc.ErrorDesc()); ++ return false; ++ } ++ pRootElement = (TiXmlElement*)xmlDoc.RootElement()->Clone(); ++ //printf("%s: load:%s,%s,%s\n", __func__, strPath.c_str(), strPathLower.c_str(), strLowerPath.c_str()); ++ ++ if (!pRootElement) ++ return false; ++ ++ if (strcmpi(pRootElement->Value(), "window")) ++ { ++ CLog::Log(LOGERROR, "file : XML file doesnt contain "); ++ return false; ++ } ++ ++ TiXmlElement *pChild = pRootElement->FirstChildElement(); ++ while (pChild) ++ { ++ if (strcmpi(pChild->Value(), "controls") == 0) ++ { ++ TiXmlElement *pControl = pChild->FirstChildElement(); ++ while (pControl) ++ { ++ //printf("%s:2 %s\n", __func__, pControl->Value()); ++ if (strcmpi(pControl->Value(), "control") == 0) ++ { ++ std::string strStringValue; ++ if (XMLUtils::GetString(pControl, "texture", strStringValue)) ++ { ++ const char* idAttr = pControl->Attribute("id"); ++ int index = idAttr ? atoi(idAttr)-1 : -1; ++ if (index >= 0 && index < (int)(sizeof m_cursors/sizeof *m_cursors)) ++ { ++ if (m_cursors[index].pixels) ++ free(m_cursors[index].pixels); ++ std::string path = g_TextureManager.GetTexturePath(strStringValue); ++ m_cursors[index].width = m_cursors[index].height = 64; // max ++ m_cursors[index].pixels = LoadImage(path, m_cursors[index].width, m_cursors[index].height); ++ //printf("%s: texture: %d %s %dx%d %p\n", __func__, index, path.c_str(), m_cursors[index].width, m_cursors[index].height, m_cursors[index].pixels); ++ } ++ } ++ } ++ pControl = pControl->NextSiblingElement(); ++ } ++ } ++ pChild = pChild->NextSiblingElement(); ++ } ++ delete pRootElement; ++ return true; ++} ++#endif ++ + bool CWinEventsLinux::MessagePump() + { + if (!m_initialized) { - if(resolutions[i].iScreenWidth == res.iScreenWidth && resolutions[i].iScreenHeight == res.iScreenHeight && resolutions[i].fRefreshRate == res.fRefreshRate && -- (resolutions[i].dwFlags & (D3DPRESENTFLAG_MODE3DSBS|D3DPRESENTFLAG_MODE3DTB)) == (res.dwFlags & (D3DPRESENTFLAG_MODE3DSBS|D3DPRESENTFLAG_MODE3DTB))) -+ (resolutions[i].dwFlags & D3DPRESENTFLAG_MODEMASK) == (res.dwFlags & D3DPRESENTFLAG_MODEMASK)) - { - return i; - } -@@ -203,8 +203,7 @@ int CEGLNativeTypeRaspberryPI::AddUniqueResolution(RESOLUTION_INFO &res, std::ve - int i = FindMatchingResolution(res, resolutions); - if (i>=0) - { // don't replace a progressive resolution with an interlaced one of same resolution -- if (!(res.dwFlags & D3DPRESENTFLAG_INTERLACED)) -- resolutions[i] = res; -+ resolutions[i] = res; + m_devices.InitAvailable(); + m_initialized = true; ++#ifdef TARGET_RASPBERRY_PI ++ LoadXML("Pointer.xml"); ++#endif } - else + + bool ret = false; + XBMC_Event event = {0}; ++#ifdef TARGET_RASPBERRY_PI ++ int64_t Now = CurrentHostCounter(); ++ int state = CInputManager::Get().GetMouseState() - 1; ++ if (m_mouse_state != state) ++ { ++ //printf("%s: %d->%d\n", __func__, m_mouse_state, state); ++ if (state >= 0 && state < (int)(sizeof m_cursors/sizeof *m_cursors) && m_cursors[state].pixels) ++ { ++ g_RBP.set_cursor(m_cursors[state].pixels, m_cursors[state].width, m_cursors[state].height, 0, 0); ++ } ++ m_mouse_state = state; ++ } ++#endif + while (1) { -@@ -516,7 +515,7 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r - vc_tv_hdmi_get_property(&property); - m_desktopRes.fRefreshRate = property.param1 == HDMI_PIXEL_CLOCK_TYPE_NTSC ? tv_state.display.hdmi.frame_rate * (1000.0f/1001.0f) : tv_state.display.hdmi.frame_rate; - } -- else // sdtv -+ else if ((tv_state.state & ( VC_SDTV_NTSC | VC_SDTV_PAL )) != 0) // sdtv + event = m_devices.ReadEvent(); ++#ifdef TARGET_RASPBERRY_PI ++ if (event.type == XBMC_MOUSEMOTION || event.type == XBMC_MOUSEBUTTONDOWN || event.type == XBMC_MOUSEBUTTONUP) ++ { ++ if (event.type == XBMC_MOUSEMOTION) ++ g_RBP.update_cursor(event.motion.x, event.motion.y, 1); ++ m_last_mouse_move_time = Now; ++ //printf("%s: %d,%d %d %d,%d (%d,%d)\n", __func__, event.motion.type, event.motion.which, event.motion.state, event.motion.x, event.motion.y, event.motion.xrel, event.motion.yrel); ++ } ++#endif + if (event.type != XBMC_NOEVENT) { - m_desktopRes.iScreen = 0; - m_desktopRes.bFullScreen = true; -@@ -541,7 +540,6 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r - GetSupportedModes(HDMI_RES_GROUP_CEA, resolutions); - GetSupportedModes(HDMI_RES_GROUP_DMT, resolutions); + ret |= g_application.OnEvent(event); +@@ -71,6 +214,10 @@ bool CWinEventsLinux::MessagePump() + } + } -- if(resolutions.size() == 0) - { - AddUniqueResolution(m_desktopRes, resolutions); - CLog::Log(LOGDEBUG, "EGL probe resolution %s:%x\n", m_desktopRes.strMode.c_str(), m_desktopRes.dwFlags); -@@ -636,6 +634,12 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v - res.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res.iScreenWidth / (float)res.iScreenHeight); - res.iSubtitles = (int)(0.965 * res.iHeight); ++#ifdef TARGET_RASPBERRY_PI ++ if (Now - m_last_mouse_move_time > 5 * 1000000000LL) ++ g_RBP.update_cursor(0, 0, 0); ++#endif + return ret; + } -+ if (!m_desktopRes.dwFlags && prefer_group == group && prefer_mode == tv->code) -+ m_desktopRes = res; -+ -+ if (res.dwFlags & D3DPRESENTFLAG_INTERLACED) -+ continue; -+ - AddUniqueResolution(res, resolutions); - CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f) %s%s:%x\n", i, res.strMode.c_str(), res.fPixelRatio, - tv->native ? "N" : "", tv->scan_mode ? "I" : "", tv->code); +diff --git a/xbmc/windowing/WinEventsLinux.h b/xbmc/windowing/WinEventsLinux.h +index f6c8df0..5c2b583 100644 +--- a/xbmc/windowing/WinEventsLinux.h ++++ b/xbmc/windowing/WinEventsLinux.h +@@ -42,6 +42,17 @@ class CWinEventsLinux : public IWinEvents + private: + static bool m_initialized; + static CLinuxInputDevices m_devices; ++#ifdef TARGET_RASPBERRY_PI ++ bool LoadXML(const std::string strFileName); ++ void *LoadImage(const std::string texturePath, int &width, int &height); ++ int64_t m_last_mouse_move_time; ++ struct ++ { ++ void *pixels; ++ int width, height; ++ } m_cursors[4]; ++ int m_mouse_state; ++#endif + }; + + #endif diff --git a/projects/RPi2/patches/kodi/kodi-001-isengard-rpb-backports.patch b/projects/RPi2/patches/kodi/kodi-001-isengard-rpb-backports.patch index c60b9d9c25..e1ec4be1b1 100644 --- a/projects/RPi2/patches/kodi/kodi-001-isengard-rpb-backports.patch +++ b/projects/RPi2/patches/kodi/kodi-001-isengard-rpb-backports.patch @@ -1,7 +1,7 @@ -From 334f38e87d0f4d071929f26a73db4075f5a40a86 Mon Sep 17 00:00:00 2001 +From d4dbab9f0c3bc4ab02ba312ba0d4aa9f41371fdf Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 18:19:32 +0100 -Subject: [PATCH 01/51] [rbp/omxplayer] When opening a stream don't try to +Subject: [PATCH 01/58] [rbp/omxplayer] When opening a stream don't try to update gui so often --- @@ -25,10 +25,10 @@ index 2faceea..889d7a2 100644 g_windowManager.ProcessRenderLoop(false); if (allowCancel && dialog->IsCanceled()) -From 7ddf4d5ef049c6ab43814ea9946347fd8e13e36c Mon Sep 17 00:00:00 2001 +From 1ecf22c5b4c919e3aed5274c67f748bbae86fbf0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 8 Mar 2014 15:36:06 +0000 -Subject: [PATCH 03/51] [hifiberry] Hack: force it to be recognised as IEC958 +Subject: [PATCH 03/58] [hifiberry] Hack: force it to be recognised as IEC958 capable to enable passthrough options --- @@ -51,10 +51,10 @@ index e22db7a..0120bd5 100644 info.m_displayName.substr(info.m_displayName.size()-5) == " HDMI") { -From 9d64e65d1de3cd2c18fdb95bc7d7825f42602ad9 Mon Sep 17 00:00:00 2001 +From ac054e5b5efd9ec9205598f9b7549a8e953272fd Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 1 May 2014 16:28:39 +0100 -Subject: [PATCH 04/51] Improved file buffering in CArchive +Subject: [PATCH 04/58] 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 @@ -114,10 +114,10 @@ index 6ed0f8f..8506d95 100644 } else -From 11c32ec255761eb3763fa4b2bf7f4a261238e102 Mon Sep 17 00:00:00 2001 +From 1a7d63a938850a884f08bd3af66808bef91b7588 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 12 Aug 2014 00:31:36 +0100 -Subject: [PATCH 05/51] [omxcodec] Don't force software codec with dvds +Subject: [PATCH 05/58] [omxcodec] Don't force software codec with dvds --- xbmc/cores/dvdplayer/DVDPlayer.cpp | 2 ++ @@ -138,10 +138,10 @@ index 82b5baa..70b1ac3 100644 else if (m_pInputStream && m_pInputStream->IsStreamType(DVDSTREAM_TYPE_PVRMANAGER)) { -From 9a08c47d230a839bc32bf6c81c3d54bb8692b248 Mon Sep 17 00:00:00 2001 +From 47e9b3430cd67a4e9e17de65df96f9c0dbb7c39c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 10 Aug 2014 16:45:16 +0100 -Subject: [PATCH 06/51] filesystem: Make support of browsing into archives +Subject: [PATCH 06/58] 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. @@ -159,7 +159,7 @@ We'll let people who don't use archives disable it manually 3 files changed, 18 insertions(+) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 97039ca..9614036 100644 +index ff32bfd..5345dc2 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -16582,6 +16582,15 @@ msgstr "" @@ -224,10 +224,10 @@ index 5af92e7..568a1a8 100644 { // XBMC Smart playlist - just XML renamed to XSP // read the name of the playlist in -From 52ba2eb2daaeba3eaa7213b2f370f11b73ebdd51 Mon Sep 17 00:00:00 2001 +From e863fd0253902d92c56ed85e589bffadc98b245f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 27 Oct 2014 13:06:57 +0000 -Subject: [PATCH 08/51] [rbp] Make cachemembuffersize default depend on memory +Subject: [PATCH 08/58] [rbp] Make cachemembuffersize default depend on memory size --- @@ -329,10 +329,10 @@ index 2e3282c..d1606a2 100644 } -From b14ed34e6cf3a147e4e93161c60ff804b6a77286 Mon Sep 17 00:00:00 2001 +From 06bd0674846783738e6b81f351ba49bb633c473b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 30 May 2014 14:58:43 +0100 -Subject: [PATCH 10/51] [settings] Experiment: Report DESKTOP resolution in +Subject: [PATCH 10/58] [settings] Experiment: Report DESKTOP resolution in video settings --- @@ -354,10 +354,10 @@ index 4376463..fc4e5ea 100644 StringUtils::Format("%dx%d%s", resolution->width, resolution->height, ModeFlagsToString(resolution->flags, false).c_str()), -From 975844c8114a270ab8c97925806b41a09600a90e Mon Sep 17 00:00:00 2001 +From c2b0eafa1ed07258aa09a24a443d4535db8b3a1e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 9 Sep 2014 12:04:26 +0100 -Subject: [PATCH 11/51] egl: Treat unknown display aspect ratio as square pixel +Subject: [PATCH 11/58] egl: Treat unknown display aspect ratio as square pixel --- xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 4 ++-- @@ -386,10 +386,10 @@ index bda7430..68fc647 100644 SetResolutionString(m_desktopRes); -From 873e875a8538a1c5219054f30a80d90877d0d301 Mon Sep 17 00:00:00 2001 +From 5f1821e4d8157a890c795744841dcb895a1349b4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 19 Sep 2014 11:54:49 +0100 -Subject: [PATCH 12/51] [dvdplayer/rbp] Add pi specific option to maintain +Subject: [PATCH 12/58] [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". @@ -414,7 +414,7 @@ Needed updated firmware 9 files changed, 91 insertions(+), 7 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 9614036..36b8c5d 100644 +index 5345dc2..6d08156 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -6321,7 +6321,22 @@ msgctxt "#13459" @@ -681,10 +681,10 @@ index 7df1bf7..732b69d 100644 float m_audioPlayCountMinimumPercent; bool m_dvdplayerIgnoreDTSinWAV; -From 0323acdf71a6bf8d66ff569403e8fc0412291325 Mon Sep 17 00:00:00 2001 +From 6ead5d132f5d43c6ea3063c5fcd1c7d3b23eca18 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 24 Sep 2014 23:13:52 +0100 -Subject: [PATCH 13/51] [audio] Add settings option to boost centre channel +Subject: [PATCH 13/58] [audio] Add settings option to boost centre channel when downmixing This allows a dB volume increase to be added to centre channel. @@ -702,7 +702,7 @@ Should work with Pi Sink (dvdplayer/paplayer) and omxplayer 5 files changed, 45 insertions(+) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 36b8c5d..c1148e8 100644 +index 6d08156..6e36b42 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -16650,3 +16650,17 @@ msgctxt "#38006" @@ -772,7 +772,7 @@ index e4ddf9e..34d0152 100644 if (remapLayout) { diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -index 7807149..759ba7b 100644 +index 78071493..759ba7b 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp @@ -164,6 +164,12 @@ bool CActiveAEResamplePi::Init(uint64_t dst_chan_layout, int dst_channels, int d @@ -806,10 +806,10 @@ index f99c0e6..1911189 100644 // stereo upmix if (upmix && m_src_channels == 2 && m_dst_channels > 2) -From 8dada388745328d01b186ede90c64be0b571a936 Mon Sep 17 00:00:00 2001 +From aca0d43f243143b6776e1cc8ef259197d2bee97a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 27 Oct 2014 15:23:51 +0000 -Subject: [PATCH 14/51] [rbp] Default extract thumbnails to false +Subject: [PATCH 14/58] [rbp] Default extract thumbnails to false It can take 80 seconds for a single file on a Pi. It can cause crashes with out-of-memory errors. It genereates a lot of support issues. Best to default to disabled and let users enable it if they must @@ -839,10 +839,10 @@ index 50fe36a..a54a4c4 100644
-From cf3e013db35eda90e5e2f337d8355312ce0e5955 Mon Sep 17 00:00:00 2001 +From 35f0f171ab8a9c37b2ebb5aca81b2242834fda72 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 15 Nov 2014 12:03:34 +0000 -Subject: [PATCH 19/51] [dvdplayer] Add lock for player creation +Subject: [PATCH 19/58] [dvdplayer] Add lock for player creation --- xbmc/cores/dvdplayer/DVDPlayer.cpp | 3 +++ @@ -878,7 +878,7 @@ index 70b1ac3..b41c8f0 100644 std::string retVal; diff --git a/xbmc/cores/dvdplayer/DVDPlayer.h b/xbmc/cores/dvdplayer/DVDPlayer.h -index 2a4aea5..f74e71d 100644 +index ab6a228..32e76c1 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.h +++ b/xbmc/cores/dvdplayer/DVDPlayer.h @@ -557,4 +557,5 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer @@ -888,10 +888,10 @@ index 2a4aea5..f74e71d 100644 + CCriticalSection m_players_lock; }; -From 5d3ab1cf45b4eca6f524b4555e3f103e27467a49 Mon Sep 17 00:00:00 2001 +From 51e261109f6a8d1cb0e96bdaa56a01aa7077633f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 24 Nov 2014 22:07:25 +0000 -Subject: [PATCH 20/51] [dvdplayervideo] Prod decoder when in stills mode +Subject: [PATCH 20/58] [dvdplayervideo] Prod decoder when in stills mode An asynchronous hardware decoder doesn't only produce output pictures when new packets arrive. In dvd stills mode give it a chance to return pictures that weren't ready when frame was decoded. @@ -900,7 +900,7 @@ In dvd stills mode give it a chance to return pictures that weren't ready when f 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 656c937..bdc3edb 100644 +index f1a7e60..9be8aae 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -314,7 +314,8 @@ void CDVDPlayerVideo::Process() @@ -968,10 +968,10 @@ index 656c937..bdc3edb 100644 if (pMsg->IsType(CDVDMsg::GENERAL_SYNCHRONIZE)) -From 25d43d2d6bdf9de85a30161aa1c7e0260b4de33b Mon Sep 17 00:00:00 2001 +From deb376b5dad3cef8f86cef69aab9a4280bac9b21 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 27 Nov 2014 16:31:56 +0000 -Subject: [PATCH 21/51] [languageinvoker] Reduce priority of python threads +Subject: [PATCH 21/58] [languageinvoker] Reduce priority of python threads --- xbmc/interfaces/generic/LanguageInvokerThread.cpp | 5 +++++ @@ -994,10 +994,10 @@ index fcdd063..16f0c89 100644 } -From 126cddbf807d68c42e07d24c733d65abb687b500 Mon Sep 17 00:00:00 2001 +From 7351fa296cd1740f04c6c5a2047c11e3b607f700 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 14 Dec 2013 16:55:05 +0000 -Subject: [PATCH 22/51] logging: Add microsecond timer to log messages +Subject: [PATCH 22/58] logging: Add microsecond timer to log messages --- xbmc/utils/log.cpp | 17 +++++++++++++++-- @@ -1050,10 +1050,10 @@ index 3443f12..31c4a99 100644 levelNames[logLevel]) + strData; -From cfe6214efcc206c97cf8eb6b224c0a8d63981c77 Mon Sep 17 00:00:00 2001 +From c2bc1032b22f6214ffbbbecb29e3538f9790f016 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 29 Nov 2014 15:25:16 +0000 -Subject: [PATCH 23/51] [rbp] hack: wait for splash to complete before changing +Subject: [PATCH 23/58] [rbp] hack: wait for splash to complete before changing hdmi mode --- @@ -1127,10 +1127,10 @@ index 68fc647..c80114e 100644 if(!m_fixedMode && GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) -From 1610df489966e26604392af08d40a2a2eacad8db Mon Sep 17 00:00:00 2001 +From 58ed12b2f7dd77fc57b3ddbff8fbaa04a0172716 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 11 Dec 2014 17:00:57 +0000 -Subject: [PATCH 24/51] Fix for UI not showing both extractflags and +Subject: [PATCH 24/58] Fix for UI not showing both extractflags and extractthumb --- @@ -1139,7 +1139,7 @@ Subject: [PATCH 24/51] Fix for UI not showing both extractflags and 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index b6b48b4..6c3a220 100644 +index 788a831..a794cd8 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -11015,7 +11015,7 @@ msgstr "" @@ -1194,10 +1194,10 @@ index 09c3d10..1059b09 100644 -From 07f3c28448d28cf7347394dca6e6a1faeaa7e3ec Mon Sep 17 00:00:00 2001 +From 6f0adae04039766326ebb5a735433dac07787a0f Mon Sep 17 00:00:00 2001 From: anaconda Date: Thu, 11 Sep 2014 21:30:43 +0200 -Subject: [PATCH 25/51] Disable autoscrolling while on screensaver and while +Subject: [PATCH 25/58] Disable autoscrolling while on screensaver and while opening streams. --- @@ -1210,10 +1210,10 @@ Subject: [PATCH 25/51] Disable autoscrolling while on screensaver and while 6 files changed, 24 insertions(+), 3 deletions(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index ffc7ad3..f35871a 100644 +index 697f278..a2a7fd2 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -4993,3 +4993,13 @@ bool CApplication::NotifyActionListeners(const CAction &action) const +@@ -4996,3 +4996,13 @@ bool CApplication::NotifyActionListeners(const CAction &action) const return false; } @@ -1328,10 +1328,10 @@ index 0d5b3f7..6d23024 100644 if (m_lastRenderTime) m_autoScrollDelayTime += currentTime - m_lastRenderTime; -From 5acd81c2d630bbe83763c5463cc26aae862a87b4 Mon Sep 17 00:00:00 2001 +From 9b85c054f66cb5efde618d34198bd533f16f26d5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 13 Dec 2014 18:35:20 +0000 -Subject: [PATCH 26/51] [demuxer] Avoid memcpy on every demuxer packet +Subject: [PATCH 26/58] [demuxer] Avoid memcpy on every demuxer packet Avoids an unnecessary memcpy on every demuxer packet which for high bitrate videos can be significant. @@ -1426,10 +1426,10 @@ index ab298b2..10c5ee0 100644 } catch(...) { -From 80367ca635d7fd6ba3e278fe4c4f2a9275f5c358 Mon Sep 17 00:00:00 2001 +From cb5bcc331593fa2d2088c0a0f8f72aefce1030e2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 15 Feb 2015 14:06:12 +0000 -Subject: [PATCH 27/51] [mmal] Allow mmal codec for dvd stills +Subject: [PATCH 27/58] [mmal] Allow mmal codec for dvd stills --- xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp | 7 +++++++ @@ -1461,10 +1461,10 @@ index 4c363cf..b90237b 100644 { // If dvd is an mpeg2 and hint.stills -From 959665eaf7160c8adb2d0f2e862e1e8ef5df2419 Mon Sep 17 00:00:00 2001 +From 3873604d5ef7443bdfc33603c979495fe8a0f17c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 31 Mar 2015 17:31:47 +0100 -Subject: [PATCH 28/51] [mmalrenderer] Add SetCodecControl function and prefer +Subject: [PATCH 28/58] [mmalrenderer] Add SetCodecControl function and prefer to return pictures when renderer is low (disabled) --- @@ -1535,10 +1535,10 @@ index 51a64d1..bde8c06 100644 CCriticalSection m_sharedSection; MMAL_COMPONENT_T *m_dec; -From aa0a393eb9fc52c4aa791042dd521d16f8852567 Mon Sep 17 00:00:00 2001 +From 8f077b7937e519bbe44a02c3559808672696903e Mon Sep 17 00:00:00 2001 From: anaconda Date: Wed, 25 Feb 2015 18:22:21 +0100 -Subject: [PATCH 29/51] Load OSD dialogs on startup. +Subject: [PATCH 29/58] Load OSD dialogs on startup. Fixes skipped frames the first time they're loaded in memory on less powered devices, like a Raspberry Pi, when using DVDPlayer. @@ -1633,10 +1633,10 @@ index 9f25fa5..3ece45b 100644 CGUIDialogVideoSettings::~CGUIDialogVideoSettings() { } -From cd731d75ce08cb29dc73de665830a4597db691a9 Mon Sep 17 00:00:00 2001 +From 2c96de41d5df402113fb6f675c5c6766ad48b267 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 7 Mar 2015 22:46:21 +0000 -Subject: [PATCH 30/51] configure: Add raspberry-pi2 platform +Subject: [PATCH 30/58] configure: Add raspberry-pi2 platform --- configure.ac | 14 +++++++-- @@ -1648,7 +1648,7 @@ Subject: [PATCH 30/51] configure: Add raspberry-pi2 platform 6 files changed, 44 insertions(+), 22 deletions(-) diff --git a/configure.ac b/configure.ac -index 96be96f..7e924a2 100644 +index 71883d2..6beec97 100644 --- a/configure.ac +++ b/configure.ac @@ -744,8 +744,17 @@ case $use_platform in @@ -1810,449 +1810,10 @@ index cdc2fe4..379bd1d 100644 set(CMAKE_SYSTEM_NAME Linux) endif() -From a6e8bc8e2784775522dce233f0f9dc0bde7fca44 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 16 Apr 2014 21:18:06 +0100 -Subject: [PATCH 31/51] [omxplayer] Don't propagate 3d flags based on supported - 3d modes - ---- - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 29 +++-------------------------- - 1 file changed, 3 insertions(+), 26 deletions(-) - -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index 212a89b..dd509ea 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -752,40 +752,17 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f - uint32_t video_width = CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth; - uint32_t video_height = CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight; - -- unsigned flags = 0; - ERenderFormat format = RENDER_FMT_BYPASS; - -+ /* figure out steremode expected based on user settings and hints */ -+ unsigned flags = GetStereoModeFlags(GetStereoMode()); -+ - if(m_bAllowFullscreen) - { - flags |= CONF_FLAGS_FULLSCREEN; - m_bAllowFullscreen = false; // only allow on first configure - } - -- flags |= GetStereoModeFlags(GetStereoMode()); -- -- if(flags & CONF_FLAGS_STEREO_MODE_SBS) -- { -- if(g_Windowing.Support3D(video_width, video_height, D3DPRESENTFLAG_MODE3DSBS)) -- CLog::Log(LOGNOTICE, "3DSBS movie found"); -- else -- { -- flags &= ~CONF_FLAGS_STEREO_MODE_MASK(~0); -- CLog::Log(LOGNOTICE, "3DSBS movie found but not supported"); -- } -- } -- else if(flags & CONF_FLAGS_STEREO_MODE_TAB) -- { -- if(g_Windowing.Support3D(video_width, video_height, D3DPRESENTFLAG_MODE3DTB)) -- CLog::Log(LOGNOTICE, "3DTB movie found"); -- else -- { -- flags &= ~CONF_FLAGS_STEREO_MODE_MASK(~0); -- CLog::Log(LOGNOTICE, "3DTB movie found but not supported"); -- } -- } -- else -- CLog::Log(LOGNOTICE, "not a 3D movie"); -- - unsigned int iDisplayWidth = width; - unsigned int iDisplayHeight = height; - - -From 46641c44cbf4832f8dc2e09de13c90ec263c7eb0 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 17 Apr 2014 13:01:51 +0100 -Subject: [PATCH 32/51] [graphics] Allow switching to a more suitable 3D - resolution - ---- - xbmc/guilib/GraphicContext.cpp | 40 +++++++++++++++++++++++++++++++++++++++- - xbmc/guilib/GraphicContext.h | 1 + - 2 files changed, 40 insertions(+), 1 deletion(-) - -diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp -index bd7dff9..ed7316a 100644 ---- a/xbmc/guilib/GraphicContext.cpp -+++ b/xbmc/guilib/GraphicContext.cpp -@@ -32,6 +32,7 @@ - #include "input/InputManager.h" - #include "GUIWindowManager.h" - #include "video/VideoReferenceClock.h" -+#include - - using namespace std; - -@@ -499,6 +500,43 @@ RESOLUTION CGraphicContext::GetVideoResolution() const - return m_Resolution; - } - -+RESOLUTION CGraphicContext::Get3DVideoResolution(RESOLUTION resolution, RENDER_STEREO_MODE mode) const -+{ -+ RESOLUTION best = resolution; -+ RESOLUTION_INFO curr = CDisplaySettings::Get().GetResolutionInfo(best); -+ // Find closest refresh rate -+ for (size_t i = (int)RES_DESKTOP; i < CDisplaySettings::Get().ResolutionInfoSize(); i++) -+ { -+ const RESOLUTION_INFO info = CDisplaySettings::Get().GetResolutionInfo((RESOLUTION)i); -+ -+ //discard resolutions that are not the same width and height (and interlaced/3D flags) -+ //or have a too low refreshrate -+ if (info.iScreenWidth != curr.iScreenWidth -+ || info.iScreenHeight != curr.iScreenHeight -+ || info.iScreen != curr.iScreen -+ || (info.dwFlags & D3DPRESENTFLAG_INTERLACED) != (curr.dwFlags & D3DPRESENTFLAG_INTERLACED) -+ || fabs(info.fRefreshRate - curr.fRefreshRate) >= FLT_EPSILON) -+ continue; -+ -+ if (mode == RENDER_STEREO_MODE_SPLIT_VERTICAL && info.dwFlags & D3DPRESENTFLAG_MODE3DSBS) -+ { -+ best = (RESOLUTION)i; -+ break; -+ } -+ else if (mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL && info.dwFlags & D3DPRESENTFLAG_MODE3DTB) -+ { -+ best = (RESOLUTION)i; -+ break; -+ } -+ else if ((mode == RENDER_STEREO_MODE_OFF || mode == RENDER_STEREO_MODE_MONO) && !(info.dwFlags & (D3DPRESENTFLAG_MODE3DSBS|D3DPRESENTFLAG_MODE3DTB))) -+ { -+ best = (RESOLUTION)i; -+ break; -+ } -+ } -+ return best; -+} -+ - void CGraphicContext::ResetOverscan(RESOLUTION_INFO &res) - { - res.Overscan.left = 0; -@@ -1042,7 +1080,7 @@ void CGraphicContext::Flip(const CDirtyRegionList& dirty) - if(m_stereoMode != m_nextStereoMode) - { - m_stereoMode = m_nextStereoMode; -- SetVideoResolution(GetVideoResolution(), true); -+ SetVideoResolution(Get3DVideoResolution(m_Resolution, m_stereoMode), true); - g_windowManager.SendMessage(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_RENDERER_RESET); - } - } -diff --git a/xbmc/guilib/GraphicContext.h b/xbmc/guilib/GraphicContext.h -index a8fd03e..8501e58 100644 ---- a/xbmc/guilib/GraphicContext.h -+++ b/xbmc/guilib/GraphicContext.h -@@ -108,6 +108,7 @@ class CGraphicContext : public CCriticalSection, - bool IsValidResolution(RESOLUTION res); - void SetVideoResolution(RESOLUTION res, bool forceUpdate = false); - RESOLUTION GetVideoResolution() const; -+ RESOLUTION Get3DVideoResolution(RESOLUTION resolution, RENDER_STEREO_MODE mode) const; - void ResetOverscan(RESOLUTION res, OVERSCAN &overscan); - void ResetOverscan(RESOLUTION_INFO &resinfo); - void ResetScreenParameters(RESOLUTION res); - -From 55a4a727c1c8d0ca28deb1a8ca2c6ffa6a4eb0aa Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 17 Apr 2014 13:38:55 +0100 -Subject: [PATCH 33/51] [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. ---- - xbmc/cores/VideoRenderers/BaseRenderer.cpp | 47 +++++++++++------------------- - 1 file changed, 17 insertions(+), 30 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.cpp b/xbmc/cores/VideoRenderers/BaseRenderer.cpp -index bfafab7..84e6261 100644 ---- a/xbmc/cores/VideoRenderers/BaseRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/BaseRenderer.cpp -@@ -222,10 +222,14 @@ void CBaseRenderer::FindResolutionFromFpsMatch(float fps, float& weight) - RESOLUTION CBaseRenderer::FindClosestResolution(float fps, float multiplier, RESOLUTION current, float& weight) - { - RESOLUTION_INFO curr = g_graphicsContext.GetResInfo(current); -+ unsigned int stereo_mode = CONF_FLAGS_STEREO_MODE_MASK(m_iFlags); - - float fRefreshRate = fps; - -- float last_diff = fRefreshRate; -+ int c_weight = MathUtils::round_int(RefreshWeight(curr.fRefreshRate, fRefreshRate * multiplier) * 1000.0); -+ if (!(stereo_mode == CONF_FLAGS_STEREO_MODE_SBS) != !(curr.dwFlags & D3DPRESENTFLAG_MODE3DSBS) || -+ !(stereo_mode == CONF_FLAGS_STEREO_MODE_TAB) != !(curr.dwFlags & D3DPRESENTFLAG_MODE3DTB)) -+ c_weight += 1000; - - // Find closest refresh rate - for (size_t i = (int)RES_DESKTOP; i < CDisplaySettings::Get().ResolutionInfoSize(); i++) -@@ -241,40 +245,23 @@ RESOLUTION CBaseRenderer::FindClosestResolution(float fps, float multiplier, RES - || info.fRefreshRate < (fRefreshRate * multiplier / 1.001) - 0.001) - continue; - -- // For 3D choose the closest refresh rate -- if(CONF_FLAGS_STEREO_MODE_MASK(m_iFlags)) -- { -- float diff = (info.fRefreshRate - fRefreshRate); -- if(diff < 0) -- diff *= -1.0f; -+ int i_weight = MathUtils::round_int(RefreshWeight(info.fRefreshRate, fRefreshRate * multiplier) * 1000.0); - -- if(diff < last_diff) -- { -- last_diff = diff; -- current = (RESOLUTION)i; -- curr = info; -- } -- } -- else -- { -- int c_weight = MathUtils::round_int(RefreshWeight(curr.fRefreshRate, fRefreshRate * multiplier) * 1000.0); -- int i_weight = MathUtils::round_int(RefreshWeight(info.fRefreshRate, fRefreshRate * multiplier) * 1000.0); -+ if (!(stereo_mode == CONF_FLAGS_STEREO_MODE_SBS) != !(info.dwFlags & D3DPRESENTFLAG_MODE3DSBS) || -+ !(stereo_mode == CONF_FLAGS_STEREO_MODE_TAB) != !(info.dwFlags & D3DPRESENTFLAG_MODE3DTB)) -+ i_weight += 1000; - -- // Closer the better, prefer higher refresh rate if the same -- if ((i_weight < c_weight) -- || (i_weight == c_weight && info.fRefreshRate > curr.fRefreshRate)) -- { -- current = (RESOLUTION)i; -- curr = info; -- } -+ // Closer the better, prefer higher refresh rate if the same -+ if ((i_weight < c_weight) -+ || (i_weight == c_weight && info.fRefreshRate > curr.fRefreshRate)) -+ { -+ current = (RESOLUTION)i; -+ curr = info; -+ c_weight = i_weight; - } - } - -- // For 3D overwrite weight -- if(CONF_FLAGS_STEREO_MODE_MASK(m_iFlags)) -- weight = 0; -- else -- weight = RefreshWeight(curr.fRefreshRate, fRefreshRate * multiplier); -+ weight = RefreshWeight(curr.fRefreshRate, fRefreshRate * multiplier); - - return current; - } - -From 568e84b69fc126735e0c9e298d3fa7d2eea0aae2 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 23 Apr 2014 00:05:07 +0100 -Subject: [PATCH 34/51] [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. ---- - xbmc/cores/VideoRenderers/BaseRenderer.cpp | 10 +++---- - xbmc/guilib/GraphicContext.cpp | 37 ++++++++++++------------- - xbmc/guilib/GraphicContext.h | 12 ++++++-- - xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 8 ------ - 4 files changed, 32 insertions(+), 35 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.cpp b/xbmc/cores/VideoRenderers/BaseRenderer.cpp -index 84e6261..f82f37f 100644 ---- a/xbmc/cores/VideoRenderers/BaseRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/BaseRenderer.cpp -@@ -119,7 +119,7 @@ bool CBaseRenderer::FindResolutionFromOverride(float fps, float& weight, bool fa - - for (size_t j = (int)RES_DESKTOP; j < CDisplaySettings::Get().ResolutionInfoSize(); j++) - { -- RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)j); -+ RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)j, g_graphicsContext.GetStereoMode((RESOLUTION)j)); - - if (info.iScreenWidth == curr.iScreenWidth - && info.iScreenHeight == curr.iScreenHeight -@@ -179,7 +179,7 @@ void CBaseRenderer::FindResolutionFromFpsMatch(float fps, float& weight) - //get the resolution with the refreshrate closest to 60 hertz - for (size_t i = (int)RES_DESKTOP; i < CDisplaySettings::Get().ResolutionInfoSize(); i++) - { -- RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)i); -+ RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)i, g_graphicsContext.GetStereoMode((RESOLUTION)i)); - - if (MathUtils::round_int(info.fRefreshRate) == 60 - && info.iScreenWidth == curr.iScreenWidth -@@ -200,7 +200,7 @@ void CBaseRenderer::FindResolutionFromFpsMatch(float fps, float& weight) - CLog::Log(LOGDEBUG, "60 hertz refreshrate not available, choosing highest"); - for (size_t i = (int)RES_DESKTOP; i < CDisplaySettings::Get().ResolutionInfoSize(); i++) - { -- RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)i); -+ RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)i, g_graphicsContext.GetStereoMode((RESOLUTION)i)); - - if (info.fRefreshRate > curr.fRefreshRate - && info.iScreenWidth == curr.iScreenWidth -@@ -234,14 +234,14 @@ RESOLUTION CBaseRenderer::FindClosestResolution(float fps, float multiplier, RES - // Find closest refresh rate - for (size_t i = (int)RES_DESKTOP; i < CDisplaySettings::Get().ResolutionInfoSize(); i++) - { -- const RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)i); -+ const RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)i, g_graphicsContext.GetStereoMode((RESOLUTION)i)); - - //discard resolutions that are not the same width and height (and interlaced/3D flags) - //or have a too low refreshrate - if (info.iScreenWidth != curr.iScreenWidth - || info.iScreenHeight != curr.iScreenHeight - || info.iScreen != curr.iScreen -- || (info.dwFlags & D3DPRESENTFLAG_MODEMASK) != (curr.dwFlags & D3DPRESENTFLAG_MODEMASK) -+ || (info.dwFlags & D3DPRESENTFLAG_INTERLACED) != (curr.dwFlags & D3DPRESENTFLAG_INTERLACED) - || info.fRefreshRate < (fRefreshRate * multiplier / 1.001) - 0.001) - continue; - -diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp -index ed7316a..f591b9c 100644 ---- a/xbmc/guilib/GraphicContext.cpp -+++ b/xbmc/guilib/GraphicContext.cpp -@@ -746,32 +746,33 @@ void CGraphicContext::ApplyStateBlock() - g_Windowing.ApplyStateBlock(); - } - --const RESOLUTION_INFO CGraphicContext::GetResInfo(RESOLUTION res) const -+RENDER_STEREO_MODE CGraphicContext::GetStereoMode(RESOLUTION res) const - { - RESOLUTION_INFO info = CDisplaySettings::Get().GetResolutionInfo(res); -+ return (info.dwFlags & D3DPRESENTFLAG_MODE3DTB) ? RENDER_STEREO_MODE_SPLIT_HORIZONTAL : -+ (info.dwFlags & D3DPRESENTFLAG_MODE3DSBS) ? RENDER_STEREO_MODE_SPLIT_VERTICAL : RENDER_STEREO_MODE_OFF; -+} - -- if(m_stereoMode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) -+const RESOLUTION_INFO CGraphicContext::GetResInfo(RESOLUTION res, RENDER_STEREO_MODE stereoMode) const -+{ -+ RESOLUTION_INFO info = CDisplaySettings::Get().GetResolutionInfo(res); -+ -+ if(stereoMode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) - { -- if((info.dwFlags & D3DPRESENTFLAG_MODE3DTB) == 0) -- { -- info.fPixelRatio /= 2; -- info.iBlanking = 0; -- info.dwFlags |= D3DPRESENTFLAG_MODE3DTB; -- } -+ info.fPixelRatio /= 2; -+ info.iBlanking = 0; -+ info.dwFlags |= D3DPRESENTFLAG_MODE3DTB; - info.iHeight = (info.iHeight - info.iBlanking) / 2; - info.Overscan.top /= 2; - info.Overscan.bottom = (info.Overscan.bottom - info.iBlanking) / 2; - info.iSubtitles = (info.iSubtitles - info.iBlanking) / 2; - } - -- if(m_stereoMode == RENDER_STEREO_MODE_SPLIT_VERTICAL) -+ if(stereoMode == RENDER_STEREO_MODE_SPLIT_VERTICAL) - { -- if((info.dwFlags & D3DPRESENTFLAG_MODE3DSBS) == 0) -- { -- info.fPixelRatio *= 2; -- info.iBlanking = 0; -- info.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; -- } -+ info.fPixelRatio *= 2; -+ info.iBlanking = 0; -+ info.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; - info.iWidth = (info.iWidth - info.iBlanking) / 2; - info.Overscan.left /= 2; - info.Overscan.right = (info.Overscan.right - info.iBlanking) / 2; -@@ -795,16 +796,14 @@ void CGraphicContext::SetResInfo(RESOLUTION res, const RESOLUTION_INFO& info) - if(info.dwFlags & D3DPRESENTFLAG_MODE3DSBS) - { - curr.Overscan.right = info.Overscan.right * 2 + info.iBlanking; -- if((curr.dwFlags & D3DPRESENTFLAG_MODE3DSBS) == 0) -- curr.fPixelRatio /= 2.0; -+ curr.fPixelRatio /= 2.0; - } - - if(info.dwFlags & D3DPRESENTFLAG_MODE3DTB) - { - curr.Overscan.bottom = info.Overscan.bottom * 2 + info.iBlanking; - curr.iSubtitles = info.iSubtitles * 2 + info.iBlanking; -- if((curr.dwFlags & D3DPRESENTFLAG_MODE3DTB) == 0) -- curr.fPixelRatio *= 2.0; -+ curr.fPixelRatio *= 2.0; - } - } - -diff --git a/xbmc/guilib/GraphicContext.h b/xbmc/guilib/GraphicContext.h -index 8501e58..0c53cae 100644 ---- a/xbmc/guilib/GraphicContext.h -+++ b/xbmc/guilib/GraphicContext.h -@@ -120,11 +120,15 @@ class CGraphicContext : public CCriticalSection, - void GetAllowedResolutions(std::vector &res); - - // output scaling -+ const RESOLUTION_INFO GetResInfo(RESOLUTION res) const -+ { -+ return GetResInfo(res, GetStereoMode()); -+ } - const RESOLUTION_INFO GetResInfo() const - { - return GetResInfo(m_Resolution); - } -- const RESOLUTION_INFO GetResInfo(RESOLUTION res) const; -+ const RESOLUTION_INFO GetResInfo(RESOLUTION res, RENDER_STEREO_MODE stereo_mode) const; - void SetResInfo(RESOLUTION res, const RESOLUTION_INFO& info); - - /* \brief Get UI scaling information from a given resolution to the screen resolution. -@@ -161,9 +165,11 @@ class CGraphicContext : public CCriticalSection, - void RestoreOrigin(); - void SetCameraPosition(const CPoint &camera); - void SetStereoView(RENDER_STEREO_VIEW view); -- RENDER_STEREO_VIEW GetStereoView() { return m_stereoView; } -+ RENDER_STEREO_VIEW GetStereoView() const { return m_stereoView; } - void SetStereoMode(RENDER_STEREO_MODE mode) { m_nextStereoMode = mode; } -- RENDER_STEREO_MODE GetStereoMode() { return m_stereoMode; } -+ RENDER_STEREO_MODE GetStereoMode() const { return m_stereoMode; } -+ RENDER_STEREO_MODE GetStereoMode(RESOLUTION res) const; -+ - void RestoreCameraPosition(); - /*! \brief Set a region in which to clip all rendering - Anything that is rendered after setting a clip region will be clipped so that no part renders -diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -index c80114e..80c05d2 100644 ---- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -+++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -@@ -499,15 +499,9 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r - m_desktopRes.fPixelRatio = tv_state.display.hdmi.display_options.aspect == 0 ? 1.0f : get_display_aspect_ratio((HDMI_ASPECT_T)tv_state.display.hdmi.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); - // Also add 3D flags - if (tv_state.display.hdmi.format_3d == HDMI_3D_FORMAT_SBS_HALF) -- { - m_desktopRes.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; -- m_desktopRes.fPixelRatio *= 2.0; -- } - else if (tv_state.display.hdmi.format_3d == HDMI_3D_FORMAT_TB_HALF) -- { - m_desktopRes.dwFlags |= D3DPRESENTFLAG_MODE3DTB; -- m_desktopRes.fPixelRatio *= 0.5; -- } - HDMI_PROPERTY_PARAM_T property; - property.property = HDMI_PROPERTY_PIXEL_CLOCK_TYPE; - vc_tv_hdmi_get_property(&property); -@@ -650,7 +644,6 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v - RESOLUTION_INFO res2 = res; - res2.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; - res2.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res2.iScreenWidth / (float)res2.iScreenHeight); -- res2.fPixelRatio *= 2.0f; - res2.iSubtitles = (int)(0.965 * res2.iHeight); - - AddUniqueResolution(res2, resolutions); -@@ -666,7 +659,6 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v - RESOLUTION_INFO res2 = res; - res2.dwFlags |= D3DPRESENTFLAG_MODE3DTB; - res2.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res2.iScreenWidth / (float)res2.iScreenHeight); -- res2.fPixelRatio *= 0.5f; - res2.iSubtitles = (int)(0.965 * res2.iHeight); - - AddUniqueResolution(res2, resolutions); - -From 0c9da02efd32493162bbe0080ce08fc75d024ad2 Mon Sep 17 00:00:00 2001 +From ecf7d1b7364dd7cb121825168aa51a6b14946614 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 10 Mar 2015 17:05:18 +0000 -Subject: [PATCH 35/51] [players] Add settings option to enable MVC support +Subject: [PATCH 31/58] [players] Add settings option to enable MVC support --- addons/resource.language.en_gb/resources/strings.po | 10 ++++++++++ @@ -2262,7 +1823,7 @@ Subject: [PATCH 35/51] [players] Add settings option to enable MVC support 4 files changed, 27 insertions(+) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 6c3a220..f5b7c42 100644 +index a794cd8..acb6372 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -16680,6 +16680,16 @@ msgctxt "#38052" @@ -2333,10 +1894,10 @@ index e4f6d86..5d324f4 100644 case AV_CODEC_ID_MPEG4: // (role name) video_decoder.mpeg4 -From 397a5d0b70abe0922387a0afd8beb4842a56e9b0 Mon Sep 17 00:00:00 2001 +From 7c831c1cf47b62ee6ea8d57457b4b5ee35f29882 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 14 Mar 2015 12:38:08 +0000 -Subject: [PATCH 36/51] [mmalrenderer] Switch to using transform flags for 3d +Subject: [PATCH 32/58] [mmalrenderer] Switch to using transform flags for 3d modes --- @@ -2350,7 +1911,7 @@ Subject: [PATCH 36/51] [mmalrenderer] Switch to using transform flags for 3d 7 files changed, 75 insertions(+), 130 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index f5b7c42..4848047 100644 +index acb6372..e1b691d 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -16690,6 +16690,16 @@ msgctxt "#38111" @@ -2529,7 +2090,7 @@ index 9f1f803..6cde0c5 100644 + region.dest_rect.x, region.dest_rect.y, region.dest_rect.width, region.dest_rect.height, region.transform); } diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index dd509ea..adf9910 100644 +index 212a89b..ba17a46 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp @@ -649,9 +649,7 @@ int OMXPlayerVideo::GetFreeSpace() @@ -2687,7 +2248,7 @@ index d0634bb..86e94ce 100644 bool GetPlayerInfo(double &match, double &phase, double &pll); void SubmitEOS(); diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -index 80c05d2..ae85484 100644 +index c80114e..3816b55 100644 --- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp @@ -281,7 +281,9 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) @@ -2695,7 +2256,7 @@ index 80c05d2..ae85484 100644 HDMI_PROPERTY_PARAM_T property; property.property = HDMI_PROPERTY_3D_STRUCTURE; - if (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) -+ if (CSettings::Get().GetBool("videoplayer.framepacking")) ++ if (CSettings::Get().GetBool("videoplayer.framepacking") && CSettings::Get().GetBool("videoplayer.supportmvc")) + property.param1 = HDMI_3D_FORMAT_FRAME_PACKING; + else if (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) property.param1 = HDMI_3D_FORMAT_SBS_HALF; @@ -2716,10 +2277,10 @@ index 80c05d2..ae85484 100644 m_width, m_height, dst_rect.width, dst_rect.height, res.fRefreshRate, GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), (int)res.dwFlags, res.fPixelRatio); -From 180bad11da9d406158975f960198af9315170743 Mon Sep 17 00:00:00 2001 +From 404462b4bf655a3dd1f50f619162839f47f6efaa Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 14 Apr 2015 20:51:14 +0100 -Subject: [PATCH 39/51] [gui] Also limit GUI updates when in non full-screen +Subject: [PATCH 35/58] [gui] Also limit GUI updates when in non full-screen video mode --- @@ -2727,10 +2288,10 @@ Subject: [PATCH 39/51] [gui] Also limit GUI updates when in non full-screen 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index f35871a..dd58116 100644 +index a2a7fd2..95ec768 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -2504,7 +2504,7 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) +@@ -2507,7 +2507,7 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) #if defined(TARGET_RASPBERRY_PI) || defined(HAS_IMXVPU) // This code reduces rendering fps of the GUI layer when playing videos in fullscreen mode // it makes only sense on architectures with multiple layers @@ -2739,7 +2300,7 @@ index f35871a..dd58116 100644 fps = CSettings::Get().GetInt("videoplayer.limitguiupdate"); #endif -@@ -2517,6 +2517,8 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) +@@ -2520,6 +2520,8 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) { if (!m_skipGuiRender) g_windowManager.Process(CTimeUtils::GetFrameTime()); @@ -2749,10 +2310,761 @@ index f35871a..dd58116 100644 g_windowManager.FrameMove(); } -From a00d53ea266d3513d4785ff730d4d3ed9aace2a4 Mon Sep 17 00:00:00 2001 +From f83aef5f43795b2e08d87dc1ba8723bd7c7f09a2 Mon Sep 17 00:00:00 2001 +From: macrule +Date: Thu, 11 Apr 2013 18:24:42 +0200 +Subject: [PATCH 36/58] Added some vc_tv_* functions that were missing in + DllBCM. + +--- + xbmc/linux/DllBCM.h | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/xbmc/linux/DllBCM.h b/xbmc/linux/DllBCM.h +index b92fdb8..9c7e293 100644 +--- a/xbmc/linux/DllBCM.h ++++ b/xbmc/linux/DllBCM.h +@@ -48,6 +48,9 @@ class DllBcmHostInterface + virtual void bcm_host_init() = 0; + virtual void bcm_host_deinit() = 0; + virtual int32_t graphics_get_display_size( const uint16_t display_number, uint32_t *width, uint32_t *height) = 0; ++ virtual int vc_tv_power_off() = 0; ++ virtual int vc_tv_sdtv_power_on(SDTV_MODE_T mode, SDTV_OPTIONS_T *options) = 0; ++ virtual int vc_tv_hdmi_power_on_preferred() = 0; + virtual int vc_tv_hdmi_power_on_best(uint32_t width, uint32_t height, uint32_t frame_rate, + HDMI_INTERLACED_T scan_mode, EDID_MODE_MATCH_FLAG_T match_flags) = 0; + virtual int vc_tv_hdmi_power_on_best_3d(uint32_t width, uint32_t height, uint32_t frame_rate, +@@ -92,6 +95,12 @@ class DllBcmHost : public DllDynamic, DllBcmHostInterface + { return ::bcm_host_deinit(); }; + virtual int32_t graphics_get_display_size( const uint16_t display_number, uint32_t *width, uint32_t *height) + { return ::graphics_get_display_size(display_number, width, height); }; ++ virtual int vc_tv_power_off() ++ { return ::vc_tv_power_off(); } ++ virtual int vc_tv_sdtv_power_on(SDTV_MODE_T mode, SDTV_OPTIONS_T *options) ++ { return ::vc_tv_sdtv_power_on(mode, options); } ++ virtual int vc_tv_hdmi_power_on_preferred() ++ { return ::vc_tv_hdmi_power_on_preferred(); } + virtual int vc_tv_hdmi_power_on_best(uint32_t width, uint32_t height, uint32_t frame_rate, + 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 f72df42ab7b2987446c08230917f59391f58c1ef Mon Sep 17 00:00:00 2001 +From: macrule +Date: Thu, 11 Apr 2013 18:29:03 +0200 +Subject: [PATCH 37/58] Added private utility function to map a float display + aspect, to the respective SDTV_ASPECT_* enum value. + +--- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +index 3816b55..520bf95 100644 +--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp ++++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +@@ -60,7 +60,10 @@ + # define DLOG(fmt, args...) + #endif + ++#if defined(TARGET_RASPBERRY_PI) + static void SetResolutionString(RESOLUTION_INFO &res); ++static SDTV_ASPECT_T get_sdtv_aspect_from_display_aspect(float display_aspect); ++#endif + + CEGLNativeTypeRaspberryPI::CEGLNativeTypeRaspberryPI() + { +@@ -470,6 +473,25 @@ static void SetResolutionString(RESOLUTION_INFO &res) + res.dwFlags & D3DPRESENTFLAG_MODE3DTB ? " 3DTB" : "", + res.dwFlags & D3DPRESENTFLAG_MODE3DSBS ? " 3DSBS" : ""); + } ++ ++static SDTV_ASPECT_T get_sdtv_aspect_from_display_aspect(float display_aspect) ++{ ++ SDTV_ASPECT_T aspect; ++ const float delta = 1e-3; ++ if(fabs(get_display_aspect_ratio(SDTV_ASPECT_16_9) - display_aspect) < delta) ++ { ++ aspect = SDTV_ASPECT_16_9; ++ } ++ else if(fabs(get_display_aspect_ratio(SDTV_ASPECT_14_9) - display_aspect) < delta) ++ { ++ aspect = SDTV_ASPECT_14_9; ++ } ++ else ++ { ++ aspect = SDTV_ASPECT_4_3; ++ } ++ return aspect; ++} + #endif + + bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &resolutions) + +From dbb24dacba5c40c0d536f4f71f5ac8b3b01fab41 Mon Sep 17 00:00:00 2001 +From: macrule +Date: Thu, 11 Apr 2013 19:50:58 +0200 +Subject: [PATCH 38/58] 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. + +--- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 36 ++++++++++++++++++++----- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h | 1 - + 2 files changed, 29 insertions(+), 8 deletions(-) + +diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +index 520bf95..a1f67fd 100644 +--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp ++++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +@@ -274,7 +274,7 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) + + DestroyDispmaxWindow(); + +- if(!m_fixedMode && GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) ++ if(GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) + { + sem_init(&m_tv_synced, 0, 0); + m_DllBcmHost->vc_tv_register_callback(CallbackTvServiceCallback, this); +@@ -330,6 +330,33 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) + + m_desktopRes = res; + } ++ else if(!GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) ++ { ++ sem_init(&m_tv_synced, 0, 0); ++ m_DllBcmHost->vc_tv_register_callback(CallbackTvServiceCallback, this); ++ ++ SDTV_OPTIONS_T options; ++ options.aspect = get_sdtv_aspect_from_display_aspect((float)res.iScreenWidth / (float)res.iScreenHeight); ++ ++ int success = m_DllBcmHost->vc_tv_sdtv_power_on((SDTV_MODE_T)GETFLAGS_MODE(res.dwFlags), &options); ++ ++ if (success == 0) ++ { ++ CLog::Log(LOGDEBUG, "EGL set SDTV mode (%d,%d)=%d\n", ++ GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), success); ++ ++ sem_wait(&m_tv_synced); ++ } ++ else ++ { ++ CLog::Log(LOGERROR, "EGL failed to set SDTV mode (%d,%d)=%d\n", ++ GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), success); ++ } ++ m_DllBcmHost->vc_tv_unregister_callback(CallbackTvServiceCallback); ++ sem_destroy(&m_tv_synced); ++ ++ m_desktopRes = res; ++ } + + m_dispman_display = g_RBP.OpenDisplay(0); + +@@ -502,8 +529,6 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + if(!m_DllBcmHost) + return false; + +- m_fixedMode = false; +- + /* read initial desktop resolution before probe resolutions. + * probing will replace the desktop resolution when it finds the same one. + * we raplace it because probing will generate more detailed +@@ -552,7 +577,7 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + m_desktopRes.iHeight = tv_state.display.sdtv.height; + m_desktopRes.iScreenWidth = tv_state.display.sdtv.width; + m_desktopRes.iScreenHeight= tv_state.display.sdtv.height; +- m_desktopRes.dwFlags = D3DPRESENTFLAG_INTERLACED; ++ m_desktopRes.dwFlags = MAKEFLAGS(HDMI_RES_GROUP_INVALID, tv_state.display.sdtv.mode, 1); + m_desktopRes.fRefreshRate = (float)tv_state.display.sdtv.frame_rate; + m_desktopRes.fPixelRatio = tv_state.display.hdmi.display_options.aspect == 0 ? 1.0f : get_display_aspect_ratio((SDTV_ASPECT_T)tv_state.display.sdtv.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); + } +@@ -575,9 +600,6 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + CLog::Log(LOGDEBUG, "EGL probe resolution %s:%x\n", m_desktopRes.strMode.c_str(), m_desktopRes.dwFlags); + } + +- if(resolutions.size() < 2) +- m_fixedMode = true; +- + DLOG("CEGLNativeTypeRaspberryPI::ProbeResolutions\n"); + return true; + #else +diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h +index 59401f5..a0acb1a 100644 +--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h ++++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h +@@ -59,7 +59,6 @@ class CEGLNativeTypeRaspberryPI : public CEGLNativeType + DISPMANX_ELEMENT_HANDLE_T m_dispman_element; + TV_GET_STATE_RESP_T m_tv_state; + sem_t m_tv_synced; +- bool m_fixedMode; + RESOLUTION_INFO m_desktopRes; + int m_width; + int m_height; + +From 06f189a4535e06b3d21f89e43b7caee7dedbe0d3 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 21 Jun 2015 17:11:09 +0100 +Subject: [PATCH 39/58] Revert "[3D] don't back out from 3D handling on + resolution changes if we're switching to a different 3D mode" + +This reverts commit 3c4c236a799dab8369b4bb74ff9993bc58a61a72. +--- + xbmc/guilib/GraphicContext.cpp | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp +index bd7dff9..fc4cc95 100644 +--- a/xbmc/guilib/GraphicContext.cpp ++++ b/xbmc/guilib/GraphicContext.cpp +@@ -436,17 +436,14 @@ void CGraphicContext::SetVideoResolutionInternal(RESOLUTION res, bool forceUpdat + + RENDER_STEREO_MODE stereo_mode = m_stereoMode; + +- // if the new resolution is an actual stereo mode, switch to that +- // if the old resolution was an actual stereo mode and renderer is still in old 3D mode, switch to no 3d mode ++ // if the new mode is an actual stereo mode, switch to that ++ // if the old mode was an actual stereo mode, switch to no 3d mode + if (info_org.dwFlags & D3DPRESENTFLAG_MODE3DTB) + stereo_mode = RENDER_STEREO_MODE_SPLIT_HORIZONTAL; + else if (info_org.dwFlags & D3DPRESENTFLAG_MODE3DSBS) + stereo_mode = RENDER_STEREO_MODE_SPLIT_VERTICAL; +- else if ((info_last.dwFlags & D3DPRESENTFLAG_MODE3DTB) +- && m_stereoMode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) +- stereo_mode = RENDER_STEREO_MODE_OFF; +- else if ((info_last.dwFlags & D3DPRESENTFLAG_MODE3DSBS) +- && m_stereoMode == RENDER_STEREO_MODE_SPLIT_VERTICAL) ++ else if ((info_last.dwFlags & D3DPRESENTFLAG_MODE3DSBS) != 0 ++ || (info_last.dwFlags & D3DPRESENTFLAG_MODE3DTB) != 0) + stereo_mode = RENDER_STEREO_MODE_OFF; + + if(stereo_mode != m_stereoMode) + +From 445dce97603e36fadc97ee3d479abe6f581f6a07 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 10 Jun 2015 20:42:03 +0100 +Subject: [PATCH 40/58] [rbp] Fix zoom modes with stereoscopic videos + +--- + xbmc/cores/VideoRenderers/MMALRenderer.cpp | 12 ++++++++++-- + xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 12 ++++++++++-- + 2 files changed, 20 insertions(+), 4 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +index 6cde0c5..5fc68d2 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +@@ -621,9 +621,17 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect + CRect display(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight); + + if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) +- DestRect.x2 *= 2.0f; ++ { ++ float width = DestRect.x2 - DestRect.x1; ++ DestRect.x1 *= 2.0f; ++ DestRect.x2 = DestRect.x1 + 2.0f * width; ++ } + else if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) +- DestRect.y2 *= 2.0f; ++ { ++ float height = DestRect.y2 - DestRect.y1; ++ DestRect.y1 *= 2.0f; ++ DestRect.y2 = DestRect.y1 + 2.0f * height; ++ } + + if (gui != display) + { +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +index ba17a46..298eaff 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +@@ -690,9 +690,17 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec + CRect display(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight); + + if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) +- DestRect.x2 *= 2.0f; ++ { ++ float width = DestRect.x2 - DestRect.x1; ++ DestRect.x1 *= 2.0f; ++ DestRect.x2 = DestRect.x1 + 2.0f * width; ++ } + else if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) +- DestRect.y2 *= 2.0f; ++ { ++ float height = DestRect.y2 - DestRect.y1; ++ DestRect.y1 *= 2.0f; ++ DestRect.y2 = DestRect.y1 + 2.0f * height; ++ } + + if (gui != display) + { + +From 84bc87e546d79c342b8a7c169f81e8521611cdb3 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 21 Jun 2015 17:42:03 +0100 +Subject: [PATCH 41/58] [WinSystemEGL] Remove unused Support3D function + +--- + xbmc/windowing/egl/WinSystemEGL.cpp | 29 ----------------------------- + xbmc/windowing/egl/WinSystemEGL.h | 1 - + 2 files changed, 30 deletions(-) + +diff --git a/xbmc/windowing/egl/WinSystemEGL.cpp b/xbmc/windowing/egl/WinSystemEGL.cpp +index c3bdb6a..c43c4d0 100644 +--- a/xbmc/windowing/egl/WinSystemEGL.cpp ++++ b/xbmc/windowing/egl/WinSystemEGL.cpp +@@ -531,35 +531,6 @@ EGLConfig CWinSystemEGL::GetEGLConfig() + return m_config; + } + +-// the logic in this function should match whether CBaseRenderer::FindClosestResolution picks a 3D mode +-bool CWinSystemEGL::Support3D(int width, int height, uint32_t mode) const +-{ +- RESOLUTION_INFO &curr = CDisplaySettings::Get().GetResolutionInfo(g_graphicsContext.GetVideoResolution()); +- +- // if we are using automatic hdmi mode switching +- if (CSettings::Get().GetInt("videoplayer.adjustrefreshrate") != ADJUST_REFRESHRATE_OFF) +- { +- int searchWidth = curr.iScreenWidth; +- int searchHeight = curr.iScreenHeight; +- +- // only search the custom resolutions +- for (unsigned int i = (int)RES_DESKTOP; i < CDisplaySettings::Get().ResolutionInfoSize(); i++) +- { +- RESOLUTION_INFO res = CDisplaySettings::Get().GetResolutionInfo(i); +- if(res.iScreenWidth == searchWidth && res.iScreenHeight == searchHeight && (res.dwFlags & mode)) +- return true; +- } +- } +- // otherwise just consider current mode +- else +- { +- if (curr.dwFlags & mode) +- return true; +- } +- +- return false; +-} +- + bool CWinSystemEGL::ClampToGUIDisplayLimits(int &width, int &height) + { + width = width > m_nWidth ? m_nWidth : width; +diff --git a/xbmc/windowing/egl/WinSystemEGL.h b/xbmc/windowing/egl/WinSystemEGL.h +index 9d4baf6..1ec4225 100644 +--- a/xbmc/windowing/egl/WinSystemEGL.h ++++ b/xbmc/windowing/egl/WinSystemEGL.h +@@ -59,7 +59,6 @@ class CWinSystemEGL : public CWinSystemBase, public CRenderSystemGLES + virtual void Register(IDispResource *resource); + virtual void Unregister(IDispResource *resource); + +- virtual bool Support3D(int width, int height, uint32_t mode) const; + virtual bool ClampToGUIDisplayLimits(int &width, int &height); + + EGLConfig GetEGLConfig(); + +From 1597e6d82c667d55a763e965cb1e6448e0fbc01e Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 16 Apr 2014 21:18:06 +0100 +Subject: [PATCH 42/58] [omxplayer] Don't propagate 3d flags based on supported + 3d modes + +--- + xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 29 +++-------------------------- + 1 file changed, 3 insertions(+), 26 deletions(-) + +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +index 298eaff..3bf7c2e 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +@@ -726,40 +726,17 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f + uint32_t video_width = CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth; + uint32_t video_height = CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight; + +- unsigned flags = 0; + ERenderFormat format = RENDER_FMT_BYPASS; + ++ /* figure out steremode expected based on user settings and hints */ ++ unsigned flags = GetStereoModeFlags(GetStereoMode()); ++ + if(m_bAllowFullscreen) + { + flags |= CONF_FLAGS_FULLSCREEN; + m_bAllowFullscreen = false; // only allow on first configure + } + +- flags |= GetStereoModeFlags(GetStereoMode()); +- +- if(flags & CONF_FLAGS_STEREO_MODE_SBS) +- { +- if(g_Windowing.Support3D(video_width, video_height, D3DPRESENTFLAG_MODE3DSBS)) +- CLog::Log(LOGNOTICE, "3DSBS movie found"); +- else +- { +- flags &= ~CONF_FLAGS_STEREO_MODE_MASK(~0); +- CLog::Log(LOGNOTICE, "3DSBS movie found but not supported"); +- } +- } +- else if(flags & CONF_FLAGS_STEREO_MODE_TAB) +- { +- if(g_Windowing.Support3D(video_width, video_height, D3DPRESENTFLAG_MODE3DTB)) +- CLog::Log(LOGNOTICE, "3DTB movie found"); +- else +- { +- flags &= ~CONF_FLAGS_STEREO_MODE_MASK(~0); +- CLog::Log(LOGNOTICE, "3DTB movie found but not supported"); +- } +- } +- else +- CLog::Log(LOGNOTICE, "not a 3D movie"); +- + unsigned int iDisplayWidth = width; + unsigned int iDisplayHeight = height; + + +From abadc22d9bed0fdf91c3a5be16dd07d8aa8d9f79 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 21 Jun 2015 18:52:28 +0100 +Subject: [PATCH 43/58] [3d] Avoid switching stereo mode based on current + display mode + +--- + xbmc/guilib/GraphicContext.cpp | 21 --------------------- + 1 file changed, 21 deletions(-) + +diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp +index fc4cc95..e18232e 100644 +--- a/xbmc/guilib/GraphicContext.cpp ++++ b/xbmc/guilib/GraphicContext.cpp +@@ -432,27 +432,6 @@ void CGraphicContext::SetVideoResolutionInternal(RESOLUTION res, bool forceUpdat + Lock(); + + RESOLUTION_INFO info_org = CDisplaySettings::Get().GetResolutionInfo(res); +- RESOLUTION_INFO info_last = CDisplaySettings::Get().GetResolutionInfo(lastRes); +- +- RENDER_STEREO_MODE stereo_mode = m_stereoMode; +- +- // if the new mode is an actual stereo mode, switch to that +- // if the old mode was an actual stereo mode, switch to no 3d mode +- if (info_org.dwFlags & D3DPRESENTFLAG_MODE3DTB) +- stereo_mode = RENDER_STEREO_MODE_SPLIT_HORIZONTAL; +- else if (info_org.dwFlags & D3DPRESENTFLAG_MODE3DSBS) +- stereo_mode = RENDER_STEREO_MODE_SPLIT_VERTICAL; +- else if ((info_last.dwFlags & D3DPRESENTFLAG_MODE3DSBS) != 0 +- || (info_last.dwFlags & D3DPRESENTFLAG_MODE3DTB) != 0) +- stereo_mode = RENDER_STEREO_MODE_OFF; +- +- if(stereo_mode != m_stereoMode) +- { +- m_stereoView = RENDER_STEREO_VIEW_OFF; +- m_stereoMode = stereo_mode; +- m_nextStereoMode = stereo_mode; +- CSettings::Get().SetInt("videoscreen.stereoscopicmode", (int)m_stereoMode); +- } + + RESOLUTION_INFO info_mod = GetResInfo(res); + + +From ecb3cd064f5df496cbf685eec4c4d680c3c79704 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 3 Jun 2015 23:13:51 +0100 +Subject: [PATCH 44/58] [rpi] Always add desktop resolution to supported list + +There was an assumption that the desktop resolution would be in the probed list, but that is sometimes not the case. +We don't add interlaced resolutions to list, but they can be the preferred resolution read from edid. See: +http://openelec.tv/forum/124-raspberry-pi/77074-forcing-interlaced-output + +Also hotplug changes causing an edid reread may cause the supported modes to change (e.g. powering on receiver) +and it is possible the previous preferred mode is no longer there + +So ensure that desktop resolution is always added to list. Also handle the case where desktop resolution is invalid on launch +(e.g. hdmi output powered off) +--- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +index a1f67fd..69ce9b7 100644 +--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp ++++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +@@ -190,7 +190,7 @@ int CEGLNativeTypeRaspberryPI::FindMatchingResolution(const RESOLUTION_INFO &res + for (int i = 0; i < (int)resolutions.size(); i++) + { + if(resolutions[i].iScreenWidth == res.iScreenWidth && resolutions[i].iScreenHeight == res.iScreenHeight && resolutions[i].fRefreshRate == res.fRefreshRate && +- (resolutions[i].dwFlags & (D3DPRESENTFLAG_MODE3DSBS|D3DPRESENTFLAG_MODE3DTB)) == (res.dwFlags & (D3DPRESENTFLAG_MODE3DSBS|D3DPRESENTFLAG_MODE3DTB))) ++ (resolutions[i].dwFlags & D3DPRESENTFLAG_MODEMASK) == (res.dwFlags & D3DPRESENTFLAG_MODEMASK)) + { + return i; + } +@@ -206,8 +206,7 @@ int CEGLNativeTypeRaspberryPI::AddUniqueResolution(RESOLUTION_INFO &res, std::ve + int i = FindMatchingResolution(res, resolutions); + if (i>=0) + { // don't replace a progressive resolution with an interlaced one of same resolution +- if (!(res.dwFlags & D3DPRESENTFLAG_INTERLACED)) +- resolutions[i] = res; ++ resolutions[i] = res; + } + else + { +@@ -569,7 +568,7 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + vc_tv_hdmi_get_property(&property); + m_desktopRes.fRefreshRate = property.param1 == HDMI_PIXEL_CLOCK_TYPE_NTSC ? tv_state.display.hdmi.frame_rate * (1000.0f/1001.0f) : tv_state.display.hdmi.frame_rate; + } +- else // sdtv ++ else if ((tv_state.state & ( VC_SDTV_NTSC | VC_SDTV_PAL )) != 0) // sdtv + { + m_desktopRes.iScreen = 0; + m_desktopRes.bFullScreen = true; +@@ -594,7 +593,6 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + GetSupportedModes(HDMI_RES_GROUP_CEA, resolutions); + GetSupportedModes(HDMI_RES_GROUP_DMT, resolutions); + +- if(resolutions.size() == 0) + { + AddUniqueResolution(m_desktopRes, resolutions); + CLog::Log(LOGDEBUG, "EGL probe resolution %s:%x\n", m_desktopRes.strMode.c_str(), m_desktopRes.dwFlags); +@@ -686,6 +684,12 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v + res.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res.iScreenWidth / (float)res.iScreenHeight); + res.iSubtitles = (int)(0.965 * res.iHeight); + ++ if (!m_desktopRes.dwFlags && prefer_group == group && prefer_mode == tv->code) ++ m_desktopRes = res; ++ ++ if (res.dwFlags & D3DPRESENTFLAG_INTERLACED) ++ continue; ++ + AddUniqueResolution(res, resolutions); + CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f) %s%s:%x\n", i, res.strMode.c_str(), res.fPixelRatio, + tv->native ? "N" : "", tv->scan_mode ? "I" : "", tv->code); + +From 71f32189c08f3001e0a00f3d21d799eb7b0ac9ba Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 21 Jun 2015 18:53:29 +0100 +Subject: [PATCH 45/58] [rbp] Drop reporting 3D modes and just use current + rendering mode to request 3D signalling + +--- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 76 +++++-------------------- + 1 file changed, 15 insertions(+), 61 deletions(-) + +diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +index 69ce9b7..25a97ad 100644 +--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp ++++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +@@ -28,6 +28,9 @@ + #include "linux/RBP.h" + #include "utils/StringUtils.h" + #include "settings/Settings.h" ++#include "guilib/GraphicContext.h" ++#include "guilib/StereoscopicsManager.h" ++#include "rendering/RenderSystem.h" + #include + + #ifndef __VIDEOCORE4__ +@@ -273,21 +276,22 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) + + DestroyDispmaxWindow(); + ++ RENDER_STEREO_MODE stereo_mode = g_graphicsContext.GetStereoMode(); + if(GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) + { + sem_init(&m_tv_synced, 0, 0); + m_DllBcmHost->vc_tv_register_callback(CallbackTvServiceCallback, this); + +- if (res.dwFlags & (D3DPRESENTFLAG_MODE3DSBS|D3DPRESENTFLAG_MODE3DTB)) ++ if (stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL || stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) + { + /* inform TV of any 3D settings. Note this property just applies to next hdmi mode change, so no need to call for 2D modes */ + HDMI_PROPERTY_PARAM_T property; + property.property = HDMI_PROPERTY_3D_STRUCTURE; + if (CSettings::Get().GetBool("videoplayer.framepacking") && CSettings::Get().GetBool("videoplayer.supportmvc")) + property.param1 = HDMI_3D_FORMAT_FRAME_PACKING; +- else if (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) ++ else if (stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) + property.param1 = HDMI_3D_FORMAT_SBS_HALF; +- else if (res.dwFlags & D3DPRESENTFLAG_MODE3DTB) ++ else if (stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) + property.param1 = HDMI_3D_FORMAT_TB_HALF; + else + property.param1 = HDMI_3D_FORMAT_NONE; +@@ -310,19 +314,17 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) + + if (success == 0) + { +- CLog::Log(LOGDEBUG, "EGL set HDMI mode (%d,%d)=%d%s%s\n", ++ CLog::Log(LOGDEBUG, "EGL set HDMI mode (%d,%d)=%d %s\n", + GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), success, +- (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) ? " SBS":"", +- (res.dwFlags & D3DPRESENTFLAG_MODE3DTB) ? " TB":""); ++ CStereoscopicsManager::Get().ConvertGuiStereoModeToString(stereo_mode)); + + sem_wait(&m_tv_synced); + } + else + { +- CLog::Log(LOGERROR, "EGL failed to set HDMI mode (%d,%d)=%d%s%s\n", ++ CLog::Log(LOGERROR, "EGL failed to set HDMI mode (%d,%d)=%d %s\n", + GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), success, +- (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) ? " SBS":"", +- (res.dwFlags & D3DPRESENTFLAG_MODE3DTB) ? " TB":""); ++ CStereoscopicsManager::Get().ConvertGuiStereoModeToString(stereo_mode)); + } + m_DllBcmHost->vc_tv_unregister_callback(CallbackTvServiceCallback); + sem_destroy(&m_tv_synced); +@@ -385,9 +387,9 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) + DISPMANX_TRANSFORM_T transform = DISPMANX_NO_ROTATE; + DISPMANX_UPDATE_HANDLE_T dispman_update = m_DllBcmHost->vc_dispmanx_update_start(0); + +- if (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) ++ if (stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) + transform = DISPMANX_STEREOSCOPIC_SBS; +- else if (res.dwFlags & D3DPRESENTFLAG_MODE3DTB) ++ else if (stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) + transform = DISPMANX_STEREOSCOPIC_TB; + else + transform = DISPMANX_STEREOSCOPIC_MONO; +@@ -494,10 +496,8 @@ static void SetResolutionString(RESOLUTION_INFO &res) + res.iWidth = gui_width; + res.iHeight = gui_height; + +- res.strMode = StringUtils::Format("%dx%d (%dx%d) @ %.2f%s%s%s - Full Screen", res.iScreenWidth, res.iScreenHeight, res.iWidth, res.iHeight, res.fRefreshRate, +- res.dwFlags & D3DPRESENTFLAG_INTERLACED ? "i" : "", +- res.dwFlags & D3DPRESENTFLAG_MODE3DTB ? " 3DTB" : "", +- res.dwFlags & D3DPRESENTFLAG_MODE3DSBS ? " 3DSBS" : ""); ++ res.strMode = StringUtils::Format("%dx%d (%dx%d) @ %.2f%s - Full Screen", res.iScreenWidth, res.iScreenHeight, res.iWidth, res.iHeight, res.fRefreshRate, ++ res.dwFlags & D3DPRESENTFLAG_INTERLACED ? "i" : ""); + } + + static SDTV_ASPECT_T get_sdtv_aspect_from_display_aspect(float display_aspect) +@@ -552,17 +552,6 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + m_desktopRes.iScreenHeight= tv_state.display.hdmi.height; + m_desktopRes.dwFlags = MAKEFLAGS(tv_state.display.hdmi.group, tv_state.display.hdmi.mode, tv_state.display.hdmi.scan_mode); + m_desktopRes.fPixelRatio = tv_state.display.hdmi.display_options.aspect == 0 ? 1.0f : get_display_aspect_ratio((HDMI_ASPECT_T)tv_state.display.hdmi.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); +- // Also add 3D flags +- if (tv_state.display.hdmi.format_3d == HDMI_3D_FORMAT_SBS_HALF) +- { +- m_desktopRes.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; +- m_desktopRes.fPixelRatio *= 2.0; +- } +- else if (tv_state.display.hdmi.format_3d == HDMI_3D_FORMAT_TB_HALF) +- { +- m_desktopRes.dwFlags |= D3DPRESENTFLAG_MODE3DTB; +- m_desktopRes.fPixelRatio *= 0.5; +- } + HDMI_PROPERTY_PARAM_T property; + property.property = HDMI_PROPERTY_PIXEL_CLOCK_TYPE; + vc_tv_hdmi_get_property(&property); +@@ -700,41 +689,6 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v + res2.fRefreshRate = (float)tv->frame_rate * (1000.0f/1001.0f); + AddUniqueResolution(res2, resolutions); + } +- +- // Also add 3D versions of modes +- if (tv->struct_3d_mask & HDMI_3D_STRUCT_SIDE_BY_SIDE_HALF_HORIZONTAL) +- { +- RESOLUTION_INFO res2 = res; +- res2.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; +- res2.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res2.iScreenWidth / (float)res2.iScreenHeight); +- res2.fPixelRatio *= 2.0f; +- res2.iSubtitles = (int)(0.965 * res2.iHeight); +- +- AddUniqueResolution(res2, resolutions); +- CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f)\n", i, res2.strMode.c_str(), res2.fPixelRatio); +- if (tv->frame_rate == 24 || tv->frame_rate == 30 || tv->frame_rate == 60) +- { +- res2.fRefreshRate = (float)tv->frame_rate * (1000.0f/1001.0f); +- AddUniqueResolution(res2, resolutions); +- } +- } +- if (tv->struct_3d_mask & HDMI_3D_STRUCT_TOP_AND_BOTTOM) +- { +- RESOLUTION_INFO res2 = res; +- res2.dwFlags |= D3DPRESENTFLAG_MODE3DTB; +- res2.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res2.iScreenWidth / (float)res2.iScreenHeight); +- res2.fPixelRatio *= 0.5f; +- res2.iSubtitles = (int)(0.965 * res2.iHeight); +- +- AddUniqueResolution(res2, resolutions); +- CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f)\n", i, res2.strMode.c_str(), res2.fPixelRatio); +- if (tv->frame_rate == 24 || tv->frame_rate == 30 || tv->frame_rate == 60) +- { +- res2.fRefreshRate = (float)tv->frame_rate * (1000.0f/1001.0f); +- AddUniqueResolution(res2, resolutions); +- } +- +- } + } + } + if (supported_modes) + +From 23e4fb99f6f4ad1cc969cc8361dc55338769419f Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 30 Jun 2015 14:08:24 +0100 +Subject: [PATCH 46/58] [rbp] Ignore video stereo mode when 3D display mode is + disabled + +--- + xbmc/cores/VideoRenderers/MMALRenderer.cpp | 4 ++++ + xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +index 5fc68d2..ce2e98d 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +@@ -589,6 +589,10 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect + bool stereo_invert = (m_iFlags & CONF_FLAGS_STEREO_CADANCE_RIGHT_LEFT) ? true : false; + RENDER_STEREO_MODE display_stereo_mode = g_graphicsContext.GetStereoMode(); + ++ // ignore video stereo mode when 3D display mode is disabled ++ if (display_stereo_mode == RENDER_STEREO_MODE_OFF) ++ video_stereo_mode = RENDER_STEREO_MODE_OFF; ++ + // fix up transposed video + if (m_renderOrientation == 90 || m_renderOrientation == 270) + { +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +index 3bf7c2e..5f6b402 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +@@ -658,6 +658,10 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec + bool stereo_invert = (flags & CONF_FLAGS_STEREO_CADANCE_RIGHT_LEFT) ? true : false; + RENDER_STEREO_MODE display_stereo_mode = g_graphicsContext.GetStereoMode(); + ++ // ignore video stereo mode when 3D display mode is disabled ++ if (display_stereo_mode == RENDER_STEREO_MODE_OFF) ++ video_stereo_mode = RENDER_STEREO_MODE_OFF; ++ + // fix up transposed video + if (m_hints.orientation == 90 || m_hints.orientation == 270) + { + +From 72e7fc2a4f0701ce47e624c5c73f457ae8db93fd Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 22 Jun 2015 16:27:15 +0100 +Subject: [PATCH 47/58] [EGL] Don't skip out when HDMI mode is considered the + same + +It might have different 3D signalling. TODO: keep track of 3D signalling +--- + xbmc/windowing/egl/WinSystemEGL.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/windowing/egl/WinSystemEGL.cpp b/xbmc/windowing/egl/WinSystemEGL.cpp +index c43c4d0..13b75b1 100644 +--- a/xbmc/windowing/egl/WinSystemEGL.cpp ++++ b/xbmc/windowing/egl/WinSystemEGL.cpp +@@ -287,7 +287,7 @@ bool CWinSystemEGL::CreateNewWindow(const std::string& name, bool fullScreen, RE + (current_resolution.dwFlags & D3DPRESENTFLAG_MODEMASK) == (res.dwFlags & D3DPRESENTFLAG_MODEMASK)) + { + CLog::Log(LOGDEBUG, "CWinSystemEGL::CreateNewWindow: No need to create a new window"); +- return true; ++//xxx return true; + } + + m_bFullScreen = fullScreen; + +From 9747f3d0ba4d3fabe46c35ceaeb74d2ee5daf547 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 21 Apr 2015 14:32:07 +0100 -Subject: [PATCH 40/51] [mmalrenderer] Add sharpness control +Subject: [PATCH 48/58] [mmalrenderer] Add sharpness control --- addons/resource.language.en_gb/resources/strings.po | 2 +- @@ -2761,7 +3073,7 @@ Subject: [PATCH 40/51] [mmalrenderer] Add sharpness control 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 5ad526e..d252240 100644 +index 6d861c1..c41b177 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -7503,7 +7503,7 @@ msgstr "" @@ -2774,7 +3086,7 @@ index 5ad526e..d252240 100644 #: xbmc/video/dialogs/GUIDialogVideoSettings.cpp diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index 6cde0c5..9bf1aed 100644 +index ce2e98d..fb92079 100644 --- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp +++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp @@ -207,6 +207,7 @@ CMMALRenderer::CMMALRenderer() @@ -2824,17 +3136,17 @@ index 1404fb3..9bced7e 100644 CCriticalSection m_sharedSection; MMAL_COMPONENT_T *m_vout; -From 38eef3259f992329214af255923b6a2ce7364921 Mon Sep 17 00:00:00 2001 +From 7995698144c5b5c44dd9f4f80f17fa7803962586 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 24 Apr 2015 13:49:51 +0100 -Subject: [PATCH 41/51] [dvdplayer] Add back required include +Subject: [PATCH 49/58] [dvdplayer] Add back required include --- xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index bdc3edb..2dad96c 100644 +index 9be8aae..ebec92d 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -33,6 +33,7 @@ @@ -2846,10 +3158,10 @@ index bdc3edb..2dad96c 100644 #include "guilib/GraphicContext.h" #include -From ec33b18ad7a9fe49b5a9a10f053bd5b9d1ea4214 Mon Sep 17 00:00:00 2001 +From 9cb45bcb661cf5de4814e304706d982352453f48 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 5 May 2015 23:58:06 +0100 -Subject: [PATCH 42/51] [screensaver] Leave GUI contents available for +Subject: [PATCH 50/58] [screensaver] Leave GUI contents available for screensaver --- @@ -2879,10 +3191,10 @@ index ba33908..17ea269 100644 // Add window to the history list (we must do this before we activate it, -From 5964fa6583235b7fce1d0c83ba4005380a7bf322 Mon Sep 17 00:00:00 2001 +From 2e8dcaa3564b564dfdd7961c1d2beabee57cb7f8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 15 May 2015 14:04:11 +0100 -Subject: [PATCH 44/51] [omxplayer] Make unsupported when ac3transcode is +Subject: [PATCH 52/58] [omxplayer] Make unsupported when ac3transcode is enabled --- @@ -2890,7 +3202,7 @@ Subject: [PATCH 44/51] [omxplayer] Make unsupported when ac3transcode is 1 file changed, 6 insertions(+) diff --git a/xbmc/cores/omxplayer/OMXHelper.cpp b/xbmc/cores/omxplayer/OMXHelper.cpp -index be54f31..373e3f2 100644 +index eff47e0..b954276 100644 --- a/xbmc/cores/omxplayer/OMXHelper.cpp +++ b/xbmc/cores/omxplayer/OMXHelper.cpp @@ -56,6 +56,12 @@ bool OMXPlayerUnsuitable(bool m_HasVideo, bool m_HasAudio, CDVDDemux* m_pDemuxer @@ -2907,10 +3219,10 @@ index be54f31..373e3f2 100644 { // find video stream -From ba0740cf8f5e163720e03516186522bbf16c25b0 Mon Sep 17 00:00:00 2001 +From 8294881aca9494a55c30f7347599779fe770c50d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 1 Jun 2015 14:14:43 +0100 -Subject: [PATCH 45/51] [omximage] Don't report failed decode of progressive +Subject: [PATCH 53/58] [omximage] Don't report failed decode of progressive jpegs as as error --- @@ -2996,10 +3308,10 @@ index a43a446..890ca88 100644 } -From 33a38607218899acba79a30dc7b9163daaf99c65 Mon Sep 17 00:00:00 2001 +From 61003a22eb36823420523a2d3df994e1222e0cea Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 25 May 2015 19:01:00 +0100 -Subject: [PATCH 46/51] [rbp] Allow settings option for timestamp preference +Subject: [PATCH 54/58] [rbp] Allow settings option for timestamp preference We currently have some files that play better with pts timestamps and some that play better with dts timestamps Provide a gui setting to allow users to adjust this behaviour until we have a better solution @@ -3011,7 +3323,7 @@ Provide a gui setting to allow users to adjust this behaviour until we have a be 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index b76e723..3c18575 100644 +index 0138e5f..2d043ec 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -16714,3 +16714,13 @@ msgstr "" @@ -3060,7 +3372,7 @@ index a583450..4a63820 100644 // set a flag so we can identify primary frames from generated frames (deinterlace) buffer->flags = MMAL_BUFFER_HEADER_FLAG_USER0; diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index adf9910..f9b9232 100644 +index 5f6b402..ce23bec 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp @@ -495,7 +495,7 @@ void OMXPlayerVideo::Process() @@ -3073,10 +3385,10 @@ index adf9910..f9b9232 100644 if (pts == DVD_NOPTS_VALUE) pts = dts; -From 792a42205d18d6d389a36101c85594884eb9b34e Mon Sep 17 00:00:00 2001 +From 9fc7a4289b865202e2b8d4ac9bc8174e1001e1ad Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 6 Jun 2015 18:44:37 +0100 -Subject: [PATCH 47/51] [rbp] Ignore pts value when m_hints.ptsinvalid set +Subject: [PATCH 55/58] [rbp] Ignore pts value when m_hints.ptsinvalid set --- xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 2 +- @@ -3097,7 +3409,7 @@ index 4a63820..f7b0b25 100644 // set a flag so we can identify primary frames from generated frames (deinterlace) buffer->flags = MMAL_BUFFER_HEADER_FLAG_USER0; diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index f9b9232..33aa88c 100644 +index ce23bec..e17fdb8 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp @@ -495,7 +495,7 @@ void OMXPlayerVideo::Process() @@ -3110,69 +3422,10 @@ index f9b9232..33aa88c 100644 if (pts == DVD_NOPTS_VALUE) pts = dts; -From 493d0d8dfac375bedb0e80c08213bb45a714a4bb Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 10 Jun 2015 20:42:03 +0100 -Subject: [PATCH 49/51] [rbp] Fix zoom modes with stereoscopic videos - ---- - xbmc/cores/VideoRenderers/MMALRenderer.cpp | 12 ++++++++++-- - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 12 ++++++++++-- - 2 files changed, 20 insertions(+), 4 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index 9bf1aed..e420834 100644 ---- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -@@ -632,9 +632,17 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect - CRect display(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight); - - if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) -- DestRect.x2 *= 2.0f; -+ { -+ float width = DestRect.x2 - DestRect.x1; -+ DestRect.x1 *= 2.0f; -+ DestRect.x2 = DestRect.x1 + 2.0f * width; -+ } - else if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) -- DestRect.y2 *= 2.0f; -+ { -+ float height = DestRect.y2 - DestRect.y1; -+ DestRect.y1 *= 2.0f; -+ DestRect.y2 = DestRect.y1 + 2.0f * height; -+ } - - if (gui != display) - { -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index 33aa88c..e008405 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -690,9 +690,17 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec - CRect display(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight); - - if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) -- DestRect.x2 *= 2.0f; -+ { -+ float width = DestRect.x2 - DestRect.x1; -+ DestRect.x1 *= 2.0f; -+ DestRect.x2 = DestRect.x1 + 2.0f * width; -+ } - else if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) -- DestRect.y2 *= 2.0f; -+ { -+ float height = DestRect.y2 - DestRect.y1; -+ DestRect.y1 *= 2.0f; -+ DestRect.y2 = DestRect.y1 + 2.0f * height; -+ } - - if (gui != display) - { - -From 8312d9234bddd5878f60a7a297e16e61d2cab255 Mon Sep 17 00:00:00 2001 +From 08b2eeaffdfdd1dc124ee3eb2f5a21b664074eca Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 6 Jun 2015 18:43:57 +0100 -Subject: [PATCH 50/51] ffmpeg: Automatic switch to software decode for GMC +Subject: [PATCH 56/58] ffmpeg: Automatic switch to software decode for GMC with more than one warp point --- @@ -3187,6 +3440,60 @@ Subject: [PATCH 50/51] ffmpeg: Automatic switch to software decode for GMC 8 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 tools/depends/target/ffmpeg/0001-mpeg4video-Signal-unsupported-GMC-with-more-than-one.patch +diff --git a/tools/depends/target/ffmpeg/0001-mpeg4video-Signal-unsupported-GMC-with-more-than-one.patch b/tools/depends/target/ffmpeg/0001-mpeg4video-Signal-unsupported-GMC-with-more-than-one.patch +new file mode 100644 +index 0000000..4cb8dd8 +--- /dev/null ++++ b/tools/depends/target/ffmpeg/0001-mpeg4video-Signal-unsupported-GMC-with-more-than-one.patch +@@ -0,0 +1,48 @@ ++From 84e9a1784bbd3182b68cefa5e5feae8da8b9e184 Mon Sep 17 00:00:00 2001 ++From: popcornmix ++Date: Fri, 5 Jun 2015 22:48:33 +0100 ++Subject: [PATCH] mpeg4video: Signal unsupported GMC with more than one warp ++ point ++ ++--- ++ libavcodec/avcodec.h | 1 + ++ libavcodec/mpeg4videodec.c | 4 ++++ ++ 2 files changed, 5 insertions(+) ++ ++diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h ++index 8c7c420..e63dc2d 100644 ++--- a/libavcodec/avcodec.h +++++ b/libavcodec/avcodec.h ++@@ -2527,6 +2527,7 @@ typedef struct AVCodecContext { ++ #define FF_BUG_DC_CLIP 4096 ++ #define FF_BUG_MS 8192 ///< Work around various bugs in Microsoft's broken decoders. ++ #define FF_BUG_TRUNCATED 16384 +++#define FF_BUG_GMC_UNSUPPORTED 32768 ++ ++ /** ++ * strictly follow the standard (MPEG4, ...). ++diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c ++index 9bf33dd..0b5d3b9 100644 ++--- a/libavcodec/mpeg4videodec.c +++++ b/libavcodec/mpeg4videodec.c ++@@ -2179,6 +2179,9 @@ int ff_mpeg4_workaround_bugs(AVCodecContext *avctx) ++ ++ if (ctx->divx_version >= 0) ++ s->workaround_bugs |= FF_BUG_HPEL_CHROMA; +++ +++ if (ctx->num_sprite_warping_points > 1) +++ s->workaround_bugs |= FF_BUG_GMC_UNSUPPORTED; ++ } ++ ++ if (s->workaround_bugs & FF_BUG_STD_QPEL) { ++@@ -2203,6 +2206,7 @@ int ff_mpeg4_workaround_bugs(AVCodecContext *avctx) ++ s->workaround_bugs, ctx->lavc_build, ctx->xvid_build, ++ ctx->divx_version, ctx->divx_build, s->divx_packed ? "p" : ""); ++ +++ avctx->workaround_bugs = s->workaround_bugs; ++ if (CONFIG_MPEG4_DECODER && ctx->xvid_build >= 0 && ++ s->codec_id == AV_CODEC_ID_MPEG4 && ++ avctx->idct_algo == FF_IDCT_AUTO) { ++-- ++1.9.1 ++ diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp index f7b0b25..3e97f1d 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp @@ -3274,7 +3581,7 @@ index c0e22a2..3849993 100644 // AUDIO int channels; diff --git a/xbmc/cores/omxplayer/OMXHelper.cpp b/xbmc/cores/omxplayer/OMXHelper.cpp -index 373e3f2..093388c 100644 +index b954276..b5ee4b6 100644 --- a/xbmc/cores/omxplayer/OMXHelper.cpp +++ b/xbmc/cores/omxplayer/OMXHelper.cpp @@ -77,7 +77,9 @@ bool OMXPlayerUnsuitable(bool m_HasVideo, bool m_HasAudio, CDVDDemux* m_pDemuxer @@ -3289,74 +3596,1069 @@ index 373e3f2..093388c 100644 else if ((hint.codec == AV_CODEC_ID_VC1 || hint.codec == AV_CODEC_ID_WMV3) && g_RBP.GetCodecWvc1()) supported = true; -From 1798b2059a7dcc34b4dcecfec56736225d2ac918 Mon Sep 17 00:00:00 2001 +From e51804ed122dd0a642104d102315787970fffb8d Mon Sep 17 00:00:00 2001 From: popcornmix -Date: Wed, 3 Jun 2015 23:13:51 +0100 -Subject: [PATCH 51/51] [rpi] Always add desktop resolution to supported list +Date: Mon, 22 Jun 2015 21:46:57 +0100 +Subject: [PATCH 57/58] [rbp] Use default resampling setting on Pi2 -There was an assumption that the desktop resolution would be in the probed list, but that is sometimes not the case. -We don't add interlaced resolutions to list, but they can be the preferred resolution read from edid. See: -http://openelec.tv/forum/124-raspberry-pi/77074-forcing-interlaced-output - -Also hotplug changes causing an edid reread may cause the supported modes to change (e.g. powering on receiver) -and it is possible the previous preferred mode is no longer there - -So ensure that desktop resolution is always added to list. Also handle the case where desktop resolution is invalid on launch -(e.g. hdmi output powered off) --- - xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 14 +++++++++----- - 1 file changed, 9 insertions(+), 5 deletions(-) + system/settings/rbp2.xml | 5 +++++ + 1 file changed, 5 insertions(+) -diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -index ae85484..a4b8a81 100644 ---- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -+++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -@@ -187,7 +187,7 @@ int CEGLNativeTypeRaspberryPI::FindMatchingResolution(const RESOLUTION_INFO &res - for (int i = 0; i < (int)resolutions.size(); i++) +diff --git a/system/settings/rbp2.xml b/system/settings/rbp2.xml +index b29a428..1c8b116 100644 +--- a/system/settings/rbp2.xml ++++ b/system/settings/rbp2.xml +@@ -28,6 +28,11 @@ + + + ++ ++ ++ 30 ++ ++ + +
+ + +From 175260bab79c330366834bd86512afc2902dba0a Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Thu, 25 Jun 2015 19:43:10 +0100 +Subject: [PATCH 58/58] [rbp] HW mouse pointer + +Updating the mouse point provokes a complete screen update which can make it feel laggy +and results in high cpu. + +Render the mouse with an overlay to avoid redrawing the normal gui. + +Requires recent firmware. +--- + xbmc/guilib/GUIWindowManager.cpp | 2 + + xbmc/linux/RBP.cpp | 254 +++++++++++++++++++++ + xbmc/linux/RBP.h | 10 + + xbmc/linux/rpi_user_vcsm.h | 460 ++++++++++++++++++++++++++++++++++++++ + xbmc/windowing/WinEventsLinux.cpp | 147 ++++++++++++ + xbmc/windowing/WinEventsLinux.h | 11 + + 6 files changed, 884 insertions(+) + create mode 100644 xbmc/linux/rpi_user_vcsm.h + +diff --git a/xbmc/guilib/GUIWindowManager.cpp b/xbmc/guilib/GUIWindowManager.cpp +index 17ea269..6965319 100644 +--- a/xbmc/guilib/GUIWindowManager.cpp ++++ b/xbmc/guilib/GUIWindowManager.cpp +@@ -193,7 +193,9 @@ void CGUIWindowManager::CreateWindows() + Add(new CGUIWindowAddonBrowser); + Add(new CGUIWindowScreensaverDim); + Add(new CGUIWindowDebugInfo); ++#ifndef TARGET_RASPBERRY_PI + Add(new CGUIWindowPointer); ++#endif + Add(new CGUIDialogYesNo); + Add(new CGUIDialogProgress); + Add(new CGUIDialogExtendedProgressBar); +diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp +index 096ea18..2c8d09b 100644 +--- a/xbmc/linux/RBP.cpp ++++ b/xbmc/linux/RBP.cpp +@@ -28,6 +28,31 @@ + + #include "cores/omxplayer/OMXImage.h" + ++#include "guilib/GraphicContext.h" ++#include "settings/DisplaySettings.h" ++ ++#include ++#include ++#include "rpi_user_vcsm.h" ++ ++#define MAJOR_NUM 100 ++#define IOCTL_MBOX_PROPERTY _IOWR(MAJOR_NUM, 0, char *) ++#define DEVICE_FILE_NAME "/dev/vcio" ++ ++typedef struct gpu_mem_ptr_s { ++ void *arm; // Pointer to memory mapped on ARM side ++ int vc_handle; // Videocore handle of relocatable memory ++ int vcsm_handle; // Handle for use by VCSM ++ int vc; // Address for use in GPU code ++ int numbytes; // Size of memory block ++ int suballoc; ++} GPU_MEM_PTR_T; ++ ++static int mbox_open(); ++static void mbox_close(int file_desc); ++static void gpu_free_internal(GPU_MEM_PTR_T *p, int mb); ++static int gpu_malloc_uncached_internal(int numbytes, GPU_MEM_PTR_T *p, int mb); ++ + CRBP::CRBP() + { + m_initialized = false; +@@ -35,6 +60,9 @@ CRBP::CRBP() + m_DllBcmHost = new DllBcmHost(); + m_OMX = new COMXCore(); + m_display = DISPMANX_NO_HANDLE; ++ m_p = NULL; ++ m_mb = mbox_open(); ++ vcsm_init(); + } + + CRBP::~CRBP() +@@ -115,7 +143,10 @@ void CRBP::LogFirmwareVerison() + DISPMANX_DISPLAY_HANDLE_T CRBP::OpenDisplay(uint32_t device) + { + if (m_display == DISPMANX_NO_HANDLE) ++ { + m_display = vc_dispmanx_display_open( 0 /*screen*/ ); ++ init_cursor(); ++ } + return m_display; + } + +@@ -124,6 +155,7 @@ void CRBP::CloseDisplay(DISPMANX_DISPLAY_HANDLE_T display) + assert(display == m_display); + vc_dispmanx_display_close(m_display); + m_display = DISPMANX_NO_HANDLE; ++ uninit_cursor(); + } + + void CRBP::GetDisplaySize(int &width, int &height) +@@ -224,6 +256,15 @@ void CRBP::Deinitialize() + m_omx_image_init = false; + m_initialized = false; + m_omx_initialized = false; ++ uninit_cursor(); ++ if (m_mb && m_p) ++ gpu_free_internal(m_p, m_mb); ++ delete m_p; ++ m_p = NULL; ++ if (m_mb) ++ mbox_close(m_mb); ++ m_mb = 0; ++ vcsm_exit(); + } + + double CRBP::AdjustHDMIClock(double adjust) +@@ -239,4 +280,217 @@ double CRBP::AdjustHDMIClock(double adjust) + } + + ++static int mbox_property(int file_desc, void *buf) ++{ ++ int ret_val = ioctl(file_desc, IOCTL_MBOX_PROPERTY, buf); ++ ++ if (ret_val < 0) { ++ printf("ioctl_set_msg failed:%d\n", ret_val); ++ } ++ return ret_val; ++} ++ ++static int mbox_open() ++{ ++ int file_desc; ++ ++ // open a char device file used for communicating with kernel mbox driver ++ file_desc = open(DEVICE_FILE_NAME, 0); ++ if (file_desc < 0) { ++ printf("Can't open device file: %s (%d)\n", DEVICE_FILE_NAME, file_desc); ++ printf("Try creating a device file with: sudo mknod %s c %d 0\n", DEVICE_FILE_NAME, MAJOR_NUM); ++ } ++ return file_desc; ++} ++ ++static void mbox_close(int file_desc) ++{ ++ close(file_desc); ++} ++ ++static unsigned mem_lock(int file_desc, unsigned handle) ++{ ++ int i=0; ++ unsigned p[32]; ++ p[i++] = 0; // size ++ p[i++] = 0x00000000; // process request ++ ++ p[i++] = 0x3000d; // (the tag id) ++ p[i++] = 4; // (size of the buffer) ++ p[i++] = 4; // (size of the data) ++ p[i++] = handle; ++ ++ p[i++] = 0x00000000; // end tag ++ p[0] = i*sizeof *p; // actual size ++ ++ mbox_property(file_desc, p); ++ return p[5]; ++} ++ ++unsigned mem_unlock(int file_desc, unsigned handle) ++{ ++ int i=0; ++ unsigned p[32]; ++ p[i++] = 0; // size ++ p[i++] = 0x00000000; // process request ++ ++ p[i++] = 0x3000e; // (the tag id) ++ p[i++] = 4; // (size of the buffer) ++ p[i++] = 4; // (size of the data) ++ p[i++] = handle; ++ ++ p[i++] = 0x00000000; // end tag ++ p[0] = i*sizeof *p; // actual size ++ ++ mbox_property(file_desc, p); ++ return p[5]; ++} ++ ++unsigned int mailbox_set_cursor_info(int file_desc, int width, int height, int format, uint32_t buffer, int hotspotx, int hotspoty) ++{ ++ int i=0; ++ unsigned int p[32]; ++ p[i++] = 0; // size ++ p[i++] = 0x00000000; // process request ++ p[i++] = 0x00008010; // set cursor state ++ p[i++] = 24; // buffer size ++ p[i++] = 24; // data size ++ ++ p[i++] = width; ++ p[i++] = height; ++ p[i++] = format; ++ p[i++] = buffer; // ptr to VC memory buffer. Doesn't work in 64bit.... ++ p[i++] = hotspotx; ++ p[i++] = hotspoty; ++ ++ p[i++] = 0x00000000; // end tag ++ p[0] = i*sizeof(*p); // actual size ++ ++ mbox_property(file_desc, p); ++ return p[5]; ++ ++} ++ ++unsigned int mailbox_set_cursor_position(int file_desc, int enabled, int x, int y) ++{ ++ int i=0; ++ unsigned p[32]; ++ p[i++] = 0; // size ++ p[i++] = 0x00000000; // process request ++ p[i++] = 0x00008011; // set cursor state ++ p[i++] = 12; // buffer size ++ p[i++] = 12; // data size ++ ++ p[i++] = enabled; ++ p[i++] = x; ++ p[i++] = y; ++ ++ p[i++] = 0x00000000; // end tag ++ p[0] = i*sizeof *p; // actual size ++ ++ mbox_property(file_desc, p); ++ return p[5]; ++} ++ ++static int gpu_malloc_uncached_internal(int numbytes, GPU_MEM_PTR_T *p, int mb) ++{ ++ //printf("%s %d\n", __func__, numbytes); ++ ++ p->numbytes = numbytes; ++ p->suballoc = 0; ++ p->vcsm_handle = vcsm_malloc_cache(numbytes, VCSM_CACHE_TYPE_NONE, (char *)"Mouse pointer"); ++ assert(p->vcsm_handle); ++ p->vc_handle = vcsm_vc_hdl_from_hdl(p->vcsm_handle); ++ assert(p->vc_handle); ++ p->arm = vcsm_lock(p->vcsm_handle); ++ assert(p->arm); ++ p->vc = mem_lock(mb, p->vc_handle); ++ assert(p->vc); ++ return 0; ++} ++ ++static void gpu_free_internal(GPU_MEM_PTR_T *p, int mb) ++{ ++ mem_unlock(mb,p->vc_handle); ++ vcsm_unlock_ptr(p->arm); ++ vcsm_free(p->vcsm_handle); ++} ++ ++#define T 0 ++#define W 0xffffffff ++#define B 0xff000000 ++ ++const static uint32_t default_cursor_pixels[] = ++{ ++ B,B,B,B,B,B,B,B,B,T,T,T,T,T,T,T, ++ B,W,W,W,W,W,W,B,T,T,T,T,T,T,T,T, ++ B,W,W,W,W,W,B,T,T,T,T,T,T,T,T,T, ++ B,W,W,W,W,B,T,T,T,T,T,T,T,T,T,T, ++ B,W,W,W,W,W,B,T,T,T,T,T,T,T,T,T, ++ B,W,W,B,W,W,W,B,T,T,T,T,T,T,T,T, ++ B,W,B,T,B,W,W,W,B,T,T,T,T,T,T,T, ++ B,B,T,T,T,B,W,W,W,B,T,T,T,T,T,T, ++ B,T,T,T,T,T,B,W,W,W,B,T,T,T,T,T, ++ T,T,T,T,T,T,T,B,W,W,W,B,T,T,T,T, ++ T,T,T,T,T,T,T,T,B,W,W,W,B,T,T,T, ++ T,T,T,T,T,T,T,T,T,B,W,W,W,B,T,T, ++ T,T,T,T,T,T,T,T,T,T,B,W,W,W,B,T, ++ T,T,T,T,T,T,T,T,T,T,T,B,W,W,W,B, ++ T,T,T,T,T,T,T,T,T,T,T,T,B,W,B,T, ++ T,T,T,T,T,T,T,T,T,T,T,T,T,B,T,T ++}; ++ ++#undef T ++#undef W ++#undef B ++ ++void CRBP::init_cursor() ++{ ++ //printf("%s\n", __func__); ++ if (!m_mb) ++ return; ++ if (!m_p) ++ { ++ m_p = new GPU_MEM_PTR_T; ++ if (m_p) ++ gpu_malloc_uncached_internal(64 * 64 * 4, m_p, m_mb); ++ } ++ if (m_mb && m_p && m_p->arm && m_p->vc) ++ set_cursor(default_cursor_pixels, 16, 16, 0, 0); ++} ++ ++void CRBP::set_cursor(const void *pixels, int width, int height, int hotspot_x, int hotspot_y) ++{ ++ if (!m_mb || !m_p || !m_p->arm || !m_p->vc || !pixels || width * height > 64 * 64) ++ return; ++ //printf("%s %dx%d %p\n", __func__, width, height, pixels); ++ memcpy(m_p->arm, pixels, width * height * 4); ++ unsigned int s = mailbox_set_cursor_info(m_mb, width, height, 0, m_p->vc, hotspot_x, hotspot_y); ++ assert(s == 0); ++} ++ ++void CRBP::update_cursor(int x, int y, bool enabled) ++{ ++ if (!m_mb || !m_p || !m_p->arm || !m_p->vc) ++ return; ++ ++ RESOLUTION res = g_graphicsContext.GetVideoResolution(); ++ CRect gui(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iWidth, CDisplaySettings::Get().GetResolutionInfo(res).iHeight); ++ CRect display(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight); ++ ++ int x2 = x * display.Width() / gui.Width(); ++ int y2 = y * display.Height() / gui.Height(); ++ ++ //printf("%s %d,%d (%d)\n", __func__, x, y, enabled); ++ mailbox_set_cursor_position(m_mb, enabled, x2, y2); ++} ++ ++void CRBP::uninit_cursor() ++{ ++ if (!m_mb || !m_p || !m_p->arm || !m_p->vc) ++ return; ++ //printf("%s\n", __func__); ++ mailbox_set_cursor_position(m_mb, 0, 0, 0); ++} ++ + #endif +diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h +index b422c89..f233a5e 100644 +--- a/xbmc/linux/RBP.h ++++ b/xbmc/linux/RBP.h +@@ -41,6 +41,8 @@ + #include "threads/CriticalSection.h" + #include "threads/Event.h" + ++struct gpu_mem_ptr_s; ++ + class CRBP + { + public: +@@ -81,6 +83,14 @@ class CRBP + CEvent m_vsync; + class DllLibOMXCore; + CCriticalSection m_critSection; ++ ++ struct gpu_mem_ptr_s *m_p; ++ int m_mb; ++public: ++ void init_cursor(); ++ void set_cursor(const void *pixels, int width, int height, int hotspot_x, int hotspot_y); ++ void update_cursor(int x, int y, bool enabled); ++ void uninit_cursor(); + }; + + extern CRBP g_RBP; +diff --git a/xbmc/linux/rpi_user_vcsm.h b/xbmc/linux/rpi_user_vcsm.h +new file mode 100644 +index 0000000..94e6e79 +--- /dev/null ++++ b/xbmc/linux/rpi_user_vcsm.h +@@ -0,0 +1,460 @@ ++/***************************************************************************** ++* Copyright 2001 - 2011 Broadcom Corporation. All rights reserved. ++* ++* This program is the proprietary software of Broadcom Corporation and/or ++* its licensors, and may only be used, duplicated, modified or distributed ++* pursuant to the terms and conditions of a separate, written license ++* agreement executed between you and Broadcom (an "Authorized License"). ++* Except as set forth in an Authorized License, Broadcom grants no license ++* (express or implied), right to use, or waiver of any kind with respect to ++* the Software, and Broadcom expressly reserves all rights in and to the ++* Software and all intellectual property rights therein. IF YOU HAVE NO ++* AUTHORIZED LICENSE, THEN YOU HAVE NO RIGHT TO USE THIS SOFTWARE IN ANY ++* WAY, AND SHOULD IMMEDIATELY NOTIFY BROADCOM AND DISCONTINUE ALL USE OF ++* THE SOFTWARE. ++* ++* Except as expressly set forth in the Authorized License, ++* 1. This program, including its structure, sequence and organization, ++* constitutes the valuable trade secrets of Broadcom, and you shall use ++* all reasonable efforts to protect the confidentiality thereof, and to ++* use this information only in connection with your use of Broadcom ++* integrated circuit products. ++* 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" ++* AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS OR ++* WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH ++* RESPECT TO THE SOFTWARE. BROADCOM SPECIFICALLY DISCLAIMS ANY AND ALL ++* IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS ++* FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, ++* QUIET ENJOYMENT, QUIET POSSESSION OR CORRESPONDENCE TO DESCRIPTION. YOU ++* ASSUME THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE. ++* 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR ITS ++* LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, ++* OR EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO ++* YOUR USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ++* ADVISED OF THE POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS ++* OF THE AMOUNT ACTUALLY PAID FOR THE SOFTWARE ITSELF OR U.S. $1, WHICHEVER ++* IS GREATER. THESE LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ++* ESSENTIAL PURPOSE OF ANY LIMITED REMEDY. ++*****************************************************************************/ ++ ++#ifndef __USER_VCSM__H__INCLUDED__ ++#define __USER_VCSM__H__INCLUDED__ ++ ++/* VideoCore Shared Memory - user interface library. ++** ++** This library provides all the necessary abstraction for any application to ++** make use of the shared memory service which is distributed accross a kernel ++** driver and a videocore service. ++** ++** It is an application design decision to choose or not to use this service. ++** ++** The logical flow of operations that a user application needs to follow when ++** using this service is: ++** ++** 1) Initialize the service. ++** 2) Allocate shared memory blocks. ++** 3) Start using the allocated blocks. ++** - In order to gain ownership on a block, lock the allocated block, ++** locking a block returns a valid address that the user application ++** can access. ++** - When finished with using the block for the current execution cycle ++** or function, and so when giving up the ownership, unlock the block. ++** 4) A block can be locked/unlocked as many times required - within or outside ++** of - a specific execution context. ++** 5) To completely release an allocated block, free it. ++** 6) If the service is no longer required, terminate it. ++** ++** ++** Some generic considerations: ++ ++** Allocating memory blocks. ++** ++** Memory blocks can be allocated in different manners depending on the cache ++** behavior desired. A given block can either be: ++ ++** - Allocated in a non cached fashion all the way through host and videocore. ++** - Allocated in a cached fashion on host OR videocore. ++** - Allocated in a cached fashion on host AND videocore. ++** ++** It is an application decision to determine how to allocate a block. Evidently ++** if the application will be doing substantial read/write accesses to a given block, ++** it is recommended to allocate the block at least in a 'host cached' fashion for ++** better results. ++** ++** ++** Locking memory blocks. ++** ++** When the memory block has been allocated in a host cached fashion, locking the ++** memory block (and so taking ownership of it) will trigger a cache invalidation. ++** ++** For the above reason and when using host cached allocation, it is important that ++** an application properly implements the lock/unlock mechanism to ensure cache will ++** stay coherent, otherwise there is no guarantee it will at all be. ++** ++** It is possible to dynamically change the host cache behavior (ie cached or non ++** cached) of a given allocation without needing to free and re-allocate the block. ++** This feature can be useful for such application which requires access to the block ++** only at certain times and not otherwise. By changing the cache behavior dynamically ++** the application can optimize performances for a given duration of use. ++** Such dynamic cache behavior remapping only applies to host cache and not videocore ++** cache. If one requires to change the videocore cache behavior, then a new block ++** must be created to replace the old one. ++** ++** On successful locking, a valid pointer is returned that the application can use ++** to access to data inside the block. There is no guarantee that the pointer will ++** stay valid following the unlock action corresponding to this lock. ++** ++** ++** Unocking memory blocks. ++** ++** When the memory block has been allocated in a host cached fashion, unlocking the ++** memory block (and so forgiving its ownership) will trigger a cache flush unless ++** explicitely asked not to flush the cache for performances reasons. ++** ++** For the above reason and when using host cached allocation, it is important that ++** an application properly implements the lock/unlock mechanism to ensure cache will ++** stay coherent, otherwise there is no guarantee it will at all be. ++** ++** ++** A complete API is defined below. ++*/ ++ ++#ifdef __cplusplus ++extern "C" ++{ ++#endif ++ ++/* Different status that can be dumped. ++*/ ++typedef enum ++{ ++ VCSM_STATUS_VC_WALK_ALLOC = 0, // Walks *all* the allocation on videocore. ++ // Result of the walk is seen in the videocore ++ // log. ++ VCSM_STATUS_HOST_WALK_MAP, // Walks the *full* mapping allocation on host ++ // driver (ie for all processes). Result of ++ // the walk is seen in the kernel log. ++ VCSM_STATUS_HOST_WALK_PID_MAP, // Walks the per process mapping allocation on host ++ // driver (for current process). Result of ++ // the walk is seen in the kernel log. ++ VCSM_STATUS_HOST_WALK_PID_ALLOC, // Walks the per process host allocation on host ++ // driver (for current process). Result of ++ // the walk is seen in the kernel log. ++ VCSM_STATUS_VC_MAP_ALL, // Equivalent to both VCSM_STATUS_VC_WALK_ALLOC and ++ // VCSM_STATUS_HOST_WALK_MAP. ++ // ++ VCSM_STATUS_NONE, // Must be last - invalid. ++ ++} VCSM_STATUS_T; ++ ++/* Different kind of cache behavior. ++*/ ++typedef enum ++{ ++ VCSM_CACHE_TYPE_NONE = 0, // No caching applies. ++ VCSM_CACHE_TYPE_HOST, // Allocation is cached on host (user space). ++ VCSM_CACHE_TYPE_VC, // Allocation is cached on videocore. ++ VCSM_CACHE_TYPE_HOST_AND_VC, // Allocation is cached on both host and videocore. ++ ++} VCSM_CACHE_TYPE_T; ++ ++/* Initialize the vcsm processing. ++** ++** Must be called once before attempting to do anything else. ++** ++** Returns 0 on success, -1 on error. ++*/ ++int vcsm_init( void ); ++ ++ ++/* Terminates the vcsm processing. ++** ++** Must be called vcsm services are no longer needed, it will ++** take care of removing any allocation under the current process ++** control if deemed necessary. ++*/ ++void vcsm_exit( void ); ++ ++ ++/* Queries the status of the the vcsm. ++** ++** Triggers dump of various kind of information, see the ++** different variants specified in VCSM_STATUS_T. ++** ++** Pid is optional. ++*/ ++void vcsm_status( VCSM_STATUS_T status, int pid ); ++ ++ ++/* Allocates a non-cached block of memory of size 'size' via the vcsm memory ++** allocator. ++** ++** Returns: 0 on error ++** a non-zero opaque handle on success. ++** ++** On success, the user must invoke vcsm_lock with the returned opaque ++** handle to gain access to the memory associated with the opaque handle. ++** When finished using the memory, the user calls vcsm_unlock_xx (see those ++** function definition for more details on the one that can be used). ++** ++** A well behaved application should make every attempt to lock/unlock ++** only for the duration it needs to access the memory data associated with ++** the opaque handle. ++*/ ++unsigned int vcsm_malloc( unsigned int size, char *name ); ++ ++ ++/* Allocates a cached block of memory of size 'size' via the vcsm memory ++** allocator, the type of caching requested is passed as argument of the ++** function call. ++** ++** Returns: 0 on error ++** a non-zero opaque handle on success. ++** ++** On success, the user must invoke vcsm_lock with the returned opaque ++** handle to gain access to the memory associated with the opaque handle. ++** When finished using the memory, the user calls vcsm_unlock_xx (see those ++** function definition for more details on the one that can be used). ++** ++** A well behaved application should make every attempt to lock/unlock ++** only for the duration it needs to access the memory data associated with ++** the opaque handle. ++*/ ++unsigned int vcsm_malloc_cache( unsigned int size, VCSM_CACHE_TYPE_T cache, char *name ); ++ ++ ++/* Shares an allocated block of memory via the vcsm memory allocator. ++** ++** Returns: 0 on error ++** a non-zero opaque handle on success. ++** ++** On success, the user must invoke vcsm_lock with the returned opaque ++** handle to gain access to the memory associated with the opaque handle. ++** When finished using the memory, the user calls vcsm_unlock_xx (see those ++** function definition for more details on the one that can be used). ++** ++** A well behaved application should make every attempt to lock/unlock ++** only for the duration it needs to access the memory data associated with ++** the opaque handle. ++*/ ++unsigned int vcsm_malloc_share( unsigned int handle ); ++ ++ ++/* Resizes a block of memory allocated previously by vcsm_alloc. ++** ++** Returns: 0 on success ++** -errno on error. ++** ++** The handle must be unlocked by user prior to attempting any ++** resize action. ++** ++** On error, the original size allocated against the handle ++** remains available the same way it would be following a ++** successful vcsm_malloc. ++*/ ++int vcsm_resize( unsigned int handle, unsigned int new_size ); ++ ++ ++/* Frees a block of memory that was successfully allocated by ++** a prior call the vcms_alloc. ++** ++** The handle should be considered invalid upon return from this ++** call. ++** ++** Whether any memory is actually freed up or not as the result of ++** this call will depends on many factors, if all goes well it will ++** be freed. If something goes wrong, the memory will likely end up ++** being freed up as part of the vcsm_exit process. In the end the ++** memory is guaranteed to be freed one way or another. ++*/ ++void vcsm_free( unsigned int handle ); ++ ++ ++/* Retrieves a videocore opaque handle from a mapped user address ++** pointer. The videocore handle will correspond to the actual ++** memory mapped in videocore. ++** ++** Returns: 0 on error ++** a non-zero opaque handle on success. ++** ++** Note: the videocore opaque handle is distinct from the user ++** opaque handle (allocated via vcsm_malloc) and it is only ++** significant for such application which knows what to do ++** with it, for the others it is just a number with little ++** use since nothing can be done with it (in particular ++** for safety reason it cannot be used to map anything). ++*/ ++unsigned int vcsm_vc_hdl_from_ptr( void *usr_ptr ); ++ ++ ++/* Retrieves a videocore opaque handle from a opaque handle ++** pointer. The videocore handle will correspond to the actual ++** memory mapped in videocore. ++** ++** Returns: 0 on error ++** a non-zero opaque handle on success. ++** ++** Note: the videocore opaque handle is distinct from the user ++** opaque handle (allocated via vcsm_malloc) and it is only ++** significant for such application which knows what to do ++** with it, for the others it is just a number with little ++** use since nothing can be done with it (in particular ++** for safety reason it cannot be used to map anything). ++*/ ++unsigned int vcsm_vc_hdl_from_hdl( unsigned int handle ); ++ ++ ++/* Retrieves a user opaque handle from a mapped user address ++** pointer. ++** ++** Returns: 0 on error ++** a non-zero opaque handle on success. ++*/ ++unsigned int vcsm_usr_handle( void *usr_ptr ); ++ ++ ++/* Retrieves a mapped user address from an opaque user ++** handle. ++** ++** Returns: 0 on error ++** a non-zero address on success. ++** ++** On success, the address corresponds to the pointer ++** which can access the data allocated via the vcsm_malloc ++** call. ++*/ ++void *vcsm_usr_address( unsigned int handle ); ++ ++ ++/* Locks the memory associated with this opaque handle. ++** ++** Returns: NULL on error ++** a valid pointer on success. ++** ++** A user MUST lock the handle received from vcsm_malloc ++** in order to be able to use the memory associated with it. ++** ++** On success, the pointer returned is only valid within ++** the lock content (ie until a corresponding vcsm_unlock_xx ++** is invoked). ++*/ ++void *vcsm_lock( unsigned int handle ); ++ ++ ++/* Locks the memory associated with this opaque handle. The lock ++** also gives a chance to update the *host* cache behavior of the ++** allocated buffer if so desired. The *videocore* cache behavior ++** of the allocated buffer cannot be changed by this call and such ++** attempt will be ignored. ++** ++** The system will attempt to honour the cache_update mode request, ++** the cache_result mode will provide the final answer on which cache ++** mode is really in use. Failing to change the cache mode will not ++** result in a failure to lock the buffer as it is an application ++** decision to choose what to do if (cache_result != cache_update) ++** ++** The value returned in cache_result can only be considered valid if ++** the returned pointer is non NULL. The cache_result pointer may be ++** NULL if the application does not care about the actual outcome of ++** its action with regards to the cache behavior change. ++** ++** Returns: NULL on error ++** a valid pointer on success. ++** ++** A user MUST lock the handle received from vcsm_malloc ++** in order to be able to use the memory associated with it. ++** ++** On success, the pointer returned is only valid within ++** the lock content (ie until a corresponding vcsm_unlock_xx ++** is invoked). ++*/ ++void *vcsm_lock_cache( unsigned int handle, ++ VCSM_CACHE_TYPE_T cache_update, ++ VCSM_CACHE_TYPE_T *cache_result ); ++ ++ ++/* Unlocks the memory associated with this user mapped address. ++** ++** Returns: 0 on success ++** -errno on error. ++** ++** After unlocking a mapped address, the user should no longer ++** attempt to reference it. ++*/ ++int vcsm_unlock_ptr( void *usr_ptr ); ++ ++ ++/* Unlocks the memory associated with this user mapped address. ++** Apply special processing that would override the otherwise ++** default behavior. ++** ++** If 'cache_no_flush' is specified: ++** Do not flush cache as the result of the unlock (if cache ++** flush was otherwise applicable in this case). ++** ++** Returns: 0 on success ++** -errno on error. ++** ++** After unlocking a mapped address, the user should no longer ++** attempt to reference it. ++*/ ++int vcsm_unlock_ptr_sp( void *usr_ptr, int cache_no_flush ); ++ ++ ++/* Unlocks the memory associated with this user opaque handle. ++** ++** Returns: 0 on success ++** -errno on error. ++** ++** After unlocking an opaque handle, the user should no longer ++** attempt to reference the mapped addressed once associated ++** with it. ++*/ ++int vcsm_unlock_hdl( unsigned int handle ); ++ ++ ++/* Unlocks the memory associated with this user opaque handle. ++** Apply special processing that would override the otherwise ++** default behavior. ++** ++** If 'cache_no_flush' is specified: ++** Do not flush cache as the result of the unlock (if cache ++** flush was otherwise applicable in this case). ++** ++** Returns: 0 on success ++** -errno on error. ++** ++** After unlocking an opaque handle, the user should no longer ++** attempt to reference the mapped addressed once associated ++** with it. ++*/ ++int vcsm_unlock_hdl_sp( unsigned int handle, int cache_no_flush ); ++ ++/* Clean and/or invalidate the memory associated with this user opaque handle ++** ++** Returns: non-zero on error ++** ++** structure contains a list of flush/invalidate commands. Commands are: ++** 0: nop ++** 1: invalidate given virtual range in L1/L2 ++** 2: clean given virtual range in L1/L2 ++** 3: clean+invalidate given virtual range in L1/L2 ++** 4: flush all L1/L2 ++*/ ++struct vcsm_user_clean_invalid_s { ++ struct { ++ unsigned int cmd; ++ unsigned int handle; ++ unsigned int addr; ++ unsigned int size; ++ } s[8]; ++}; ++ ++int vcsm_clean_invalid( struct vcsm_user_clean_invalid_s *s ); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* __USER_VCSM__H__INCLUDED__ */ ++ +diff --git a/xbmc/windowing/WinEventsLinux.cpp b/xbmc/windowing/WinEventsLinux.cpp +index 6f97e9e..bde7649 100644 +--- a/xbmc/windowing/WinEventsLinux.cpp ++++ b/xbmc/windowing/WinEventsLinux.cpp +@@ -30,11 +30,31 @@ + #include "utils/log.h" + #include "powermanagement/PowerManager.h" + ++#ifdef TARGET_RASPBERRY_PI ++#include "utils/TimeUtils.h" ++#include "guilib/Resolution.h" ++#include "addons/Skin.h" ++#include "utils/XMLUtils.h" ++#include "utils/StringUtils.h" ++#include "filesystem/File.h" ++#include "guilib/iimage.h" ++#include "guilib/XBTF.h" ++#include "guilib/imagefactory.h" ++#include "guilib/TextureManager.h" ++#include "linux/RBP.h" ++#include "input/InputManager.h" ++#endif ++ + bool CWinEventsLinux::m_initialized = false; + CLinuxInputDevices CWinEventsLinux::m_devices; + + CWinEventsLinux::CWinEventsLinux() + { ++#ifdef TARGET_RASPBERRY_PI ++ m_last_mouse_move_time = 0; ++ m_mouse_state = -1; ++ memset(m_cursors, 0, sizeof m_cursors); ++#endif + } + + void CWinEventsLinux::RefreshDevices() +@@ -48,19 +68,142 @@ bool CWinEventsLinux::IsRemoteLowBattery() + return false; + } + ++#ifdef TARGET_RASPBERRY_PI ++void *CWinEventsLinux::LoadImage(const std::string texturePath, int &width, int &height) ++{ ++ void *pixels = NULL; ++ // Read image into memory to use our vfs ++ XFILE::CFile file; ++ XFILE::auto_buffer buf; ++ ++ if (file.LoadFile(texturePath, buf) <= 0) ++ return NULL; ++ ++ IImage *pImage = ImageFactory::CreateLoader(texturePath); ++ if (pImage != NULL && pImage->LoadImageFromMemory((unsigned char *)buf.get(), buf.size(), width, height)) ++ { ++ width = pImage->Width(); ++ height = pImage->Height(); ++ if (width > 0 && height > 0) ++ { ++ pixels = malloc(width * height * 4); ++ if (!pixels) ++ return NULL; ++ if (!pImage->Decode((unsigned char *)pixels, width * 4, XB_FMT_A8R8G8B8)) ++ { ++ free(pixels); ++ return NULL; ++ } ++ } ++ } ++ return pixels; ++} ++ ++bool CWinEventsLinux::LoadXML(const std::string strFileName) ++{ ++ RESOLUTION_INFO m_coordsRes; // resolution that the window coordinates are in. ++ // Find appropriate skin folder + resolution to load from ++ std::string strFileNameLower = strFileName; ++ StringUtils::ToLower(strFileNameLower); ++ std::string strLowerPath = g_SkinInfo->GetSkinPath(strFileNameLower, &m_coordsRes); ++ std::string strPath = g_SkinInfo->GetSkinPath(strFileName, &m_coordsRes); ++ ++ TiXmlElement* pRootElement = NULL; ++ CXBMCTinyXML xmlDoc; ++ std::string strPathLower = strPath; ++ StringUtils::ToLower(strPathLower); ++ if (!xmlDoc.LoadFile(strPath) && !xmlDoc.LoadFile(strPathLower) && !xmlDoc.LoadFile(strLowerPath)) ++ { ++ CLog::Log(LOGERROR, "unable to load:%s, Line %d\n%s", strPath.c_str(), xmlDoc.ErrorRow(), xmlDoc.ErrorDesc()); ++ return false; ++ } ++ pRootElement = (TiXmlElement*)xmlDoc.RootElement()->Clone(); ++ //printf("%s: load:%s,%s,%s\n", __func__, strPath.c_str(), strPathLower.c_str(), strLowerPath.c_str()); ++ ++ if (!pRootElement) ++ return false; ++ ++ if (strcmpi(pRootElement->Value(), "window")) ++ { ++ CLog::Log(LOGERROR, "file : XML file doesnt contain "); ++ return false; ++ } ++ ++ TiXmlElement *pChild = pRootElement->FirstChildElement(); ++ while (pChild) ++ { ++ if (strcmpi(pChild->Value(), "controls") == 0) ++ { ++ TiXmlElement *pControl = pChild->FirstChildElement(); ++ while (pControl) ++ { ++ //printf("%s:2 %s\n", __func__, pControl->Value()); ++ if (strcmpi(pControl->Value(), "control") == 0) ++ { ++ std::string strStringValue; ++ if (XMLUtils::GetString(pControl, "texture", strStringValue)) ++ { ++ const char* idAttr = pControl->Attribute("id"); ++ int index = idAttr ? atoi(idAttr)-1 : -1; ++ if (index >= 0 && index < (int)(sizeof m_cursors/sizeof *m_cursors)) ++ { ++ if (m_cursors[index].pixels) ++ free(m_cursors[index].pixels); ++ std::string path = g_TextureManager.GetTexturePath(strStringValue); ++ m_cursors[index].width = m_cursors[index].height = 64; // max ++ m_cursors[index].pixels = LoadImage(path, m_cursors[index].width, m_cursors[index].height); ++ //printf("%s: texture: %d %s %dx%d %p\n", __func__, index, path.c_str(), m_cursors[index].width, m_cursors[index].height, m_cursors[index].pixels); ++ } ++ } ++ } ++ pControl = pControl->NextSiblingElement(); ++ } ++ } ++ pChild = pChild->NextSiblingElement(); ++ } ++ delete pRootElement; ++ return true; ++} ++#endif ++ + bool CWinEventsLinux::MessagePump() + { + if (!m_initialized) { - if(resolutions[i].iScreenWidth == res.iScreenWidth && resolutions[i].iScreenHeight == res.iScreenHeight && resolutions[i].fRefreshRate == res.fRefreshRate && -- (resolutions[i].dwFlags & (D3DPRESENTFLAG_MODE3DSBS|D3DPRESENTFLAG_MODE3DTB)) == (res.dwFlags & (D3DPRESENTFLAG_MODE3DSBS|D3DPRESENTFLAG_MODE3DTB))) -+ (resolutions[i].dwFlags & D3DPRESENTFLAG_MODEMASK) == (res.dwFlags & D3DPRESENTFLAG_MODEMASK)) - { - return i; - } -@@ -203,8 +203,7 @@ int CEGLNativeTypeRaspberryPI::AddUniqueResolution(RESOLUTION_INFO &res, std::ve - int i = FindMatchingResolution(res, resolutions); - if (i>=0) - { // don't replace a progressive resolution with an interlaced one of same resolution -- if (!(res.dwFlags & D3DPRESENTFLAG_INTERLACED)) -- resolutions[i] = res; -+ resolutions[i] = res; + m_devices.InitAvailable(); + m_initialized = true; ++#ifdef TARGET_RASPBERRY_PI ++ LoadXML("Pointer.xml"); ++#endif } - else + + bool ret = false; + XBMC_Event event = {0}; ++#ifdef TARGET_RASPBERRY_PI ++ int64_t Now = CurrentHostCounter(); ++ int state = CInputManager::Get().GetMouseState() - 1; ++ if (m_mouse_state != state) ++ { ++ //printf("%s: %d->%d\n", __func__, m_mouse_state, state); ++ if (state >= 0 && state < (int)(sizeof m_cursors/sizeof *m_cursors) && m_cursors[state].pixels) ++ { ++ g_RBP.set_cursor(m_cursors[state].pixels, m_cursors[state].width, m_cursors[state].height, 0, 0); ++ } ++ m_mouse_state = state; ++ } ++#endif + while (1) { -@@ -516,7 +515,7 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r - vc_tv_hdmi_get_property(&property); - m_desktopRes.fRefreshRate = property.param1 == HDMI_PIXEL_CLOCK_TYPE_NTSC ? tv_state.display.hdmi.frame_rate * (1000.0f/1001.0f) : tv_state.display.hdmi.frame_rate; - } -- else // sdtv -+ else if ((tv_state.state & ( VC_SDTV_NTSC | VC_SDTV_PAL )) != 0) // sdtv + event = m_devices.ReadEvent(); ++#ifdef TARGET_RASPBERRY_PI ++ if (event.type == XBMC_MOUSEMOTION || event.type == XBMC_MOUSEBUTTONDOWN || event.type == XBMC_MOUSEBUTTONUP) ++ { ++ if (event.type == XBMC_MOUSEMOTION) ++ g_RBP.update_cursor(event.motion.x, event.motion.y, 1); ++ m_last_mouse_move_time = Now; ++ //printf("%s: %d,%d %d %d,%d (%d,%d)\n", __func__, event.motion.type, event.motion.which, event.motion.state, event.motion.x, event.motion.y, event.motion.xrel, event.motion.yrel); ++ } ++#endif + if (event.type != XBMC_NOEVENT) { - m_desktopRes.iScreen = 0; - m_desktopRes.bFullScreen = true; -@@ -541,7 +540,6 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r - GetSupportedModes(HDMI_RES_GROUP_CEA, resolutions); - GetSupportedModes(HDMI_RES_GROUP_DMT, resolutions); + ret |= g_application.OnEvent(event); +@@ -71,6 +214,10 @@ bool CWinEventsLinux::MessagePump() + } + } -- if(resolutions.size() == 0) - { - AddUniqueResolution(m_desktopRes, resolutions); - CLog::Log(LOGDEBUG, "EGL probe resolution %s:%x\n", m_desktopRes.strMode.c_str(), m_desktopRes.dwFlags); -@@ -636,6 +634,12 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v - res.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res.iScreenWidth / (float)res.iScreenHeight); - res.iSubtitles = (int)(0.965 * res.iHeight); ++#ifdef TARGET_RASPBERRY_PI ++ if (Now - m_last_mouse_move_time > 5 * 1000000000LL) ++ g_RBP.update_cursor(0, 0, 0); ++#endif + return ret; + } -+ if (!m_desktopRes.dwFlags && prefer_group == group && prefer_mode == tv->code) -+ m_desktopRes = res; -+ -+ if (res.dwFlags & D3DPRESENTFLAG_INTERLACED) -+ continue; -+ - AddUniqueResolution(res, resolutions); - CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f) %s%s:%x\n", i, res.strMode.c_str(), res.fPixelRatio, - tv->native ? "N" : "", tv->scan_mode ? "I" : "", tv->code); +diff --git a/xbmc/windowing/WinEventsLinux.h b/xbmc/windowing/WinEventsLinux.h +index f6c8df0..5c2b583 100644 +--- a/xbmc/windowing/WinEventsLinux.h ++++ b/xbmc/windowing/WinEventsLinux.h +@@ -42,6 +42,17 @@ class CWinEventsLinux : public IWinEvents + private: + static bool m_initialized; + static CLinuxInputDevices m_devices; ++#ifdef TARGET_RASPBERRY_PI ++ bool LoadXML(const std::string strFileName); ++ void *LoadImage(const std::string texturePath, int &width, int &height); ++ int64_t m_last_mouse_move_time; ++ struct ++ { ++ void *pixels; ++ int width, height; ++ } m_cursors[4]; ++ int m_mouse_state; ++#endif + }; + + #endif