From 3b28e2f61f68dbec37415b9b757adab26d26d3e4 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Wed, 30 Mar 2016 05:40:33 +0100 Subject: [PATCH] RPi/RPi2: Update Kodi patches --- ...ch => kodi-001-jarvis-rbp-backports.patch} | 3188 ++++++++++++++--- ...ch => kodi-001-jarvis-rbp-backports.patch} | 3188 ++++++++++++++--- 2 files changed, 5386 insertions(+), 990 deletions(-) rename projects/RPi/patches/kodi/{kodi-001-jarvis-rpb-backports.patch => kodi-001-jarvis-rbp-backports.patch} (95%) rename projects/RPi2/patches/kodi/{kodi-001-jarvis-rpb-backports.patch => kodi-001-jarvis-rbp-backports.patch} (95%) diff --git a/projects/RPi/patches/kodi/kodi-001-jarvis-rpb-backports.patch b/projects/RPi/patches/kodi/kodi-001-jarvis-rbp-backports.patch similarity index 95% rename from projects/RPi/patches/kodi/kodi-001-jarvis-rpb-backports.patch rename to projects/RPi/patches/kodi/kodi-001-jarvis-rbp-backports.patch index 16d501a0c6..89a72271ff 100644 --- a/projects/RPi/patches/kodi/kodi-001-jarvis-rpb-backports.patch +++ b/projects/RPi/patches/kodi/kodi-001-jarvis-rbp-backports.patch @@ -1,7 +1,8 @@ -From 927d6ad60e7f1d38b5263b12cc60910d51de31e0 Mon Sep 17 00:00:00 2001 +From 0418867953596638f7c8bd9a73f993588ef9ca14 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Sep 2015 19:11:14 +0100 -Subject: [PATCH] Enable concealed error frames, but discard them when returned +Subject: [PATCH 01/94] Enable concealed error frames, but discard them when + returned --- xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 17 ++++++++--------- @@ -50,11 +51,15 @@ index bebe136..727a9ea 100644 if (status != MMAL_SUCCESS) CLog::Log(LOGERROR, "%s::%s Failed to disable error concealment on %s (status=%x %s)", CLASSNAME, __func__, m_dec_input->name, status, mmal_status_to_string(status)); -From cded5cf3c63fb1a3481c3983b232fad07ba3f218 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 66a74ecce9891a49ef5af36ecb216524d399d309 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 26 Aug 2015 21:47:41 +0100 -Subject: [PATCH] Reduce framerate of high framerate videos when not running - fullscreen +Subject: [PATCH 02/94] Reduce framerate of high framerate videos when not + running fullscreen --- xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 14 +++++++++++++- @@ -106,7 +111,7 @@ diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdpl index d081b9c..0ea6ecd 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -123,6 +123,8 @@ class CMMALVideo : public CDVDVideoCodec +@@ -123,6 +123,8 @@ protected: bool SendCodecConfigData(); CDVDStreamInfo m_hints; @@ -115,10 +120,14 @@ index d081b9c..0ea6ecd 100644 // Components MMAL_INTERLACETYPE_T m_interlace_mode; EINTERLACEMETHOD m_interlace_method; -From f72fa574396fd38e389ae16aed207ce46eeefdb1 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 9aaaf4cc73da770a7900e5a8095500150fb46db7 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 2 Dec 2015 20:08:05 +0000 -Subject: [PATCH] Remove preroll +Subject: [PATCH 03/94] Remove preroll --- xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 12 ++---------- @@ -181,7 +190,7 @@ diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdpl index 0ea6ecd..50ac0e3 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -131,7 +131,6 @@ class CMMALVideo : public CDVDVideoCodec +@@ -131,7 +131,6 @@ protected: double m_demuxerPts; double m_decoderPts; int m_speed; @@ -189,10 +198,14 @@ index 0ea6ecd..50ac0e3 100644 CCriticalSection m_sharedSection; MMAL_COMPONENT_T *m_dec; -From da33fcf121d1dbc2455ca2ddfa9e709551cb79f4 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 103c4eb8a0a6d33bbcb42f128b82d16a5997386f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 2 Dec 2015 22:35:11 +0000 -Subject: [PATCH] Remove demux queue +Subject: [PATCH 04/94] Remove demux queue --- xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 81 ++++------------------ @@ -359,7 +372,7 @@ diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdpl index 50ac0e3..f4df09c 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -64,13 +64,6 @@ class CMMALVideoBuffer +@@ -64,13 +64,6 @@ private: class CMMALVideo : public CDVDVideoCodec { @@ -373,7 +386,7 @@ index 50ac0e3..f4df09c 100644 public: CMMALVideo(); virtual ~CMMALVideo(); -@@ -110,9 +103,6 @@ class CMMALVideo : public CDVDVideoCodec +@@ -110,9 +103,6 @@ protected: float m_aspect_ratio; const char *m_pFormatName; @@ -383,10 +396,14 @@ index 50ac0e3..f4df09c 100644 // mmal output buffers (video frames) pthread_mutex_t m_output_mutex; std::queue m_output_ready; -From 24dcd8662b2ba576f4a5621070c1b80de2d561cb Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 8869a77fbd72a0e9a341ad859a08c3dd8f64eff0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 2 Dec 2015 20:10:33 +0000 -Subject: [PATCH] Remove time based limit on submitted packets +Subject: [PATCH 05/94] Remove time based limit on submitted packets --- xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 24 +++------------------- @@ -458,7 +475,7 @@ diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdpl index f4df09c..8f84557 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -118,8 +118,6 @@ class CMMALVideo : public CDVDVideoCodec +@@ -118,8 +118,6 @@ protected: // Components MMAL_INTERLACETYPE_T m_interlace_mode; EINTERLACEMETHOD m_interlace_method; @@ -467,10 +484,14 @@ index f4df09c..8f84557 100644 int m_speed; CCriticalSection m_sharedSection; -From 6e6d985927e7bc626a2c2b68ce7b1a6228453eaf Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 2aee01ad85f6233bc6f850d75c594a0e7838930f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Dec 2015 22:18:47 +0000 -Subject: [PATCH] Add back logging of data queued in decoder +Subject: [PATCH 06/94] Add back logging of data queued in decoder --- xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 22 +++++++++++++++++++++- @@ -542,7 +563,7 @@ diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdpl index 8f84557..f4df09c 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -118,6 +118,8 @@ class CMMALVideo : public CDVDVideoCodec +@@ -118,6 +118,8 @@ protected: // Components MMAL_INTERLACETYPE_T m_interlace_mode; EINTERLACEMETHOD m_interlace_method; @@ -551,11 +572,15 @@ index 8f84557..f4df09c 100644 int m_speed; CCriticalSection m_sharedSection; -From 83759ec3a304fe3206f629d2c4eff4ba8bb16948 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 011ad87c7a06222473b06654ab4df0a292edc956 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 8 Dec 2015 11:40:17 +0000 -Subject: [PATCH] Try to minimise latency through hardware decoder. This could - reduce performance but keeps videoplayer happier +Subject: [PATCH 07/94] Try to minimise latency through hardware decoder. This + could reduce performance but keeps videoplayer happier --- xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 42 +++++++++++++++++----- @@ -639,10 +664,15 @@ index 35a9847..f96cc14 100644 return ret; } -From f66265227a97d12f958318188bf63c2db0da6fc4 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 3302e62bfc5a964bdb7beb98ca0624b138edadaa Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Jul 2015 19:27:25 +0100 -Subject: [PATCH] Enable QPU based deinterlace and remove resolution limit +Subject: [PATCH 08/94] Enable QPU based deinterlace and remove resolution + limit --- xbmc/cores/VideoRenderers/MMALRenderer.cpp | 2 +- @@ -709,10 +739,14 @@ index e50c13a..20ad4fa 100644 if (!advanced_deinterlace) image_filter.eImageFilter = OMX_ImageFilterDeInterlaceFast; else -From f32634dbefc6530ed540a7a57009deaea187fc71 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From db5f80d9955ecf1fa37c12f10bc48d8b84871f99 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 16 Aug 2015 15:46:33 +0100 -Subject: [PATCH] Allow deinterlace with software decode +Subject: [PATCH 09/94] Allow deinterlace with software decode --- xbmc/cores/VideoRenderers/MMALRenderer.cpp | 9 +++++++++ @@ -745,11 +779,57 @@ index bee3af1..9b5c666 100644 return m_sourceWidth * m_sourceHeight <= 576 * 720 ? VS_INTERLACEMETHOD_MMAL_ADVANCED : VS_INTERLACEMETHOD_MMAL_BOB; } -From e664ff7a544b0cb1b24f095ff6f408425e4fb3e4 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 36180656b74f719ee0c2a8748a5d12d5ccbea93b Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 15 Sep 2015 22:26:26 +0100 +Subject: [PATCH 10/94] omxplayer: Don't use AutoInterlaceMethod it changes at + start of file + +--- + xbmc/cores/omxplayer/OMXHelper.cpp | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/xbmc/cores/omxplayer/OMXHelper.cpp b/xbmc/cores/omxplayer/OMXHelper.cpp +index de493a2..7251fc1 100644 +--- a/xbmc/cores/omxplayer/OMXHelper.cpp ++++ b/xbmc/cores/omxplayer/OMXHelper.cpp +@@ -130,19 +130,19 @@ bool OMXDoProcessing(struct SOmxPlayerState &m_OmxPlayerState, int m_playSpeed, + bool audio_fifo_low = false, video_fifo_low = false, audio_fifo_high = false, video_fifo_high = false; + + if (m_OmxPlayerState.interlace_method == VS_INTERLACEMETHOD_MAX) +- m_OmxPlayerState.interlace_method = g_renderManager.AutoInterlaceMethod(CMediaSettings::GetInstance().GetCurrentVideoSettings().m_InterlaceMethod); ++ m_OmxPlayerState.interlace_method = CMediaSettings::GetInstance().GetCurrentVideoSettings().m_InterlaceMethod; + + // if deinterlace setting has changed, we should close and open video + if (m_OmxPlayerState.current_deinterlace != CMediaSettings::GetInstance().GetCurrentVideoSettings().m_DeinterlaceMode || + (m_OmxPlayerState.current_deinterlace != VS_DEINTERLACEMODE_OFF && +- m_OmxPlayerState.interlace_method != g_renderManager.AutoInterlaceMethod(CMediaSettings::GetInstance().GetCurrentVideoSettings().m_InterlaceMethod))) ++ m_OmxPlayerState.interlace_method != CMediaSettings::GetInstance().GetCurrentVideoSettings().m_InterlaceMethod)) + { + CLog::Log(LOGNOTICE, "%s - Reopen stream due to interlace change (%d,%d,%d,%d)", __FUNCTION__, + m_OmxPlayerState.current_deinterlace, CMediaSettings::GetInstance().GetCurrentVideoSettings().m_DeinterlaceMode, +- m_OmxPlayerState.interlace_method, g_renderManager.AutoInterlaceMethod(CMediaSettings::GetInstance().GetCurrentVideoSettings().m_InterlaceMethod)); ++ m_OmxPlayerState.interlace_method, CMediaSettings::GetInstance().GetCurrentVideoSettings().m_InterlaceMethod); + + m_OmxPlayerState.current_deinterlace = CMediaSettings::GetInstance().GetCurrentVideoSettings().m_DeinterlaceMode; +- m_OmxPlayerState.interlace_method = g_renderManager.AutoInterlaceMethod(CMediaSettings::GetInstance().GetCurrentVideoSettings().m_InterlaceMethod); ++ m_OmxPlayerState.interlace_method = CMediaSettings::GetInstance().GetCurrentVideoSettings().m_InterlaceMethod; + reopen_stream = true; + } + +-- +2.5.0 + + +From a0ce519db0d21eb3e9a2dfd070b0859d72784569 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 16 Sep 2015 15:05:37 +0100 -Subject: [PATCH] Avoid calling render callback with the lock held to avoid a - deadlock +Subject: [PATCH 11/94] Avoid calling render callback with the lock held to + avoid a deadlock --- xbmc/cores/omxplayer/OMXVideo.cpp | 27 ++++++++++++++------------- @@ -842,7 +922,7 @@ index d0634bb..7baefa5 100644 class COMXVideo { public: -@@ -50,7 +58,7 @@ class COMXVideo +@@ -50,7 +58,7 @@ public: // Required overrides bool SendDecoderConfig(); bool Open(CDVDStreamInfo &hints, OMXClock *clock, EDEINTERLACEMODE deinterlace = VS_DEINTERLACEMODE_OFF, bool hdmi_clock_sync = false); @@ -851,10 +931,15 @@ index d0634bb..7baefa5 100644 void RegisterResolutionUpdateCallBack(void *ctx, ResolutionUpdateCallBackFn callback) { m_res_ctx = ctx; m_res_callback = callback; } void Close(void); unsigned int GetFreeSpace(); -From a454c0556e42cb01096a1b459f4c202c0982f961 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 8d8e6b7c7b0af50800e2489a0e370c5e656dddb1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 16 Dec 2015 22:03:56 +0000 -Subject: [PATCH] Add settings option to enable MVC and frame packing support +Subject: [PATCH 12/94] Add settings option to enable MVC and frame packing + support --- .../resource.language.en_gb/resources/strings.po | 22 ++++++++++++++++++++++ @@ -983,7 +1068,7 @@ diff --git a/xbmc/settings/Settings.h b/xbmc/settings/Settings.h index 55e150d..f3ba426 100644 --- a/xbmc/settings/Settings.h +++ b/xbmc/settings/Settings.h -@@ -137,6 +137,7 @@ class CSettings : public CSettingCreator, public CSettingControlCreator +@@ -137,6 +137,7 @@ public: static const std::string SETTING_VIDEOPLAYER_USEMMAL; static const std::string SETTING_VIDEOPLAYER_USESTAGEFRIGHT; static const std::string SETTING_VIDEOPLAYER_LIMITGUIUPDATE; @@ -991,7 +1076,7 @@ index 55e150d..f3ba426 100644 static const std::string SETTING_MYVIDEOS_SELECTACTION; static const std::string SETTING_MYVIDEOS_EXTRACTFLAGS; static const std::string SETTING_MYVIDEOS_EXTRACTCHAPTERTHUMBS; -@@ -300,6 +301,7 @@ class CSettings : public CSettingCreator, public CSettingControlCreator +@@ -300,6 +301,7 @@ public: static const std::string SETTING_VIDEOSCREEN_GUICALIBRATION; static const std::string SETTING_VIDEOSCREEN_TESTPATTERN; static const std::string SETTING_VIDEOSCREEN_LIMITEDRANGE; @@ -999,10 +1084,14 @@ index 55e150d..f3ba426 100644 static const std::string SETTING_AUDIOOUTPUT_AUDIODEVICE; static const std::string SETTING_AUDIOOUTPUT_CHANNELS; static const std::string SETTING_AUDIOOUTPUT_CONFIG; -From 02255c425298a1240c143458e1e800e8ed45c799 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 7e941d7f0e1fc87d5d43e36b1febb3f7681f1e18 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Dec 2015 15:38:34 +0000 -Subject: [PATCH] Don't adjust 3d rectangles in bypass mode +Subject: [PATCH 13/94] Don't adjust 3d rectangles in bypass mode --- xbmc/cores/VideoRenderers/BaseRenderer.cpp | 55 ++++++++++++++++-------------- @@ -1077,10 +1166,14 @@ index 7889cf8..d4bb306 100644 } CalcNormalDisplayRect(m_viewRect.x1, m_viewRect.y1, m_viewRect.Width(), m_viewRect.Height(), GetAspectRatio() * CDisplaySettings::GetInstance().GetPixelRatio(), CDisplaySettings::GetInstance().GetZoomAmount(), CDisplaySettings::GetInstance().GetVerticalShift()); -From 69364688942df22b40b5190a5cdf1a83d450a8d0 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 1b8497b41521ac8277f2fab23baa6980d5680607 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 14 Mar 2015 12:38:08 +0000 -Subject: [PATCH] Switch to using transform flags for 3d modes +Subject: [PATCH 14/94] Switch to using transform flags for 3d modes --- xbmc/cores/VideoRenderers/MMALRenderer.cpp | 100 +++++++++--------------- @@ -1454,7 +1547,7 @@ diff --git a/xbmc/cores/omxplayer/OMXVideo.h b/xbmc/cores/omxplayer/OMXVideo.h index 7baefa5..31982b4 100644 --- a/xbmc/cores/omxplayer/OMXVideo.h +++ b/xbmc/cores/omxplayer/OMXVideo.h -@@ -67,7 +67,7 @@ class COMXVideo +@@ -67,7 +67,7 @@ public: void Reset(void); void SetDropState(bool bDrop); std::string GetDecoderName() { return m_video_codec_name; }; @@ -1492,10 +1585,14 @@ index 5d5b74b..443d037 100644 CLog::Log(LOGDEBUG, "EGL set resolution %dx%d -> %dx%d @ %.2f fps (%d,%d) flags:%x aspect:%.2f\n", 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 e8bc95c119f47640f864c50f4865c4cf934a94c5 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 6a912e2c074aa44c0dc288a64e0e4dff1edccc77 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 21 Jun 2015 17:42:03 +0100 -Subject: [PATCH] Remove unused Support3D function +Subject: [PATCH 15/94] Remove unused Support3D function --- xbmc/windowing/egl/WinSystemEGL.cpp | 29 ----------------------------- @@ -1546,7 +1643,7 @@ diff --git a/xbmc/windowing/egl/WinSystemEGL.h b/xbmc/windowing/egl/WinSystemEGL 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 +@@ -59,7 +59,6 @@ public: virtual void Register(IDispResource *resource); virtual void Unregister(IDispResource *resource); @@ -1554,10 +1651,15 @@ index 9d4baf6..1ec4225 100644 virtual bool ClampToGUIDisplayLimits(int &width, int &height); EGLConfig GetEGLConfig(); -From fdef730bacc4fb43a202eb65187a35405948951d Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 299d2a7f59caf3e44aa04c67c5a4bcceae6a4310 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 16 Dec 2015 21:08:34 +0000 -Subject: [PATCH] Avoid switching stereo mode based on current display mode +Subject: [PATCH 16/94] Avoid switching stereo mode based on current display + mode --- xbmc/guilib/GraphicContext.cpp | 24 ------------------------ @@ -1598,11 +1700,15 @@ index a1b8812..60979bb 100644 RESOLUTION_INFO info_mod = GetResInfo(res); -From be33e26546e5beb44bfacbff7d5f1cbfaa15ff8f Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 1d0be437addc2225a969b42088511d5b2e50c9f0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 21 Jun 2015 18:53:29 +0100 -Subject: [PATCH] Drop reporting 3D modes and just use current rendering mode - to request 3D signalling +Subject: [PATCH 17/94] Drop reporting 3D modes and just use current rendering + mode to request 3D signalling [rbp] Add ntsc version of 48Hz mode @@ -1862,7 +1968,7 @@ diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h b/xbmc/windowing/egl/ index a0acb1a..e5bcae7 100644 --- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h +++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h -@@ -69,7 +69,7 @@ class CEGLNativeTypeRaspberryPI : public CEGLNativeType +@@ -69,7 +69,7 @@ private: static void CallbackTvServiceCallback(void *userdata, uint32_t reason, uint32_t param1, uint32_t param2); void DestroyDispmaxWindow(); @@ -1872,10 +1978,14 @@ index a0acb1a..e5bcae7 100644 + int AddUniqueResolution(RESOLUTION_INFO &res, std::vector &resolutions, bool desktop = false); #endif }; -From 4bf34dc54fc0b4e5255eb8d2f2834287fa704680 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From e40391cacdb8e49b0af12cfa093d9362daf41842 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 22 Jun 2015 16:27:15 +0100 -Subject: [PATCH] Consider stereomode when creating a new window +Subject: [PATCH 18/94] Consider stereomode when creating a new window We might be changing from a non-3D to a 3D mode --- @@ -1923,7 +2033,7 @@ diff --git a/xbmc/windowing/egl/WinSystemEGL.h b/xbmc/windowing/egl/WinSystemEGL index 1ec4225..a33dedc 100644 --- a/xbmc/windowing/egl/WinSystemEGL.h +++ b/xbmc/windowing/egl/WinSystemEGL.h -@@ -78,6 +78,7 @@ class CWinSystemEGL : public CWinSystemBase, public CRenderSystemGLES +@@ -78,6 +78,7 @@ protected: EGLSurface m_surface; EGLContext m_context; EGLConfig m_config; @@ -1931,11 +2041,15 @@ index 1ec4225..a33dedc 100644 CEGLWrapper *m_egl; std::string m_extensions; -From 9167ed5222005d9b6788e6e52ea765f9d73fb13e Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From f917226a056672e2266d30540e79caee45ec869f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 18:19:32 +0100 -Subject: [PATCH] [rbp/omxplayer] When opening a stream don't try to update gui - so often +Subject: [PATCH 19/94] [rbp/omxplayer] When opening a stream don't try to + update gui so often --- xbmc/dialogs/GUIDialogBusy.cpp | 4 ++++ @@ -1957,10 +2071,14 @@ index 6816b45..6cc5a8f 100644 { g_windowManager.ProcessRenderLoop(false); if (allowCancel && dialog->IsCanceled()) -From 6bad783448faf1a5971a68fe8a2572c0435e125c Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From c5007f5c066a37c5d052816688e877b1559b28a9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 29 Apr 2014 15:23:22 +0100 -Subject: [PATCH] [ffmpeg] Speed up wtv index creation +Subject: [PATCH 20/94] [ffmpeg] Speed up wtv index creation The index creation is O(N^2) with number of entries (typically thousands). On a Pi this can take more than 60 seconds to execute for a recording of a few hours. @@ -2045,11 +2163,15 @@ index 0000000..d829898 + } + } + } -From 48f5c6c5ef76b9c63c1b41ce88b1f36493c63d12 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From b9a63ad68ba584cd374345d48614ea4cd04bbce1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 8 Mar 2014 15:36:06 +0000 -Subject: [PATCH] [hifiberry] Hack: force it to be recognised as IEC958 capable - to enable passthrough options +Subject: [PATCH 21/94] [hifiberry] Hack: force it to be recognised as IEC958 + capable to enable passthrough options --- xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp | 4 ++++ @@ -2070,10 +2192,14 @@ index e22db7a..0120bd5 100644 if (info.m_deviceType == AE_DEVTYPE_HDMI && info.m_displayName.size() > 5 && info.m_displayName.substr(info.m_displayName.size()-5) == " HDMI") { -From c043110afb41f25bbced31dd01249d74aa220d68 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 5bf1a1d26e0c3e4dd2c6a2e71f2550fb7eab2d64 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 1 May 2014 16:28:39 +0100 -Subject: [PATCH] Improved file buffering in CArchive +Subject: [PATCH 22/94] 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 @@ -2096,7 +2222,7 @@ diff --git a/xbmc/utils/Archive.h b/xbmc/utils/Archive.h index 6ed0f8f..8506d95 100644 --- a/xbmc/utils/Archive.h +++ b/xbmc/utils/Archive.h -@@ -154,9 +154,17 @@ class CArchive +@@ -154,9 +154,17 @@ protected: * than waiting until we attempt to put more data into an already full buffer */ if (m_BufferRemain > size) { @@ -2114,7 +2240,7 @@ index 6ed0f8f..8506d95 100644 return *this; } else -@@ -171,9 +179,17 @@ class CArchive +@@ -171,9 +179,17 @@ protected: /* Note, refilling the buffer is deferred until we know we need to read more from it */ if (m_BufferRemain >= size) { @@ -2132,10 +2258,14 @@ index 6ed0f8f..8506d95 100644 return *this; } else -From b261ee73179e6cdcdee76ec5b55337f2433a9376 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 5be85818f72f316ac0419273069fd96d02ac8eb7 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 12 Aug 2014 00:31:36 +0100 -Subject: [PATCH] [omxcodec] Don't force software codec with dvds +Subject: [PATCH 23/94] [omxcodec] Don't force software codec with dvds --- xbmc/cores/dvdplayer/DVDPlayer.cpp | 2 ++ @@ -2155,10 +2285,15 @@ index 4ffe33a..4b09e8f 100644 } else if (m_pInputStream && m_pInputStream->IsStreamType(DVDSTREAM_TYPE_PVRMANAGER)) { -From eafbec7c06d774bfaae87697629eb0535de8f529 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 60f3a3087411daae5e3a690820fe4bf65c295532 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 10 Aug 2014 16:45:16 +0100 -Subject: [PATCH] filesystem: Make support of browsing into archives optional +Subject: [PATCH 24/94] 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. It's quite common to see reports of a large rar file that causes xbmc to crash with an out-of-memory error when browsing or scanning. @@ -2239,10 +2374,15 @@ index a1d4ee4..4929283 100644 if (url.IsFileType("xbt")) { CURL xbtUrl = URIUtils::CreateArchivePath("xbt", url); -From eed8fd81ac11ce6ea49f77efc9ae5f0428a12622 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 0417dd5c5b0c15ddf536cea15e1881594ab0eef6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 27 Oct 2014 13:06:57 +0000 -Subject: [PATCH] [rbp] Make cachemembuffersize default depend on memory size +Subject: [PATCH 25/94] [rbp] Make cachemembuffersize default depend on memory + size --- xbmc/linux/RBP.cpp | 10 ++++++++++ @@ -2296,7 +2436,7 @@ diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h index 9559914..7fc8b42 100644 --- a/xbmc/linux/RBP.h +++ b/xbmc/linux/RBP.h -@@ -48,6 +48,7 @@ class CRBP +@@ -48,6 +48,7 @@ public: ~CRBP(); bool Initialize(); @@ -2342,11 +2482,15 @@ index bc3aa8c..562757e 100644 m_initialized = true; } -From 607037670f5ce73906706f1649312d9137bb1cdb Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 66ca5923eb98f9fafcd35487c03079b7326fee07 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 30 May 2014 14:58:43 +0100 -Subject: [PATCH] [settings] Experiment: Report DESKTOP resolution in video - settings +Subject: [PATCH 26/94] [settings] Experiment: Report DESKTOP resolution in + video settings --- xbmc/settings/DisplaySettings.cpp | 3 +++ @@ -2366,11 +2510,15 @@ index 7993a73..761385b 100644 list.push_back(std::make_pair( StringUtils::Format("%dx%d%s", resolution->width, resolution->height, ModeFlagsToString(resolution->flags, false).c_str()), -From 9ccc337d1d203b7e8205d765a141a805dfcf0f00 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 0a2735dd4f859337281ff77d2f02b781c94f98c5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 19 Sep 2014 11:54:49 +0100 -Subject: [PATCH] [dvdplayer/rbp] Add pi specific option to maintain vsync with - pll adjustment +Subject: [PATCH 27/94] [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". This uses video clock (so perfect video syncing) but avoids having to resample @@ -2582,7 +2730,7 @@ diff --git a/xbmc/cores/dvdplayer/DVDPlayerAudio.h b/xbmc/cores/dvdplayer/DVDPla index 014574d..409b2d7 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerAudio.h +++ b/xbmc/cores/dvdplayer/DVDPlayerAudio.h -@@ -228,6 +228,9 @@ class CDVDPlayerAudio : public CThread, public IDVDStreamPlayerAudio +@@ -228,6 +228,9 @@ protected: bool m_prevskipped; double m_maxspeedadjust; double m_resampleratio; //resample ratio when using SYNC_RESAMPLE, used for the codec info @@ -2625,7 +2773,7 @@ diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h index 7fc8b42..db2fade 100644 --- a/xbmc/linux/RBP.h +++ b/xbmc/linux/RBP.h -@@ -64,6 +64,8 @@ class CRBP +@@ -64,6 +64,8 @@ public: unsigned char *CaptureDisplay(int width, int height, int *stride, bool swap_red_blue, bool video_only = true); DllOMX *GetDllOMX() { return m_OMX ? m_OMX->GetDll() : NULL; } void WaitVsync(); @@ -2634,7 +2782,7 @@ index 7fc8b42..db2fade 100644 private: DllBcmHost *m_DllBcmHost; -@@ -80,6 +82,7 @@ class CRBP +@@ -80,6 +82,7 @@ private: CEvent m_vsync; class DllLibOMXCore; CCriticalSection m_critSection; @@ -2674,11 +2822,15 @@ index 6475350..93de9bd 100644 std::string m_audioDefaultPlayer; float m_audioPlayCountMinimumPercent; bool m_dvdplayerIgnoreDTSinWAV; -From 9284250ce7e47e489dd5497379112aaff306836e Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From c7f85eb57480d0ea7296ab6adac768334f1d1889 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 24 Sep 2014 23:13:52 +0100 -Subject: [PATCH] [audio] Add settings option to boost centre channel when - downmixing +Subject: [PATCH 28/94] [audio] Add settings option to boost centre channel + when downmixing This allows a dB volume increase to be added to centre channel. This can help improve dialgue in the presence of background music/effects. @@ -2766,7 +2918,7 @@ index e4ddf9e..625ea88 100644 if (remapLayout) { diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -index 78071493..698a6ae 100644 +index 7807149..698a6ae 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 @@ -2799,10 +2951,14 @@ index 08b1b84..70d0866 100644 // stereo upmix if (upmix && m_src_channels == 2 && m_dst_channels > 2) -From 59888ef17bb7f03377208399ae46ec49b0789481 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 1592ab35c711338d52ad1ac08f79ff2fd3365020 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 27 Oct 2014 15:23:51 +0000 -Subject: [PATCH] [rbp] Default extract thumbnails to false +Subject: [PATCH 29/94] [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 @@ -2831,10 +2987,15 @@ index 7a170c2..1506035 100644
-From 9b4bb9c37f2123332556f2a9183c59823c31fc68 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 1d482f503a08b533b17640759b9f61bad2391743 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 10 Feb 2015 15:29:16 +0000 -Subject: [PATCH] [libcec] Add repeating keypress patch from popcornmix' repo +Subject: [PATCH 30/94] [libcec] Add repeating keypress patch from popcornmix' + repo --- tools/depends/target/libcec/Makefile | 1 + @@ -3719,10 +3880,14 @@ index 0000000..8366a69 +-- +1.9.1 + -From aae277129fda65177902a4b3552b69e81ca60082 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 63cf430f0c46993da63b37ded994cf1bc964dece Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 28 Oct 2014 00:19:40 +0000 -Subject: [PATCH] [cec] Add settings for configuring button repeats +Subject: [PATCH 31/94] [cec] Add settings for configuring button repeats --- addons/resource.language.en_gb/resources/strings.po | 15 +++++++++++++++ @@ -3802,10 +3967,14 @@ index e0d8dae..f738c84 100644 if (GetSettingBool("pause_playback_on_deactivate")) { -From c87e546b73f1b58c4132cac53ae76299f3807a1b Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 3550128073031d9a7560b76c1f215acfdf58bc1d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Nov 2014 23:17:46 +0000 -Subject: [PATCH] [cec] Don't discard buttons when repeat mode is enabled +Subject: [PATCH 32/94] [cec] Don't discard buttons when repeat mode is enabled --- xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 5 ++++- @@ -3827,10 +3996,14 @@ index f738c84..58d7d0d 100644 { if (m_currentButton.iButton == key.iButton && m_currentButton.iDuration == 0) { -From 3aaafcb5d5dfaa47e4285c5277e9303a583e94a8 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 8dca506d73857bc367f3e4ce0a4c95c622d269da Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 4 Nov 2014 18:50:00 +0000 -Subject: [PATCH] [cec] Temp - more logging +Subject: [PATCH 33/94] [cec] Temp - more logging --- xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 8 +++++++- @@ -3881,10 +4054,14 @@ index 58d7d0d..dfba61a 100644 m_buttonQueue.push_back(key); } -From ffba32357856396008e26926c52cb27bf7ad5b54 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From a211f8b79ba4842fcde3cb56abc5a2c2b179ba74 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 15 Nov 2014 12:03:34 +0000 -Subject: [PATCH] [dvdplayer] Add lock for player creation +Subject: [PATCH 34/94] [dvdplayer] Add lock for player creation --- xbmc/cores/dvdplayer/DVDPlayer.cpp | 3 +++ @@ -3923,16 +4100,20 @@ diff --git a/xbmc/cores/dvdplayer/DVDPlayer.h b/xbmc/cores/dvdplayer/DVDPlayer.h index 2f00647..b1418e3 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.h +++ b/xbmc/cores/dvdplayer/DVDPlayer.h -@@ -567,4 +567,5 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer +@@ -567,4 +567,5 @@ protected: // omxplayer variables struct SOmxPlayerState m_OmxPlayerState; bool m_omxplayer_mode; // using omxplayer acceleration + CCriticalSection m_players_lock; }; -From 806552069a7085e7ec945502c5c9f325ec84db35 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 385ad863ed94508583882aff64a7e54d14ed89ae Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 24 Nov 2014 22:07:25 +0000 -Subject: [PATCH] [dvdplayervideo] Prod decoder when in stills mode +Subject: [PATCH 35/94] [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. @@ -4008,10 +4189,14 @@ index 379c541..b5777a1 100644 } if (pMsg->IsType(CDVDMsg::GENERAL_SYNCHRONIZE)) -From e03cd165e45dcbff956cb81b0a8f0da15154f67b Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From bbc0384997b0bb8ccd869b320ec8d60fa31d5087 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 27 Nov 2014 16:31:56 +0000 -Subject: [PATCH] [languageinvoker] Reduce priority of python threads +Subject: [PATCH 36/94] [languageinvoker] Reduce priority of python threads --- xbmc/interfaces/generic/LanguageInvokerThread.cpp | 5 +++++ @@ -4033,10 +4218,14 @@ index fcdd063..16f0c89 100644 return true; } -From b4c3faf5d8b6dec5b1e867b3cda681e1cb6b3b88 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 77e535d399cebf699327d19490ef78519004a557 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 14 Dec 2013 16:55:05 +0000 -Subject: [PATCH] logging: Add microsecond timer to log messages +Subject: [PATCH 37/94] logging: Add microsecond timer to log messages --- xbmc/utils/log.cpp | 17 +++++++++++++++-- @@ -4088,11 +4277,15 @@ index 3443f12..31c4a99 100644 (uint64_t)CThread::GetCurrentThreadId(), levelNames[logLevel]) + strData; -From 93c5a32d9c502d13f55ce0500bb9860f6375ecc1 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 661ea4c177ec232a63a9a9ba21f855c5c581a2f3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 29 Nov 2014 15:25:16 +0000 -Subject: [PATCH] [rbp] hack: wait for splash to complete before changing hdmi - mode +Subject: [PATCH 38/94] [rbp] hack: wait for splash to complete before changing + hdmi mode --- xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 49 +++++++++++++++++++++++++ @@ -4164,10 +4357,15 @@ index ee29770..ff0d3e3 100644 DestroyDispmaxWindow(); RENDER_STEREO_MODE stereo_mode = g_graphicsContext.GetStereoMode(); -From 89e8ca28f5f135b3eea72237c46d48c195cb555c Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 50bec5d613ec9e5b1b946f904776565de130eafd Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 11 Dec 2014 17:00:57 +0000 -Subject: [PATCH] Fix for UI not showing both extractflags and extractthumb +Subject: [PATCH 39/94] Fix for UI not showing both extractflags and + extractthumb --- addons/resource.language.en_gb/resources/strings.po | 11 ++++++++--- @@ -4229,11 +4427,15 @@ index 918e8bf..61e1a22 100644 true -From 9648793c91db1b59c4b2ae741ca81fe150462ee2 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 88fcb5323a0a277feb21bcba9ef62986089aef46 Mon Sep 17 00:00:00 2001 From: anaconda Date: Thu, 11 Sep 2014 21:30:43 +0200 -Subject: [PATCH] Disable autoscrolling while on screensaver and while opening - streams. +Subject: [PATCH 40/94] Disable autoscrolling while on screensaver and while + opening streams. --- xbmc/Application.cpp | 10 ++++++++++ @@ -4266,7 +4468,7 @@ diff --git a/xbmc/Application.h b/xbmc/Application.h index d7e5eee..a34ed98 100644 --- a/xbmc/Application.h +++ b/xbmc/Application.h -@@ -390,6 +390,8 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs +@@ -390,6 +390,8 @@ public: */ void UnregisterActionListener(IActionListener *listener); @@ -4362,10 +4564,14 @@ index d7bc1c5..ac76629 100644 { if (m_lastRenderTime) m_autoScrollDelayTime += currentTime - m_lastRenderTime; -From 31ca2e2d20ac422b29163bdedc4a3442ebc1fb42 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From ba23654e3dfab6001f1087babc1fb6ebb050b18d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 13 Dec 2014 18:35:20 +0000 -Subject: [PATCH] [demuxer] Avoid memcpy on every demuxer packet +Subject: [PATCH 41/94] [demuxer] Avoid memcpy on every demuxer packet Avoids an unnecessary memcpy on every demuxer packet which for high bitrate videos can be significant. @@ -4462,10 +4668,14 @@ index ab298b2..10c5ee0 100644 delete pPacket; } catch(...) { -From c5ab0539c4924aa9edc3decc38b667f8dd5984ae Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 5fa43ef359f31432130fe4e92fbd0a1235ca16c2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 15 Feb 2015 14:06:12 +0000 -Subject: [PATCH] [mmal] Allow mmal codec for dvd stills +Subject: [PATCH 42/94] [mmal] Allow mmal codec for dvd stills --- xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp | 7 +++++++ @@ -4496,10 +4706,14 @@ index 84e9ef1..f920f49 100644 if (hint.stills && (hint.codec == AV_CODEC_ID_MPEG2VIDEO || hint.codec == AV_CODEC_ID_MPEG1VIDEO)) { // If dvd is an mpeg2 and hint.stills -From 9a5738bae07d81d195bb362a67c0cf3112cc50d5 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From b128dfc4848e7a102208c8ec95e1390c9a7d6d47 Mon Sep 17 00:00:00 2001 From: anaconda Date: Wed, 25 Feb 2015 18:22:21 +0100 -Subject: [PATCH] Load OSD dialogs on startup. +Subject: [PATCH 43/94] 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. @@ -4593,11 +4807,195 @@ index b248566..96c63cd 100644 CGUIDialogVideoSettings::~CGUIDialogVideoSettings() { } -From 0c40bf778b0b018574abf05ad841d1606e237184 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 22ccff2dc885a214b951e69323c9045830607ee4 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sat, 7 Mar 2015 22:46:21 +0000 +Subject: [PATCH 44/94] configure: Add raspberry-pi2 platform + +--- + configure.ac | 14 +++++++-- + m4/xbmc_arch.m4 | 8 ++--- + tools/depends/Makefile.include.in | 2 +- + tools/depends/configure.ac | 38 ++++++++++++++++------- + tools/depends/target/Toolchain.cmake.in | 2 +- + tools/depends/target/Toolchain_binaddons.cmake.in | 2 +- + 6 files changed, 44 insertions(+), 22 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 55e73b9..7a06a31 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -698,8 +698,17 @@ case $use_platform in + raspberry-pi) + target_platform=target_raspberry_pi + use_neon=no +- use_arch="arm" + use_cpu=arm1176jzf-s ++ ;; ++ raspberry-pi2) ++ target_platform=target_raspberry_pi ++ use_neon=yes ++ use_cpu=cortex-a7 ++ ;; ++esac ++ ++if test "$target_platform" = "target_raspberry_pi" ; then ++ use_arch="arm" + use_hardcoded_tables="yes" + use_openmax=no + ARCH="arm" +@@ -708,8 +717,7 @@ case $use_platform in + USE_MMAL=1; AC_DEFINE([HAS_MMAL],[1],["Define to 1 if MMAL libs is enabled"]) + CFLAGS="$CFLAGS" + CXXFLAGS="$CXXFLAGS" +- ;; +-esac ++fi + + if test "$host_vendor" = "apple"; then + use_avahi=no +diff --git a/m4/xbmc_arch.m4 b/m4/xbmc_arch.m4 +index 0b66a82..adb8e97 100644 +--- a/m4/xbmc_arch.m4 ++++ b/m4/xbmc_arch.m4 +@@ -77,9 +77,7 @@ if test "$target_platform" = "target_android" ; then + AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -DTARGET_ANDROID") + fi + +-case $use_platform in +- raspberry-pi) +- AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_ARMEL -DTARGET_RASPBERRY_PI") +- ;; +-esac ++if test "$target_platform" = "target_raspberry_pi" ; then ++ AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_ARMEL -DTARGET_RASPBERRY_PI") ++fi + ]) +diff --git a/tools/depends/Makefile.include.in b/tools/depends/Makefile.include.in +index 6e37022..326e7b8 100644 +--- a/tools/depends/Makefile.include.in ++++ b/tools/depends/Makefile.include.in +@@ -20,7 +20,7 @@ NATIVE_OS=@build_os@ + CROSS_COMPILING=@cross_compiling@ + ARCH_DEFINES=@ARCH_DEFINES@ + NATIVE_ARCH_DEFINES=@NATIVE_ARCH_DEFINES@ +-TARGET_PLATFORM=@use_platform@ ++TARGET_PLATFORM=@target_platform@ + XCODE_VERSION=@use_xcode@ + AAPT=@AAPT@ + DX=@DX@ +diff --git a/tools/depends/configure.ac b/tools/depends/configure.ac +index 12935e3..478f5f0 100644 +--- a/tools/depends/configure.ac ++++ b/tools/depends/configure.ac +@@ -17,7 +17,8 @@ AC_ARG_WITH([toolchain], + AC_ARG_WITH([platform], + [AS_HELP_STRING([--with-platform], + [target platform [auto]])], +- [use_platform=$withval]) ++ [use_platform=$withval], ++ [target_platform=$withval]) + + AC_ARG_WITH([firmware], + [AS_HELP_STRING([--with-firmware], +@@ -302,34 +303,49 @@ case $host in + AC_MSG_ERROR(unsupported host ($use_host)) + esac + +-if test "$use_platform" = "raspberry-pi"; then ++case $use_platform in ++ raspberry-pi) ++ target_platform=raspberry_pi ++ use_neon=no ++ use_cpu=arm1176jzf-s ++ platform_cflags="-mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp" ++ platform_cxxflags="-mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp" ++ platform_ldflags="" ++ ;; ++ raspberry-pi2) ++ target_platform=raspberry_pi ++ use_neon=yes ++ use_cpu=cortex-a7 ++ platform_cflags="-fPIC -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4" ++ platform_cxxflags="-fPIC -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4" ++ platform_ldflags="-lpthread" ++ ;; ++esac ++ ++if test "$target_platform" = "raspberry_pi" ; then + if test -d "${use_firmware}/opt/vc/include"; then + : + else + AC_MSG_ERROR([Raspberry Pi firmware not found]) + fi +- use_neon=no + use_arch="arm" +- use_cpu="arm1176jzf-s" + use_hardcoded_tables="yes" +- use_alsa="no" + ARCH="arm" + platform_os="linux" + cross_compiling="yes" + use_host="arm-linux-gnueabihf" + deps_dir="$use_host" +- platform_cflags="-pipe -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfloat-abi=hard \ +- -mfpu=vfp -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated \ +- -Wno-deprecated-declarations -isystem${use_firmware}/opt/vc/include \ ++ platform_cflags+=" -pipe -mabi=aapcs-linux -Wno-psabi \ ++ -Wa,-mno-warn-deprecated -Wno-deprecated-declarations \ ++ -isystem${use_firmware}/opt/vc/include \ + -isystem${use_firmware}/opt/vc/include/interface/vcos/pthreads \ + -isystem${use_firmware}/opt/vc/include/interface/vmcs_host/linux" +- platform_cxxflags="-pipe -mcpu=arm1176jzf-s -mtune=arm1176jzf-s \ +- -mfloat-abi=hard -mfpu=vfp -mabi=aapcs-linux -Wno-psabi \ ++ platform_cxxflags+=" -pipe -mabi=aapcs-linux -Wno-psabi \ + -Wa,-mno-warn-deprecated -Wno-deprecated-declarations \ + -isystem${use_firmware}/opt/vc/include \ + -isystem${use_firmware}/opt/vc/include/interface/vcos/pthreads \ + -isystem${use_firmware}/opt/vc/include/interface/vmcs_host/linux" +- platform_ldflags="-L${use_firmware}/opt/vc/lib -lEGL -lGLESv2 -lbcm_host -lvcos \ ++ platform_ldflags+=" -L${use_firmware}/opt/vc/lib -lEGL -lGLESv2 -lbcm_host -lvcos \ + -lvchiq_arm" + fi + +diff --git a/tools/depends/target/Toolchain.cmake.in b/tools/depends/target/Toolchain.cmake.in +index 943be73..59385e8 100644 +--- a/tools/depends/target/Toolchain.cmake.in ++++ b/tools/depends/target/Toolchain.cmake.in +@@ -1,6 +1,6 @@ + SET(OS "@platform_os@") + SET(CPU "@use_cpu@") +-SET(PLATFORM "@use_platform@") ++SET(PLATFORM "@target_platform@") + IF("${OS}" STREQUAL "linux" OR "${OS}" STREQUAL "android") + SET(CMAKE_SYSTEM_NAME Linux) + ENDIF() +diff --git a/tools/depends/target/Toolchain_binaddons.cmake.in b/tools/depends/target/Toolchain_binaddons.cmake.in +index dc6d565..98494b4 100644 +--- a/tools/depends/target/Toolchain_binaddons.cmake.in ++++ b/tools/depends/target/Toolchain_binaddons.cmake.in +@@ -1,7 +1,7 @@ + set(CMAKE_SYSTEM_VERSION 1) + set(OS "@platform_os@") + set(CPU "@use_cpu@") +-set(PLATFORM "@use_platform@") ++set(PLATFORM "@target_platform@") + if("${OS}" STREQUAL "linux" OR "${OS}" STREQUAL "android") + set(CMAKE_SYSTEM_NAME Linux) + endif() +-- +2.5.0 + + +From a391a55f4d2e257a6716c8726165fe8d205cfffb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 14 Apr 2015 20:51:14 +0100 -Subject: [PATCH] [gui] Also limit GUI updates when in non full-screen video - mode +Subject: [PATCH 45/94] [gui] Also limit GUI updates when in non full-screen + video mode --- xbmc/Application.cpp | 4 +++- @@ -4625,10 +5023,14 @@ index c274e2f..212a5c7 100644 } g_windowManager.FrameMove(); } -From 4a5a77bd0d87ecbbc2f45f6f73a258210def3980 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 1fe321817d24a691808649fd3ee42d81ef57087e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 21 Apr 2015 14:32:07 +0100 -Subject: [PATCH] [mmalrenderer] Add sharpness control +Subject: [PATCH 46/94] [mmalrenderer] Add sharpness control --- addons/resource.language.en_gb/resources/strings.po | 2 +- @@ -4691,7 +5093,7 @@ diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.h b/xbmc/cores/VideoRenderer index d3e5129..a71e645 100644 --- a/xbmc/cores/VideoRenderers/MMALRenderer.h +++ b/xbmc/cores/VideoRenderers/MMALRenderer.h -@@ -119,6 +119,7 @@ class CMMALRenderer : public CBaseRenderer +@@ -119,6 +119,7 @@ protected: RENDER_STEREO_MODE m_display_stereo_mode; bool m_StereoInvert; int m_inflight; @@ -4699,10 +5101,14 @@ index d3e5129..a71e645 100644 CCriticalSection m_sharedSection; MMAL_COMPONENT_T *m_vout; -From 3f78d202fd034e566c44194880cd2a4c4183e947 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 679fdc4c44faf1a24d79ca7e787e756d29206467 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 24 Apr 2015 13:49:51 +0100 -Subject: [PATCH] [dvdplayer] Add back required include +Subject: [PATCH 47/94] [dvdplayer] Add back required include --- xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 1 + @@ -4720,10 +5126,15 @@ index b5777a1..64b4d60 100644 #include "DVDOverlayRenderer.h" #include "guilib/GraphicContext.h" #include -From 9f555729881bf17d4638f61009775ae5e2cfefd3 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 215bed9200f096f6c3eeb8956b19332b9fe5dbd3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 5 May 2015 23:58:06 +0100 -Subject: [PATCH] [screensaver] Leave GUI contents available for screensaver +Subject: [PATCH 48/94] [screensaver] Leave GUI contents available for + screensaver --- xbmc/guilib/GUIWindowManager.cpp | 11 ++++++++++- @@ -4751,11 +5162,15 @@ index 89cfb8b..767c7b6 100644 g_infoManager.SetNextWindow(WINDOW_INVALID); // Add window to the history list (we must do this before we activate it, -From 9f53886de4c8da1af721841f6bdbc8d4e85ad1ef Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 9ecafc23229679c7dedce2c5d6b7bf928cf7db9a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 6 Jun 2015 18:43:57 +0100 -Subject: [PATCH] ffmpeg: Automatic switch to software decode for GMC with more - than one warp point +Subject: [PATCH 49/94] ffmpeg: Automatic switch to software decode for GMC + with more than one warp point --- ...Signal-unsupported-GMC-with-more-than-one.patch | 48 ++++++++++++++++++++++ @@ -4872,7 +5287,7 @@ diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h b/xbmc/cores/dvdplayer/ index e380056..122e539 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h -@@ -160,6 +160,7 @@ class CDemuxStreamVideo : public CDemuxStream +@@ -160,6 +160,7 @@ public: type = STREAM_VIDEO; iOrientation = 0; iBitsPerPixel = 0; @@ -4880,7 +5295,7 @@ index e380056..122e539 100644 } virtual ~CDemuxStreamVideo() {} -@@ -176,6 +177,7 @@ class CDemuxStreamVideo : public CDemuxStream +@@ -176,6 +177,7 @@ public: int iOrientation; // orientation of the video in degress counter clockwise int iBitsPerPixel; std::string stereo_mode; // expected stereo mode @@ -4933,7 +5348,7 @@ diff --git a/xbmc/cores/dvdplayer/DVDStreamInfo.h b/xbmc/cores/dvdplayer/DVDStre index c0e22a2..3849993 100644 --- a/xbmc/cores/dvdplayer/DVDStreamInfo.h +++ b/xbmc/cores/dvdplayer/DVDStreamInfo.h -@@ -73,6 +73,7 @@ class CDVDStreamInfo +@@ -73,6 +73,7 @@ public: int bitsperpixel; int pid; std::string stereo_mode; // stereoscopic 3d mode @@ -4967,17 +5382,21 @@ index 7251fc1..3429cea 100644 supported = true; else if ((hint.codec == AV_CODEC_ID_VC1 || hint.codec == AV_CODEC_ID_WMV3) && g_RBP.GetCodecWvc1()) supported = true; -From 62030ac330f5e95b2bb333021897f0d88ac4cc0e Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 76bbd617017c090bc0c9bb39946066a16cf2f34c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 22 Jun 2015 21:46:57 +0100 -Subject: [PATCH] [rbp] Use default resampling setting on Pi2 +Subject: [PATCH 50/94] [rbp] Use default resampling setting on Pi2 --- system/settings/rbp2.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/system/settings/rbp2.xml b/system/settings/rbp2.xml -index 8cc8f19..52778ecd 100644 +index 8cc8f19..52778ec 100644 --- a/system/settings/rbp2.xml +++ b/system/settings/rbp2.xml @@ -23,6 +23,11 @@ @@ -4992,10 +5411,14 @@ index 8cc8f19..52778ecd 100644
-From b8a4604577c8cc6e7361128fc276347dd96b7733 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 70d4f7303dea5456c7e1683a9f30ef3b89832612 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 10 Mar 2016 17:54:59 +0000 -Subject: [PATCH] rbp: Expose gpu memory allocation functions +Subject: [PATCH 51/94] rbp: Expose gpu memory allocation functions --- xbmc/linux/RBP.cpp | 116 ++++++++++++ @@ -5175,7 +5598,7 @@ index db2fade..ab24bbe 100644 class CRBP { public: -@@ -66,6 +80,7 @@ class CRBP +@@ -66,6 +80,7 @@ public: void WaitVsync(); double AdjustHDMIClock(double adjust); double GetAdjustHDMIClock() { return m_last_pll_adjust; } @@ -5183,7 +5606,7 @@ index db2fade..ab24bbe 100644 private: DllBcmHost *m_DllBcmHost; -@@ -83,6 +98,7 @@ class CRBP +@@ -83,6 +98,7 @@ private: class DllLibOMXCore; CCriticalSection m_critSection; double m_last_pll_adjust; @@ -5657,10 +6080,14 @@ index 0000000..94e6e79 + +#endif /* __USER_VCSM__H__INCLUDED__ */ + -From aea67bb43ee0f8ac00c40c541520250e53b429f2 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 9910d8fb2c3e0273d9e272920e6fd7b1c48b28ec Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 10 Mar 2016 17:56:11 +0000 -Subject: [PATCH] [rbp] HW mouse pointer +Subject: [PATCH 52/94] [rbp] HW mouse pointer Updating the mouse point provokes a complete screen update which can make it feel laggy and results in high cpu. @@ -5881,7 +6308,7 @@ diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h index ab24bbe..2eee35d 100644 --- a/xbmc/linux/RBP.h +++ b/xbmc/linux/RBP.h -@@ -99,6 +99,15 @@ class CRBP +@@ -99,6 +99,15 @@ private: CCriticalSection m_critSection; double m_last_pll_adjust; int m_mb; @@ -6077,7 +6504,7 @@ index a17e987..23244a2 100644 class CWinEventsLinux : public IWinEvents { -@@ -43,6 +44,16 @@ class CWinEventsLinux : public IWinEvents +@@ -43,6 +44,16 @@ public: private: static bool m_initialized; static CLinuxInputDevices m_devices; @@ -6094,10 +6521,14 @@ index a17e987..23244a2 100644 }; #endif -From 499ac171bb8804bd2627a74f25bcdc5cb3b4bc5d Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From ad1619a742ebf4e5ac70f1e30877a1ff0e035ac2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 2 Aug 2014 17:48:04 +0100 -Subject: [PATCH] [omx] Report decoded image name +Subject: [PATCH 53/94] [omx] Report decoded image name --- xbmc/cores/omxplayer/OMXImage.cpp | 1 + @@ -6115,11 +6546,15 @@ index 1524214..a01c435 100644 } else { -From 8ddf6074bbfb0f1fb727e069467d9cecde625343 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 9ddc7a2bc142caee6322e5cf709e47c87ce3c182 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 11 Apr 2014 16:12:27 +0100 -Subject: [PATCH] [omxplayer] Add ability to log more timestamp info in extra - debug settings +Subject: [PATCH 54/94] [omxplayer] Add ability to log more timestamp info in + extra debug settings --- addons/resource.language.en_gb/resources/strings.po | 5 +++++ @@ -6268,10 +6703,14 @@ index 22b8459..8045a03 100644 } void CAdvancedSettings::setExtraLogLevel(const std::vector &components) -From 3c6bfac3696f081191678d1257e3d8f28b24c95f Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From f72277b8b4cb29365ad55a8e6d08dd73262b8423 Mon Sep 17 00:00:00 2001 From: Memphiz Date: Tue, 18 Nov 2014 13:28:36 +0100 -Subject: [PATCH] - evaluate the setting for hiding watched +Subject: [PATCH 55/94] - evaluate the setting for hiding watched movies/episodes/musicvideos in recently added job (should influence homescreen of skins only) @@ -6383,7 +6822,7 @@ diff --git a/xbmc/video/VideoDatabase.h b/xbmc/video/VideoDatabase.h index 2021dd9..5f67d10 100644 --- a/xbmc/video/VideoDatabase.h +++ b/xbmc/video/VideoDatabase.h -@@ -693,9 +693,9 @@ class CVideoDatabase : public CDatabase +@@ -693,9 +693,9 @@ public: bool GetEpisodesNav(const std::string& strBaseDir, CFileItemList& items, int idGenre=-1, int idYear=-1, int idActor=-1, int idDirector=-1, int idShow=-1, int idSeason=-1, const SortDescription &sortDescription = SortDescription()); bool GetMusicVideosNav(const std::string& strBaseDir, CFileItemList& items, int idGenre=-1, int idYear=-1, int idArtist=-1, int idDirector=-1, int idStudio=-1, int idAlbum=-1, int idTag=-1, const SortDescription &sortDescription = SortDescription()); @@ -6396,10 +6835,14 @@ index 2021dd9..5f67d10 100644 bool HasContent(); bool HasContent(VIDEODB_CONTENT_TYPE type); -From 8e03571c814cd16ae2a32d7c5ce37078734d871d Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 50ca0e3e5e048055865c0e89f50e5293db9f95b2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 7 May 2015 14:28:37 +0100 -Subject: [PATCH] build: Add vcsm lib +Subject: [PATCH 56/94] build: Add vcsm lib --- configure.ac | 2 +- @@ -6418,11 +6861,15 @@ index 7a06a31..239a2a1 100644 else AC_CHECK_LIB([EGL], [main],, AC_MSG_ERROR($missing_library)) AC_CHECK_LIB([GLESv2],[main],, AC_MSG_ERROR($missing_library)) -From 9710e21f10846bad03639d788f59593aadafb4ed Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From da10dd6464f3bce3ed9f515baa0eed44c2775d9f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 8 May 2015 14:09:31 +0100 -Subject: [PATCH] [cec] re-implement 'RFC' style POLLing for LA registering - process +Subject: [PATCH 57/94] [cec] re-implement 'RFC' style POLLing for LA + registering process --- ...t-RFC-style-POLLing-for-LA-registering-pr.patch | 194 +++++++++++++++++++++ @@ -6642,10 +7089,14 @@ index ddf9963..5d1f933 100644 cd $(PLATFORM)/build; $(CMAKE) -DBUILD_SHARED_LIBS=1 -DSKIP_PYTHON_WRAPPER:STRING=1 -DCMAKE_INSTALL_LIBDIR=$(PREFIX)/lib .. $(LIBDYLIB): $(PLATFORM) -From 44cef9d4312ed30c96b24a85a6980318c036d0f5 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 390171edbbd26e7763b5989d9793ec508e6a2e8f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 7 May 2015 15:35:43 +0100 -Subject: [PATCH] ffmpeg: test: increase number of threads +Subject: [PATCH 58/94] ffmpeg: test: increase number of threads --- xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 3 +++ @@ -6665,10 +7116,14 @@ index 3498503..c2f3287 100644 if( num_threads > 1) m_pCodecContext->thread_count = num_threads; m_pCodecContext->thread_safe_callbacks = 1; -From b73a054068ac03f6e65f6ed559b8f9d2a3a8d5ff Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 3234bb00454e29cbfcfb36011d0a85fcb2891235 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 22 May 2015 13:56:29 +0100 -Subject: [PATCH] ffmpeg: Allow neon to be enabled in unified builds +Subject: [PATCH 59/94] ffmpeg: Allow neon to be enabled in unified builds --- tools/depends/target/ffmpeg/Makefile | 4 ++++ @@ -6690,10 +7145,15 @@ index 6a9f105..fef5ef2 100644 endif ifeq ($(OS), linux) ffmpg_config += --target-os=$(OS) --cpu=$(CPU) -From 541c085a991610efe5258b4eab31d1fcbea67c9a Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 6942378a95385798c8fe53d0480cddee6a5ad3b8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 5 Mar 2015 20:00:59 +0000 -Subject: [PATCH] [ffmpmeg] Discard data before VO/VOL in mpeg-4 over mpegts +Subject: [PATCH 60/94] [ffmpmeg] Discard data before VO/VOL in mpeg-4 over + mpegts --- ...-data-before-VO-VOL-in-mpeg-4-over-mpegts.patch | 69 ++++++++++++++++++++++ @@ -6798,10 +7258,14 @@ index fef5ef2..e780521 100644 cd $(PLATFORM);\ CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \ ./configure $(ffmpg_config) -From 9b44a82266b1c68388206b0b963c0483e2b1f25b Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 3c407f5763ef0302d8cdaf7fae59e963555517e3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 27 Feb 2015 14:37:27 +0000 -Subject: [PATCH] ffmpeg: Add some upstream HEVC optimisations +Subject: [PATCH 61/94] ffmpeg: Add some upstream HEVC optimisations --- tools/depends/target/ffmpeg/Makefile | 6 +- @@ -10584,10 +11048,14 @@ index 0000000..5e8e07d +-- +2.5.0 + -From 9950c711b222577d755847c188b26d7f92944561 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 1d2a77c2e92160fb532fc21c53f712cf1ffc3701 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 7 May 2015 14:04:18 +0100 -Subject: [PATCH] [ffmpeg] Add GPU acceleration to hevc +Subject: [PATCH 62/94] [ffmpeg] Add GPU acceleration to hevc --- tools/depends/target/ffmpeg/Makefile | 4 +- @@ -47295,10 +47763,14 @@ index 0000000..f2b8ffc +-- +2.5.0 + -From 102d10e79b164ff891130f6d694662d062a76219 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 9f7e6280af3292b27e4bdcd5e9e8a51eee261521 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Dec 2015 12:35:14 +0000 -Subject: [PATCH] [build] Add patches to ffmpeg for native build +Subject: [PATCH 63/94] [build] Add patches to ffmpeg for native build --- tools/depends/target/ffmpeg/autobuild.sh | 8 ++++++++ @@ -47323,10 +47795,14 @@ index b9bfd57..f6d4c3b 100755 CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" \ ./configure --prefix=$FFMPEG_PREFIX \ --extra-version="kodi-${VERSION}" \ -From fb9bc934858656128ef500f2d4078489b84030b8 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From b525cc97c0f168cc16849c87ec91234ea05ddd13 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 12 Jan 2016 16:29:57 +0000 -Subject: [PATCH] ffmpeg: Add cabac opimisations for hevc +Subject: [PATCH 64/94] ffmpeg: Add cabac opimisations for hevc --- .../0001-Squashed-commit-of-the-following.patch | 2288 ++++++++++++++++++++ @@ -49658,10 +50134,93 @@ index e4acfa9..072e711 100644 cd $(PLATFORM);\ CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \ -From 56e531b1a6fbe9b7cb67afe9249586438b60328d Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 4ba5e77ceafc42f8307d5611d59efe5065df16fa Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Tue, 14 Jul 2015 08:30:44 +0200 +Subject: [PATCH 65/94] fix high cpu load caused by false positive frame + limiter + +--- + xbmc/Application.cpp | 20 +++++++++----------- + 1 file changed, 9 insertions(+), 11 deletions(-) + +diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp +index 212a5c7..1adbb01 100644 +--- a/xbmc/Application.cpp ++++ b/xbmc/Application.cpp +@@ -1902,7 +1902,7 @@ void CApplication::Render() + + bool hasRendered = false; + bool limitFrames = false; +- unsigned int singleFrameTime = 10; // default limit 100 fps ++ unsigned int singleFrameTime = 40; // default limit 25 fps + bool vsync = true; + + // Whether externalplayer is playing and we're unfocused +@@ -1916,24 +1916,22 @@ void CApplication::Render() + if (!extPlayerActive && g_graphicsContext.IsFullScreenVideo() && !m_pPlayer->IsPausedPlayback()) + { + m_bPresentFrame = g_renderManager.HasFrame(); +- if (vsync_mode == VSYNC_DISABLED) +- vsync = false; + } + else + { + // engage the frame limiter as needed + limitFrames = lowfps || extPlayerActive; +- // DXMERGE - we checked for g_videoConfig.GetVSyncMode() before this +- // perhaps allowing it to be set differently than the UI option?? ++ ++ // TODO: ++ // remove those useless modes, they don't do any good + if (vsync_mode == VSYNC_DISABLED || vsync_mode == VSYNC_VIDEO) + { + limitFrames = true; // not using vsync. +- vsync = false; ++ singleFrameTime = 10; + } +- else if ((g_infoManager.GetFPS() > g_graphicsContext.GetFPS() + 10) && g_infoManager.GetFPS() > 1000.0f / singleFrameTime) ++ else if ((g_infoManager.GetFPS() > g_graphicsContext.GetFPS() + 10) && g_infoManager.GetFPS() > 100.0f) + { + limitFrames = true; // using vsync, but it isn't working. +- vsync = false; + } + + if (limitFrames) +@@ -1957,7 +1955,10 @@ void CApplication::Render() + else if (vsync_mode == VSYNC_ALWAYS) + g_Windowing.SetVSync(true); + else if (vsync_mode != VSYNC_DRIVER) ++ { + g_Windowing.SetVSync(false); ++ vsync = false; ++ } + + if (m_bPresentFrame && m_pPlayer->IsPlaying() && !m_pPlayer->IsPaused()) + ResetScreenSaver(); +@@ -2025,9 +2026,6 @@ void CApplication::Render() + //fps limiter, make sure each frame lasts at least singleFrameTime milliseconds + if (limitFrames || !(flip || m_bPresentFrame)) + { +- if (!limitFrames) +- singleFrameTime = 40; //if not flipping, loop at 25 fps +- + unsigned int frameTime = now - m_lastFrameTime; + if (frameTime < singleFrameTime) + Sleep(singleFrameTime - frameTime); +-- +2.5.0 + + +From 488f86f0dc3a9a986c4535697827ad656d8fedf1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 5 Aug 2015 13:43:25 +0100 -Subject: [PATCH] [dvdplayeraudio] Avoid busy spinning when queue is empty +Subject: [PATCH 66/94] [dvdplayeraudio] Avoid busy spinning when queue is + empty --- xbmc/cores/dvdplayer/DVDPlayerAudio.cpp | 2 ++ @@ -49680,10 +50239,14 @@ index 97a23a6..9f21a19 100644 } continue; -From 9ca8d9d2b8799f4c9c6ebce05b815d34a086ba13 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 05a5655c10b72fc3f9da1a7b91e077bb4eee0c50 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 6 Aug 2015 11:23:05 +0100 -Subject: [PATCH] [rbp] Make sync playback to display the default option +Subject: [PATCH 67/94] [rbp] Make sync playback to display the default option --- system/settings/rbp.xml | 7 +++++++ @@ -49707,11 +50270,15 @@ index 1506035..f2a6892 100644 false -From 1aa08c1f2360c42cdcb4cc21d28b5dd701fca571 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 3f638db8e9c0eed4dc2d53007c76b6ac48cb7a95 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 8 Sep 2015 23:42:30 +0100 -Subject: [PATCH] [cec] Fixing initialisation issue found on Raspberry Pi with - Buildroot +Subject: [PATCH 68/94] [cec] Fixing initialisation issue found on Raspberry Pi + with Buildroot --- tools/depends/target/libcec/Makefile | 1 + @@ -49761,11 +50328,15 @@ index 0000000..8f289f2 + { + m_queue = new CRPiCECAdapterMessageQueue(this); + } -From ee6c60cdfb97ea162c07430f349fe17bf826d17a Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 6ddb38f37c38455d28d9caa357b597b4b9d327e4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 9 Dec 2015 13:31:14 +0000 -Subject: [PATCH] [mmalcodec] Fail to open when width is invalid. Can happen - with mpegts files +Subject: [PATCH 69/94] [mmalcodec] Fail to open when width is invalid. Can + happen with mpegts files --- xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 4 ++++ @@ -49786,11 +50357,264 @@ index 3345685..5386b4a 100644 // we always qualify even if DVDFactoryCodec does this too. if (!CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_USEMMAL) || hints.software) return false; -From 0c6232841ddc2caaf3f17c6866ed48d880421b38 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 9bfbe66e6e477429af4b3ab01f5b3bf4f10ee221 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 21 Dec 2015 18:34:06 +0000 +Subject: [PATCH 70/94] [mmalrender] Force a SetVideoRect after a reconfigure + +There has been an issue with dvd stills and a hdmi refresh rate change. +The hdmi mode change loses the currently displayed picture. +Not an issue for normal video playback as another picture will be along soon. +Not the case in DVD menus. + +SetVideoRect makes the last picture redisplay and so fixes up the menu. +--- + xbmc/cores/VideoRenderers/MMALRenderer.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +index adf6f73..ad3f66f 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +@@ -286,6 +286,10 @@ bool CMMALRenderer::Configure(unsigned int width, unsigned int height, unsigned + m_fps = fps; + m_iFlags = flags; + ++ // cause SetVideoRect to trigger - needed after a hdmi mode change ++ m_src_rect.SetRect(0, 0, 0, 0); ++ m_dst_rect.SetRect(0, 0, 0, 0); ++ + CLog::Log(LOGDEBUG, "%s::%s - %dx%d->%dx%d@%.2f flags:%x format:%d ext:%x orient:%d", CLASSNAME, __func__, width, height, d_width, d_height, fps, flags, format, extended_format, orientation); + if (format != RENDER_FMT_YUV420P && format != RENDER_FMT_BYPASS && format != RENDER_FMT_MMAL) + { +-- +2.5.0 + + +From 138c0d96b6f9979a304f4d3e087f8659717b2471 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 31 Mar 2015 17:31:47 +0100 +Subject: [PATCH 71/94] mmalcodec: Add SetCodecControl function + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 10 +++++++++- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 2 ++ + 2 files changed, 11 insertions(+), 1 deletion(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +index 5386b4a..799b708 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +@@ -130,6 +130,7 @@ CMMALVideo::CMMALVideo() + m_speed = DVD_PLAYSPEED_NORMAL; + m_fps = 0.0f; + m_num_decoded = 0; ++ m_codecControlFlags = 0; + } + + CMMALVideo::~CMMALVideo() +@@ -875,7 +876,7 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) + } + + if (g_advancedSettings.CanLogComponent(LOGVIDEO)) +- CLog::Log(LOGDEBUG, "%s::%s - ret(%x) pics(%d) inputs(%d) slept(%d) queued(%.2f) (%.2f:%.2f) full(%d)", CLASSNAME, __func__, ret, m_output_ready.size(), mmal_queue_length(m_dec_input_pool->queue), slept, queued*1e-6, m_demuxerPts*1e-6, m_decoderPts*1e-6, full); ++ CLog::Log(LOGDEBUG, "%s::%s - ret(%x) pics(%d) inputs(%d) slept(%d) queued(%.2f) (%.2f:%.2f) full(%d) flags(%x)", CLASSNAME, __func__, ret, m_output_ready.size(), mmal_queue_length(m_dec_input_pool->queue), slept, queued*1e-6, m_demuxerPts*1e-6, m_decoderPts*1e-6, full, m_codecControlFlags); + + return ret; + } +@@ -939,6 +940,7 @@ void CMMALVideo::Reset(void) + } + m_decoderPts = DVD_NOPTS_VALUE; + m_demuxerPts = DVD_NOPTS_VALUE; ++ m_codecControlFlags = 0; + } + + void CMMALVideo::SetSpeed(int iSpeed) +@@ -1049,3 +1051,9 @@ bool CMMALVideo::GetCodecStats(double &pts, int &droppedPics) + droppedPics= -1; + return false; + } ++ ++void CMMALVideo::SetCodecControl(int flags) ++{ ++ CSingleLock lock(m_sharedSection); ++ m_codecControlFlags = flags; ++} +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +index f4df09c..37d0868 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +@@ -79,6 +79,7 @@ public: + virtual void SetDropState(bool bDrop); + virtual const char* GetName(void) { return m_pFormatName ? m_pFormatName:"mmal-xxx"; } + virtual bool GetCodecStats(double &pts, int &droppedPics); ++ virtual void SetCodecControl(int flags); + virtual void SetSpeed(int iSpeed); + + // MMAL decoder callback routines. +@@ -121,6 +122,7 @@ protected: + double m_demuxerPts; + double m_decoderPts; + int m_speed; ++ int m_codecControlFlags; + + CCriticalSection m_sharedSection; + MMAL_COMPONENT_T *m_dec; +-- +2.5.0 + + +From db15bb3280518a33c1a67864e126a44b87767047 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 27 Dec 2015 18:44:22 +0000 +Subject: [PATCH 72/94] mmalcodec: Switch to a condition variable when blocking + waiting for a picture + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 38 ++++++++++++---------- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 3 +- + 2 files changed, 23 insertions(+), 18 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +index 799b708..3579966 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +@@ -102,7 +102,6 @@ CMMALVideo::CMMALVideo() + { + if (g_advancedSettings.CanLogComponent(LOGVIDEO)) + CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, this); +- pthread_mutex_init(&m_output_mutex, NULL); + + m_decoded_width = 0; + m_decoded_height = 0; +@@ -141,7 +140,6 @@ CMMALVideo::~CMMALVideo() + Dispose(); + + CSingleLock lock(m_sharedSection); +- pthread_mutex_destroy(&m_output_mutex); + + if (m_deint && m_deint->control && m_deint->control->is_enabled) + mmal_port_disable(m_deint->control); +@@ -285,9 +283,11 @@ void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf + omvb->width = m_decoded_width; + omvb->height = m_decoded_height; + omvb->m_aspect_ratio = m_aspect_ratio; +- pthread_mutex_lock(&m_output_mutex); +- m_output_ready.push(omvb); +- pthread_mutex_unlock(&m_output_mutex); ++ { ++ CSingleLock lock(m_output_mutex); ++ m_output_ready.push(omvb); ++ m_output_cond.notifyAll(); ++ } + kept = true; + } + } +@@ -867,7 +867,8 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) + { + // otherwise we busy spin + CSingleExit unlock(m_sharedSection); +- Sleep(10); ++ CSingleLock lock(m_output_mutex); ++ m_output_cond.wait(lock, 10); + } + if (!m_output_ready.empty()) + ret |= VC_PICTURE; +@@ -916,14 +917,16 @@ void CMMALVideo::Reset(void) + while (1) + { + CMMALVideoBuffer *buffer = NULL; +- pthread_mutex_lock(&m_output_mutex); +- // fetch a output buffer and pop it off the ready list +- if (!m_output_ready.empty()) + { +- buffer = m_output_ready.front(); +- m_output_ready.pop(); ++ CSingleLock lock(m_output_mutex); ++ // fetch a output buffer and pop it off the ready list ++ if (!m_output_ready.empty()) ++ { ++ buffer = m_output_ready.front(); ++ m_output_ready.pop(); ++ } ++ m_output_cond.notifyAll(); + } +- pthread_mutex_unlock(&m_output_mutex); + if (buffer) + { + buffer->Acquire(); +@@ -984,11 +987,12 @@ bool CMMALVideo::GetPicture(DVDVideoPicture* pDvdVideoPicture) + { + CMMALVideoBuffer *buffer; + // fetch a output buffer and pop it off the ready list +- pthread_mutex_lock(&m_output_mutex); +- buffer = m_output_ready.front(); +- m_output_ready.pop(); +- pthread_mutex_unlock(&m_output_mutex); +- ++ { ++ CSingleLock lock(m_output_mutex); ++ buffer = m_output_ready.front(); ++ m_output_ready.pop(); ++ m_output_cond.notifyAll(); ++ } + assert(buffer->mmal_buffer); + memset(pDvdVideoPicture, 0, sizeof *pDvdVideoPicture); + pDvdVideoPicture->format = RENDER_FMT_MMAL; +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +index 37d0868..ca28c6f 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +@@ -105,7 +105,8 @@ protected: + const char *m_pFormatName; + + // mmal output buffers (video frames) +- pthread_mutex_t m_output_mutex; ++ CCriticalSection m_output_mutex; ++ XbmcThreads::ConditionVariable m_output_cond; + std::queue m_output_ready; + + // initialize mmal and get decoder component +-- +2.5.0 + + +From 426d5fc36b57594a4cc77985bc9ad78746e0e502 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sat, 16 Jan 2016 16:46:03 +0000 +Subject: [PATCH 73/94] omxaudio: Avoid reporting a spurious cached value + +Avoids seek bar showing zero after a seek +--- + xbmc/cores/omxplayer/OMXAudio.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp +index 70d0866..052b5ef 100644 +--- a/xbmc/cores/omxplayer/OMXAudio.cpp ++++ b/xbmc/cores/omxplayer/OMXAudio.cpp +@@ -1335,7 +1335,7 @@ float COMXAudio::GetDelay() + if (m_last_pts != DVD_NOPTS_VALUE && m_av_clock) + stamp = m_av_clock->OMXMediaTime(); + // if possible the delay is current media time - time of last submitted packet +- if (stamp != DVD_NOPTS_VALUE) ++ if (stamp != DVD_NOPTS_VALUE && stamp != 0.0) + { + ret = (m_last_pts - stamp) * (1.0 / DVD_TIME_BASE); + } +-- +2.5.0 + + +From 87509c4cfa3ce6f9a4239cee724ab254ba2a3d3b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 21 Dec 2015 22:17:25 +0000 -Subject: [PATCH] [omximage] Fall back to arm jpeg encode/decode when gpu is - busy +Subject: [PATCH 74/94] [omximage] Fall back to arm jpeg encode/decode when gpu + is busy --- xbmc/cores/omxplayer/OMXImage.cpp | 50 ++++++++++++++++++++++++++++++++------- @@ -49975,7 +50799,7 @@ diff --git a/xbmc/cores/omxplayer/OMXImage.h b/xbmc/cores/omxplayer/OMXImage.h index a93aa82..6f38dbc 100644 --- a/xbmc/cores/omxplayer/OMXImage.h +++ b/xbmc/cores/omxplayer/OMXImage.h -@@ -133,6 +133,7 @@ class COMXImageDec +@@ -133,6 +133,7 @@ protected: OMX_PARAM_PORTDEFINITIONTYPE m_decoded_format; CCriticalSection m_OMXSection; bool m_success; @@ -49983,7 +50807,7 @@ index a93aa82..6f38dbc 100644 }; class COMXImageEnc -@@ -144,6 +145,7 @@ class COMXImageEnc +@@ -144,6 +145,7 @@ public: // Required overrides bool CreateThumbnailFromSurface(unsigned char* buffer, unsigned int width, unsigned int height, unsigned int format, unsigned int pitch, const std::string& destFile); @@ -49991,7 +50815,7 @@ index a93aa82..6f38dbc 100644 protected: bool Encode(unsigned char *buffer, int size, unsigned int width, unsigned int height, unsigned int pitch); // Components -@@ -152,6 +154,7 @@ class COMXImageEnc +@@ -152,6 +154,7 @@ protected: OMX_PARAM_PORTDEFINITIONTYPE m_encoded_format; CCriticalSection m_OMXSection; bool m_success; @@ -49999,7 +50823,7 @@ index a93aa82..6f38dbc 100644 }; class COMXImageReEnc -@@ -163,6 +166,7 @@ class COMXImageReEnc +@@ -163,6 +166,7 @@ public: // Required overrides void Close(); bool ReEncode(COMXImageFile &srcFile, unsigned int width, unsigned int height, void * &pDestBuffer, unsigned int &nDestSize); @@ -50007,7 +50831,7 @@ index a93aa82..6f38dbc 100644 protected: bool HandlePortSettingChange(unsigned int resize_width, unsigned int resize_height, int orientation, bool port_settings_changed); // Components -@@ -176,6 +180,7 @@ class COMXImageReEnc +@@ -176,6 +180,7 @@ protected: void *m_pDestBuffer; unsigned int m_nDestAllocSize; bool m_success; @@ -50015,7 +50839,7 @@ index a93aa82..6f38dbc 100644 }; class COMXTexture -@@ -187,6 +192,7 @@ class COMXTexture +@@ -187,6 +192,7 @@ public: // Required overrides void Close(void); bool Decode(const uint8_t *data, unsigned size, unsigned int width, unsigned int height, void *egl_image); @@ -50023,7 +50847,7 @@ index a93aa82..6f38dbc 100644 protected: bool HandlePortSettingChange(unsigned int resize_width, unsigned int resize_height, void *egl_image, bool port_settings_changed); -@@ -201,6 +207,7 @@ class COMXTexture +@@ -201,6 +207,7 @@ protected: OMX_BUFFERHEADERTYPE *m_egl_buffer; CCriticalSection m_OMXSection; bool m_success; @@ -50031,10 +50855,138 @@ index a93aa82..6f38dbc 100644 }; extern COMXImage g_OMXImage; -From 47df934cc713ef7921c612fbb2d42a14c53df618 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 0fea3baccdb25c562be89bd1c69f464bce182f6f Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sat, 2 Jan 2016 18:08:16 +0000 +Subject: [PATCH 75/94] [mmalcodec] Don't send zero sized extradata + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +index 3579966..0f5c1b7 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +@@ -501,7 +501,7 @@ bool CMMALVideo::SendCodecConfigData() + { + CSingleLock lock(m_sharedSection); + MMAL_STATUS_T status; +- if (!m_dec_input_pool) ++ if (!m_dec_input_pool || !m_hints.extrasize) + return true; + // send code config data + MMAL_BUFFER_HEADER_T *buffer = mmal_queue_timedwait(m_dec_input_pool->queue, 500); +-- +2.5.0 + + +From 49f0bbf2f288d4d2f51db8f55d10268c78afdbfe Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 3 Jan 2016 19:12:16 +0000 +Subject: [PATCH 76/94] stereoscopicmanager: Ensure we don't have a stale value + of videoplayer stereoscopic mode + +--- + xbmc/guilib/StereoscopicsManager.cpp | 30 +++++++++++++++++++++--------- + xbmc/guilib/StereoscopicsManager.h | 2 ++ + 2 files changed, 23 insertions(+), 9 deletions(-) + +diff --git a/xbmc/guilib/StereoscopicsManager.cpp b/xbmc/guilib/StereoscopicsManager.cpp +index d9e0fa4..4942f01 100644 +--- a/xbmc/guilib/StereoscopicsManager.cpp ++++ b/xbmc/guilib/StereoscopicsManager.cpp +@@ -140,12 +140,7 @@ void CStereoscopicsManager::SetStereoMode(const RENDER_STEREO_MODE &mode) + + // resolve automatic mode before applying + if (mode == RENDER_STEREO_MODE_AUTO) +- { +- if (g_infoManager.EvaluateBool("videoplayer.isstereoscopic")) +- applyMode = GetStereoModeOfPlayingVideo(); +- else +- applyMode = RENDER_STEREO_MODE_OFF; +- } ++ applyMode = GetStereoModeOfPlayingVideo(); + + if (applyMode != currentMode && applyMode >= RENDER_STEREO_MODE_OFF) + { +@@ -209,7 +204,7 @@ RENDER_STEREO_MODE CStereoscopicsManager::GetStereoModeByUserChoice(const std::s + { + RENDER_STEREO_MODE mode = GetStereoMode(); + // if no stereo mode is set already, suggest mode of current video by preselecting it +- if (mode == RENDER_STEREO_MODE_OFF && g_infoManager.EvaluateBool("videoplayer.isstereoscopic")) ++ if (mode == RENDER_STEREO_MODE_OFF) + mode = GetStereoModeOfPlayingVideo(); + + CGUIDialogSelect* pDlgSelect = (CGUIDialogSelect*)g_windowManager.GetWindow(WINDOW_DIALOG_SELECT); +@@ -254,8 +249,8 @@ RENDER_STEREO_MODE CStereoscopicsManager::GetStereoModeByUserChoice(const std::s + RENDER_STEREO_MODE CStereoscopicsManager::GetStereoModeOfPlayingVideo(void) + { + RENDER_STEREO_MODE mode = RENDER_STEREO_MODE_OFF; ++ std::string playerMode = GetVideoStereoMode(); + +- std::string playerMode = g_infoManager.GetLabel(VIDEOPLAYER_STEREOSCOPIC_MODE); + if (!playerMode.empty()) + { + int convertedMode = ConvertVideoToGuiStereoMode(playerMode); +@@ -504,6 +499,23 @@ void CStereoscopicsManager::ApplyStereoMode(const RENDER_STEREO_MODE &mode, bool + } + } + ++std::string CStereoscopicsManager::GetVideoStereoMode() ++{ ++ std::string playerMode; ++ if (g_application.m_pPlayer->IsPlaying()) ++ { ++ SPlayerVideoStreamInfo videoInfo; ++ g_application.m_pPlayer->GetVideoStreamInfo(videoInfo); ++ playerMode = videoInfo.stereoMode; ++ } ++ return playerMode; ++} ++ ++bool CStereoscopicsManager::IsVideoStereoscopic() ++{ ++ return !GetVideoStereoMode().empty(); ++} ++ + void CStereoscopicsManager::OnPlaybackStarted(void) + { + STEREOSCOPIC_PLAYBACK_MODE playbackMode = (STEREOSCOPIC_PLAYBACK_MODE) CSettings::GetInstance().GetInt(CSettings::SETTING_VIDEOPLAYER_STEREOSCOPICPLAYBACKMODE); +@@ -513,7 +525,7 @@ void CStereoscopicsManager::OnPlaybackStarted(void) + if (playbackMode == STEREOSCOPIC_PLAYBACK_MODE_IGNORE && mode == RENDER_STEREO_MODE_OFF) + return; + +- if (!g_infoManager.EvaluateBool("videoplayer.isstereoscopic")) ++ if (!CStereoscopicsManager::IsVideoStereoscopic()) + { + // exit stereo mode if started item is not stereoscopic + // and if user prefers to stop 3D playback when movie is finished +diff --git a/xbmc/guilib/StereoscopicsManager.h b/xbmc/guilib/StereoscopicsManager.h +index ec2310f..f090bb9 100644 +--- a/xbmc/guilib/StereoscopicsManager.h ++++ b/xbmc/guilib/StereoscopicsManager.h +@@ -92,6 +92,8 @@ private: + void ApplyStereoMode(const RENDER_STEREO_MODE &mode, bool notify = true); + void OnPlaybackStarted(void); + void OnPlaybackStopped(void); ++ std::string GetVideoStereoMode(); ++ bool IsVideoStereoscopic(); + + RENDER_STEREO_MODE m_stereoModeSetByUser; + RENDER_STEREO_MODE m_lastStereoModeSetByUser; +-- +2.5.0 + + +From 7399f59303833e2f6442e67e2d9d4c17adc41e35 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 16 Sep 2015 19:05:12 +0100 -Subject: [PATCH] [3d] Make MVC a valid 3D filename tag +Subject: [PATCH 77/94] [3d] Make MVC a valid 3D filename tag --- xbmc/guilib/StereoscopicsManager.cpp | 9 +++++++++ @@ -50094,10 +51046,14 @@ index 93de9bd..4da88f4 100644 /*!< @brief position behavior of ass subtitiles when setting "subtitle position on screen" set to "fixed" True to show at the fixed position set in video calibration -From 917036937e1e6bcdee5add347e8a9cfc8f571932 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 6cee5258e6f154631e457615c4028b74fd4e5525 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 24 Jan 2016 16:42:04 +0000 -Subject: [PATCH] fixup! [build] Add patches to ffmpeg for native build +Subject: [PATCH 78/94] fixup! [build] Add patches to ffmpeg for native build --- tools/depends/target/ffmpeg/autobuild.sh | 2 +- @@ -50116,337 +51072,1579 @@ index f6d4c3b..cc59d17 100755 CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" \ ./configure --prefix=$FFMPEG_PREFIX \ -From 4c58ea8b09c9f22527263d521589e5842ef2ceea Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From a4f972065465a09a608315605358cfca1088365d Mon Sep 17 00:00:00 2001 From: popcornmix -Date: Mon, 15 Feb 2016 15:50:00 +0000 -Subject: [PATCH] temp: Add lock around mmal and omx calls to avoid stalled - audio issue +Date: Tue, 26 Jan 2016 19:58:30 +0000 +Subject: [PATCH 79/94] OMXAudio: Make use of m_bGotFrame to skip decoding when + full --- - xbmc/cores/VideoRenderers/MMALRenderer.cpp | 1 + - xbmc/cores/VideoRenderers/MMALRenderer.h | 2 +- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 1 + - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 2 +- - xbmc/linux/OMXCore.cpp | 29 ++++++++++++++++++++++ - xbmc/linux/OMXCore.h | 2 ++ - xbmc/linux/RBP.h | 1 + - 7 files changed, 36 insertions(+), 2 deletions(-) + xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) -diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index ad3f66f6..a619448 100644 ---- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -@@ -240,6 +240,7 @@ bool CMMALRenderer::init_vout(ERenderFormat format) +diff --git a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp +index 33c4c6a..b9dab89 100644 +--- a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp ++++ b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp +@@ -158,7 +158,8 @@ int COMXAudioCodecOMX::Decode(BYTE* pData, int iSize, double dts, double pts) + if (!m_pCodecContext) return -1; + + AVPacket avpkt; +- m_bGotFrame = false; ++ if (m_bGotFrame) ++ return 0; + av_init_packet(&avpkt); + avpkt.data = pData; + avpkt.size = iSize; +@@ -257,6 +258,7 @@ int COMXAudioCodecOMX::GetData(BYTE** dst, double &dts, double &pts) + outputSize = 0; + } + } ++ m_bGotFrame = false; + int desired_size = AUDIO_DECODE_OUTPUT_BUFFER * (m_pCodecContext->channels * GetBitsPerSample()) >> (rounded_up_channels_shift[m_pCodecContext->channels] + 4); + + if (m_bFirstFrame) +@@ -274,7 +276,6 @@ int COMXAudioCodecOMX::GetData(BYTE** dst, double &dts, double &pts) + if (m_iBufferOutputUsed + outputSize > desired_size || m_bNoConcatenate) + { + int ret = m_iBufferOutputUsed; +- m_bGotFrame = false; + m_iBufferOutputUsed = 0; + dts = m_dts; + pts = m_pts; +-- +2.5.0 + + +From c6f3b279c5d18c805ae6c3a6e9db8b5680602a61 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 26 Jan 2016 20:01:18 +0000 +Subject: [PATCH 80/94] OMXAudio: Handle GetData before adding the next buffer + so we can be sure it fits + +--- + xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp | 28 ++++++++++++++-------------- + 1 file changed, 14 insertions(+), 14 deletions(-) + +diff --git a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp +index b9dab89..f150dc6 100644 +--- a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp ++++ b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp +@@ -206,12 +206,24 @@ int COMXAudioCodecOMX::GetData(BYTE** dst, double &dts, double &pts) + /* output audio will be packed */ + int outputSize = av_samples_get_buffer_size(&outLineSize, m_pCodecContext->channels, m_pFrame1->nb_samples, m_desiredSampleFormat, 1); + ++ // if this buffer won't fit then flush out what we have ++ int desired_size = AUDIO_DECODE_OUTPUT_BUFFER * (m_pCodecContext->channels * GetBitsPerSample()) >> (rounded_up_channels_shift[m_pCodecContext->channels] + 4); ++ if (m_iBufferOutputUsed && (m_iBufferOutputUsed + outputSize > desired_size || m_bNoConcatenate)) ++ { ++ int ret = m_iBufferOutputUsed; ++ m_iBufferOutputUsed = 0; ++ dts = m_dts; ++ pts = m_pts; ++ *dst = m_pBufferOutput; ++ return ret; ++ } ++ m_frameSize = outputSize; ++ + if (m_iBufferOutputAlloced < m_iBufferOutputUsed + outputSize) + { + m_pBufferOutput = (BYTE*)av_realloc(m_pBufferOutput, m_iBufferOutputUsed + outputSize + FF_INPUT_BUFFER_PADDING_SIZE); + m_iBufferOutputAlloced = m_iBufferOutputUsed + outputSize; + } +- *dst = m_pBufferOutput; + + /* need to convert format */ + if(m_pCodecContext->sample_fmt != m_desiredSampleFormat) +@@ -259,28 +271,16 @@ int COMXAudioCodecOMX::GetData(BYTE** dst, double &dts, double &pts) + } + } + m_bGotFrame = false; +- int desired_size = AUDIO_DECODE_OUTPUT_BUFFER * (m_pCodecContext->channels * GetBitsPerSample()) >> (rounded_up_channels_shift[m_pCodecContext->channels] + 4); + + if (m_bFirstFrame) + { +- CLog::Log(LOGDEBUG, "COMXAudioCodecOMX::GetData size=%d/%d line=%d/%d buf=%p, desired=%d", inputSize, outputSize, inLineSize, outLineSize, *dst, desired_size); ++ CLog::Log(LOGDEBUG, "COMXAudioCodecOMX::GetData size=%d/%d line=%d/%d buf=%p, desired=%d", inputSize, outputSize, inLineSize, outLineSize, m_pBufferOutput, desired_size); + m_bFirstFrame = false; + } + m_iBufferOutputUsed += outputSize; + + if (!m_bNoConcatenate && m_pCodecContext->sample_fmt == AV_SAMPLE_FMT_FLTP && m_frameSize && (int)m_frameSize != outputSize) + CLog::Log(LOGERROR, "COMXAudioCodecOMX::GetData Unexpected change of size (%d->%d)", m_frameSize, outputSize); +- m_frameSize = outputSize; +- +- // if next buffer submitted won't fit then flush it out +- if (m_iBufferOutputUsed + outputSize > desired_size || m_bNoConcatenate) +- { +- int ret = m_iBufferOutputUsed; +- m_iBufferOutputUsed = 0; +- dts = m_dts; +- pts = m_pts; +- return ret; +- } + return 0; } - CMMALRenderer::CMMALRenderer() -+: m_sharedSection(g_RBP.GetLock()) - { - CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); - m_vout = NULL; -diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.h b/xbmc/cores/VideoRenderers/MMALRenderer.h -index a71e645..084d59a 100644 ---- a/xbmc/cores/VideoRenderers/MMALRenderer.h -+++ b/xbmc/cores/VideoRenderers/MMALRenderer.h -@@ -121,7 +121,7 @@ class CMMALRenderer : public CBaseRenderer - int m_inflight; - float m_sharpness; +-- +2.5.0 + + +From 9dbad1bfa2329d5ca5a1d82e3e982a69dbad965d Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 26 Jan 2016 20:03:49 +0000 +Subject: [PATCH 81/94] OMXAudio: Handle changes in decoded audio size + correctly + +--- + xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp +index f150dc6..4956b5b 100644 +--- a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp ++++ b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp +@@ -103,10 +103,6 @@ bool COMXAudioCodecOMX::Open(CDVDStreamInfo &hints) + if (m_pCodecContext->request_channel_layout) + CLog::Log(LOGNOTICE,"COMXAudioCodecOMX::Open() Requesting channel layout of %x", (unsigned)m_pCodecContext->request_channel_layout); -- CCriticalSection m_sharedSection; -+ CCriticalSection &m_sharedSection; - MMAL_COMPONENT_T *m_vout; - MMAL_PORT_T *m_vout_input; - MMAL_POOL_T *m_vout_input_pool; +- // vorbis and wma2v2 have variable sized planar output, so skip concatenation +- if (hints.codec == AV_CODEC_ID_VORBIS || hints.codec == AV_CODEC_ID_WMAV2) +- m_bNoConcatenate = true; +- + if(m_pCodecContext->bits_per_coded_sample == 0) + m_pCodecContext->bits_per_coded_sample = 16; + +@@ -206,12 +202,19 @@ int COMXAudioCodecOMX::GetData(BYTE** dst, double &dts, double &pts) + /* output audio will be packed */ + int outputSize = av_samples_get_buffer_size(&outLineSize, m_pCodecContext->channels, m_pFrame1->nb_samples, m_desiredSampleFormat, 1); + ++ if (!m_bNoConcatenate && m_iBufferOutputUsed && (int)m_frameSize != outputSize) ++ { ++ CLog::Log(LOGERROR, "COMXAudioCodecOMX::GetData Unexpected change of size (%d->%d)", m_frameSize, outputSize); ++ m_bNoConcatenate = true; ++ } ++ + // if this buffer won't fit then flush out what we have + int desired_size = AUDIO_DECODE_OUTPUT_BUFFER * (m_pCodecContext->channels * GetBitsPerSample()) >> (rounded_up_channels_shift[m_pCodecContext->channels] + 4); + if (m_iBufferOutputUsed && (m_iBufferOutputUsed + outputSize > desired_size || m_bNoConcatenate)) + { + int ret = m_iBufferOutputUsed; + m_iBufferOutputUsed = 0; ++ m_bNoConcatenate = false; + dts = m_dts; + pts = m_pts; + *dst = m_pBufferOutput; +@@ -278,9 +281,6 @@ int COMXAudioCodecOMX::GetData(BYTE** dst, double &dts, double &pts) + m_bFirstFrame = false; + } + m_iBufferOutputUsed += outputSize; +- +- if (!m_bNoConcatenate && m_pCodecContext->sample_fmt == AV_SAMPLE_FMT_FLTP && m_frameSize && (int)m_frameSize != outputSize) +- CLog::Log(LOGERROR, "COMXAudioCodecOMX::GetData Unexpected change of size (%d->%d)", m_frameSize, outputSize); + return 0; + } + +-- +2.5.0 + + +From 88f9f9f084fde1e563e9c7510cfb84bedf21c842 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Thu, 4 Feb 2016 15:29:55 +0000 +Subject: [PATCH 82/94] MMALCodec: Set dropped flag on output pictures when + input requested that + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 6 ++++++ + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 1 + + 2 files changed, 7 insertions(+) + diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 08f61fc..25a4c84 100644 +index 0f5c1b7..7b025fd 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -99,6 +99,7 @@ long CMMALVideoBuffer::Release() - #define CLASSNAME "CMMALVideo" - - CMMALVideo::CMMALVideo() -+: m_sharedSection(g_RBP.GetLock()) +@@ -759,6 +759,7 @@ void CMMALVideo::SetDropState(bool bDrop) { if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, this); + CLog::Log(LOGDEBUG, "%s::%s - bDrop(%d)", CLASSNAME, __func__, bDrop); ++ m_dropState = bDrop; + } + + int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) +@@ -794,6 +795,8 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) + buffer->length = (uint32_t)iSize > buffer->alloc_size ? buffer->alloc_size : (uint32_t)iSize; + // set a flag so we can identify primary frames from generated frames (deinterlace) + buffer->flags = MMAL_BUFFER_HEADER_FLAG_USER0; ++ if (m_dropState) ++ buffer->flags |= MMAL_BUFFER_HEADER_FLAG_USER3; + + memcpy(buffer->data, pData, buffer->length); + iSize -= buffer->length; +@@ -944,6 +947,7 @@ void CMMALVideo::Reset(void) + m_decoderPts = DVD_NOPTS_VALUE; + m_demuxerPts = DVD_NOPTS_VALUE; + m_codecControlFlags = 0; ++ m_dropState = false; + } + + void CMMALVideo::SetSpeed(int iSpeed) +@@ -1021,6 +1025,8 @@ bool CMMALVideo::GetPicture(DVDVideoPicture* pDvdVideoPicture) + + pDvdVideoPicture->MMALBuffer->Acquire(); + pDvdVideoPicture->iFlags = DVP_FLAG_ALLOCATED; ++ if (buffer->mmal_buffer->flags & MMAL_BUFFER_HEADER_FLAG_USER3) ++ pDvdVideoPicture->iFlags |= DVP_FLAG_DROPPED; + if (g_advancedSettings.CanLogComponent(LOGVIDEO)) + CLog::Log(LOGINFO, "%s::%s dts:%.3f pts:%.3f flags:%x:%x MMALBuffer:%p mmal_buffer:%p", CLASSNAME, __func__, + pDvdVideoPicture->dts == DVD_NOPTS_VALUE ? 0.0 : pDvdVideoPicture->dts*1e-6, pDvdVideoPicture->pts == DVD_NOPTS_VALUE ? 0.0 : pDvdVideoPicture->pts*1e-6, diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index bf669e0..60a3e5f 100644 +index ca28c6f..bf669e0 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -126,7 +126,7 @@ class CMMALVideo : public CDVDVideoCodec +@@ -124,6 +124,7 @@ protected: + double m_decoderPts; + int m_speed; int m_codecControlFlags; - bool m_dropState; ++ bool m_dropState; -- CCriticalSection m_sharedSection; -+ CCriticalSection &m_sharedSection; + CCriticalSection m_sharedSection; MMAL_COMPONENT_T *m_dec; - MMAL_PORT_T *m_dec_input; - MMAL_PORT_T *m_dec_output; -diff --git a/xbmc/linux/OMXCore.cpp b/xbmc/linux/OMXCore.cpp -index 5f91787..a7edc95 100644 ---- a/xbmc/linux/OMXCore.cpp -+++ b/xbmc/linux/OMXCore.cpp -@@ -59,6 +59,7 @@ static void add_timespecs(struct timespec &time, long millisecs) +-- +2.5.0 + + +From e51fd26cfe75c298e107f26af4ba6dd3a68f4e22 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 3 Feb 2016 21:35:01 +0000 +Subject: [PATCH 83/94] DVDVideoCodecFFmpeg: Enable refcounted frames + +Without this frames will get (deep) copied when deinterlace is set to automatic, +but file is not deinterlaced. + +For 1080p24 that costs 150MB/s of memory bandwidth which is very expensive. +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +index c2f3287..64087f2 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +@@ -316,6 +316,10 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options + av_opt_set(m_pCodecContext, it->m_name.c_str(), it->m_value.c_str(), 0); + } ++ // If non-zero, the decoded audio and video frames returned from avcodec_decode_video2() are reference-counted and are valid indefinitely. ++ // Without this frames will get (deep) copied when deinterlace is set to automatic, but file is not deinterlaced. ++ m_pCodecContext->refcounted_frames = 1; ++ + if (avcodec_open2(m_pCodecContext, pCodec, NULL) < 0) + { + CLog::Log(LOGDEBUG,"CDVDVideoCodecFFmpeg::Open() Unable to open codec"); +-- +2.5.0 + + +From 6df990c5d6b5930b34a05167b989bb0155a6fcae Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 19 Feb 2016 13:45:23 +0000 +Subject: [PATCH 84/94] mmal: increase decode buffering a little to help harder + MVC files + +PR8610 reduced buffering in codec which generally improved behaviour, +but we have some reports of hard streams (like 3D BluRay) that now +lag. The problem is when the codec's input buffer runs dry you +waste useful decoder cycles. It seems adding another two frames of +latency to decoder gets the performance back. +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +index 7b025fd..08f61fc 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +@@ -676,7 +676,7 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) - COMXCoreTunel::COMXCoreTunel() -+: m_sharedSection(g_RBP.GetLock()) + // limit number of callback structures in video_decode to reduce latency. Too low and video hangs. + // negative numbers have special meaning. -1=size of DPB -2=size of DPB+1 +- status = mmal_port_parameter_set_uint32(m_dec_input, MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS, -3); ++ status = mmal_port_parameter_set_uint32(m_dec_input, MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS, -5); + if (status != MMAL_SUCCESS) + CLog::Log(LOGERROR, "%s::%s Failed to configure max num callbacks on %s (status=%x %s)", CLASSNAME, __func__, m_dec_input->name, status, mmal_status_to_string(status)); + +-- +2.5.0 + + +From 1d254cfd3db48c1fc2307467da5c801639cc73c3 Mon Sep 17 00:00:00 2001 +From: Mario Holzinger +Date: Fri, 11 Dec 2015 16:48:57 +0100 +Subject: [PATCH 85/94] touch panel to display adjustment + +--- + xbmc/input/linux/LinuxInputDevices.cpp | 7 ++++--- + xbmc/settings/AdvancedSettings.cpp | 16 ++++++++++++++++ + xbmc/settings/AdvancedSettings.h | 6 ++++++ + 3 files changed, 26 insertions(+), 3 deletions(-) + +diff --git a/xbmc/input/linux/LinuxInputDevices.cpp b/xbmc/input/linux/LinuxInputDevices.cpp +index 9f3e866..a506956 100644 +--- a/xbmc/input/linux/LinuxInputDevices.cpp ++++ b/xbmc/input/linux/LinuxInputDevices.cpp +@@ -98,6 +98,7 @@ typedef unsigned long kernel_ulong_t; + #include "utils/log.h" + #include "input/touch/generic/GenericTouchActionHandler.h" + #include "input/touch/generic/GenericTouchInputHandler.h" ++#include "settings/AdvancedSettings.h" + + #ifndef BITS_PER_LONG + #define BITS_PER_LONG (sizeof(long) * 8) +@@ -653,13 +654,13 @@ bool CLinuxInputDevice::AbsEvent(const struct input_event& levt, XBMC_Event& dev + switch (levt.code) + { + case ABS_X: +- m_mouseX = levt.value; ++ m_mouseX = (int)((float)levt.value * g_advancedSettings.m_screenAlign_xStretchFactor) + g_advancedSettings.m_screenAlign_xOffset; // stretch and shift touch x coordinates + break; + + case ABS_Y: +- m_mouseY = levt.value; ++ m_mouseY = (int)((float)levt.value * g_advancedSettings.m_screenAlign_yStretchFactor) + g_advancedSettings.m_screenAlign_yOffset; // stretch and shift touch y coordinates + break; +- ++ + case ABS_MISC: + remoteStatus = levt.value & 0xFF; + break; +diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp +index aeea13b..326e9f5 100644 +--- a/xbmc/settings/AdvancedSettings.cpp ++++ b/xbmc/settings/AdvancedSettings.cpp +@@ -303,6 +303,12 @@ void CAdvancedSettings::Initialize() + m_iEdlCommBreakAutowait = 0; // Off by default + m_iEdlCommBreakAutowind = 0; // Off by default + ++ // Touchscreen default values if no adjustment is necessarry ++ m_screenAlign_xOffset = 0; ++ m_screenAlign_yOffset= 0; ++ m_screenAlign_xStretchFactor = 1.0; ++ m_screenAlign_yStretchFactor = 1.0; ++ + m_curlconnecttimeout = 10; + m_curllowspeedtime = 20; + m_curlretries = 2; +@@ -871,6 +877,16 @@ void CAdvancedSettings::ParseSettingsFile(const std::string &file) + XMLUtils::GetInt(pElement, "commbreakautowind", m_iEdlCommBreakAutowind, 0, 10); // Between 0 and 10 seconds + } + ++ // Touchscreen ++ pElement = pRootElement->FirstChildElement("touchscreen"); ++ if (pElement) ++ { ++ XMLUtils::GetInt(pElement, "x_offset", m_screenAlign_xOffset ); ++ XMLUtils::GetInt(pElement, "y_offset", m_screenAlign_yOffset ); ++ XMLUtils::GetFloat(pElement, "x_stretch_factor", m_screenAlign_xStretchFactor ); ++ XMLUtils::GetFloat(pElement, "y_stretch_factor", m_screenAlign_yStretchFactor ); ++ } ++ + // picture exclude regexps + TiXmlElement* pPictureExcludes = pRootElement->FirstChildElement("pictureexcludes"); + if (pPictureExcludes) +diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h +index 4da88f4..1bdc77e 100644 +--- a/xbmc/settings/AdvancedSettings.h ++++ b/xbmc/settings/AdvancedSettings.h +@@ -334,6 +334,12 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler + std::string m_cpuTempCmd; + std::string m_gpuTempCmd; + ++ // Touchscreen ++ int m_screenAlign_xOffset; ++ int m_screenAlign_yOffset; ++ float m_screenAlign_xStretchFactor; ++ float m_screenAlign_yStretchFactor; ++ + /* PVR/TV related advanced settings */ + int m_iPVRTimeCorrection; /*!< @brief correct all times (epg tags, timer tags, recording tags) by this amount of minutes. defaults to 0. */ + int m_iPVRInfoToggleInterval; /*!< @brief if there are more than 1 pvr gui info item available (e.g. multiple recordings active at the same time), use this toggle delay in milliseconds. defaults to 3000. */ +-- +2.5.0 + + +From e5e1e2f22f64436ddcabf7f51d25bcd6a13eb4a4 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 15 Feb 2016 15:51:11 +0000 +Subject: [PATCH 86/94] touch panel to display adjustment - support multitouch + +PR7978 allowed a simple calibration to be applied to touch input +It didn't cover multitouch which this adds support for +--- + xbmc/input/linux/LinuxInputDevices.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/xbmc/input/linux/LinuxInputDevices.cpp b/xbmc/input/linux/LinuxInputDevices.cpp +index a506956..3579cd0 100644 +--- a/xbmc/input/linux/LinuxInputDevices.cpp ++++ b/xbmc/input/linux/LinuxInputDevices.cpp +@@ -707,7 +707,7 @@ bool CLinuxInputDevice::mtAbsEvent(const struct input_event& levt) + case ABS_MT_POSITION_X: + if (m_mt_currentSlot < TOUCH_MAX_POINTERS) + { +- m_mt_x[m_mt_currentSlot] = levt.value; ++ m_mt_x[m_mt_currentSlot] = (int)((float)levt.value * g_advancedSettings.m_screenAlign_xStretchFactor) + g_advancedSettings.m_screenAlign_xOffset; // stretch and shift touch x coordinates + if (m_mt_event[m_mt_currentSlot] == TouchInputUnchanged) + m_mt_event[m_mt_currentSlot] = TouchInputMove; + } +@@ -716,7 +716,7 @@ bool CLinuxInputDevice::mtAbsEvent(const struct input_event& levt) + case ABS_MT_POSITION_Y: + if (m_mt_currentSlot < TOUCH_MAX_POINTERS) + { +- m_mt_y[m_mt_currentSlot] = levt.value; ++ m_mt_y[m_mt_currentSlot] = (int)((float)levt.value * g_advancedSettings.m_screenAlign_yStretchFactor) + g_advancedSettings.m_screenAlign_yOffset; // stretch and shift touch y coordinates; + if (m_mt_event[m_mt_currentSlot] == TouchInputUnchanged) + m_mt_event[m_mt_currentSlot] = TouchInputMove; + } +-- +2.5.0 + + +From 93502d0fbe98de0119c0e03a245528cfb89e69b9 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 22 Mar 2016 22:28:13 +0000 +Subject: [PATCH 87/94] [linux] Move hotplug checking into its own thread + +Currently checking for new linux input devices is called from the rendering thread. +We've been getting reports of skipped frames on raspberry pi. + +Specifically if eventlirc is active and you have an LIRC capable device connected +the hotplug check is slow and you get a frame skip every ten seconds. + +So move this code into its own thread +--- + xbmc/input/linux/LinuxInputDevices.cpp | 54 +++++++++++++++++++++------------- + xbmc/input/linux/LinuxInputDevices.h | 14 ++++++++- + xbmc/windowing/WinEventsLinux.cpp | 1 + + xbmc/windowing/WinEventsLinux.h | 2 ++ + 4 files changed, 49 insertions(+), 22 deletions(-) + +diff --git a/xbmc/input/linux/LinuxInputDevices.cpp b/xbmc/input/linux/LinuxInputDevices.cpp +index 3579cd0..7b3c6ad 100644 +--- a/xbmc/input/linux/LinuxInputDevices.cpp ++++ b/xbmc/input/linux/LinuxInputDevices.cpp +@@ -1081,6 +1081,30 @@ bool CLinuxInputDevice::IsUnplugged() + return m_bUnplugged; + } + ++CLinuxInputDevicesCheckHotplugged::CLinuxInputDevicesCheckHotplugged(CLinuxInputDevices &parent) : ++ CThread("CLinuxInputDevicesCheckHotplugged"), m_parent(parent) ++{ ++ Create(); ++ SetPriority(THREAD_PRIORITY_BELOW_NORMAL); ++} ++ ++CLinuxInputDevicesCheckHotplugged::~CLinuxInputDevicesCheckHotplugged() ++{ ++ m_bStop = true; ++ m_quitEvent.Set(); ++ StopThread(true); ++} ++ ++void CLinuxInputDevicesCheckHotplugged::Process() ++{ ++ while (!m_bStop) ++ { ++ m_parent.CheckHotplugged(); ++ // every ten seconds ++ m_quitEvent.WaitMSec(10000); ++ } ++} ++ + bool CLinuxInputDevices::CheckDevice(const char *device) { - m_src_component = NULL; - m_dst_component = NULL; -@@ -74,6 +75,7 @@ COMXCoreTunel::~COMXCoreTunel() - - void COMXCoreTunel::Initialize(COMXCoreComponent *src_component, unsigned int src_port, COMXCoreComponent *dst_component, unsigned int dst_port) + int fd; +@@ -1147,10 +1171,6 @@ void CLinuxInputDevices::InitAvailable() + */ + void CLinuxInputDevices::CheckHotplugged() { -+ CSingleLock lock(m_sharedSection); - m_src_component = src_component; - m_src_port = src_port; - m_dst_component = dst_component; -@@ -82,6 +84,7 @@ void COMXCoreTunel::Initialize(COMXCoreComponent *src_component, unsigned int sr +- CSingleLock lock(m_devicesListLock); +- +- int deviceId = m_devices.size(); +- + /* No devices specified. Try to guess some. */ + for (int i = 0; i < MAX_LINUX_INPUT_DEVICES; i++) + { +@@ -1158,18 +1178,22 @@ void CLinuxInputDevices::CheckHotplugged() + bool ispresent = false; - OMX_ERRORTYPE COMXCoreTunel::Deestablish(bool noWait) + snprintf(buf, 32, "/dev/input/event%d", i); +- +- for (size_t j = 0; j < m_devices.size(); j++) + { +- if (m_devices[j]->GetFileName().compare(buf) == 0) ++ CSingleLock lock(m_devicesListLock); ++ for (size_t j = 0; j < m_devices.size(); j++) + { +- ispresent = true; +- break; ++ if (m_devices[j]->GetFileName().compare(buf) == 0) ++ { ++ ispresent = true; ++ break; ++ } + } + } + + if (!ispresent && CheckDevice(buf)) + { ++ CSingleLock lock(m_devicesListLock); ++ int deviceId = m_devices.size(); + CLog::Log(LOGINFO, "Found input device %s", buf); + m_devices.push_back(new CLinuxInputDevice(buf, deviceId)); + ++deviceId; +@@ -1360,18 +1384,6 @@ XBMC_Event CLinuxInputDevices::ReadEvent() + InitAvailable(); + m_bReInitialize = false; + } +- else +- { +- time_t now; +- time(&now); +- +- if ((now - m_lastHotplugCheck) >= 10) +- { +- CheckHotplugged(); +- m_lastHotplugCheck = now; +- } +- } +- + CSingleLock lock(m_devicesListLock); + + XBMC_Event event; +diff --git a/xbmc/input/linux/LinuxInputDevices.h b/xbmc/input/linux/LinuxInputDevices.h +index 8c88a1d..4fde1aa 100644 +--- a/xbmc/input/linux/LinuxInputDevices.h ++++ b/xbmc/input/linux/LinuxInputDevices.h +@@ -28,6 +28,7 @@ + #include "threads/SingleLock.h" + #include "input/touch/ITouchInputHandler.h" + #include "input/touch/generic/IGenericTouchGestureDetector.h" ++#include "threads/Thread.h" + + struct KeymapEntry { -+ CSingleLock lock(m_sharedSection); - if(!m_src_component || !m_dst_component || !IsInitialized()) - return OMX_ErrorUndefined; - -@@ -156,6 +159,7 @@ OMX_ERRORTYPE COMXCoreTunel::Deestablish(bool noWait) - - OMX_ERRORTYPE COMXCoreTunel::Establish(bool enable_ports /* = true */, bool disable_ports /* = false */) - { -+ CSingleLock lock(m_sharedSection); - OMX_ERRORTYPE omx_err = OMX_ErrorNone; - OMX_PARAM_U32TYPE param; - OMX_INIT_STRUCTURE(param); -@@ -293,6 +297,7 @@ OMX_ERRORTYPE COMXCoreTunel::Establish(bool enable_ports /* = true */, bool disa - //////////////////////////////////////////////////////////////////////////////////////////// - - COMXCoreComponent::COMXCoreComponent() -+: m_sharedSection(g_RBP.GetLock()) - { - m_input_port = 0; - m_output_port = 0; -@@ -332,6 +337,7 @@ COMXCoreComponent::COMXCoreComponent() - - COMXCoreComponent::~COMXCoreComponent() - { -+ CSingleLock lock(m_sharedSection); - Deinitialize(); - - pthread_mutex_destroy(&m_omx_input_mutex); -@@ -357,6 +363,7 @@ void COMXCoreComponent::TransitionToStateLoaded() - - OMX_ERRORTYPE COMXCoreComponent::EmptyThisBuffer(OMX_BUFFERHEADERTYPE *omx_buffer) - { -+ CSingleLock lock(m_sharedSection); - OMX_ERRORTYPE omx_err = OMX_ErrorNone; - - #if defined(OMX_DEBUG_EVENTHANDLER) -@@ -377,6 +384,7 @@ OMX_ERRORTYPE COMXCoreComponent::EmptyThisBuffer(OMX_BUFFERHEADERTYPE *omx_buffe - - OMX_ERRORTYPE COMXCoreComponent::FillThisBuffer(OMX_BUFFERHEADERTYPE *omx_buffer) - { -+ CSingleLock lock(m_sharedSection); - OMX_ERRORTYPE omx_err = OMX_ErrorNone; - - #if defined(OMX_DEBUG_EVENTHANDLER) -@@ -397,6 +405,7 @@ OMX_ERRORTYPE COMXCoreComponent::FillThisBuffer(OMX_BUFFERHEADERTYPE *omx_buffer - - OMX_ERRORTYPE COMXCoreComponent::FreeOutputBuffer(OMX_BUFFERHEADERTYPE *omx_buffer) - { -+ CSingleLock lock(m_sharedSection); - OMX_ERRORTYPE omx_err = OMX_ErrorNone; - - if(!m_handle || !omx_buffer) -@@ -420,6 +429,7 @@ void COMXCoreComponent::FlushAll() - - void COMXCoreComponent::FlushInput() - { -+ CSingleLock lock(m_sharedSection); - if(!m_handle || m_resource_error) - return; - -@@ -435,6 +445,7 @@ void COMXCoreComponent::FlushInput() - - void COMXCoreComponent::FlushOutput() - { -+ CSingleLock lock(m_sharedSection); - if(!m_handle || m_resource_error) - return; - -@@ -568,6 +579,7 @@ OMX_ERRORTYPE COMXCoreComponent::WaitForOutputDone(long timeout /*=200*/) - - OMX_ERRORTYPE COMXCoreComponent::AllocInputBuffers(bool use_buffers /* = false **/) - { -+ CSingleLock lock(m_sharedSection); - OMX_ERRORTYPE omx_err = OMX_ErrorNone; - - m_omx_input_use_buffers = use_buffers; -@@ -649,6 +661,7 @@ OMX_ERRORTYPE COMXCoreComponent::AllocInputBuffers(bool use_buffers /* = false * - - OMX_ERRORTYPE COMXCoreComponent::AllocOutputBuffers(bool use_buffers /* = false */) - { -+ CSingleLock lock(m_sharedSection); - OMX_ERRORTYPE omx_err = OMX_ErrorNone; - - if(!m_handle) -@@ -730,6 +743,7 @@ OMX_ERRORTYPE COMXCoreComponent::AllocOutputBuffers(bool use_buffers /* = false - - OMX_ERRORTYPE COMXCoreComponent::FreeInputBuffers() - { -+ CSingleLock lock(m_sharedSection); - OMX_ERRORTYPE omx_err = OMX_ErrorNone; - - if(!m_handle) -@@ -788,6 +802,7 @@ OMX_ERRORTYPE COMXCoreComponent::FreeInputBuffers() - - OMX_ERRORTYPE COMXCoreComponent::FreeOutputBuffers() - { -+ CSingleLock lock(m_sharedSection); - OMX_ERRORTYPE omx_err = OMX_ErrorNone; - - if(!m_handle) -@@ -846,6 +861,7 @@ OMX_ERRORTYPE COMXCoreComponent::FreeOutputBuffers() - - OMX_ERRORTYPE COMXCoreComponent::DisableAllPorts() - { -+ CSingleLock lock(m_sharedSection); - if(!m_handle) - return OMX_ErrorUndefined; - -@@ -1074,6 +1090,7 @@ OMX_ERRORTYPE COMXCoreComponent::WaitForCommand(OMX_U32 command, OMX_U32 nData2, - - OMX_ERRORTYPE COMXCoreComponent::SetStateForComponent(OMX_STATETYPE state) - { -+ CSingleLock lock(m_sharedSection); - if(!m_handle) - return OMX_ErrorUndefined; - -@@ -1112,6 +1129,7 @@ OMX_ERRORTYPE COMXCoreComponent::SetStateForComponent(OMX_STATETYPE state) - - OMX_STATETYPE COMXCoreComponent::GetState() const - { -+ CSingleLock lock(m_sharedSection); - if(!m_handle) - return (OMX_STATETYPE)0; - -@@ -1123,6 +1141,7 @@ OMX_STATETYPE COMXCoreComponent::GetState() const - - OMX_ERRORTYPE COMXCoreComponent::SetParameter(OMX_INDEXTYPE paramIndex, OMX_PTR paramStruct) - { -+ CSingleLock lock(m_sharedSection); - if(!m_handle) - return OMX_ErrorUndefined; - -@@ -1139,6 +1158,7 @@ OMX_ERRORTYPE COMXCoreComponent::SetParameter(OMX_INDEXTYPE paramIndex, OMX_PTR - - OMX_ERRORTYPE COMXCoreComponent::GetParameter(OMX_INDEXTYPE paramIndex, OMX_PTR paramStruct) const - { -+ CSingleLock lock(m_sharedSection); - if(!m_handle) - return OMX_ErrorUndefined; - -@@ -1155,6 +1175,7 @@ OMX_ERRORTYPE COMXCoreComponent::GetParameter(OMX_INDEXTYPE paramIndex, OMX_PTR - - OMX_ERRORTYPE COMXCoreComponent::SetConfig(OMX_INDEXTYPE configIndex, OMX_PTR configStruct) - { -+ CSingleLock lock(m_sharedSection); - if(!m_handle) - return OMX_ErrorUndefined; - -@@ -1171,6 +1192,7 @@ OMX_ERRORTYPE COMXCoreComponent::SetConfig(OMX_INDEXTYPE configIndex, OMX_PTR co - - OMX_ERRORTYPE COMXCoreComponent::GetConfig(OMX_INDEXTYPE configIndex, OMX_PTR configStruct) const - { -+ CSingleLock lock(m_sharedSection); - if(!m_handle) - return OMX_ErrorUndefined; - -@@ -1187,6 +1209,7 @@ OMX_ERRORTYPE COMXCoreComponent::GetConfig(OMX_INDEXTYPE configIndex, OMX_PTR co - - OMX_ERRORTYPE COMXCoreComponent::SendCommand(OMX_COMMANDTYPE cmd, OMX_U32 cmdParam, OMX_PTR cmdParamData) - { -+ CSingleLock lock(m_sharedSection); - if(!m_handle) - return OMX_ErrorUndefined; - -@@ -1203,6 +1226,7 @@ OMX_ERRORTYPE COMXCoreComponent::SendCommand(OMX_COMMANDTYPE cmd, OMX_U32 cmdPar - - OMX_ERRORTYPE COMXCoreComponent::EnablePort(unsigned int port, bool wait) - { -+ CSingleLock lock(m_sharedSection); - if(!m_handle) - return OMX_ErrorUndefined; - -@@ -1237,6 +1261,7 @@ OMX_ERRORTYPE COMXCoreComponent::EnablePort(unsigned int port, bool wait) - - OMX_ERRORTYPE COMXCoreComponent::DisablePort(unsigned int port, bool wait) - { -+ CSingleLock lock(m_sharedSection); - if(!m_handle) - return OMX_ErrorUndefined; - -@@ -1271,6 +1296,7 @@ OMX_ERRORTYPE COMXCoreComponent::DisablePort(unsigned int port, bool wait) - - OMX_ERRORTYPE COMXCoreComponent::UseEGLImage(OMX_BUFFERHEADERTYPE** ppBufferHdr, OMX_U32 nPortIndex, OMX_PTR pAppPrivate, void* eglImage) - { -+ CSingleLock lock(m_sharedSection); - OMX_ERRORTYPE omx_err = OMX_ErrorNone; - - if(!m_handle) -@@ -1350,6 +1376,7 @@ OMX_ERRORTYPE COMXCoreComponent::UseEGLImage(OMX_BUFFERHEADERTYPE** ppBufferHdr, - - bool COMXCoreComponent::Initialize( const std::string &component_name, OMX_INDEXTYPE index) - { -+ CSingleLock lock(m_sharedSection); - OMX_ERRORTYPE omx_err; - - m_input_port = 0; -@@ -1437,6 +1464,7 @@ bool COMXCoreComponent::Initialize( const std::string &component_name, OMX_INDEX - - void COMXCoreComponent::ResetEos() - { -+ CSingleLock lock(m_sharedSection); - pthread_mutex_lock(&m_omx_eos_mutex); - m_eos = false; - pthread_mutex_unlock(&m_omx_eos_mutex); -@@ -1444,6 +1472,7 @@ void COMXCoreComponent::ResetEos() - - bool COMXCoreComponent::Deinitialize() - { -+ CSingleLock lock(m_sharedSection); - OMX_ERRORTYPE omx_err; - - m_exit = true; -diff --git a/xbmc/linux/OMXCore.h b/xbmc/linux/OMXCore.h -index 05052e5..2c2f91c 100644 ---- a/xbmc/linux/OMXCore.h -+++ b/xbmc/linux/OMXCore.h -@@ -78,6 +78,7 @@ class COMXCoreTunel - unsigned int m_dst_port; - DllOMX *m_DllOMX; - bool m_tunnel_set; -+ CCriticalSection &m_sharedSection; +@@ -105,7 +106,18 @@ private: + bool CheckDevice(const char *device); + std::vector m_devices; + bool m_bReInitialize; +- time_t m_lastHotplugCheck; ++}; ++ ++class CLinuxInputDevicesCheckHotplugged : protected CThread ++{ ++public: ++ CLinuxInputDevicesCheckHotplugged(CLinuxInputDevices &parent); ++ ~CLinuxInputDevicesCheckHotplugged(); ++private: ++ CLinuxInputDevices &m_parent; ++ CEvent m_quitEvent; ++protected: ++ virtual void Process(); }; - class COMXCoreComponent -@@ -199,6 +200,7 @@ class COMXCoreComponent - bool m_flush_input; - bool m_flush_output; - bool m_resource_error; -+ CCriticalSection &m_sharedSection; - }; + #endif /* LINUXINPUTDEVICES_H_ */ +diff --git a/xbmc/windowing/WinEventsLinux.cpp b/xbmc/windowing/WinEventsLinux.cpp +index 2b3d77a..fb6c987 100644 +--- a/xbmc/windowing/WinEventsLinux.cpp ++++ b/xbmc/windowing/WinEventsLinux.cpp +@@ -134,6 +134,7 @@ bool CWinEventsLinux::MessagePump() + if (!m_initialized) + { + m_devices.InitAvailable(); ++ m_checkHotplug = std::unique_ptr(new CLinuxInputDevicesCheckHotplugged(m_devices)); + m_initialized = true; + #ifdef TARGET_RASPBERRY_PI + LoadXML("Pointer.xml"); +diff --git a/xbmc/windowing/WinEventsLinux.h b/xbmc/windowing/WinEventsLinux.h +index 23244a2..c82ba84 100644 +--- a/xbmc/windowing/WinEventsLinux.h ++++ b/xbmc/windowing/WinEventsLinux.h +@@ -22,6 +22,7 @@ + #define WINDOW_EVENTS_LINUX_H - class COMXCore + #pragma once ++#include + #include "windowing/WinEvents.h" + #include "input/linux/LinuxInputDevices.h" + #include "guilib/TextureManager.h" +@@ -44,6 +45,7 @@ public: + private: + static bool m_initialized; + static CLinuxInputDevices m_devices; ++ std::unique_ptr m_checkHotplug; + #ifdef TARGET_RASPBERRY_PI + bool LoadXML(const std::string strFileName); + int64_t m_last_mouse_move_time; +-- +2.5.0 + + +From 19d44a0062028cc3b1625989de2492f39c5af9b3 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 28 Jul 2015 17:47:33 +0100 +Subject: [PATCH 88/94] [rbp] Refactor the vsync handle to support multiple + callers + +--- + xbmc/linux/RBP.cpp | 100 ++++++++++++++++++++++++++++++++++------------------- + xbmc/linux/RBP.h | 10 ++++-- + 2 files changed, 73 insertions(+), 37 deletions(-) + +diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp +index 13b0504..ddc2b9c 100644 +--- a/xbmc/linux/RBP.cpp ++++ b/xbmc/linux/RBP.cpp +@@ -34,6 +34,7 @@ + #include + #include + #include "rpi_user_vcsm.h" ++#include "utils/TimeUtils.h" + + #define MAJOR_NUM 100 + #define IOCTL_MBOX_PROPERTY _IOWR(MAJOR_NUM, 0, char *) +@@ -56,6 +57,8 @@ CRBP::CRBP() + m_enabled = 0; + m_mb = mbox_open(); + vcsm_init(); ++ m_vsync_count = 0; ++ m_last_vsync = 0; + } + + CRBP::~CRBP() +@@ -73,7 +76,7 @@ void CRBP::InitializeSettings() + + bool CRBP::Initialize() + { +- CSingleLock lock (m_critSection); ++ CSingleLock lock(m_critSection); + if (m_initialized) + return true; + +@@ -133,11 +136,62 @@ void CRBP::LogFirmwareVerison() + CLog::Log(LOGNOTICE, "Config:\n%s", response); + } + ++static void vsync_callback_static(DISPMANX_UPDATE_HANDLE_T u, void *arg) ++{ ++ CRBP *rbp = reinterpret_cast(arg); ++ rbp->VSyncCallback(); ++} ++ ++void CRBP::VSyncCallback() ++{ ++ CSingleLock lock(m_vsync_lock); ++ m_vsync_count++; ++ m_last_vsync = CurrentHostCounter(); ++ m_vsync_cond.notifyAll(); ++} ++ ++unsigned int CRBP::VsyncCount() ++{ ++ CSingleLock lock(m_vsync_lock); ++ return m_vsync_count; ++} ++ ++int64_t CRBP::LastVsync() ++{ ++ CSingleLock lock(m_vsync_lock); ++ return m_last_vsync; ++} ++ ++unsigned int CRBP::WaitVsync(unsigned int target) ++{ ++ CSingleLock vlock(m_vsync_lock); ++ DISPMANX_DISPLAY_HANDLE_T display = m_display; ++ XbmcThreads::EndTime delay(50); ++ if (target == ~0U) ++ target = m_vsync_count+1; ++ while (!delay.IsTimePast()) ++ { ++ CSingleLock lock(m_critSection); ++ if (m_vsync_count >= target) ++ break; ++ lock.Leave(); ++ if (!m_vsync_cond.wait(vlock, delay.MillisLeft())) ++ break; ++ } ++ if (m_vsync_count < target) ++ CLog::Log(LOGDEBUG, "CRBP::%s no vsync %d/%d display:%x(%x) delay:%d", __FUNCTION__, m_vsync_count, target, m_display, display, delay.MillisLeft()); ++ ++ return m_vsync_count; ++} ++ + DISPMANX_DISPLAY_HANDLE_T CRBP::OpenDisplay(uint32_t device) + { ++ CSingleLock lock(m_critSection); + if (m_display == DISPMANX_NO_HANDLE) + { + m_display = vc_dispmanx_display_open( 0 /*screen*/ ); ++ int s = vc_dispmanx_vsync_callback(m_display, vsync_callback_static, (void *)this); ++ assert(s == 0); + init_cursor(); + } + return m_display; +@@ -145,16 +199,20 @@ DISPMANX_DISPLAY_HANDLE_T CRBP::OpenDisplay(uint32_t device) + + void CRBP::CloseDisplay(DISPMANX_DISPLAY_HANDLE_T display) + { ++ CSingleLock lock(m_critSection); + assert(display == m_display); ++ int s = vc_dispmanx_vsync_callback(m_display, NULL, NULL); ++ assert(s == 0); ++ uninit_cursor(); + vc_dispmanx_display_close(m_display); + m_display = DISPMANX_NO_HANDLE; +- uninit_cursor(); + } + + void CRBP::GetDisplaySize(int &width, int &height) + { ++ CSingleLock lock(m_critSection); + DISPMANX_MODEINFO_T info; +- if (vc_dispmanx_display_get_info(m_display, &info) == 0) ++ if (m_display != DISPMANX_NO_HANDLE && vc_dispmanx_display_get_info(m_display, &info) == 0) + { + width = info.width; + height = info.height; +@@ -183,13 +241,13 @@ unsigned char *CRBP::CaptureDisplay(int width, int height, int *pstride, bool sw + flags |= DISPMANX_SNAPSHOT_PACK; + + stride = ((width + 15) & ~15) * 4; +- image = new unsigned char [height * stride]; + +- if (image) ++ CSingleLock lock(m_critSection); ++ if (m_display != DISPMANX_NO_HANDLE) + { ++ image = new unsigned char [height * stride]; + resource = vc_dispmanx_resource_create( VC_IMAGE_RGBA32, width, height, &vc_image_ptr ); + +- assert(m_display != DISPMANX_NO_HANDLE); + vc_dispmanx_snapshot(m_display, resource, (DISPMANX_TRANSFORM_T)flags); + + vc_dispmanx_rect_set(&rect, 0, 0, width, height); +@@ -201,35 +259,6 @@ unsigned char *CRBP::CaptureDisplay(int width, int height, int *pstride, bool sw + return image; + } + +- +-static void vsync_callback(DISPMANX_UPDATE_HANDLE_T u, void *arg) +-{ +- CEvent *sync = (CEvent *)arg; +- sync->Set(); +-} +- +-void CRBP::WaitVsync() +-{ +- int s; +- DISPMANX_DISPLAY_HANDLE_T m_display = vc_dispmanx_display_open( 0 /*screen*/ ); +- if (m_display == DISPMANX_NO_HANDLE) +- { +- CLog::Log(LOGDEBUG, "CRBP::%s skipping while display closed", __func__); +- return; +- } +- m_vsync.Reset(); +- s = vc_dispmanx_vsync_callback(m_display, vsync_callback, (void *)&m_vsync); +- if (s == 0) +- { +- m_vsync.WaitMSec(1000); +- } +- else assert(0); +- s = vc_dispmanx_vsync_callback(m_display, NULL, NULL); +- assert(s == 0); +- vc_dispmanx_display_close( m_display ); +-} +- +- + void CRBP::Deinitialize() + { + if (m_omx_image_init) +@@ -260,6 +289,7 @@ void CRBP::Deinitialize() + + double CRBP::AdjustHDMIClock(double adjust) + { ++ CSingleLock lock(m_critSection); + char response[80]; + vc_gencmd(response, sizeof response, "hdmi_adjust_clock %f", adjust); + char *p = strchr(response, '='); diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h -index 2eee35d..884d7c2 100644 +index 2eee35d..3b59cd9 100644 --- a/xbmc/linux/RBP.h +++ b/xbmc/linux/RBP.h -@@ -81,6 +81,7 @@ class CRBP +@@ -77,7 +77,10 @@ public: + // stride can be null for packed output + unsigned char *CaptureDisplay(int width, int height, int *stride, bool swap_red_blue, bool video_only = true); + DllOMX *GetDllOMX() { return m_OMX ? m_OMX->GetDll() : NULL; } +- void WaitVsync(); ++ unsigned int WaitVsync(unsigned int target = ~0U); ++ int64_t LastVsync(); ++ unsigned int VsyncCount(); ++ void VSyncCallback(); double AdjustHDMIClock(double adjust); double GetAdjustHDMIClock() { return m_last_pll_adjust; } int GetMBox() { return m_mb; } -+ CCriticalSection &GetLock() { return m_critSection; } +@@ -94,7 +97,10 @@ private: + bool m_codec_wvc1_enabled; + COMXCore *m_OMX; + DISPMANX_DISPLAY_HANDLE_T m_display; +- CEvent m_vsync; ++ CCriticalSection m_vsync_lock; ++ XbmcThreads::ConditionVariable m_vsync_cond; ++ unsigned int m_vsync_count; ++ int64_t m_last_vsync; + class DllLibOMXCore; + CCriticalSection m_critSection; + double m_last_pll_adjust; +-- +2.5.0 + + +From 8a52d5281d3f5f6e4b33016233cecdcc6775f4b7 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Thu, 24 Mar 2016 23:24:18 +0000 +Subject: [PATCH 89/94] [mmalrenderer] Wait for vsync before submitting to mmal + when display sync is disabled + +This avoids an issue where video occasionally goes stuttery after a seek, until the next pause/play or seek. +The issue is when display sync is disabled, and framerate of video matches display, and render times are coincident with vsync +you find that depending on timestamp/scheduling jitter, you may or may not get an update each vsync resulting in stuttery video. + +Some scheme to force render times to be dependent on vsync is required. We do this by using a queue that is popped following vsyncs. +We ensure the queue always has 1 or 2 frames so it doesn't underrun with a late frame, but this adds a frame of latency. +--- + xbmc/cores/VideoRenderers/MMALRenderer.cpp | 52 ++++++++++++++++++++++++++---- + xbmc/cores/VideoRenderers/MMALRenderer.h | 5 ++- + 2 files changed, 50 insertions(+), 7 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +index ad3f66f..e879cba 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +@@ -239,7 +239,7 @@ bool CMMALRenderer::init_vout(ERenderFormat format) + return true; + } - private: - DllBcmHost *m_DllBcmHost; +-CMMALRenderer::CMMALRenderer() ++CMMALRenderer::CMMALRenderer() : CThread("MMALRenderer") + { + CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); + m_vout = NULL; +@@ -253,15 +253,41 @@ CMMALRenderer::CMMALRenderer() + m_iYV12RenderBuffer = 0; + m_inflight = 0; + m_sharpness = -2.0f; ++ m_queue = mmal_queue_create(); ++ Create(); + } + + CMMALRenderer::~CMMALRenderer() + { + CSingleLock lock(m_sharedSection); + CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); ++ StopThread(true); ++ mmal_queue_destroy(m_queue); + UnInit(); + } + ++void CMMALRenderer::Process() ++{ ++ bool started = false; ++ SetPriority(THREAD_PRIORITY_ABOVE_NORMAL); ++ while (!m_bStop) ++ { ++ g_RBP.WaitVsync(); ++ if (!started && mmal_queue_length(m_queue) >= 2) ++ started = true; ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - vsync:%d queue:%d started:%d", CLASSNAME, __func__, g_RBP.VsyncCount(), mmal_queue_length(m_queue), started); ++ if (started) ++ { ++ MMAL_BUFFER_HEADER_T *buffer = mmal_queue_get(m_queue); ++ if (buffer) ++ mmal_port_send_buffer(m_vout_input, buffer); ++ else ++ started = false; ++ } ++ } ++} ++ + void CMMALRenderer::AddProcessor(CMMALVideoBuffer *buffer, int index) + { + #if defined(MMAL_DEBUG_VERBOSE) +@@ -496,10 +522,17 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + return; + omvb->Acquire(); + omvb->mmal_buffer->flags |= MMAL_BUFFER_HEADER_FLAG_USER1 | MMAL_BUFFER_HEADER_FLAG_USER2; +- mmal_port_send_buffer(m_vout_input, omvb->mmal_buffer); +- } +- else +- CLog::Log(LOGDEBUG, "%s::%s - No buffer to update", CLASSNAME, __func__); ++ if (!CSettings::GetInstance().GetBool("videoplayer.usedisplayasclock") && m_fps > 0.0 && fabs(m_fps - g_graphicsContext.GetFPS()) < 1e-2) ++ { ++ while (mmal_queue_length(m_queue) >= 2) ++ Sleep(1); ++ mmal_queue_put(m_queue, omvb->mmal_buffer); ++ } ++ else ++ mmal_port_send_buffer(m_vout_input, omvb->mmal_buffer); ++ } ++ else ++ CLog::Log(LOGDEBUG, "%s::%s - No buffer to update", CLASSNAME, __func__); + } + else if (m_format == RENDER_FMT_YUV420P) + { +@@ -516,7 +549,14 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + omvb->Acquire(); + omvb->mmal_buffer->flags |= MMAL_BUFFER_HEADER_FLAG_USER1 | MMAL_BUFFER_HEADER_FLAG_USER2; + omvb->mmal_buffer->user_data = omvb; +- mmal_port_send_buffer(m_vout_input, omvb->mmal_buffer); ++ if (!CSettings::GetInstance().GetBool("videoplayer.usedisplayasclock") && m_fps > 0.0 && fabs(m_fps - g_graphicsContext.GetFPS()) < 1e-2) ++ { ++ while (mmal_queue_length(m_queue) >= 2) ++ Sleep(1); ++ mmal_queue_put(m_queue, omvb->mmal_buffer); ++ } ++ else ++ mmal_port_send_buffer(m_vout_input, omvb->mmal_buffer); + } + else + CLog::Log(LOGDEBUG, "%s::%s - No buffer to update: clear:%d flags:%x alpha:%d source:%d", CLASSNAME, __func__, clear, flags, alpha, source); +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.h b/xbmc/cores/VideoRenderers/MMALRenderer.h +index a71e645..f17dc47 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.h ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.h +@@ -29,6 +29,7 @@ + #include "cores/dvdplayer/DVDStreamInfo.h" + #include "guilib/Geometry.h" + #include "BaseRenderer.h" ++#include "threads/Thread.h" + + #include + #include +@@ -55,7 +56,7 @@ protected: + long m_refs; + }; + +-class CMMALRenderer : public CBaseRenderer ++class CMMALRenderer : public CBaseRenderer, public CThread + { + struct YUVBUFFER + { +@@ -66,6 +67,7 @@ public: + CMMALRenderer(); + ~CMMALRenderer(); + ++ void Process(); + virtual void Update(); + virtual void SetupScreenshot() {}; + +@@ -125,6 +127,7 @@ protected: + MMAL_COMPONENT_T *m_vout; + MMAL_PORT_T *m_vout_input; + MMAL_POOL_T *m_vout_input_pool; ++ MMAL_QUEUE_T *m_queue; + + bool init_vout(ERenderFormat format); + void ReleaseBuffers(); +-- +2.5.0 + + +From c262dea07c4ae5c6b280f534dcce4699f9ffdaf8 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 25 Mar 2016 11:36:25 +0000 +Subject: [PATCH 90/94] Revert "[mmalrenderer] Wait for vsync before submitting + to mmal when display sync is disabled" + +This reverts commit bc61a9f7823b5a934ae46ed9bac6cfa0f4b520fa. +--- + xbmc/cores/VideoRenderers/MMALRenderer.cpp | 52 ++++-------------------------- + xbmc/cores/VideoRenderers/MMALRenderer.h | 5 +-- + 2 files changed, 7 insertions(+), 50 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +index e879cba..ad3f66f 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +@@ -239,7 +239,7 @@ bool CMMALRenderer::init_vout(ERenderFormat format) + return true; + } + +-CMMALRenderer::CMMALRenderer() : CThread("MMALRenderer") ++CMMALRenderer::CMMALRenderer() + { + CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); + m_vout = NULL; +@@ -253,41 +253,15 @@ CMMALRenderer::CMMALRenderer() : CThread("MMALRenderer") + m_iYV12RenderBuffer = 0; + m_inflight = 0; + m_sharpness = -2.0f; +- m_queue = mmal_queue_create(); +- Create(); + } + + CMMALRenderer::~CMMALRenderer() + { + CSingleLock lock(m_sharedSection); + CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); +- StopThread(true); +- mmal_queue_destroy(m_queue); + UnInit(); + } + +-void CMMALRenderer::Process() +-{ +- bool started = false; +- SetPriority(THREAD_PRIORITY_ABOVE_NORMAL); +- while (!m_bStop) +- { +- g_RBP.WaitVsync(); +- if (!started && mmal_queue_length(m_queue) >= 2) +- started = true; +- if (g_advancedSettings.CanLogComponent(LOGVIDEO)) +- CLog::Log(LOGDEBUG, "%s::%s - vsync:%d queue:%d started:%d", CLASSNAME, __func__, g_RBP.VsyncCount(), mmal_queue_length(m_queue), started); +- if (started) +- { +- MMAL_BUFFER_HEADER_T *buffer = mmal_queue_get(m_queue); +- if (buffer) +- mmal_port_send_buffer(m_vout_input, buffer); +- else +- started = false; +- } +- } +-} +- + void CMMALRenderer::AddProcessor(CMMALVideoBuffer *buffer, int index) + { + #if defined(MMAL_DEBUG_VERBOSE) +@@ -522,17 +496,10 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + return; + omvb->Acquire(); + omvb->mmal_buffer->flags |= MMAL_BUFFER_HEADER_FLAG_USER1 | MMAL_BUFFER_HEADER_FLAG_USER2; +- if (!CSettings::GetInstance().GetBool("videoplayer.usedisplayasclock") && m_fps > 0.0 && fabs(m_fps - g_graphicsContext.GetFPS()) < 1e-2) +- { +- while (mmal_queue_length(m_queue) >= 2) +- Sleep(1); +- mmal_queue_put(m_queue, omvb->mmal_buffer); +- } +- else +- mmal_port_send_buffer(m_vout_input, omvb->mmal_buffer); +- } +- else +- CLog::Log(LOGDEBUG, "%s::%s - No buffer to update", CLASSNAME, __func__); ++ mmal_port_send_buffer(m_vout_input, omvb->mmal_buffer); ++ } ++ else ++ CLog::Log(LOGDEBUG, "%s::%s - No buffer to update", CLASSNAME, __func__); + } + else if (m_format == RENDER_FMT_YUV420P) + { +@@ -549,14 +516,7 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + omvb->Acquire(); + omvb->mmal_buffer->flags |= MMAL_BUFFER_HEADER_FLAG_USER1 | MMAL_BUFFER_HEADER_FLAG_USER2; + omvb->mmal_buffer->user_data = omvb; +- if (!CSettings::GetInstance().GetBool("videoplayer.usedisplayasclock") && m_fps > 0.0 && fabs(m_fps - g_graphicsContext.GetFPS()) < 1e-2) +- { +- while (mmal_queue_length(m_queue) >= 2) +- Sleep(1); +- mmal_queue_put(m_queue, omvb->mmal_buffer); +- } +- else +- mmal_port_send_buffer(m_vout_input, omvb->mmal_buffer); ++ mmal_port_send_buffer(m_vout_input, omvb->mmal_buffer); + } + else + CLog::Log(LOGDEBUG, "%s::%s - No buffer to update: clear:%d flags:%x alpha:%d source:%d", CLASSNAME, __func__, clear, flags, alpha, source); +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.h b/xbmc/cores/VideoRenderers/MMALRenderer.h +index f17dc47..a71e645 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.h ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.h +@@ -29,7 +29,6 @@ + #include "cores/dvdplayer/DVDStreamInfo.h" + #include "guilib/Geometry.h" + #include "BaseRenderer.h" +-#include "threads/Thread.h" + + #include + #include +@@ -56,7 +55,7 @@ protected: + long m_refs; + }; + +-class CMMALRenderer : public CBaseRenderer, public CThread ++class CMMALRenderer : public CBaseRenderer + { + struct YUVBUFFER + { +@@ -67,7 +66,6 @@ public: + CMMALRenderer(); + ~CMMALRenderer(); + +- void Process(); + virtual void Update(); + virtual void SetupScreenshot() {}; + +@@ -127,7 +125,6 @@ protected: + MMAL_COMPONENT_T *m_vout; + MMAL_PORT_T *m_vout_input; + MMAL_POOL_T *m_vout_input_pool; +- MMAL_QUEUE_T *m_queue; + + bool init_vout(ERenderFormat format); + void ReleaseBuffers(); +-- +2.5.0 + + +From aabdf8c31cbdea15c399219d99826e469fa007af Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 23 Mar 2016 15:54:43 +0000 +Subject: [PATCH 91/94] [mmalrenderer] Wait for vsync before submitting to mmal + when display sync is disabled + +This avoids an issue where video occasionally goes stuttery after a seek, until the next pause/play or seek. +The issue is when display sync is disabled, and framerate of video matches display, and render times are coincident with vsync +you find that depending on timestamp/scheduling jitter, you may or may not get an update each vsync resulting in stuttery video. + +Some scheme to force render times to be dependent on vsync is required. We do this by blocking in RenderUpdate unto next vsync. +--- + xbmc/cores/VideoRenderers/MMALRenderer.cpp | 34 ++++++++++++++++++++++++++++-- + xbmc/cores/VideoRenderers/MMALRenderer.h | 2 ++ + 2 files changed, 34 insertions(+), 2 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +index ad3f66f..a2e0df2 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +@@ -33,6 +33,7 @@ + #include "windowing/WindowingFactory.h" + #include "cores/dvdplayer/DVDCodecs/Video/MMALCodec.h" + #include "xbmc/Application.h" ++#include "utils/TimeUtils.h" + + #define CLASSNAME "CMMALRenderer" + +@@ -253,6 +254,7 @@ CMMALRenderer::CMMALRenderer() + m_iYV12RenderBuffer = 0; + m_inflight = 0; + m_sharpness = -2.0f; ++ m_vsyncCount = ~0; + } + + CMMALRenderer::~CMMALRenderer() +@@ -444,6 +446,32 @@ void CMMALRenderer::Update() + ManageDisplay(); + } + ++void CMMALRenderer::SubmitFrame(MMAL_BUFFER_HEADER_T *buffer) ++{ ++ if (!CSettings::GetInstance().GetBool("videoplayer.usedisplayasclock") && m_fps > 0.0f) ++ { ++ float ratio = g_graphicsContext.GetFPS() / m_fps; ++ long int factor = lrint(ratio); ++ float diff = ratio - (float)factor; ++ if (fabsf(diff) < 1e-2) ++ { ++ int64_t lastvsync = g_RBP.LastVsync(); ++ int64_t start = CurrentHostCounter(); ++ unsigned int vsynccount = g_RBP.WaitVsync(m_vsyncCount) + factor; ++ int64_t now = CurrentHostCounter(); ++ bool normal = m_vsyncCount + factor == vsynccount || m_vsyncCount + factor + 1 == vsynccount; ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - buffer:%p vfps:%.3f dfps:%.3f vsync:%d/%d delay:%.1f/%.1f dsync:%d normal:%d", CLASSNAME, __func__, buffer, m_fps, g_graphicsContext.GetFPS(), vsynccount, m_vsyncCount, ++ (now - start)*1e-6, (now - lastvsync)*1e-6, CSettings::GetInstance().GetBool("videoplayer.usedisplayasclock"), normal); ++ if (normal) ++ m_vsyncCount += factor; ++ else ++ m_vsyncCount = vsynccount; ++ } ++ } ++ mmal_port_send_buffer(m_vout_input, buffer); ++} ++ + void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + { + CSingleLock lock(m_sharedSection); +@@ -496,7 +524,8 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + return; + omvb->Acquire(); + omvb->mmal_buffer->flags |= MMAL_BUFFER_HEADER_FLAG_USER1 | MMAL_BUFFER_HEADER_FLAG_USER2; +- mmal_port_send_buffer(m_vout_input, omvb->mmal_buffer); ++ lock.Leave(); ++ SubmitFrame(omvb->mmal_buffer); + } + else + CLog::Log(LOGDEBUG, "%s::%s - No buffer to update", CLASSNAME, __func__); +@@ -516,7 +545,8 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + omvb->Acquire(); + omvb->mmal_buffer->flags |= MMAL_BUFFER_HEADER_FLAG_USER1 | MMAL_BUFFER_HEADER_FLAG_USER2; + omvb->mmal_buffer->user_data = omvb; +- mmal_port_send_buffer(m_vout_input, omvb->mmal_buffer); ++ lock.Leave(); ++ SubmitFrame(omvb->mmal_buffer); + } + else + CLog::Log(LOGDEBUG, "%s::%s - No buffer to update: clear:%d flags:%x alpha:%d source:%d", CLASSNAME, __func__, clear, flags, alpha, source); +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.h b/xbmc/cores/VideoRenderers/MMALRenderer.h +index a71e645..19e38f7 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.h ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.h +@@ -112,6 +112,7 @@ protected: + unsigned int m_destWidth; + unsigned int m_destHeight; + int m_neededBuffers; ++ int m_vsyncCount; + + CRect m_src_rect; + CRect m_dst_rect; +@@ -129,4 +130,5 @@ protected: + bool init_vout(ERenderFormat format); + void ReleaseBuffers(); + void UnInitMMAL(); ++ void SubmitFrame(MMAL_BUFFER_HEADER_T *buffer); + }; +-- +2.5.0 + + +From c29b3010d9bd0bbd845bebacea0af8855f0eca71 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 23 Mar 2016 16:57:19 +0000 +Subject: [PATCH 92/94] mmal: Include mmal renderer logging in video category + +On Pi the decoder and renderer are closely coupled so combining the +logging category makes sense to me. +--- + xbmc/cores/VideoRenderers/MMALRenderer.cpp | 109 +++++++++++------------------ + 1 file changed, 42 insertions(+), 67 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +index a2e0df2..a4db9af 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +@@ -37,10 +37,6 @@ + + #define CLASSNAME "CMMALRenderer" + +-#ifdef _DEBUG +-#define MMAL_DEBUG_VERBOSE +-#endif +- + + CYUVVideoBuffer::CYUVVideoBuffer() + { +@@ -57,9 +53,8 @@ CYUVVideoBuffer::~CYUVVideoBuffer() + CYUVVideoBuffer *CYUVVideoBuffer::Acquire() + { + long count = AtomicIncrement(&m_refs); +-#ifdef MMAL_DEBUG_VERBOSE +- CLog::Log(LOGDEBUG, "%s::%s omvb:%p mmal:%p ref:%ld", CLASSNAME, __func__, this, mmal_buffer, count); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s omvb:%p mmal:%p ref:%ld", CLASSNAME, __func__, this, mmal_buffer, count); + (void)count; + return this; + } +@@ -67,9 +62,8 @@ CYUVVideoBuffer *CYUVVideoBuffer::Acquire() + long CYUVVideoBuffer::Release() + { + long count = AtomicDecrement(&m_refs); +-#ifdef MMAL_DEBUG_VERBOSE +- CLog::Log(LOGDEBUG, "%s::%s omvb:%p mmal:%p ref:%ld", CLASSNAME, __func__, this, mmal_buffer, count); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s omvb:%p mmal:%p ref:%ld", CLASSNAME, __func__, this, mmal_buffer, count); + if (count == 0) + { + mmal_buffer_header_release(mmal_buffer); +@@ -89,9 +83,8 @@ CRenderInfo CMMALRenderer::GetRenderInfo() + if (!m_bMMALConfigured) + m_bMMALConfigured = init_vout(RENDER_FMT_MMAL); + +- #if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s cookie:%p", CLASSNAME, __func__, (void *)m_vout_input_pool); +- #endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s cookie:%p", CLASSNAME, __func__, (void *)m_vout_input_pool); + + info.max_buffer_size = NUM_BUFFERS; + info.optimal_buffer_size = NUM_BUFFERS; +@@ -113,18 +106,16 @@ void CMMALRenderer::vout_input_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T * + { + CMMALVideoBuffer *omvb = (CMMALVideoBuffer *)buffer->user_data; + assert(buffer == omvb->mmal_buffer); +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s port:%p omvb:%p mmal:%p len:%d cmd:%x flags:%x flight:%d", CLASSNAME, __func__, port, omvb, omvb->mmal_buffer, buffer->length, buffer->cmd, buffer->flags, m_inflight); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s port:%p omvb:%p mmal:%p len:%d cmd:%x flags:%x flight:%d", CLASSNAME, __func__, port, omvb, omvb->mmal_buffer, buffer->length, buffer->cmd, buffer->flags, m_inflight); + omvb->Release(); + } + else if (m_format == RENDER_FMT_YUV420P) + { + CYUVVideoBuffer *omvb = (CYUVVideoBuffer *)buffer->user_data; + assert(buffer == omvb->mmal_buffer); +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s port:%p omvb:%p mmal:%p len:%d cmd:%x flags:%x flight:%d", CLASSNAME, __func__, port, omvb, omvb->mmal_buffer, buffer->length, buffer->cmd, buffer->flags, m_inflight); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s port:%p omvb:%p mmal:%p len:%d cmd:%x flags:%x flight:%d", CLASSNAME, __func__, port, omvb, omvb->mmal_buffer, buffer->length, buffer->cmd, buffer->flags, m_inflight); + m_inflight--; + omvb->Release(); + } +@@ -266,9 +257,8 @@ CMMALRenderer::~CMMALRenderer() + + void CMMALRenderer::AddProcessor(CMMALVideoBuffer *buffer, int index) + { +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - %p (%p) %i", CLASSNAME, __func__, buffer, buffer->mmal_buffer, index); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - %p (%p) %i", CLASSNAME, __func__, buffer, buffer->mmal_buffer, index); + + YUVBUFFER &buf = m_buffers[index]; + assert(!buf.MMALBuffer); +@@ -320,17 +310,15 @@ int CMMALRenderer::GetImage(YV12Image *image, int source, bool readonly) + { + if (!image || source < 0) + { +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - invalid: image:%p source:%d ro:%d flight:%d", CLASSNAME, __func__, image, source, readonly, m_inflight); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - invalid: image:%p source:%d ro:%d flight:%d", CLASSNAME, __func__, image, source, readonly, m_inflight); + return -1; + } + + if (m_format == RENDER_FMT_MMAL) + { +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - MMAL: image:%p source:%d ro:%d flight:%d", CLASSNAME, __func__, image, source, readonly, m_inflight); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - MMAL: image:%p source:%d ro:%d flight:%d", CLASSNAME, __func__, image, source, readonly, m_inflight); + } + else if (m_format == RENDER_FMT_YUV420P) + { +@@ -373,9 +361,8 @@ int CMMALRenderer::GetImage(YV12Image *image, int source, bool readonly) + if (!buf.YUVBuffer) + return -1; + buf.YUVBuffer->mmal_buffer = buffer; +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - YUV: image:%p source:%d ro:%d omvb:%p mmal:%p flight:%d", CLASSNAME, __func__, image, source, readonly, buf.YUVBuffer, buffer, m_inflight); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - YUV: image:%p source:%d ro:%d omvb:%p mmal:%p flight:%d", CLASSNAME, __func__, image, source, readonly, buf.YUVBuffer, buffer, m_inflight); + buf.YUVBuffer->Acquire(); + } + else assert(0); +@@ -388,16 +375,14 @@ void CMMALRenderer::ReleaseBuffer(int idx) + CSingleLock lock(m_sharedSection); + if (!m_bMMALConfigured) + { +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - not configured: source:%d", CLASSNAME, __func__, idx); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - not configured: source:%d", CLASSNAME, __func__, idx); + return; + } + if (m_format == RENDER_FMT_BYPASS) + { +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - bypass: source:%d", CLASSNAME, __func__, idx); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - bypass: source:%d", CLASSNAME, __func__, idx); + return; + } + +@@ -405,17 +390,15 @@ void CMMALRenderer::ReleaseBuffer(int idx) + if (m_format == RENDER_FMT_MMAL) + { + CMMALVideoBuffer *omvb = buffer->MMALBuffer; +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - MMAL: source:%d omvb:%p mmal:%p", CLASSNAME, __func__, idx, omvb, omvb ? omvb->mmal_buffer:NULL); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - MMAL: source:%d omvb:%p mmal:%p", CLASSNAME, __func__, idx, omvb, omvb ? omvb->mmal_buffer:NULL); + SAFE_RELEASE(buffer->MMALBuffer); + } + else if (m_format == RENDER_FMT_YUV420P) + { + CYUVVideoBuffer *omvb = buffer->YUVBuffer; +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - YUV: source:%d omvb:%p mmal:%p flight:%d", CLASSNAME, __func__, idx, omvb, omvb ? omvb->mmal_buffer:NULL, m_inflight); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - YUV: source:%d omvb:%p mmal:%p flight:%d", CLASSNAME, __func__, idx, omvb, omvb ? omvb->mmal_buffer:NULL, m_inflight); + if (omvb && omvb->mmal_buffer) + SAFE_RELEASE(buffer->YUVBuffer); + } +@@ -439,9 +422,8 @@ void CMMALRenderer::Flush() + + void CMMALRenderer::Update() + { +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); + if (!m_bConfigured) return; + ManageDisplay(); + } +@@ -479,9 +461,8 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + + if (!m_bConfigured) + { +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - not configured: clear:%d flags:%x alpha:%d source:%d", CLASSNAME, __func__, clear, flags, alpha, source); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - not configured: clear:%d flags:%x alpha:%d source:%d", CLASSNAME, __func__, clear, flags, alpha, source); + return; + } + +@@ -503,9 +484,8 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + + if (m_format == RENDER_FMT_BYPASS) + { +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - bypass: clear:%d flags:%x alpha:%d source:%d", CLASSNAME, __func__, clear, flags, alpha, source); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - bypass: clear:%d flags:%x alpha:%d source:%d", CLASSNAME, __func__, clear, flags, alpha, source); + return; + } + SetVideoRect(m_sourceRect, m_destRect); +@@ -516,9 +496,8 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + CMMALVideoBuffer *omvb = buffer->MMALBuffer; + if (omvb && omvb->mmal_buffer) + { +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - MMAL: clear:%d flags:%x alpha:%d source:%d omvb:%p mmal:%p mflags:%x", CLASSNAME, __func__, clear, flags, alpha, source, omvb, omvb->mmal_buffer, omvb->mmal_buffer->flags); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - MMAL: clear:%d flags:%x alpha:%d source:%d omvb:%p mmal:%p mflags:%x", CLASSNAME, __func__, clear, flags, alpha, source, omvb, omvb->mmal_buffer, omvb->mmal_buffer->flags); + // we only want to upload frames once + if (omvb->mmal_buffer->flags & MMAL_BUFFER_HEADER_FLAG_USER1) + return; +@@ -535,9 +514,8 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + CYUVVideoBuffer *omvb = buffer->YUVBuffer; + if (omvb && omvb->mmal_buffer) + { +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - YUV: clear:%d flags:%x alpha:%d source:%d omvb:%p mmal:%p mflags:%x", CLASSNAME, __func__, clear, flags, alpha, source, omvb, omvb->mmal_buffer, omvb->mmal_buffer->flags); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - YUV: clear:%d flags:%x alpha:%d source:%d omvb:%p mmal:%p mflags:%x", CLASSNAME, __func__, clear, flags, alpha, source, omvb, omvb->mmal_buffer, omvb->mmal_buffer->flags); + // we only want to upload frames once + if (omvb->mmal_buffer->flags & MMAL_BUFFER_HEADER_FLAG_USER1) + return; +@@ -559,15 +537,13 @@ void CMMALRenderer::FlipPage(int source) + CSingleLock lock(m_sharedSection); + if (!m_bConfigured || m_format == RENDER_FMT_BYPASS) + { +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - not configured: source:%d", CLASSNAME, __func__, source); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - not configured: source:%d", CLASSNAME, __func__, source); + return; + } + +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - source:%d", CLASSNAME, __func__, source); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - source:%d", CLASSNAME, __func__, source); + + m_iYV12RenderBuffer = source; + } +@@ -600,9 +576,8 @@ unsigned int CMMALRenderer::PreInit() + + void CMMALRenderer::ReleaseBuffers() + { +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); + for (int i=0; i +Date: Wed, 23 Mar 2016 17:34:48 +0000 +Subject: [PATCH 93/94] rendermanager: Increase configure timeout to see if it + fixes video playing in background issues + +--- + xbmc/cores/VideoRenderers/RenderManager.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp +index 7a99ac4..4b03c86 100644 +--- a/xbmc/cores/VideoRenderers/RenderManager.cpp ++++ b/xbmc/cores/VideoRenderers/RenderManager.cpp +@@ -244,7 +244,7 @@ bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsi + CSingleLock lock2(m_presentlock); + + /* make sure any queued frame was fully presented */ +- XbmcThreads::EndTime endtime(5000); ++ XbmcThreads::EndTime endtime(10000); + while(m_presentstep != PRESENT_IDLE && m_presentstep != PRESENT_READY) + { + if(endtime.IsTimePast()) +-- +2.5.0 + + +From 6d406c27db47e8ac260f436a2a09187bb495a6ba Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 23 Mar 2016 17:39:47 +0000 +Subject: [PATCH 94/94] Revert "[rbp] Use default resampling setting on Pi2" + +This reverts commit e6b2f1693480ad5d8062acaed512393e72fb9b1d. +--- + system/settings/rbp2.xml | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/system/settings/rbp2.xml b/system/settings/rbp2.xml +index 52778ec..8cc8f19 100644 +--- a/system/settings/rbp2.xml ++++ b/system/settings/rbp2.xml +@@ -23,11 +23,6 @@ + + + +- +- +- 30 +- +- + + + +-- +2.5.0 + diff --git a/projects/RPi2/patches/kodi/kodi-001-jarvis-rpb-backports.patch b/projects/RPi2/patches/kodi/kodi-001-jarvis-rbp-backports.patch similarity index 95% rename from projects/RPi2/patches/kodi/kodi-001-jarvis-rpb-backports.patch rename to projects/RPi2/patches/kodi/kodi-001-jarvis-rbp-backports.patch index 16d501a0c6..89a72271ff 100644 --- a/projects/RPi2/patches/kodi/kodi-001-jarvis-rpb-backports.patch +++ b/projects/RPi2/patches/kodi/kodi-001-jarvis-rbp-backports.patch @@ -1,7 +1,8 @@ -From 927d6ad60e7f1d38b5263b12cc60910d51de31e0 Mon Sep 17 00:00:00 2001 +From 0418867953596638f7c8bd9a73f993588ef9ca14 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Sep 2015 19:11:14 +0100 -Subject: [PATCH] Enable concealed error frames, but discard them when returned +Subject: [PATCH 01/94] Enable concealed error frames, but discard them when + returned --- xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 17 ++++++++--------- @@ -50,11 +51,15 @@ index bebe136..727a9ea 100644 if (status != MMAL_SUCCESS) CLog::Log(LOGERROR, "%s::%s Failed to disable error concealment on %s (status=%x %s)", CLASSNAME, __func__, m_dec_input->name, status, mmal_status_to_string(status)); -From cded5cf3c63fb1a3481c3983b232fad07ba3f218 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 66a74ecce9891a49ef5af36ecb216524d399d309 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 26 Aug 2015 21:47:41 +0100 -Subject: [PATCH] Reduce framerate of high framerate videos when not running - fullscreen +Subject: [PATCH 02/94] Reduce framerate of high framerate videos when not + running fullscreen --- xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 14 +++++++++++++- @@ -106,7 +111,7 @@ diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdpl index d081b9c..0ea6ecd 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -123,6 +123,8 @@ class CMMALVideo : public CDVDVideoCodec +@@ -123,6 +123,8 @@ protected: bool SendCodecConfigData(); CDVDStreamInfo m_hints; @@ -115,10 +120,14 @@ index d081b9c..0ea6ecd 100644 // Components MMAL_INTERLACETYPE_T m_interlace_mode; EINTERLACEMETHOD m_interlace_method; -From f72fa574396fd38e389ae16aed207ce46eeefdb1 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 9aaaf4cc73da770a7900e5a8095500150fb46db7 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 2 Dec 2015 20:08:05 +0000 -Subject: [PATCH] Remove preroll +Subject: [PATCH 03/94] Remove preroll --- xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 12 ++---------- @@ -181,7 +190,7 @@ diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdpl index 0ea6ecd..50ac0e3 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -131,7 +131,6 @@ class CMMALVideo : public CDVDVideoCodec +@@ -131,7 +131,6 @@ protected: double m_demuxerPts; double m_decoderPts; int m_speed; @@ -189,10 +198,14 @@ index 0ea6ecd..50ac0e3 100644 CCriticalSection m_sharedSection; MMAL_COMPONENT_T *m_dec; -From da33fcf121d1dbc2455ca2ddfa9e709551cb79f4 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 103c4eb8a0a6d33bbcb42f128b82d16a5997386f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 2 Dec 2015 22:35:11 +0000 -Subject: [PATCH] Remove demux queue +Subject: [PATCH 04/94] Remove demux queue --- xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 81 ++++------------------ @@ -359,7 +372,7 @@ diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdpl index 50ac0e3..f4df09c 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -64,13 +64,6 @@ class CMMALVideoBuffer +@@ -64,13 +64,6 @@ private: class CMMALVideo : public CDVDVideoCodec { @@ -373,7 +386,7 @@ index 50ac0e3..f4df09c 100644 public: CMMALVideo(); virtual ~CMMALVideo(); -@@ -110,9 +103,6 @@ class CMMALVideo : public CDVDVideoCodec +@@ -110,9 +103,6 @@ protected: float m_aspect_ratio; const char *m_pFormatName; @@ -383,10 +396,14 @@ index 50ac0e3..f4df09c 100644 // mmal output buffers (video frames) pthread_mutex_t m_output_mutex; std::queue m_output_ready; -From 24dcd8662b2ba576f4a5621070c1b80de2d561cb Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 8869a77fbd72a0e9a341ad859a08c3dd8f64eff0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 2 Dec 2015 20:10:33 +0000 -Subject: [PATCH] Remove time based limit on submitted packets +Subject: [PATCH 05/94] Remove time based limit on submitted packets --- xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 24 +++------------------- @@ -458,7 +475,7 @@ diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdpl index f4df09c..8f84557 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -118,8 +118,6 @@ class CMMALVideo : public CDVDVideoCodec +@@ -118,8 +118,6 @@ protected: // Components MMAL_INTERLACETYPE_T m_interlace_mode; EINTERLACEMETHOD m_interlace_method; @@ -467,10 +484,14 @@ index f4df09c..8f84557 100644 int m_speed; CCriticalSection m_sharedSection; -From 6e6d985927e7bc626a2c2b68ce7b1a6228453eaf Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 2aee01ad85f6233bc6f850d75c594a0e7838930f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Dec 2015 22:18:47 +0000 -Subject: [PATCH] Add back logging of data queued in decoder +Subject: [PATCH 06/94] Add back logging of data queued in decoder --- xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 22 +++++++++++++++++++++- @@ -542,7 +563,7 @@ diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdpl index 8f84557..f4df09c 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -118,6 +118,8 @@ class CMMALVideo : public CDVDVideoCodec +@@ -118,6 +118,8 @@ protected: // Components MMAL_INTERLACETYPE_T m_interlace_mode; EINTERLACEMETHOD m_interlace_method; @@ -551,11 +572,15 @@ index 8f84557..f4df09c 100644 int m_speed; CCriticalSection m_sharedSection; -From 83759ec3a304fe3206f629d2c4eff4ba8bb16948 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 011ad87c7a06222473b06654ab4df0a292edc956 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 8 Dec 2015 11:40:17 +0000 -Subject: [PATCH] Try to minimise latency through hardware decoder. This could - reduce performance but keeps videoplayer happier +Subject: [PATCH 07/94] Try to minimise latency through hardware decoder. This + could reduce performance but keeps videoplayer happier --- xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 42 +++++++++++++++++----- @@ -639,10 +664,15 @@ index 35a9847..f96cc14 100644 return ret; } -From f66265227a97d12f958318188bf63c2db0da6fc4 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 3302e62bfc5a964bdb7beb98ca0624b138edadaa Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Jul 2015 19:27:25 +0100 -Subject: [PATCH] Enable QPU based deinterlace and remove resolution limit +Subject: [PATCH 08/94] Enable QPU based deinterlace and remove resolution + limit --- xbmc/cores/VideoRenderers/MMALRenderer.cpp | 2 +- @@ -709,10 +739,14 @@ index e50c13a..20ad4fa 100644 if (!advanced_deinterlace) image_filter.eImageFilter = OMX_ImageFilterDeInterlaceFast; else -From f32634dbefc6530ed540a7a57009deaea187fc71 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From db5f80d9955ecf1fa37c12f10bc48d8b84871f99 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 16 Aug 2015 15:46:33 +0100 -Subject: [PATCH] Allow deinterlace with software decode +Subject: [PATCH 09/94] Allow deinterlace with software decode --- xbmc/cores/VideoRenderers/MMALRenderer.cpp | 9 +++++++++ @@ -745,11 +779,57 @@ index bee3af1..9b5c666 100644 return m_sourceWidth * m_sourceHeight <= 576 * 720 ? VS_INTERLACEMETHOD_MMAL_ADVANCED : VS_INTERLACEMETHOD_MMAL_BOB; } -From e664ff7a544b0cb1b24f095ff6f408425e4fb3e4 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 36180656b74f719ee0c2a8748a5d12d5ccbea93b Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 15 Sep 2015 22:26:26 +0100 +Subject: [PATCH 10/94] omxplayer: Don't use AutoInterlaceMethod it changes at + start of file + +--- + xbmc/cores/omxplayer/OMXHelper.cpp | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/xbmc/cores/omxplayer/OMXHelper.cpp b/xbmc/cores/omxplayer/OMXHelper.cpp +index de493a2..7251fc1 100644 +--- a/xbmc/cores/omxplayer/OMXHelper.cpp ++++ b/xbmc/cores/omxplayer/OMXHelper.cpp +@@ -130,19 +130,19 @@ bool OMXDoProcessing(struct SOmxPlayerState &m_OmxPlayerState, int m_playSpeed, + bool audio_fifo_low = false, video_fifo_low = false, audio_fifo_high = false, video_fifo_high = false; + + if (m_OmxPlayerState.interlace_method == VS_INTERLACEMETHOD_MAX) +- m_OmxPlayerState.interlace_method = g_renderManager.AutoInterlaceMethod(CMediaSettings::GetInstance().GetCurrentVideoSettings().m_InterlaceMethod); ++ m_OmxPlayerState.interlace_method = CMediaSettings::GetInstance().GetCurrentVideoSettings().m_InterlaceMethod; + + // if deinterlace setting has changed, we should close and open video + if (m_OmxPlayerState.current_deinterlace != CMediaSettings::GetInstance().GetCurrentVideoSettings().m_DeinterlaceMode || + (m_OmxPlayerState.current_deinterlace != VS_DEINTERLACEMODE_OFF && +- m_OmxPlayerState.interlace_method != g_renderManager.AutoInterlaceMethod(CMediaSettings::GetInstance().GetCurrentVideoSettings().m_InterlaceMethod))) ++ m_OmxPlayerState.interlace_method != CMediaSettings::GetInstance().GetCurrentVideoSettings().m_InterlaceMethod)) + { + CLog::Log(LOGNOTICE, "%s - Reopen stream due to interlace change (%d,%d,%d,%d)", __FUNCTION__, + m_OmxPlayerState.current_deinterlace, CMediaSettings::GetInstance().GetCurrentVideoSettings().m_DeinterlaceMode, +- m_OmxPlayerState.interlace_method, g_renderManager.AutoInterlaceMethod(CMediaSettings::GetInstance().GetCurrentVideoSettings().m_InterlaceMethod)); ++ m_OmxPlayerState.interlace_method, CMediaSettings::GetInstance().GetCurrentVideoSettings().m_InterlaceMethod); + + m_OmxPlayerState.current_deinterlace = CMediaSettings::GetInstance().GetCurrentVideoSettings().m_DeinterlaceMode; +- m_OmxPlayerState.interlace_method = g_renderManager.AutoInterlaceMethod(CMediaSettings::GetInstance().GetCurrentVideoSettings().m_InterlaceMethod); ++ m_OmxPlayerState.interlace_method = CMediaSettings::GetInstance().GetCurrentVideoSettings().m_InterlaceMethod; + reopen_stream = true; + } + +-- +2.5.0 + + +From a0ce519db0d21eb3e9a2dfd070b0859d72784569 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 16 Sep 2015 15:05:37 +0100 -Subject: [PATCH] Avoid calling render callback with the lock held to avoid a - deadlock +Subject: [PATCH 11/94] Avoid calling render callback with the lock held to + avoid a deadlock --- xbmc/cores/omxplayer/OMXVideo.cpp | 27 ++++++++++++++------------- @@ -842,7 +922,7 @@ index d0634bb..7baefa5 100644 class COMXVideo { public: -@@ -50,7 +58,7 @@ class COMXVideo +@@ -50,7 +58,7 @@ public: // Required overrides bool SendDecoderConfig(); bool Open(CDVDStreamInfo &hints, OMXClock *clock, EDEINTERLACEMODE deinterlace = VS_DEINTERLACEMODE_OFF, bool hdmi_clock_sync = false); @@ -851,10 +931,15 @@ index d0634bb..7baefa5 100644 void RegisterResolutionUpdateCallBack(void *ctx, ResolutionUpdateCallBackFn callback) { m_res_ctx = ctx; m_res_callback = callback; } void Close(void); unsigned int GetFreeSpace(); -From a454c0556e42cb01096a1b459f4c202c0982f961 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 8d8e6b7c7b0af50800e2489a0e370c5e656dddb1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 16 Dec 2015 22:03:56 +0000 -Subject: [PATCH] Add settings option to enable MVC and frame packing support +Subject: [PATCH 12/94] Add settings option to enable MVC and frame packing + support --- .../resource.language.en_gb/resources/strings.po | 22 ++++++++++++++++++++++ @@ -983,7 +1068,7 @@ diff --git a/xbmc/settings/Settings.h b/xbmc/settings/Settings.h index 55e150d..f3ba426 100644 --- a/xbmc/settings/Settings.h +++ b/xbmc/settings/Settings.h -@@ -137,6 +137,7 @@ class CSettings : public CSettingCreator, public CSettingControlCreator +@@ -137,6 +137,7 @@ public: static const std::string SETTING_VIDEOPLAYER_USEMMAL; static const std::string SETTING_VIDEOPLAYER_USESTAGEFRIGHT; static const std::string SETTING_VIDEOPLAYER_LIMITGUIUPDATE; @@ -991,7 +1076,7 @@ index 55e150d..f3ba426 100644 static const std::string SETTING_MYVIDEOS_SELECTACTION; static const std::string SETTING_MYVIDEOS_EXTRACTFLAGS; static const std::string SETTING_MYVIDEOS_EXTRACTCHAPTERTHUMBS; -@@ -300,6 +301,7 @@ class CSettings : public CSettingCreator, public CSettingControlCreator +@@ -300,6 +301,7 @@ public: static const std::string SETTING_VIDEOSCREEN_GUICALIBRATION; static const std::string SETTING_VIDEOSCREEN_TESTPATTERN; static const std::string SETTING_VIDEOSCREEN_LIMITEDRANGE; @@ -999,10 +1084,14 @@ index 55e150d..f3ba426 100644 static const std::string SETTING_AUDIOOUTPUT_AUDIODEVICE; static const std::string SETTING_AUDIOOUTPUT_CHANNELS; static const std::string SETTING_AUDIOOUTPUT_CONFIG; -From 02255c425298a1240c143458e1e800e8ed45c799 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 7e941d7f0e1fc87d5d43e36b1febb3f7681f1e18 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Dec 2015 15:38:34 +0000 -Subject: [PATCH] Don't adjust 3d rectangles in bypass mode +Subject: [PATCH 13/94] Don't adjust 3d rectangles in bypass mode --- xbmc/cores/VideoRenderers/BaseRenderer.cpp | 55 ++++++++++++++++-------------- @@ -1077,10 +1166,14 @@ index 7889cf8..d4bb306 100644 } CalcNormalDisplayRect(m_viewRect.x1, m_viewRect.y1, m_viewRect.Width(), m_viewRect.Height(), GetAspectRatio() * CDisplaySettings::GetInstance().GetPixelRatio(), CDisplaySettings::GetInstance().GetZoomAmount(), CDisplaySettings::GetInstance().GetVerticalShift()); -From 69364688942df22b40b5190a5cdf1a83d450a8d0 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 1b8497b41521ac8277f2fab23baa6980d5680607 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 14 Mar 2015 12:38:08 +0000 -Subject: [PATCH] Switch to using transform flags for 3d modes +Subject: [PATCH 14/94] Switch to using transform flags for 3d modes --- xbmc/cores/VideoRenderers/MMALRenderer.cpp | 100 +++++++++--------------- @@ -1454,7 +1547,7 @@ diff --git a/xbmc/cores/omxplayer/OMXVideo.h b/xbmc/cores/omxplayer/OMXVideo.h index 7baefa5..31982b4 100644 --- a/xbmc/cores/omxplayer/OMXVideo.h +++ b/xbmc/cores/omxplayer/OMXVideo.h -@@ -67,7 +67,7 @@ class COMXVideo +@@ -67,7 +67,7 @@ public: void Reset(void); void SetDropState(bool bDrop); std::string GetDecoderName() { return m_video_codec_name; }; @@ -1492,10 +1585,14 @@ index 5d5b74b..443d037 100644 CLog::Log(LOGDEBUG, "EGL set resolution %dx%d -> %dx%d @ %.2f fps (%d,%d) flags:%x aspect:%.2f\n", 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 e8bc95c119f47640f864c50f4865c4cf934a94c5 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 6a912e2c074aa44c0dc288a64e0e4dff1edccc77 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 21 Jun 2015 17:42:03 +0100 -Subject: [PATCH] Remove unused Support3D function +Subject: [PATCH 15/94] Remove unused Support3D function --- xbmc/windowing/egl/WinSystemEGL.cpp | 29 ----------------------------- @@ -1546,7 +1643,7 @@ diff --git a/xbmc/windowing/egl/WinSystemEGL.h b/xbmc/windowing/egl/WinSystemEGL 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 +@@ -59,7 +59,6 @@ public: virtual void Register(IDispResource *resource); virtual void Unregister(IDispResource *resource); @@ -1554,10 +1651,15 @@ index 9d4baf6..1ec4225 100644 virtual bool ClampToGUIDisplayLimits(int &width, int &height); EGLConfig GetEGLConfig(); -From fdef730bacc4fb43a202eb65187a35405948951d Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 299d2a7f59caf3e44aa04c67c5a4bcceae6a4310 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 16 Dec 2015 21:08:34 +0000 -Subject: [PATCH] Avoid switching stereo mode based on current display mode +Subject: [PATCH 16/94] Avoid switching stereo mode based on current display + mode --- xbmc/guilib/GraphicContext.cpp | 24 ------------------------ @@ -1598,11 +1700,15 @@ index a1b8812..60979bb 100644 RESOLUTION_INFO info_mod = GetResInfo(res); -From be33e26546e5beb44bfacbff7d5f1cbfaa15ff8f Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 1d0be437addc2225a969b42088511d5b2e50c9f0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 21 Jun 2015 18:53:29 +0100 -Subject: [PATCH] Drop reporting 3D modes and just use current rendering mode - to request 3D signalling +Subject: [PATCH 17/94] Drop reporting 3D modes and just use current rendering + mode to request 3D signalling [rbp] Add ntsc version of 48Hz mode @@ -1862,7 +1968,7 @@ diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h b/xbmc/windowing/egl/ index a0acb1a..e5bcae7 100644 --- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h +++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h -@@ -69,7 +69,7 @@ class CEGLNativeTypeRaspberryPI : public CEGLNativeType +@@ -69,7 +69,7 @@ private: static void CallbackTvServiceCallback(void *userdata, uint32_t reason, uint32_t param1, uint32_t param2); void DestroyDispmaxWindow(); @@ -1872,10 +1978,14 @@ index a0acb1a..e5bcae7 100644 + int AddUniqueResolution(RESOLUTION_INFO &res, std::vector &resolutions, bool desktop = false); #endif }; -From 4bf34dc54fc0b4e5255eb8d2f2834287fa704680 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From e40391cacdb8e49b0af12cfa093d9362daf41842 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 22 Jun 2015 16:27:15 +0100 -Subject: [PATCH] Consider stereomode when creating a new window +Subject: [PATCH 18/94] Consider stereomode when creating a new window We might be changing from a non-3D to a 3D mode --- @@ -1923,7 +2033,7 @@ diff --git a/xbmc/windowing/egl/WinSystemEGL.h b/xbmc/windowing/egl/WinSystemEGL index 1ec4225..a33dedc 100644 --- a/xbmc/windowing/egl/WinSystemEGL.h +++ b/xbmc/windowing/egl/WinSystemEGL.h -@@ -78,6 +78,7 @@ class CWinSystemEGL : public CWinSystemBase, public CRenderSystemGLES +@@ -78,6 +78,7 @@ protected: EGLSurface m_surface; EGLContext m_context; EGLConfig m_config; @@ -1931,11 +2041,15 @@ index 1ec4225..a33dedc 100644 CEGLWrapper *m_egl; std::string m_extensions; -From 9167ed5222005d9b6788e6e52ea765f9d73fb13e Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From f917226a056672e2266d30540e79caee45ec869f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 18:19:32 +0100 -Subject: [PATCH] [rbp/omxplayer] When opening a stream don't try to update gui - so often +Subject: [PATCH 19/94] [rbp/omxplayer] When opening a stream don't try to + update gui so often --- xbmc/dialogs/GUIDialogBusy.cpp | 4 ++++ @@ -1957,10 +2071,14 @@ index 6816b45..6cc5a8f 100644 { g_windowManager.ProcessRenderLoop(false); if (allowCancel && dialog->IsCanceled()) -From 6bad783448faf1a5971a68fe8a2572c0435e125c Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From c5007f5c066a37c5d052816688e877b1559b28a9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 29 Apr 2014 15:23:22 +0100 -Subject: [PATCH] [ffmpeg] Speed up wtv index creation +Subject: [PATCH 20/94] [ffmpeg] Speed up wtv index creation The index creation is O(N^2) with number of entries (typically thousands). On a Pi this can take more than 60 seconds to execute for a recording of a few hours. @@ -2045,11 +2163,15 @@ index 0000000..d829898 + } + } + } -From 48f5c6c5ef76b9c63c1b41ce88b1f36493c63d12 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From b9a63ad68ba584cd374345d48614ea4cd04bbce1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 8 Mar 2014 15:36:06 +0000 -Subject: [PATCH] [hifiberry] Hack: force it to be recognised as IEC958 capable - to enable passthrough options +Subject: [PATCH 21/94] [hifiberry] Hack: force it to be recognised as IEC958 + capable to enable passthrough options --- xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp | 4 ++++ @@ -2070,10 +2192,14 @@ index e22db7a..0120bd5 100644 if (info.m_deviceType == AE_DEVTYPE_HDMI && info.m_displayName.size() > 5 && info.m_displayName.substr(info.m_displayName.size()-5) == " HDMI") { -From c043110afb41f25bbced31dd01249d74aa220d68 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 5bf1a1d26e0c3e4dd2c6a2e71f2550fb7eab2d64 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 1 May 2014 16:28:39 +0100 -Subject: [PATCH] Improved file buffering in CArchive +Subject: [PATCH 22/94] 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 @@ -2096,7 +2222,7 @@ diff --git a/xbmc/utils/Archive.h b/xbmc/utils/Archive.h index 6ed0f8f..8506d95 100644 --- a/xbmc/utils/Archive.h +++ b/xbmc/utils/Archive.h -@@ -154,9 +154,17 @@ class CArchive +@@ -154,9 +154,17 @@ protected: * than waiting until we attempt to put more data into an already full buffer */ if (m_BufferRemain > size) { @@ -2114,7 +2240,7 @@ index 6ed0f8f..8506d95 100644 return *this; } else -@@ -171,9 +179,17 @@ class CArchive +@@ -171,9 +179,17 @@ protected: /* Note, refilling the buffer is deferred until we know we need to read more from it */ if (m_BufferRemain >= size) { @@ -2132,10 +2258,14 @@ index 6ed0f8f..8506d95 100644 return *this; } else -From b261ee73179e6cdcdee76ec5b55337f2433a9376 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 5be85818f72f316ac0419273069fd96d02ac8eb7 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 12 Aug 2014 00:31:36 +0100 -Subject: [PATCH] [omxcodec] Don't force software codec with dvds +Subject: [PATCH 23/94] [omxcodec] Don't force software codec with dvds --- xbmc/cores/dvdplayer/DVDPlayer.cpp | 2 ++ @@ -2155,10 +2285,15 @@ index 4ffe33a..4b09e8f 100644 } else if (m_pInputStream && m_pInputStream->IsStreamType(DVDSTREAM_TYPE_PVRMANAGER)) { -From eafbec7c06d774bfaae87697629eb0535de8f529 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 60f3a3087411daae5e3a690820fe4bf65c295532 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 10 Aug 2014 16:45:16 +0100 -Subject: [PATCH] filesystem: Make support of browsing into archives optional +Subject: [PATCH 24/94] 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. It's quite common to see reports of a large rar file that causes xbmc to crash with an out-of-memory error when browsing or scanning. @@ -2239,10 +2374,15 @@ index a1d4ee4..4929283 100644 if (url.IsFileType("xbt")) { CURL xbtUrl = URIUtils::CreateArchivePath("xbt", url); -From eed8fd81ac11ce6ea49f77efc9ae5f0428a12622 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 0417dd5c5b0c15ddf536cea15e1881594ab0eef6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 27 Oct 2014 13:06:57 +0000 -Subject: [PATCH] [rbp] Make cachemembuffersize default depend on memory size +Subject: [PATCH 25/94] [rbp] Make cachemembuffersize default depend on memory + size --- xbmc/linux/RBP.cpp | 10 ++++++++++ @@ -2296,7 +2436,7 @@ diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h index 9559914..7fc8b42 100644 --- a/xbmc/linux/RBP.h +++ b/xbmc/linux/RBP.h -@@ -48,6 +48,7 @@ class CRBP +@@ -48,6 +48,7 @@ public: ~CRBP(); bool Initialize(); @@ -2342,11 +2482,15 @@ index bc3aa8c..562757e 100644 m_initialized = true; } -From 607037670f5ce73906706f1649312d9137bb1cdb Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 66ca5923eb98f9fafcd35487c03079b7326fee07 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 30 May 2014 14:58:43 +0100 -Subject: [PATCH] [settings] Experiment: Report DESKTOP resolution in video - settings +Subject: [PATCH 26/94] [settings] Experiment: Report DESKTOP resolution in + video settings --- xbmc/settings/DisplaySettings.cpp | 3 +++ @@ -2366,11 +2510,15 @@ index 7993a73..761385b 100644 list.push_back(std::make_pair( StringUtils::Format("%dx%d%s", resolution->width, resolution->height, ModeFlagsToString(resolution->flags, false).c_str()), -From 9ccc337d1d203b7e8205d765a141a805dfcf0f00 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 0a2735dd4f859337281ff77d2f02b781c94f98c5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 19 Sep 2014 11:54:49 +0100 -Subject: [PATCH] [dvdplayer/rbp] Add pi specific option to maintain vsync with - pll adjustment +Subject: [PATCH 27/94] [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". This uses video clock (so perfect video syncing) but avoids having to resample @@ -2582,7 +2730,7 @@ diff --git a/xbmc/cores/dvdplayer/DVDPlayerAudio.h b/xbmc/cores/dvdplayer/DVDPla index 014574d..409b2d7 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerAudio.h +++ b/xbmc/cores/dvdplayer/DVDPlayerAudio.h -@@ -228,6 +228,9 @@ class CDVDPlayerAudio : public CThread, public IDVDStreamPlayerAudio +@@ -228,6 +228,9 @@ protected: bool m_prevskipped; double m_maxspeedadjust; double m_resampleratio; //resample ratio when using SYNC_RESAMPLE, used for the codec info @@ -2625,7 +2773,7 @@ diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h index 7fc8b42..db2fade 100644 --- a/xbmc/linux/RBP.h +++ b/xbmc/linux/RBP.h -@@ -64,6 +64,8 @@ class CRBP +@@ -64,6 +64,8 @@ public: unsigned char *CaptureDisplay(int width, int height, int *stride, bool swap_red_blue, bool video_only = true); DllOMX *GetDllOMX() { return m_OMX ? m_OMX->GetDll() : NULL; } void WaitVsync(); @@ -2634,7 +2782,7 @@ index 7fc8b42..db2fade 100644 private: DllBcmHost *m_DllBcmHost; -@@ -80,6 +82,7 @@ class CRBP +@@ -80,6 +82,7 @@ private: CEvent m_vsync; class DllLibOMXCore; CCriticalSection m_critSection; @@ -2674,11 +2822,15 @@ index 6475350..93de9bd 100644 std::string m_audioDefaultPlayer; float m_audioPlayCountMinimumPercent; bool m_dvdplayerIgnoreDTSinWAV; -From 9284250ce7e47e489dd5497379112aaff306836e Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From c7f85eb57480d0ea7296ab6adac768334f1d1889 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 24 Sep 2014 23:13:52 +0100 -Subject: [PATCH] [audio] Add settings option to boost centre channel when - downmixing +Subject: [PATCH 28/94] [audio] Add settings option to boost centre channel + when downmixing This allows a dB volume increase to be added to centre channel. This can help improve dialgue in the presence of background music/effects. @@ -2766,7 +2918,7 @@ index e4ddf9e..625ea88 100644 if (remapLayout) { diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -index 78071493..698a6ae 100644 +index 7807149..698a6ae 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 @@ -2799,10 +2951,14 @@ index 08b1b84..70d0866 100644 // stereo upmix if (upmix && m_src_channels == 2 && m_dst_channels > 2) -From 59888ef17bb7f03377208399ae46ec49b0789481 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 1592ab35c711338d52ad1ac08f79ff2fd3365020 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 27 Oct 2014 15:23:51 +0000 -Subject: [PATCH] [rbp] Default extract thumbnails to false +Subject: [PATCH 29/94] [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 @@ -2831,10 +2987,15 @@ index 7a170c2..1506035 100644
-From 9b4bb9c37f2123332556f2a9183c59823c31fc68 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 1d482f503a08b533b17640759b9f61bad2391743 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 10 Feb 2015 15:29:16 +0000 -Subject: [PATCH] [libcec] Add repeating keypress patch from popcornmix' repo +Subject: [PATCH 30/94] [libcec] Add repeating keypress patch from popcornmix' + repo --- tools/depends/target/libcec/Makefile | 1 + @@ -3719,10 +3880,14 @@ index 0000000..8366a69 +-- +1.9.1 + -From aae277129fda65177902a4b3552b69e81ca60082 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 63cf430f0c46993da63b37ded994cf1bc964dece Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 28 Oct 2014 00:19:40 +0000 -Subject: [PATCH] [cec] Add settings for configuring button repeats +Subject: [PATCH 31/94] [cec] Add settings for configuring button repeats --- addons/resource.language.en_gb/resources/strings.po | 15 +++++++++++++++ @@ -3802,10 +3967,14 @@ index e0d8dae..f738c84 100644 if (GetSettingBool("pause_playback_on_deactivate")) { -From c87e546b73f1b58c4132cac53ae76299f3807a1b Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 3550128073031d9a7560b76c1f215acfdf58bc1d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Nov 2014 23:17:46 +0000 -Subject: [PATCH] [cec] Don't discard buttons when repeat mode is enabled +Subject: [PATCH 32/94] [cec] Don't discard buttons when repeat mode is enabled --- xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 5 ++++- @@ -3827,10 +3996,14 @@ index f738c84..58d7d0d 100644 { if (m_currentButton.iButton == key.iButton && m_currentButton.iDuration == 0) { -From 3aaafcb5d5dfaa47e4285c5277e9303a583e94a8 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 8dca506d73857bc367f3e4ce0a4c95c622d269da Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 4 Nov 2014 18:50:00 +0000 -Subject: [PATCH] [cec] Temp - more logging +Subject: [PATCH 33/94] [cec] Temp - more logging --- xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 8 +++++++- @@ -3881,10 +4054,14 @@ index 58d7d0d..dfba61a 100644 m_buttonQueue.push_back(key); } -From ffba32357856396008e26926c52cb27bf7ad5b54 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From a211f8b79ba4842fcde3cb56abc5a2c2b179ba74 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 15 Nov 2014 12:03:34 +0000 -Subject: [PATCH] [dvdplayer] Add lock for player creation +Subject: [PATCH 34/94] [dvdplayer] Add lock for player creation --- xbmc/cores/dvdplayer/DVDPlayer.cpp | 3 +++ @@ -3923,16 +4100,20 @@ diff --git a/xbmc/cores/dvdplayer/DVDPlayer.h b/xbmc/cores/dvdplayer/DVDPlayer.h index 2f00647..b1418e3 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.h +++ b/xbmc/cores/dvdplayer/DVDPlayer.h -@@ -567,4 +567,5 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer +@@ -567,4 +567,5 @@ protected: // omxplayer variables struct SOmxPlayerState m_OmxPlayerState; bool m_omxplayer_mode; // using omxplayer acceleration + CCriticalSection m_players_lock; }; -From 806552069a7085e7ec945502c5c9f325ec84db35 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 385ad863ed94508583882aff64a7e54d14ed89ae Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 24 Nov 2014 22:07:25 +0000 -Subject: [PATCH] [dvdplayervideo] Prod decoder when in stills mode +Subject: [PATCH 35/94] [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. @@ -4008,10 +4189,14 @@ index 379c541..b5777a1 100644 } if (pMsg->IsType(CDVDMsg::GENERAL_SYNCHRONIZE)) -From e03cd165e45dcbff956cb81b0a8f0da15154f67b Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From bbc0384997b0bb8ccd869b320ec8d60fa31d5087 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 27 Nov 2014 16:31:56 +0000 -Subject: [PATCH] [languageinvoker] Reduce priority of python threads +Subject: [PATCH 36/94] [languageinvoker] Reduce priority of python threads --- xbmc/interfaces/generic/LanguageInvokerThread.cpp | 5 +++++ @@ -4033,10 +4218,14 @@ index fcdd063..16f0c89 100644 return true; } -From b4c3faf5d8b6dec5b1e867b3cda681e1cb6b3b88 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 77e535d399cebf699327d19490ef78519004a557 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 14 Dec 2013 16:55:05 +0000 -Subject: [PATCH] logging: Add microsecond timer to log messages +Subject: [PATCH 37/94] logging: Add microsecond timer to log messages --- xbmc/utils/log.cpp | 17 +++++++++++++++-- @@ -4088,11 +4277,15 @@ index 3443f12..31c4a99 100644 (uint64_t)CThread::GetCurrentThreadId(), levelNames[logLevel]) + strData; -From 93c5a32d9c502d13f55ce0500bb9860f6375ecc1 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 661ea4c177ec232a63a9a9ba21f855c5c581a2f3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 29 Nov 2014 15:25:16 +0000 -Subject: [PATCH] [rbp] hack: wait for splash to complete before changing hdmi - mode +Subject: [PATCH 38/94] [rbp] hack: wait for splash to complete before changing + hdmi mode --- xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 49 +++++++++++++++++++++++++ @@ -4164,10 +4357,15 @@ index ee29770..ff0d3e3 100644 DestroyDispmaxWindow(); RENDER_STEREO_MODE stereo_mode = g_graphicsContext.GetStereoMode(); -From 89e8ca28f5f135b3eea72237c46d48c195cb555c Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 50bec5d613ec9e5b1b946f904776565de130eafd Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 11 Dec 2014 17:00:57 +0000 -Subject: [PATCH] Fix for UI not showing both extractflags and extractthumb +Subject: [PATCH 39/94] Fix for UI not showing both extractflags and + extractthumb --- addons/resource.language.en_gb/resources/strings.po | 11 ++++++++--- @@ -4229,11 +4427,15 @@ index 918e8bf..61e1a22 100644 true -From 9648793c91db1b59c4b2ae741ca81fe150462ee2 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 88fcb5323a0a277feb21bcba9ef62986089aef46 Mon Sep 17 00:00:00 2001 From: anaconda Date: Thu, 11 Sep 2014 21:30:43 +0200 -Subject: [PATCH] Disable autoscrolling while on screensaver and while opening - streams. +Subject: [PATCH 40/94] Disable autoscrolling while on screensaver and while + opening streams. --- xbmc/Application.cpp | 10 ++++++++++ @@ -4266,7 +4468,7 @@ diff --git a/xbmc/Application.h b/xbmc/Application.h index d7e5eee..a34ed98 100644 --- a/xbmc/Application.h +++ b/xbmc/Application.h -@@ -390,6 +390,8 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs +@@ -390,6 +390,8 @@ public: */ void UnregisterActionListener(IActionListener *listener); @@ -4362,10 +4564,14 @@ index d7bc1c5..ac76629 100644 { if (m_lastRenderTime) m_autoScrollDelayTime += currentTime - m_lastRenderTime; -From 31ca2e2d20ac422b29163bdedc4a3442ebc1fb42 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From ba23654e3dfab6001f1087babc1fb6ebb050b18d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 13 Dec 2014 18:35:20 +0000 -Subject: [PATCH] [demuxer] Avoid memcpy on every demuxer packet +Subject: [PATCH 41/94] [demuxer] Avoid memcpy on every demuxer packet Avoids an unnecessary memcpy on every demuxer packet which for high bitrate videos can be significant. @@ -4462,10 +4668,14 @@ index ab298b2..10c5ee0 100644 delete pPacket; } catch(...) { -From c5ab0539c4924aa9edc3decc38b667f8dd5984ae Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 5fa43ef359f31432130fe4e92fbd0a1235ca16c2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 15 Feb 2015 14:06:12 +0000 -Subject: [PATCH] [mmal] Allow mmal codec for dvd stills +Subject: [PATCH 42/94] [mmal] Allow mmal codec for dvd stills --- xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp | 7 +++++++ @@ -4496,10 +4706,14 @@ index 84e9ef1..f920f49 100644 if (hint.stills && (hint.codec == AV_CODEC_ID_MPEG2VIDEO || hint.codec == AV_CODEC_ID_MPEG1VIDEO)) { // If dvd is an mpeg2 and hint.stills -From 9a5738bae07d81d195bb362a67c0cf3112cc50d5 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From b128dfc4848e7a102208c8ec95e1390c9a7d6d47 Mon Sep 17 00:00:00 2001 From: anaconda Date: Wed, 25 Feb 2015 18:22:21 +0100 -Subject: [PATCH] Load OSD dialogs on startup. +Subject: [PATCH 43/94] 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. @@ -4593,11 +4807,195 @@ index b248566..96c63cd 100644 CGUIDialogVideoSettings::~CGUIDialogVideoSettings() { } -From 0c40bf778b0b018574abf05ad841d1606e237184 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 22ccff2dc885a214b951e69323c9045830607ee4 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sat, 7 Mar 2015 22:46:21 +0000 +Subject: [PATCH 44/94] configure: Add raspberry-pi2 platform + +--- + configure.ac | 14 +++++++-- + m4/xbmc_arch.m4 | 8 ++--- + tools/depends/Makefile.include.in | 2 +- + tools/depends/configure.ac | 38 ++++++++++++++++------- + tools/depends/target/Toolchain.cmake.in | 2 +- + tools/depends/target/Toolchain_binaddons.cmake.in | 2 +- + 6 files changed, 44 insertions(+), 22 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 55e73b9..7a06a31 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -698,8 +698,17 @@ case $use_platform in + raspberry-pi) + target_platform=target_raspberry_pi + use_neon=no +- use_arch="arm" + use_cpu=arm1176jzf-s ++ ;; ++ raspberry-pi2) ++ target_platform=target_raspberry_pi ++ use_neon=yes ++ use_cpu=cortex-a7 ++ ;; ++esac ++ ++if test "$target_platform" = "target_raspberry_pi" ; then ++ use_arch="arm" + use_hardcoded_tables="yes" + use_openmax=no + ARCH="arm" +@@ -708,8 +717,7 @@ case $use_platform in + USE_MMAL=1; AC_DEFINE([HAS_MMAL],[1],["Define to 1 if MMAL libs is enabled"]) + CFLAGS="$CFLAGS" + CXXFLAGS="$CXXFLAGS" +- ;; +-esac ++fi + + if test "$host_vendor" = "apple"; then + use_avahi=no +diff --git a/m4/xbmc_arch.m4 b/m4/xbmc_arch.m4 +index 0b66a82..adb8e97 100644 +--- a/m4/xbmc_arch.m4 ++++ b/m4/xbmc_arch.m4 +@@ -77,9 +77,7 @@ if test "$target_platform" = "target_android" ; then + AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -DTARGET_ANDROID") + fi + +-case $use_platform in +- raspberry-pi) +- AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_ARMEL -DTARGET_RASPBERRY_PI") +- ;; +-esac ++if test "$target_platform" = "target_raspberry_pi" ; then ++ AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_ARMEL -DTARGET_RASPBERRY_PI") ++fi + ]) +diff --git a/tools/depends/Makefile.include.in b/tools/depends/Makefile.include.in +index 6e37022..326e7b8 100644 +--- a/tools/depends/Makefile.include.in ++++ b/tools/depends/Makefile.include.in +@@ -20,7 +20,7 @@ NATIVE_OS=@build_os@ + CROSS_COMPILING=@cross_compiling@ + ARCH_DEFINES=@ARCH_DEFINES@ + NATIVE_ARCH_DEFINES=@NATIVE_ARCH_DEFINES@ +-TARGET_PLATFORM=@use_platform@ ++TARGET_PLATFORM=@target_platform@ + XCODE_VERSION=@use_xcode@ + AAPT=@AAPT@ + DX=@DX@ +diff --git a/tools/depends/configure.ac b/tools/depends/configure.ac +index 12935e3..478f5f0 100644 +--- a/tools/depends/configure.ac ++++ b/tools/depends/configure.ac +@@ -17,7 +17,8 @@ AC_ARG_WITH([toolchain], + AC_ARG_WITH([platform], + [AS_HELP_STRING([--with-platform], + [target platform [auto]])], +- [use_platform=$withval]) ++ [use_platform=$withval], ++ [target_platform=$withval]) + + AC_ARG_WITH([firmware], + [AS_HELP_STRING([--with-firmware], +@@ -302,34 +303,49 @@ case $host in + AC_MSG_ERROR(unsupported host ($use_host)) + esac + +-if test "$use_platform" = "raspberry-pi"; then ++case $use_platform in ++ raspberry-pi) ++ target_platform=raspberry_pi ++ use_neon=no ++ use_cpu=arm1176jzf-s ++ platform_cflags="-mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp" ++ platform_cxxflags="-mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp" ++ platform_ldflags="" ++ ;; ++ raspberry-pi2) ++ target_platform=raspberry_pi ++ use_neon=yes ++ use_cpu=cortex-a7 ++ platform_cflags="-fPIC -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4" ++ platform_cxxflags="-fPIC -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4" ++ platform_ldflags="-lpthread" ++ ;; ++esac ++ ++if test "$target_platform" = "raspberry_pi" ; then + if test -d "${use_firmware}/opt/vc/include"; then + : + else + AC_MSG_ERROR([Raspberry Pi firmware not found]) + fi +- use_neon=no + use_arch="arm" +- use_cpu="arm1176jzf-s" + use_hardcoded_tables="yes" +- use_alsa="no" + ARCH="arm" + platform_os="linux" + cross_compiling="yes" + use_host="arm-linux-gnueabihf" + deps_dir="$use_host" +- platform_cflags="-pipe -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfloat-abi=hard \ +- -mfpu=vfp -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated \ +- -Wno-deprecated-declarations -isystem${use_firmware}/opt/vc/include \ ++ platform_cflags+=" -pipe -mabi=aapcs-linux -Wno-psabi \ ++ -Wa,-mno-warn-deprecated -Wno-deprecated-declarations \ ++ -isystem${use_firmware}/opt/vc/include \ + -isystem${use_firmware}/opt/vc/include/interface/vcos/pthreads \ + -isystem${use_firmware}/opt/vc/include/interface/vmcs_host/linux" +- platform_cxxflags="-pipe -mcpu=arm1176jzf-s -mtune=arm1176jzf-s \ +- -mfloat-abi=hard -mfpu=vfp -mabi=aapcs-linux -Wno-psabi \ ++ platform_cxxflags+=" -pipe -mabi=aapcs-linux -Wno-psabi \ + -Wa,-mno-warn-deprecated -Wno-deprecated-declarations \ + -isystem${use_firmware}/opt/vc/include \ + -isystem${use_firmware}/opt/vc/include/interface/vcos/pthreads \ + -isystem${use_firmware}/opt/vc/include/interface/vmcs_host/linux" +- platform_ldflags="-L${use_firmware}/opt/vc/lib -lEGL -lGLESv2 -lbcm_host -lvcos \ ++ platform_ldflags+=" -L${use_firmware}/opt/vc/lib -lEGL -lGLESv2 -lbcm_host -lvcos \ + -lvchiq_arm" + fi + +diff --git a/tools/depends/target/Toolchain.cmake.in b/tools/depends/target/Toolchain.cmake.in +index 943be73..59385e8 100644 +--- a/tools/depends/target/Toolchain.cmake.in ++++ b/tools/depends/target/Toolchain.cmake.in +@@ -1,6 +1,6 @@ + SET(OS "@platform_os@") + SET(CPU "@use_cpu@") +-SET(PLATFORM "@use_platform@") ++SET(PLATFORM "@target_platform@") + IF("${OS}" STREQUAL "linux" OR "${OS}" STREQUAL "android") + SET(CMAKE_SYSTEM_NAME Linux) + ENDIF() +diff --git a/tools/depends/target/Toolchain_binaddons.cmake.in b/tools/depends/target/Toolchain_binaddons.cmake.in +index dc6d565..98494b4 100644 +--- a/tools/depends/target/Toolchain_binaddons.cmake.in ++++ b/tools/depends/target/Toolchain_binaddons.cmake.in +@@ -1,7 +1,7 @@ + set(CMAKE_SYSTEM_VERSION 1) + set(OS "@platform_os@") + set(CPU "@use_cpu@") +-set(PLATFORM "@use_platform@") ++set(PLATFORM "@target_platform@") + if("${OS}" STREQUAL "linux" OR "${OS}" STREQUAL "android") + set(CMAKE_SYSTEM_NAME Linux) + endif() +-- +2.5.0 + + +From a391a55f4d2e257a6716c8726165fe8d205cfffb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 14 Apr 2015 20:51:14 +0100 -Subject: [PATCH] [gui] Also limit GUI updates when in non full-screen video - mode +Subject: [PATCH 45/94] [gui] Also limit GUI updates when in non full-screen + video mode --- xbmc/Application.cpp | 4 +++- @@ -4625,10 +5023,14 @@ index c274e2f..212a5c7 100644 } g_windowManager.FrameMove(); } -From 4a5a77bd0d87ecbbc2f45f6f73a258210def3980 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 1fe321817d24a691808649fd3ee42d81ef57087e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 21 Apr 2015 14:32:07 +0100 -Subject: [PATCH] [mmalrenderer] Add sharpness control +Subject: [PATCH 46/94] [mmalrenderer] Add sharpness control --- addons/resource.language.en_gb/resources/strings.po | 2 +- @@ -4691,7 +5093,7 @@ diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.h b/xbmc/cores/VideoRenderer index d3e5129..a71e645 100644 --- a/xbmc/cores/VideoRenderers/MMALRenderer.h +++ b/xbmc/cores/VideoRenderers/MMALRenderer.h -@@ -119,6 +119,7 @@ class CMMALRenderer : public CBaseRenderer +@@ -119,6 +119,7 @@ protected: RENDER_STEREO_MODE m_display_stereo_mode; bool m_StereoInvert; int m_inflight; @@ -4699,10 +5101,14 @@ index d3e5129..a71e645 100644 CCriticalSection m_sharedSection; MMAL_COMPONENT_T *m_vout; -From 3f78d202fd034e566c44194880cd2a4c4183e947 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 679fdc4c44faf1a24d79ca7e787e756d29206467 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 24 Apr 2015 13:49:51 +0100 -Subject: [PATCH] [dvdplayer] Add back required include +Subject: [PATCH 47/94] [dvdplayer] Add back required include --- xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 1 + @@ -4720,10 +5126,15 @@ index b5777a1..64b4d60 100644 #include "DVDOverlayRenderer.h" #include "guilib/GraphicContext.h" #include -From 9f555729881bf17d4638f61009775ae5e2cfefd3 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 215bed9200f096f6c3eeb8956b19332b9fe5dbd3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 5 May 2015 23:58:06 +0100 -Subject: [PATCH] [screensaver] Leave GUI contents available for screensaver +Subject: [PATCH 48/94] [screensaver] Leave GUI contents available for + screensaver --- xbmc/guilib/GUIWindowManager.cpp | 11 ++++++++++- @@ -4751,11 +5162,15 @@ index 89cfb8b..767c7b6 100644 g_infoManager.SetNextWindow(WINDOW_INVALID); // Add window to the history list (we must do this before we activate it, -From 9f53886de4c8da1af721841f6bdbc8d4e85ad1ef Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 9ecafc23229679c7dedce2c5d6b7bf928cf7db9a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 6 Jun 2015 18:43:57 +0100 -Subject: [PATCH] ffmpeg: Automatic switch to software decode for GMC with more - than one warp point +Subject: [PATCH 49/94] ffmpeg: Automatic switch to software decode for GMC + with more than one warp point --- ...Signal-unsupported-GMC-with-more-than-one.patch | 48 ++++++++++++++++++++++ @@ -4872,7 +5287,7 @@ diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h b/xbmc/cores/dvdplayer/ index e380056..122e539 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h -@@ -160,6 +160,7 @@ class CDemuxStreamVideo : public CDemuxStream +@@ -160,6 +160,7 @@ public: type = STREAM_VIDEO; iOrientation = 0; iBitsPerPixel = 0; @@ -4880,7 +5295,7 @@ index e380056..122e539 100644 } virtual ~CDemuxStreamVideo() {} -@@ -176,6 +177,7 @@ class CDemuxStreamVideo : public CDemuxStream +@@ -176,6 +177,7 @@ public: int iOrientation; // orientation of the video in degress counter clockwise int iBitsPerPixel; std::string stereo_mode; // expected stereo mode @@ -4933,7 +5348,7 @@ diff --git a/xbmc/cores/dvdplayer/DVDStreamInfo.h b/xbmc/cores/dvdplayer/DVDStre index c0e22a2..3849993 100644 --- a/xbmc/cores/dvdplayer/DVDStreamInfo.h +++ b/xbmc/cores/dvdplayer/DVDStreamInfo.h -@@ -73,6 +73,7 @@ class CDVDStreamInfo +@@ -73,6 +73,7 @@ public: int bitsperpixel; int pid; std::string stereo_mode; // stereoscopic 3d mode @@ -4967,17 +5382,21 @@ index 7251fc1..3429cea 100644 supported = true; else if ((hint.codec == AV_CODEC_ID_VC1 || hint.codec == AV_CODEC_ID_WMV3) && g_RBP.GetCodecWvc1()) supported = true; -From 62030ac330f5e95b2bb333021897f0d88ac4cc0e Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 76bbd617017c090bc0c9bb39946066a16cf2f34c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 22 Jun 2015 21:46:57 +0100 -Subject: [PATCH] [rbp] Use default resampling setting on Pi2 +Subject: [PATCH 50/94] [rbp] Use default resampling setting on Pi2 --- system/settings/rbp2.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/system/settings/rbp2.xml b/system/settings/rbp2.xml -index 8cc8f19..52778ecd 100644 +index 8cc8f19..52778ec 100644 --- a/system/settings/rbp2.xml +++ b/system/settings/rbp2.xml @@ -23,6 +23,11 @@ @@ -4992,10 +5411,14 @@ index 8cc8f19..52778ecd 100644
-From b8a4604577c8cc6e7361128fc276347dd96b7733 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 70d4f7303dea5456c7e1683a9f30ef3b89832612 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 10 Mar 2016 17:54:59 +0000 -Subject: [PATCH] rbp: Expose gpu memory allocation functions +Subject: [PATCH 51/94] rbp: Expose gpu memory allocation functions --- xbmc/linux/RBP.cpp | 116 ++++++++++++ @@ -5175,7 +5598,7 @@ index db2fade..ab24bbe 100644 class CRBP { public: -@@ -66,6 +80,7 @@ class CRBP +@@ -66,6 +80,7 @@ public: void WaitVsync(); double AdjustHDMIClock(double adjust); double GetAdjustHDMIClock() { return m_last_pll_adjust; } @@ -5183,7 +5606,7 @@ index db2fade..ab24bbe 100644 private: DllBcmHost *m_DllBcmHost; -@@ -83,6 +98,7 @@ class CRBP +@@ -83,6 +98,7 @@ private: class DllLibOMXCore; CCriticalSection m_critSection; double m_last_pll_adjust; @@ -5657,10 +6080,14 @@ index 0000000..94e6e79 + +#endif /* __USER_VCSM__H__INCLUDED__ */ + -From aea67bb43ee0f8ac00c40c541520250e53b429f2 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 9910d8fb2c3e0273d9e272920e6fd7b1c48b28ec Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 10 Mar 2016 17:56:11 +0000 -Subject: [PATCH] [rbp] HW mouse pointer +Subject: [PATCH 52/94] [rbp] HW mouse pointer Updating the mouse point provokes a complete screen update which can make it feel laggy and results in high cpu. @@ -5881,7 +6308,7 @@ diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h index ab24bbe..2eee35d 100644 --- a/xbmc/linux/RBP.h +++ b/xbmc/linux/RBP.h -@@ -99,6 +99,15 @@ class CRBP +@@ -99,6 +99,15 @@ private: CCriticalSection m_critSection; double m_last_pll_adjust; int m_mb; @@ -6077,7 +6504,7 @@ index a17e987..23244a2 100644 class CWinEventsLinux : public IWinEvents { -@@ -43,6 +44,16 @@ class CWinEventsLinux : public IWinEvents +@@ -43,6 +44,16 @@ public: private: static bool m_initialized; static CLinuxInputDevices m_devices; @@ -6094,10 +6521,14 @@ index a17e987..23244a2 100644 }; #endif -From 499ac171bb8804bd2627a74f25bcdc5cb3b4bc5d Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From ad1619a742ebf4e5ac70f1e30877a1ff0e035ac2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 2 Aug 2014 17:48:04 +0100 -Subject: [PATCH] [omx] Report decoded image name +Subject: [PATCH 53/94] [omx] Report decoded image name --- xbmc/cores/omxplayer/OMXImage.cpp | 1 + @@ -6115,11 +6546,15 @@ index 1524214..a01c435 100644 } else { -From 8ddf6074bbfb0f1fb727e069467d9cecde625343 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 9ddc7a2bc142caee6322e5cf709e47c87ce3c182 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 11 Apr 2014 16:12:27 +0100 -Subject: [PATCH] [omxplayer] Add ability to log more timestamp info in extra - debug settings +Subject: [PATCH 54/94] [omxplayer] Add ability to log more timestamp info in + extra debug settings --- addons/resource.language.en_gb/resources/strings.po | 5 +++++ @@ -6268,10 +6703,14 @@ index 22b8459..8045a03 100644 } void CAdvancedSettings::setExtraLogLevel(const std::vector &components) -From 3c6bfac3696f081191678d1257e3d8f28b24c95f Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From f72277b8b4cb29365ad55a8e6d08dd73262b8423 Mon Sep 17 00:00:00 2001 From: Memphiz Date: Tue, 18 Nov 2014 13:28:36 +0100 -Subject: [PATCH] - evaluate the setting for hiding watched +Subject: [PATCH 55/94] - evaluate the setting for hiding watched movies/episodes/musicvideos in recently added job (should influence homescreen of skins only) @@ -6383,7 +6822,7 @@ diff --git a/xbmc/video/VideoDatabase.h b/xbmc/video/VideoDatabase.h index 2021dd9..5f67d10 100644 --- a/xbmc/video/VideoDatabase.h +++ b/xbmc/video/VideoDatabase.h -@@ -693,9 +693,9 @@ class CVideoDatabase : public CDatabase +@@ -693,9 +693,9 @@ public: bool GetEpisodesNav(const std::string& strBaseDir, CFileItemList& items, int idGenre=-1, int idYear=-1, int idActor=-1, int idDirector=-1, int idShow=-1, int idSeason=-1, const SortDescription &sortDescription = SortDescription()); bool GetMusicVideosNav(const std::string& strBaseDir, CFileItemList& items, int idGenre=-1, int idYear=-1, int idArtist=-1, int idDirector=-1, int idStudio=-1, int idAlbum=-1, int idTag=-1, const SortDescription &sortDescription = SortDescription()); @@ -6396,10 +6835,14 @@ index 2021dd9..5f67d10 100644 bool HasContent(); bool HasContent(VIDEODB_CONTENT_TYPE type); -From 8e03571c814cd16ae2a32d7c5ce37078734d871d Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 50ca0e3e5e048055865c0e89f50e5293db9f95b2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 7 May 2015 14:28:37 +0100 -Subject: [PATCH] build: Add vcsm lib +Subject: [PATCH 56/94] build: Add vcsm lib --- configure.ac | 2 +- @@ -6418,11 +6861,15 @@ index 7a06a31..239a2a1 100644 else AC_CHECK_LIB([EGL], [main],, AC_MSG_ERROR($missing_library)) AC_CHECK_LIB([GLESv2],[main],, AC_MSG_ERROR($missing_library)) -From 9710e21f10846bad03639d788f59593aadafb4ed Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From da10dd6464f3bce3ed9f515baa0eed44c2775d9f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 8 May 2015 14:09:31 +0100 -Subject: [PATCH] [cec] re-implement 'RFC' style POLLing for LA registering - process +Subject: [PATCH 57/94] [cec] re-implement 'RFC' style POLLing for LA + registering process --- ...t-RFC-style-POLLing-for-LA-registering-pr.patch | 194 +++++++++++++++++++++ @@ -6642,10 +7089,14 @@ index ddf9963..5d1f933 100644 cd $(PLATFORM)/build; $(CMAKE) -DBUILD_SHARED_LIBS=1 -DSKIP_PYTHON_WRAPPER:STRING=1 -DCMAKE_INSTALL_LIBDIR=$(PREFIX)/lib .. $(LIBDYLIB): $(PLATFORM) -From 44cef9d4312ed30c96b24a85a6980318c036d0f5 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 390171edbbd26e7763b5989d9793ec508e6a2e8f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 7 May 2015 15:35:43 +0100 -Subject: [PATCH] ffmpeg: test: increase number of threads +Subject: [PATCH 58/94] ffmpeg: test: increase number of threads --- xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 3 +++ @@ -6665,10 +7116,14 @@ index 3498503..c2f3287 100644 if( num_threads > 1) m_pCodecContext->thread_count = num_threads; m_pCodecContext->thread_safe_callbacks = 1; -From b73a054068ac03f6e65f6ed559b8f9d2a3a8d5ff Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 3234bb00454e29cbfcfb36011d0a85fcb2891235 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 22 May 2015 13:56:29 +0100 -Subject: [PATCH] ffmpeg: Allow neon to be enabled in unified builds +Subject: [PATCH 59/94] ffmpeg: Allow neon to be enabled in unified builds --- tools/depends/target/ffmpeg/Makefile | 4 ++++ @@ -6690,10 +7145,15 @@ index 6a9f105..fef5ef2 100644 endif ifeq ($(OS), linux) ffmpg_config += --target-os=$(OS) --cpu=$(CPU) -From 541c085a991610efe5258b4eab31d1fcbea67c9a Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 6942378a95385798c8fe53d0480cddee6a5ad3b8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 5 Mar 2015 20:00:59 +0000 -Subject: [PATCH] [ffmpmeg] Discard data before VO/VOL in mpeg-4 over mpegts +Subject: [PATCH 60/94] [ffmpmeg] Discard data before VO/VOL in mpeg-4 over + mpegts --- ...-data-before-VO-VOL-in-mpeg-4-over-mpegts.patch | 69 ++++++++++++++++++++++ @@ -6798,10 +7258,14 @@ index fef5ef2..e780521 100644 cd $(PLATFORM);\ CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \ ./configure $(ffmpg_config) -From 9b44a82266b1c68388206b0b963c0483e2b1f25b Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 3c407f5763ef0302d8cdaf7fae59e963555517e3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 27 Feb 2015 14:37:27 +0000 -Subject: [PATCH] ffmpeg: Add some upstream HEVC optimisations +Subject: [PATCH 61/94] ffmpeg: Add some upstream HEVC optimisations --- tools/depends/target/ffmpeg/Makefile | 6 +- @@ -10584,10 +11048,14 @@ index 0000000..5e8e07d +-- +2.5.0 + -From 9950c711b222577d755847c188b26d7f92944561 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 1d2a77c2e92160fb532fc21c53f712cf1ffc3701 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 7 May 2015 14:04:18 +0100 -Subject: [PATCH] [ffmpeg] Add GPU acceleration to hevc +Subject: [PATCH 62/94] [ffmpeg] Add GPU acceleration to hevc --- tools/depends/target/ffmpeg/Makefile | 4 +- @@ -47295,10 +47763,14 @@ index 0000000..f2b8ffc +-- +2.5.0 + -From 102d10e79b164ff891130f6d694662d062a76219 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 9f7e6280af3292b27e4bdcd5e9e8a51eee261521 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Dec 2015 12:35:14 +0000 -Subject: [PATCH] [build] Add patches to ffmpeg for native build +Subject: [PATCH 63/94] [build] Add patches to ffmpeg for native build --- tools/depends/target/ffmpeg/autobuild.sh | 8 ++++++++ @@ -47323,10 +47795,14 @@ index b9bfd57..f6d4c3b 100755 CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" \ ./configure --prefix=$FFMPEG_PREFIX \ --extra-version="kodi-${VERSION}" \ -From fb9bc934858656128ef500f2d4078489b84030b8 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From b525cc97c0f168cc16849c87ec91234ea05ddd13 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 12 Jan 2016 16:29:57 +0000 -Subject: [PATCH] ffmpeg: Add cabac opimisations for hevc +Subject: [PATCH 64/94] ffmpeg: Add cabac opimisations for hevc --- .../0001-Squashed-commit-of-the-following.patch | 2288 ++++++++++++++++++++ @@ -49658,10 +50134,93 @@ index e4acfa9..072e711 100644 cd $(PLATFORM);\ CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \ -From 56e531b1a6fbe9b7cb67afe9249586438b60328d Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 4ba5e77ceafc42f8307d5611d59efe5065df16fa Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Tue, 14 Jul 2015 08:30:44 +0200 +Subject: [PATCH 65/94] fix high cpu load caused by false positive frame + limiter + +--- + xbmc/Application.cpp | 20 +++++++++----------- + 1 file changed, 9 insertions(+), 11 deletions(-) + +diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp +index 212a5c7..1adbb01 100644 +--- a/xbmc/Application.cpp ++++ b/xbmc/Application.cpp +@@ -1902,7 +1902,7 @@ void CApplication::Render() + + bool hasRendered = false; + bool limitFrames = false; +- unsigned int singleFrameTime = 10; // default limit 100 fps ++ unsigned int singleFrameTime = 40; // default limit 25 fps + bool vsync = true; + + // Whether externalplayer is playing and we're unfocused +@@ -1916,24 +1916,22 @@ void CApplication::Render() + if (!extPlayerActive && g_graphicsContext.IsFullScreenVideo() && !m_pPlayer->IsPausedPlayback()) + { + m_bPresentFrame = g_renderManager.HasFrame(); +- if (vsync_mode == VSYNC_DISABLED) +- vsync = false; + } + else + { + // engage the frame limiter as needed + limitFrames = lowfps || extPlayerActive; +- // DXMERGE - we checked for g_videoConfig.GetVSyncMode() before this +- // perhaps allowing it to be set differently than the UI option?? ++ ++ // TODO: ++ // remove those useless modes, they don't do any good + if (vsync_mode == VSYNC_DISABLED || vsync_mode == VSYNC_VIDEO) + { + limitFrames = true; // not using vsync. +- vsync = false; ++ singleFrameTime = 10; + } +- else if ((g_infoManager.GetFPS() > g_graphicsContext.GetFPS() + 10) && g_infoManager.GetFPS() > 1000.0f / singleFrameTime) ++ else if ((g_infoManager.GetFPS() > g_graphicsContext.GetFPS() + 10) && g_infoManager.GetFPS() > 100.0f) + { + limitFrames = true; // using vsync, but it isn't working. +- vsync = false; + } + + if (limitFrames) +@@ -1957,7 +1955,10 @@ void CApplication::Render() + else if (vsync_mode == VSYNC_ALWAYS) + g_Windowing.SetVSync(true); + else if (vsync_mode != VSYNC_DRIVER) ++ { + g_Windowing.SetVSync(false); ++ vsync = false; ++ } + + if (m_bPresentFrame && m_pPlayer->IsPlaying() && !m_pPlayer->IsPaused()) + ResetScreenSaver(); +@@ -2025,9 +2026,6 @@ void CApplication::Render() + //fps limiter, make sure each frame lasts at least singleFrameTime milliseconds + if (limitFrames || !(flip || m_bPresentFrame)) + { +- if (!limitFrames) +- singleFrameTime = 40; //if not flipping, loop at 25 fps +- + unsigned int frameTime = now - m_lastFrameTime; + if (frameTime < singleFrameTime) + Sleep(singleFrameTime - frameTime); +-- +2.5.0 + + +From 488f86f0dc3a9a986c4535697827ad656d8fedf1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 5 Aug 2015 13:43:25 +0100 -Subject: [PATCH] [dvdplayeraudio] Avoid busy spinning when queue is empty +Subject: [PATCH 66/94] [dvdplayeraudio] Avoid busy spinning when queue is + empty --- xbmc/cores/dvdplayer/DVDPlayerAudio.cpp | 2 ++ @@ -49680,10 +50239,14 @@ index 97a23a6..9f21a19 100644 } continue; -From 9ca8d9d2b8799f4c9c6ebce05b815d34a086ba13 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 05a5655c10b72fc3f9da1a7b91e077bb4eee0c50 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 6 Aug 2015 11:23:05 +0100 -Subject: [PATCH] [rbp] Make sync playback to display the default option +Subject: [PATCH 67/94] [rbp] Make sync playback to display the default option --- system/settings/rbp.xml | 7 +++++++ @@ -49707,11 +50270,15 @@ index 1506035..f2a6892 100644 false -From 1aa08c1f2360c42cdcb4cc21d28b5dd701fca571 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 3f638db8e9c0eed4dc2d53007c76b6ac48cb7a95 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 8 Sep 2015 23:42:30 +0100 -Subject: [PATCH] [cec] Fixing initialisation issue found on Raspberry Pi with - Buildroot +Subject: [PATCH 68/94] [cec] Fixing initialisation issue found on Raspberry Pi + with Buildroot --- tools/depends/target/libcec/Makefile | 1 + @@ -49761,11 +50328,15 @@ index 0000000..8f289f2 + { + m_queue = new CRPiCECAdapterMessageQueue(this); + } -From ee6c60cdfb97ea162c07430f349fe17bf826d17a Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 6ddb38f37c38455d28d9caa357b597b4b9d327e4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 9 Dec 2015 13:31:14 +0000 -Subject: [PATCH] [mmalcodec] Fail to open when width is invalid. Can happen - with mpegts files +Subject: [PATCH 69/94] [mmalcodec] Fail to open when width is invalid. Can + happen with mpegts files --- xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 4 ++++ @@ -49786,11 +50357,264 @@ index 3345685..5386b4a 100644 // we always qualify even if DVDFactoryCodec does this too. if (!CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_USEMMAL) || hints.software) return false; -From 0c6232841ddc2caaf3f17c6866ed48d880421b38 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 9bfbe66e6e477429af4b3ab01f5b3bf4f10ee221 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 21 Dec 2015 18:34:06 +0000 +Subject: [PATCH 70/94] [mmalrender] Force a SetVideoRect after a reconfigure + +There has been an issue with dvd stills and a hdmi refresh rate change. +The hdmi mode change loses the currently displayed picture. +Not an issue for normal video playback as another picture will be along soon. +Not the case in DVD menus. + +SetVideoRect makes the last picture redisplay and so fixes up the menu. +--- + xbmc/cores/VideoRenderers/MMALRenderer.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +index adf6f73..ad3f66f 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +@@ -286,6 +286,10 @@ bool CMMALRenderer::Configure(unsigned int width, unsigned int height, unsigned + m_fps = fps; + m_iFlags = flags; + ++ // cause SetVideoRect to trigger - needed after a hdmi mode change ++ m_src_rect.SetRect(0, 0, 0, 0); ++ m_dst_rect.SetRect(0, 0, 0, 0); ++ + CLog::Log(LOGDEBUG, "%s::%s - %dx%d->%dx%d@%.2f flags:%x format:%d ext:%x orient:%d", CLASSNAME, __func__, width, height, d_width, d_height, fps, flags, format, extended_format, orientation); + if (format != RENDER_FMT_YUV420P && format != RENDER_FMT_BYPASS && format != RENDER_FMT_MMAL) + { +-- +2.5.0 + + +From 138c0d96b6f9979a304f4d3e087f8659717b2471 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 31 Mar 2015 17:31:47 +0100 +Subject: [PATCH 71/94] mmalcodec: Add SetCodecControl function + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 10 +++++++++- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 2 ++ + 2 files changed, 11 insertions(+), 1 deletion(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +index 5386b4a..799b708 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +@@ -130,6 +130,7 @@ CMMALVideo::CMMALVideo() + m_speed = DVD_PLAYSPEED_NORMAL; + m_fps = 0.0f; + m_num_decoded = 0; ++ m_codecControlFlags = 0; + } + + CMMALVideo::~CMMALVideo() +@@ -875,7 +876,7 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) + } + + if (g_advancedSettings.CanLogComponent(LOGVIDEO)) +- CLog::Log(LOGDEBUG, "%s::%s - ret(%x) pics(%d) inputs(%d) slept(%d) queued(%.2f) (%.2f:%.2f) full(%d)", CLASSNAME, __func__, ret, m_output_ready.size(), mmal_queue_length(m_dec_input_pool->queue), slept, queued*1e-6, m_demuxerPts*1e-6, m_decoderPts*1e-6, full); ++ CLog::Log(LOGDEBUG, "%s::%s - ret(%x) pics(%d) inputs(%d) slept(%d) queued(%.2f) (%.2f:%.2f) full(%d) flags(%x)", CLASSNAME, __func__, ret, m_output_ready.size(), mmal_queue_length(m_dec_input_pool->queue), slept, queued*1e-6, m_demuxerPts*1e-6, m_decoderPts*1e-6, full, m_codecControlFlags); + + return ret; + } +@@ -939,6 +940,7 @@ void CMMALVideo::Reset(void) + } + m_decoderPts = DVD_NOPTS_VALUE; + m_demuxerPts = DVD_NOPTS_VALUE; ++ m_codecControlFlags = 0; + } + + void CMMALVideo::SetSpeed(int iSpeed) +@@ -1049,3 +1051,9 @@ bool CMMALVideo::GetCodecStats(double &pts, int &droppedPics) + droppedPics= -1; + return false; + } ++ ++void CMMALVideo::SetCodecControl(int flags) ++{ ++ CSingleLock lock(m_sharedSection); ++ m_codecControlFlags = flags; ++} +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +index f4df09c..37d0868 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +@@ -79,6 +79,7 @@ public: + virtual void SetDropState(bool bDrop); + virtual const char* GetName(void) { return m_pFormatName ? m_pFormatName:"mmal-xxx"; } + virtual bool GetCodecStats(double &pts, int &droppedPics); ++ virtual void SetCodecControl(int flags); + virtual void SetSpeed(int iSpeed); + + // MMAL decoder callback routines. +@@ -121,6 +122,7 @@ protected: + double m_demuxerPts; + double m_decoderPts; + int m_speed; ++ int m_codecControlFlags; + + CCriticalSection m_sharedSection; + MMAL_COMPONENT_T *m_dec; +-- +2.5.0 + + +From db15bb3280518a33c1a67864e126a44b87767047 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 27 Dec 2015 18:44:22 +0000 +Subject: [PATCH 72/94] mmalcodec: Switch to a condition variable when blocking + waiting for a picture + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 38 ++++++++++++---------- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 3 +- + 2 files changed, 23 insertions(+), 18 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +index 799b708..3579966 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +@@ -102,7 +102,6 @@ CMMALVideo::CMMALVideo() + { + if (g_advancedSettings.CanLogComponent(LOGVIDEO)) + CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, this); +- pthread_mutex_init(&m_output_mutex, NULL); + + m_decoded_width = 0; + m_decoded_height = 0; +@@ -141,7 +140,6 @@ CMMALVideo::~CMMALVideo() + Dispose(); + + CSingleLock lock(m_sharedSection); +- pthread_mutex_destroy(&m_output_mutex); + + if (m_deint && m_deint->control && m_deint->control->is_enabled) + mmal_port_disable(m_deint->control); +@@ -285,9 +283,11 @@ void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf + omvb->width = m_decoded_width; + omvb->height = m_decoded_height; + omvb->m_aspect_ratio = m_aspect_ratio; +- pthread_mutex_lock(&m_output_mutex); +- m_output_ready.push(omvb); +- pthread_mutex_unlock(&m_output_mutex); ++ { ++ CSingleLock lock(m_output_mutex); ++ m_output_ready.push(omvb); ++ m_output_cond.notifyAll(); ++ } + kept = true; + } + } +@@ -867,7 +867,8 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) + { + // otherwise we busy spin + CSingleExit unlock(m_sharedSection); +- Sleep(10); ++ CSingleLock lock(m_output_mutex); ++ m_output_cond.wait(lock, 10); + } + if (!m_output_ready.empty()) + ret |= VC_PICTURE; +@@ -916,14 +917,16 @@ void CMMALVideo::Reset(void) + while (1) + { + CMMALVideoBuffer *buffer = NULL; +- pthread_mutex_lock(&m_output_mutex); +- // fetch a output buffer and pop it off the ready list +- if (!m_output_ready.empty()) + { +- buffer = m_output_ready.front(); +- m_output_ready.pop(); ++ CSingleLock lock(m_output_mutex); ++ // fetch a output buffer and pop it off the ready list ++ if (!m_output_ready.empty()) ++ { ++ buffer = m_output_ready.front(); ++ m_output_ready.pop(); ++ } ++ m_output_cond.notifyAll(); + } +- pthread_mutex_unlock(&m_output_mutex); + if (buffer) + { + buffer->Acquire(); +@@ -984,11 +987,12 @@ bool CMMALVideo::GetPicture(DVDVideoPicture* pDvdVideoPicture) + { + CMMALVideoBuffer *buffer; + // fetch a output buffer and pop it off the ready list +- pthread_mutex_lock(&m_output_mutex); +- buffer = m_output_ready.front(); +- m_output_ready.pop(); +- pthread_mutex_unlock(&m_output_mutex); +- ++ { ++ CSingleLock lock(m_output_mutex); ++ buffer = m_output_ready.front(); ++ m_output_ready.pop(); ++ m_output_cond.notifyAll(); ++ } + assert(buffer->mmal_buffer); + memset(pDvdVideoPicture, 0, sizeof *pDvdVideoPicture); + pDvdVideoPicture->format = RENDER_FMT_MMAL; +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +index 37d0868..ca28c6f 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +@@ -105,7 +105,8 @@ protected: + const char *m_pFormatName; + + // mmal output buffers (video frames) +- pthread_mutex_t m_output_mutex; ++ CCriticalSection m_output_mutex; ++ XbmcThreads::ConditionVariable m_output_cond; + std::queue m_output_ready; + + // initialize mmal and get decoder component +-- +2.5.0 + + +From 426d5fc36b57594a4cc77985bc9ad78746e0e502 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sat, 16 Jan 2016 16:46:03 +0000 +Subject: [PATCH 73/94] omxaudio: Avoid reporting a spurious cached value + +Avoids seek bar showing zero after a seek +--- + xbmc/cores/omxplayer/OMXAudio.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp +index 70d0866..052b5ef 100644 +--- a/xbmc/cores/omxplayer/OMXAudio.cpp ++++ b/xbmc/cores/omxplayer/OMXAudio.cpp +@@ -1335,7 +1335,7 @@ float COMXAudio::GetDelay() + if (m_last_pts != DVD_NOPTS_VALUE && m_av_clock) + stamp = m_av_clock->OMXMediaTime(); + // if possible the delay is current media time - time of last submitted packet +- if (stamp != DVD_NOPTS_VALUE) ++ if (stamp != DVD_NOPTS_VALUE && stamp != 0.0) + { + ret = (m_last_pts - stamp) * (1.0 / DVD_TIME_BASE); + } +-- +2.5.0 + + +From 87509c4cfa3ce6f9a4239cee724ab254ba2a3d3b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 21 Dec 2015 22:17:25 +0000 -Subject: [PATCH] [omximage] Fall back to arm jpeg encode/decode when gpu is - busy +Subject: [PATCH 74/94] [omximage] Fall back to arm jpeg encode/decode when gpu + is busy --- xbmc/cores/omxplayer/OMXImage.cpp | 50 ++++++++++++++++++++++++++++++++------- @@ -49975,7 +50799,7 @@ diff --git a/xbmc/cores/omxplayer/OMXImage.h b/xbmc/cores/omxplayer/OMXImage.h index a93aa82..6f38dbc 100644 --- a/xbmc/cores/omxplayer/OMXImage.h +++ b/xbmc/cores/omxplayer/OMXImage.h -@@ -133,6 +133,7 @@ class COMXImageDec +@@ -133,6 +133,7 @@ protected: OMX_PARAM_PORTDEFINITIONTYPE m_decoded_format; CCriticalSection m_OMXSection; bool m_success; @@ -49983,7 +50807,7 @@ index a93aa82..6f38dbc 100644 }; class COMXImageEnc -@@ -144,6 +145,7 @@ class COMXImageEnc +@@ -144,6 +145,7 @@ public: // Required overrides bool CreateThumbnailFromSurface(unsigned char* buffer, unsigned int width, unsigned int height, unsigned int format, unsigned int pitch, const std::string& destFile); @@ -49991,7 +50815,7 @@ index a93aa82..6f38dbc 100644 protected: bool Encode(unsigned char *buffer, int size, unsigned int width, unsigned int height, unsigned int pitch); // Components -@@ -152,6 +154,7 @@ class COMXImageEnc +@@ -152,6 +154,7 @@ protected: OMX_PARAM_PORTDEFINITIONTYPE m_encoded_format; CCriticalSection m_OMXSection; bool m_success; @@ -49999,7 +50823,7 @@ index a93aa82..6f38dbc 100644 }; class COMXImageReEnc -@@ -163,6 +166,7 @@ class COMXImageReEnc +@@ -163,6 +166,7 @@ public: // Required overrides void Close(); bool ReEncode(COMXImageFile &srcFile, unsigned int width, unsigned int height, void * &pDestBuffer, unsigned int &nDestSize); @@ -50007,7 +50831,7 @@ index a93aa82..6f38dbc 100644 protected: bool HandlePortSettingChange(unsigned int resize_width, unsigned int resize_height, int orientation, bool port_settings_changed); // Components -@@ -176,6 +180,7 @@ class COMXImageReEnc +@@ -176,6 +180,7 @@ protected: void *m_pDestBuffer; unsigned int m_nDestAllocSize; bool m_success; @@ -50015,7 +50839,7 @@ index a93aa82..6f38dbc 100644 }; class COMXTexture -@@ -187,6 +192,7 @@ class COMXTexture +@@ -187,6 +192,7 @@ public: // Required overrides void Close(void); bool Decode(const uint8_t *data, unsigned size, unsigned int width, unsigned int height, void *egl_image); @@ -50023,7 +50847,7 @@ index a93aa82..6f38dbc 100644 protected: bool HandlePortSettingChange(unsigned int resize_width, unsigned int resize_height, void *egl_image, bool port_settings_changed); -@@ -201,6 +207,7 @@ class COMXTexture +@@ -201,6 +207,7 @@ protected: OMX_BUFFERHEADERTYPE *m_egl_buffer; CCriticalSection m_OMXSection; bool m_success; @@ -50031,10 +50855,138 @@ index a93aa82..6f38dbc 100644 }; extern COMXImage g_OMXImage; -From 47df934cc713ef7921c612fbb2d42a14c53df618 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 0fea3baccdb25c562be89bd1c69f464bce182f6f Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sat, 2 Jan 2016 18:08:16 +0000 +Subject: [PATCH 75/94] [mmalcodec] Don't send zero sized extradata + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +index 3579966..0f5c1b7 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +@@ -501,7 +501,7 @@ bool CMMALVideo::SendCodecConfigData() + { + CSingleLock lock(m_sharedSection); + MMAL_STATUS_T status; +- if (!m_dec_input_pool) ++ if (!m_dec_input_pool || !m_hints.extrasize) + return true; + // send code config data + MMAL_BUFFER_HEADER_T *buffer = mmal_queue_timedwait(m_dec_input_pool->queue, 500); +-- +2.5.0 + + +From 49f0bbf2f288d4d2f51db8f55d10268c78afdbfe Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 3 Jan 2016 19:12:16 +0000 +Subject: [PATCH 76/94] stereoscopicmanager: Ensure we don't have a stale value + of videoplayer stereoscopic mode + +--- + xbmc/guilib/StereoscopicsManager.cpp | 30 +++++++++++++++++++++--------- + xbmc/guilib/StereoscopicsManager.h | 2 ++ + 2 files changed, 23 insertions(+), 9 deletions(-) + +diff --git a/xbmc/guilib/StereoscopicsManager.cpp b/xbmc/guilib/StereoscopicsManager.cpp +index d9e0fa4..4942f01 100644 +--- a/xbmc/guilib/StereoscopicsManager.cpp ++++ b/xbmc/guilib/StereoscopicsManager.cpp +@@ -140,12 +140,7 @@ void CStereoscopicsManager::SetStereoMode(const RENDER_STEREO_MODE &mode) + + // resolve automatic mode before applying + if (mode == RENDER_STEREO_MODE_AUTO) +- { +- if (g_infoManager.EvaluateBool("videoplayer.isstereoscopic")) +- applyMode = GetStereoModeOfPlayingVideo(); +- else +- applyMode = RENDER_STEREO_MODE_OFF; +- } ++ applyMode = GetStereoModeOfPlayingVideo(); + + if (applyMode != currentMode && applyMode >= RENDER_STEREO_MODE_OFF) + { +@@ -209,7 +204,7 @@ RENDER_STEREO_MODE CStereoscopicsManager::GetStereoModeByUserChoice(const std::s + { + RENDER_STEREO_MODE mode = GetStereoMode(); + // if no stereo mode is set already, suggest mode of current video by preselecting it +- if (mode == RENDER_STEREO_MODE_OFF && g_infoManager.EvaluateBool("videoplayer.isstereoscopic")) ++ if (mode == RENDER_STEREO_MODE_OFF) + mode = GetStereoModeOfPlayingVideo(); + + CGUIDialogSelect* pDlgSelect = (CGUIDialogSelect*)g_windowManager.GetWindow(WINDOW_DIALOG_SELECT); +@@ -254,8 +249,8 @@ RENDER_STEREO_MODE CStereoscopicsManager::GetStereoModeByUserChoice(const std::s + RENDER_STEREO_MODE CStereoscopicsManager::GetStereoModeOfPlayingVideo(void) + { + RENDER_STEREO_MODE mode = RENDER_STEREO_MODE_OFF; ++ std::string playerMode = GetVideoStereoMode(); + +- std::string playerMode = g_infoManager.GetLabel(VIDEOPLAYER_STEREOSCOPIC_MODE); + if (!playerMode.empty()) + { + int convertedMode = ConvertVideoToGuiStereoMode(playerMode); +@@ -504,6 +499,23 @@ void CStereoscopicsManager::ApplyStereoMode(const RENDER_STEREO_MODE &mode, bool + } + } + ++std::string CStereoscopicsManager::GetVideoStereoMode() ++{ ++ std::string playerMode; ++ if (g_application.m_pPlayer->IsPlaying()) ++ { ++ SPlayerVideoStreamInfo videoInfo; ++ g_application.m_pPlayer->GetVideoStreamInfo(videoInfo); ++ playerMode = videoInfo.stereoMode; ++ } ++ return playerMode; ++} ++ ++bool CStereoscopicsManager::IsVideoStereoscopic() ++{ ++ return !GetVideoStereoMode().empty(); ++} ++ + void CStereoscopicsManager::OnPlaybackStarted(void) + { + STEREOSCOPIC_PLAYBACK_MODE playbackMode = (STEREOSCOPIC_PLAYBACK_MODE) CSettings::GetInstance().GetInt(CSettings::SETTING_VIDEOPLAYER_STEREOSCOPICPLAYBACKMODE); +@@ -513,7 +525,7 @@ void CStereoscopicsManager::OnPlaybackStarted(void) + if (playbackMode == STEREOSCOPIC_PLAYBACK_MODE_IGNORE && mode == RENDER_STEREO_MODE_OFF) + return; + +- if (!g_infoManager.EvaluateBool("videoplayer.isstereoscopic")) ++ if (!CStereoscopicsManager::IsVideoStereoscopic()) + { + // exit stereo mode if started item is not stereoscopic + // and if user prefers to stop 3D playback when movie is finished +diff --git a/xbmc/guilib/StereoscopicsManager.h b/xbmc/guilib/StereoscopicsManager.h +index ec2310f..f090bb9 100644 +--- a/xbmc/guilib/StereoscopicsManager.h ++++ b/xbmc/guilib/StereoscopicsManager.h +@@ -92,6 +92,8 @@ private: + void ApplyStereoMode(const RENDER_STEREO_MODE &mode, bool notify = true); + void OnPlaybackStarted(void); + void OnPlaybackStopped(void); ++ std::string GetVideoStereoMode(); ++ bool IsVideoStereoscopic(); + + RENDER_STEREO_MODE m_stereoModeSetByUser; + RENDER_STEREO_MODE m_lastStereoModeSetByUser; +-- +2.5.0 + + +From 7399f59303833e2f6442e67e2d9d4c17adc41e35 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 16 Sep 2015 19:05:12 +0100 -Subject: [PATCH] [3d] Make MVC a valid 3D filename tag +Subject: [PATCH 77/94] [3d] Make MVC a valid 3D filename tag --- xbmc/guilib/StereoscopicsManager.cpp | 9 +++++++++ @@ -50094,10 +51046,14 @@ index 93de9bd..4da88f4 100644 /*!< @brief position behavior of ass subtitiles when setting "subtitle position on screen" set to "fixed" True to show at the fixed position set in video calibration -From 917036937e1e6bcdee5add347e8a9cfc8f571932 Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From 6cee5258e6f154631e457615c4028b74fd4e5525 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 24 Jan 2016 16:42:04 +0000 -Subject: [PATCH] fixup! [build] Add patches to ffmpeg for native build +Subject: [PATCH 78/94] fixup! [build] Add patches to ffmpeg for native build --- tools/depends/target/ffmpeg/autobuild.sh | 2 +- @@ -50116,337 +51072,1579 @@ index f6d4c3b..cc59d17 100755 CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" \ ./configure --prefix=$FFMPEG_PREFIX \ -From 4c58ea8b09c9f22527263d521589e5842ef2ceea Mon Sep 17 00:00:00 2001 +-- +2.5.0 + + +From a4f972065465a09a608315605358cfca1088365d Mon Sep 17 00:00:00 2001 From: popcornmix -Date: Mon, 15 Feb 2016 15:50:00 +0000 -Subject: [PATCH] temp: Add lock around mmal and omx calls to avoid stalled - audio issue +Date: Tue, 26 Jan 2016 19:58:30 +0000 +Subject: [PATCH 79/94] OMXAudio: Make use of m_bGotFrame to skip decoding when + full --- - xbmc/cores/VideoRenderers/MMALRenderer.cpp | 1 + - xbmc/cores/VideoRenderers/MMALRenderer.h | 2 +- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 1 + - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 2 +- - xbmc/linux/OMXCore.cpp | 29 ++++++++++++++++++++++ - xbmc/linux/OMXCore.h | 2 ++ - xbmc/linux/RBP.h | 1 + - 7 files changed, 36 insertions(+), 2 deletions(-) + xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) -diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index ad3f66f6..a619448 100644 ---- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -@@ -240,6 +240,7 @@ bool CMMALRenderer::init_vout(ERenderFormat format) +diff --git a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp +index 33c4c6a..b9dab89 100644 +--- a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp ++++ b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp +@@ -158,7 +158,8 @@ int COMXAudioCodecOMX::Decode(BYTE* pData, int iSize, double dts, double pts) + if (!m_pCodecContext) return -1; + + AVPacket avpkt; +- m_bGotFrame = false; ++ if (m_bGotFrame) ++ return 0; + av_init_packet(&avpkt); + avpkt.data = pData; + avpkt.size = iSize; +@@ -257,6 +258,7 @@ int COMXAudioCodecOMX::GetData(BYTE** dst, double &dts, double &pts) + outputSize = 0; + } + } ++ m_bGotFrame = false; + int desired_size = AUDIO_DECODE_OUTPUT_BUFFER * (m_pCodecContext->channels * GetBitsPerSample()) >> (rounded_up_channels_shift[m_pCodecContext->channels] + 4); + + if (m_bFirstFrame) +@@ -274,7 +276,6 @@ int COMXAudioCodecOMX::GetData(BYTE** dst, double &dts, double &pts) + if (m_iBufferOutputUsed + outputSize > desired_size || m_bNoConcatenate) + { + int ret = m_iBufferOutputUsed; +- m_bGotFrame = false; + m_iBufferOutputUsed = 0; + dts = m_dts; + pts = m_pts; +-- +2.5.0 + + +From c6f3b279c5d18c805ae6c3a6e9db8b5680602a61 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 26 Jan 2016 20:01:18 +0000 +Subject: [PATCH 80/94] OMXAudio: Handle GetData before adding the next buffer + so we can be sure it fits + +--- + xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp | 28 ++++++++++++++-------------- + 1 file changed, 14 insertions(+), 14 deletions(-) + +diff --git a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp +index b9dab89..f150dc6 100644 +--- a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp ++++ b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp +@@ -206,12 +206,24 @@ int COMXAudioCodecOMX::GetData(BYTE** dst, double &dts, double &pts) + /* output audio will be packed */ + int outputSize = av_samples_get_buffer_size(&outLineSize, m_pCodecContext->channels, m_pFrame1->nb_samples, m_desiredSampleFormat, 1); + ++ // if this buffer won't fit then flush out what we have ++ int desired_size = AUDIO_DECODE_OUTPUT_BUFFER * (m_pCodecContext->channels * GetBitsPerSample()) >> (rounded_up_channels_shift[m_pCodecContext->channels] + 4); ++ if (m_iBufferOutputUsed && (m_iBufferOutputUsed + outputSize > desired_size || m_bNoConcatenate)) ++ { ++ int ret = m_iBufferOutputUsed; ++ m_iBufferOutputUsed = 0; ++ dts = m_dts; ++ pts = m_pts; ++ *dst = m_pBufferOutput; ++ return ret; ++ } ++ m_frameSize = outputSize; ++ + if (m_iBufferOutputAlloced < m_iBufferOutputUsed + outputSize) + { + m_pBufferOutput = (BYTE*)av_realloc(m_pBufferOutput, m_iBufferOutputUsed + outputSize + FF_INPUT_BUFFER_PADDING_SIZE); + m_iBufferOutputAlloced = m_iBufferOutputUsed + outputSize; + } +- *dst = m_pBufferOutput; + + /* need to convert format */ + if(m_pCodecContext->sample_fmt != m_desiredSampleFormat) +@@ -259,28 +271,16 @@ int COMXAudioCodecOMX::GetData(BYTE** dst, double &dts, double &pts) + } + } + m_bGotFrame = false; +- int desired_size = AUDIO_DECODE_OUTPUT_BUFFER * (m_pCodecContext->channels * GetBitsPerSample()) >> (rounded_up_channels_shift[m_pCodecContext->channels] + 4); + + if (m_bFirstFrame) + { +- CLog::Log(LOGDEBUG, "COMXAudioCodecOMX::GetData size=%d/%d line=%d/%d buf=%p, desired=%d", inputSize, outputSize, inLineSize, outLineSize, *dst, desired_size); ++ CLog::Log(LOGDEBUG, "COMXAudioCodecOMX::GetData size=%d/%d line=%d/%d buf=%p, desired=%d", inputSize, outputSize, inLineSize, outLineSize, m_pBufferOutput, desired_size); + m_bFirstFrame = false; + } + m_iBufferOutputUsed += outputSize; + + if (!m_bNoConcatenate && m_pCodecContext->sample_fmt == AV_SAMPLE_FMT_FLTP && m_frameSize && (int)m_frameSize != outputSize) + CLog::Log(LOGERROR, "COMXAudioCodecOMX::GetData Unexpected change of size (%d->%d)", m_frameSize, outputSize); +- m_frameSize = outputSize; +- +- // if next buffer submitted won't fit then flush it out +- if (m_iBufferOutputUsed + outputSize > desired_size || m_bNoConcatenate) +- { +- int ret = m_iBufferOutputUsed; +- m_iBufferOutputUsed = 0; +- dts = m_dts; +- pts = m_pts; +- return ret; +- } + return 0; } - CMMALRenderer::CMMALRenderer() -+: m_sharedSection(g_RBP.GetLock()) - { - CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); - m_vout = NULL; -diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.h b/xbmc/cores/VideoRenderers/MMALRenderer.h -index a71e645..084d59a 100644 ---- a/xbmc/cores/VideoRenderers/MMALRenderer.h -+++ b/xbmc/cores/VideoRenderers/MMALRenderer.h -@@ -121,7 +121,7 @@ class CMMALRenderer : public CBaseRenderer - int m_inflight; - float m_sharpness; +-- +2.5.0 + + +From 9dbad1bfa2329d5ca5a1d82e3e982a69dbad965d Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 26 Jan 2016 20:03:49 +0000 +Subject: [PATCH 81/94] OMXAudio: Handle changes in decoded audio size + correctly + +--- + xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp +index f150dc6..4956b5b 100644 +--- a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp ++++ b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp +@@ -103,10 +103,6 @@ bool COMXAudioCodecOMX::Open(CDVDStreamInfo &hints) + if (m_pCodecContext->request_channel_layout) + CLog::Log(LOGNOTICE,"COMXAudioCodecOMX::Open() Requesting channel layout of %x", (unsigned)m_pCodecContext->request_channel_layout); -- CCriticalSection m_sharedSection; -+ CCriticalSection &m_sharedSection; - MMAL_COMPONENT_T *m_vout; - MMAL_PORT_T *m_vout_input; - MMAL_POOL_T *m_vout_input_pool; +- // vorbis and wma2v2 have variable sized planar output, so skip concatenation +- if (hints.codec == AV_CODEC_ID_VORBIS || hints.codec == AV_CODEC_ID_WMAV2) +- m_bNoConcatenate = true; +- + if(m_pCodecContext->bits_per_coded_sample == 0) + m_pCodecContext->bits_per_coded_sample = 16; + +@@ -206,12 +202,19 @@ int COMXAudioCodecOMX::GetData(BYTE** dst, double &dts, double &pts) + /* output audio will be packed */ + int outputSize = av_samples_get_buffer_size(&outLineSize, m_pCodecContext->channels, m_pFrame1->nb_samples, m_desiredSampleFormat, 1); + ++ if (!m_bNoConcatenate && m_iBufferOutputUsed && (int)m_frameSize != outputSize) ++ { ++ CLog::Log(LOGERROR, "COMXAudioCodecOMX::GetData Unexpected change of size (%d->%d)", m_frameSize, outputSize); ++ m_bNoConcatenate = true; ++ } ++ + // if this buffer won't fit then flush out what we have + int desired_size = AUDIO_DECODE_OUTPUT_BUFFER * (m_pCodecContext->channels * GetBitsPerSample()) >> (rounded_up_channels_shift[m_pCodecContext->channels] + 4); + if (m_iBufferOutputUsed && (m_iBufferOutputUsed + outputSize > desired_size || m_bNoConcatenate)) + { + int ret = m_iBufferOutputUsed; + m_iBufferOutputUsed = 0; ++ m_bNoConcatenate = false; + dts = m_dts; + pts = m_pts; + *dst = m_pBufferOutput; +@@ -278,9 +281,6 @@ int COMXAudioCodecOMX::GetData(BYTE** dst, double &dts, double &pts) + m_bFirstFrame = false; + } + m_iBufferOutputUsed += outputSize; +- +- if (!m_bNoConcatenate && m_pCodecContext->sample_fmt == AV_SAMPLE_FMT_FLTP && m_frameSize && (int)m_frameSize != outputSize) +- CLog::Log(LOGERROR, "COMXAudioCodecOMX::GetData Unexpected change of size (%d->%d)", m_frameSize, outputSize); + return 0; + } + +-- +2.5.0 + + +From 88f9f9f084fde1e563e9c7510cfb84bedf21c842 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Thu, 4 Feb 2016 15:29:55 +0000 +Subject: [PATCH 82/94] MMALCodec: Set dropped flag on output pictures when + input requested that + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 6 ++++++ + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 1 + + 2 files changed, 7 insertions(+) + diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 08f61fc..25a4c84 100644 +index 0f5c1b7..7b025fd 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -99,6 +99,7 @@ long CMMALVideoBuffer::Release() - #define CLASSNAME "CMMALVideo" - - CMMALVideo::CMMALVideo() -+: m_sharedSection(g_RBP.GetLock()) +@@ -759,6 +759,7 @@ void CMMALVideo::SetDropState(bool bDrop) { if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, this); + CLog::Log(LOGDEBUG, "%s::%s - bDrop(%d)", CLASSNAME, __func__, bDrop); ++ m_dropState = bDrop; + } + + int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) +@@ -794,6 +795,8 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) + buffer->length = (uint32_t)iSize > buffer->alloc_size ? buffer->alloc_size : (uint32_t)iSize; + // set a flag so we can identify primary frames from generated frames (deinterlace) + buffer->flags = MMAL_BUFFER_HEADER_FLAG_USER0; ++ if (m_dropState) ++ buffer->flags |= MMAL_BUFFER_HEADER_FLAG_USER3; + + memcpy(buffer->data, pData, buffer->length); + iSize -= buffer->length; +@@ -944,6 +947,7 @@ void CMMALVideo::Reset(void) + m_decoderPts = DVD_NOPTS_VALUE; + m_demuxerPts = DVD_NOPTS_VALUE; + m_codecControlFlags = 0; ++ m_dropState = false; + } + + void CMMALVideo::SetSpeed(int iSpeed) +@@ -1021,6 +1025,8 @@ bool CMMALVideo::GetPicture(DVDVideoPicture* pDvdVideoPicture) + + pDvdVideoPicture->MMALBuffer->Acquire(); + pDvdVideoPicture->iFlags = DVP_FLAG_ALLOCATED; ++ if (buffer->mmal_buffer->flags & MMAL_BUFFER_HEADER_FLAG_USER3) ++ pDvdVideoPicture->iFlags |= DVP_FLAG_DROPPED; + if (g_advancedSettings.CanLogComponent(LOGVIDEO)) + CLog::Log(LOGINFO, "%s::%s dts:%.3f pts:%.3f flags:%x:%x MMALBuffer:%p mmal_buffer:%p", CLASSNAME, __func__, + pDvdVideoPicture->dts == DVD_NOPTS_VALUE ? 0.0 : pDvdVideoPicture->dts*1e-6, pDvdVideoPicture->pts == DVD_NOPTS_VALUE ? 0.0 : pDvdVideoPicture->pts*1e-6, diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index bf669e0..60a3e5f 100644 +index ca28c6f..bf669e0 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -126,7 +126,7 @@ class CMMALVideo : public CDVDVideoCodec +@@ -124,6 +124,7 @@ protected: + double m_decoderPts; + int m_speed; int m_codecControlFlags; - bool m_dropState; ++ bool m_dropState; -- CCriticalSection m_sharedSection; -+ CCriticalSection &m_sharedSection; + CCriticalSection m_sharedSection; MMAL_COMPONENT_T *m_dec; - MMAL_PORT_T *m_dec_input; - MMAL_PORT_T *m_dec_output; -diff --git a/xbmc/linux/OMXCore.cpp b/xbmc/linux/OMXCore.cpp -index 5f91787..a7edc95 100644 ---- a/xbmc/linux/OMXCore.cpp -+++ b/xbmc/linux/OMXCore.cpp -@@ -59,6 +59,7 @@ static void add_timespecs(struct timespec &time, long millisecs) +-- +2.5.0 + + +From e51fd26cfe75c298e107f26af4ba6dd3a68f4e22 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 3 Feb 2016 21:35:01 +0000 +Subject: [PATCH 83/94] DVDVideoCodecFFmpeg: Enable refcounted frames + +Without this frames will get (deep) copied when deinterlace is set to automatic, +but file is not deinterlaced. + +For 1080p24 that costs 150MB/s of memory bandwidth which is very expensive. +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +index c2f3287..64087f2 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +@@ -316,6 +316,10 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options + av_opt_set(m_pCodecContext, it->m_name.c_str(), it->m_value.c_str(), 0); + } ++ // If non-zero, the decoded audio and video frames returned from avcodec_decode_video2() are reference-counted and are valid indefinitely. ++ // Without this frames will get (deep) copied when deinterlace is set to automatic, but file is not deinterlaced. ++ m_pCodecContext->refcounted_frames = 1; ++ + if (avcodec_open2(m_pCodecContext, pCodec, NULL) < 0) + { + CLog::Log(LOGDEBUG,"CDVDVideoCodecFFmpeg::Open() Unable to open codec"); +-- +2.5.0 + + +From 6df990c5d6b5930b34a05167b989bb0155a6fcae Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 19 Feb 2016 13:45:23 +0000 +Subject: [PATCH 84/94] mmal: increase decode buffering a little to help harder + MVC files + +PR8610 reduced buffering in codec which generally improved behaviour, +but we have some reports of hard streams (like 3D BluRay) that now +lag. The problem is when the codec's input buffer runs dry you +waste useful decoder cycles. It seems adding another two frames of +latency to decoder gets the performance back. +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +index 7b025fd..08f61fc 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +@@ -676,7 +676,7 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) - COMXCoreTunel::COMXCoreTunel() -+: m_sharedSection(g_RBP.GetLock()) + // limit number of callback structures in video_decode to reduce latency. Too low and video hangs. + // negative numbers have special meaning. -1=size of DPB -2=size of DPB+1 +- status = mmal_port_parameter_set_uint32(m_dec_input, MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS, -3); ++ status = mmal_port_parameter_set_uint32(m_dec_input, MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS, -5); + if (status != MMAL_SUCCESS) + CLog::Log(LOGERROR, "%s::%s Failed to configure max num callbacks on %s (status=%x %s)", CLASSNAME, __func__, m_dec_input->name, status, mmal_status_to_string(status)); + +-- +2.5.0 + + +From 1d254cfd3db48c1fc2307467da5c801639cc73c3 Mon Sep 17 00:00:00 2001 +From: Mario Holzinger +Date: Fri, 11 Dec 2015 16:48:57 +0100 +Subject: [PATCH 85/94] touch panel to display adjustment + +--- + xbmc/input/linux/LinuxInputDevices.cpp | 7 ++++--- + xbmc/settings/AdvancedSettings.cpp | 16 ++++++++++++++++ + xbmc/settings/AdvancedSettings.h | 6 ++++++ + 3 files changed, 26 insertions(+), 3 deletions(-) + +diff --git a/xbmc/input/linux/LinuxInputDevices.cpp b/xbmc/input/linux/LinuxInputDevices.cpp +index 9f3e866..a506956 100644 +--- a/xbmc/input/linux/LinuxInputDevices.cpp ++++ b/xbmc/input/linux/LinuxInputDevices.cpp +@@ -98,6 +98,7 @@ typedef unsigned long kernel_ulong_t; + #include "utils/log.h" + #include "input/touch/generic/GenericTouchActionHandler.h" + #include "input/touch/generic/GenericTouchInputHandler.h" ++#include "settings/AdvancedSettings.h" + + #ifndef BITS_PER_LONG + #define BITS_PER_LONG (sizeof(long) * 8) +@@ -653,13 +654,13 @@ bool CLinuxInputDevice::AbsEvent(const struct input_event& levt, XBMC_Event& dev + switch (levt.code) + { + case ABS_X: +- m_mouseX = levt.value; ++ m_mouseX = (int)((float)levt.value * g_advancedSettings.m_screenAlign_xStretchFactor) + g_advancedSettings.m_screenAlign_xOffset; // stretch and shift touch x coordinates + break; + + case ABS_Y: +- m_mouseY = levt.value; ++ m_mouseY = (int)((float)levt.value * g_advancedSettings.m_screenAlign_yStretchFactor) + g_advancedSettings.m_screenAlign_yOffset; // stretch and shift touch y coordinates + break; +- ++ + case ABS_MISC: + remoteStatus = levt.value & 0xFF; + break; +diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp +index aeea13b..326e9f5 100644 +--- a/xbmc/settings/AdvancedSettings.cpp ++++ b/xbmc/settings/AdvancedSettings.cpp +@@ -303,6 +303,12 @@ void CAdvancedSettings::Initialize() + m_iEdlCommBreakAutowait = 0; // Off by default + m_iEdlCommBreakAutowind = 0; // Off by default + ++ // Touchscreen default values if no adjustment is necessarry ++ m_screenAlign_xOffset = 0; ++ m_screenAlign_yOffset= 0; ++ m_screenAlign_xStretchFactor = 1.0; ++ m_screenAlign_yStretchFactor = 1.0; ++ + m_curlconnecttimeout = 10; + m_curllowspeedtime = 20; + m_curlretries = 2; +@@ -871,6 +877,16 @@ void CAdvancedSettings::ParseSettingsFile(const std::string &file) + XMLUtils::GetInt(pElement, "commbreakautowind", m_iEdlCommBreakAutowind, 0, 10); // Between 0 and 10 seconds + } + ++ // Touchscreen ++ pElement = pRootElement->FirstChildElement("touchscreen"); ++ if (pElement) ++ { ++ XMLUtils::GetInt(pElement, "x_offset", m_screenAlign_xOffset ); ++ XMLUtils::GetInt(pElement, "y_offset", m_screenAlign_yOffset ); ++ XMLUtils::GetFloat(pElement, "x_stretch_factor", m_screenAlign_xStretchFactor ); ++ XMLUtils::GetFloat(pElement, "y_stretch_factor", m_screenAlign_yStretchFactor ); ++ } ++ + // picture exclude regexps + TiXmlElement* pPictureExcludes = pRootElement->FirstChildElement("pictureexcludes"); + if (pPictureExcludes) +diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h +index 4da88f4..1bdc77e 100644 +--- a/xbmc/settings/AdvancedSettings.h ++++ b/xbmc/settings/AdvancedSettings.h +@@ -334,6 +334,12 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler + std::string m_cpuTempCmd; + std::string m_gpuTempCmd; + ++ // Touchscreen ++ int m_screenAlign_xOffset; ++ int m_screenAlign_yOffset; ++ float m_screenAlign_xStretchFactor; ++ float m_screenAlign_yStretchFactor; ++ + /* PVR/TV related advanced settings */ + int m_iPVRTimeCorrection; /*!< @brief correct all times (epg tags, timer tags, recording tags) by this amount of minutes. defaults to 0. */ + int m_iPVRInfoToggleInterval; /*!< @brief if there are more than 1 pvr gui info item available (e.g. multiple recordings active at the same time), use this toggle delay in milliseconds. defaults to 3000. */ +-- +2.5.0 + + +From e5e1e2f22f64436ddcabf7f51d25bcd6a13eb4a4 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 15 Feb 2016 15:51:11 +0000 +Subject: [PATCH 86/94] touch panel to display adjustment - support multitouch + +PR7978 allowed a simple calibration to be applied to touch input +It didn't cover multitouch which this adds support for +--- + xbmc/input/linux/LinuxInputDevices.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/xbmc/input/linux/LinuxInputDevices.cpp b/xbmc/input/linux/LinuxInputDevices.cpp +index a506956..3579cd0 100644 +--- a/xbmc/input/linux/LinuxInputDevices.cpp ++++ b/xbmc/input/linux/LinuxInputDevices.cpp +@@ -707,7 +707,7 @@ bool CLinuxInputDevice::mtAbsEvent(const struct input_event& levt) + case ABS_MT_POSITION_X: + if (m_mt_currentSlot < TOUCH_MAX_POINTERS) + { +- m_mt_x[m_mt_currentSlot] = levt.value; ++ m_mt_x[m_mt_currentSlot] = (int)((float)levt.value * g_advancedSettings.m_screenAlign_xStretchFactor) + g_advancedSettings.m_screenAlign_xOffset; // stretch and shift touch x coordinates + if (m_mt_event[m_mt_currentSlot] == TouchInputUnchanged) + m_mt_event[m_mt_currentSlot] = TouchInputMove; + } +@@ -716,7 +716,7 @@ bool CLinuxInputDevice::mtAbsEvent(const struct input_event& levt) + case ABS_MT_POSITION_Y: + if (m_mt_currentSlot < TOUCH_MAX_POINTERS) + { +- m_mt_y[m_mt_currentSlot] = levt.value; ++ m_mt_y[m_mt_currentSlot] = (int)((float)levt.value * g_advancedSettings.m_screenAlign_yStretchFactor) + g_advancedSettings.m_screenAlign_yOffset; // stretch and shift touch y coordinates; + if (m_mt_event[m_mt_currentSlot] == TouchInputUnchanged) + m_mt_event[m_mt_currentSlot] = TouchInputMove; + } +-- +2.5.0 + + +From 93502d0fbe98de0119c0e03a245528cfb89e69b9 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 22 Mar 2016 22:28:13 +0000 +Subject: [PATCH 87/94] [linux] Move hotplug checking into its own thread + +Currently checking for new linux input devices is called from the rendering thread. +We've been getting reports of skipped frames on raspberry pi. + +Specifically if eventlirc is active and you have an LIRC capable device connected +the hotplug check is slow and you get a frame skip every ten seconds. + +So move this code into its own thread +--- + xbmc/input/linux/LinuxInputDevices.cpp | 54 +++++++++++++++++++++------------- + xbmc/input/linux/LinuxInputDevices.h | 14 ++++++++- + xbmc/windowing/WinEventsLinux.cpp | 1 + + xbmc/windowing/WinEventsLinux.h | 2 ++ + 4 files changed, 49 insertions(+), 22 deletions(-) + +diff --git a/xbmc/input/linux/LinuxInputDevices.cpp b/xbmc/input/linux/LinuxInputDevices.cpp +index 3579cd0..7b3c6ad 100644 +--- a/xbmc/input/linux/LinuxInputDevices.cpp ++++ b/xbmc/input/linux/LinuxInputDevices.cpp +@@ -1081,6 +1081,30 @@ bool CLinuxInputDevice::IsUnplugged() + return m_bUnplugged; + } + ++CLinuxInputDevicesCheckHotplugged::CLinuxInputDevicesCheckHotplugged(CLinuxInputDevices &parent) : ++ CThread("CLinuxInputDevicesCheckHotplugged"), m_parent(parent) ++{ ++ Create(); ++ SetPriority(THREAD_PRIORITY_BELOW_NORMAL); ++} ++ ++CLinuxInputDevicesCheckHotplugged::~CLinuxInputDevicesCheckHotplugged() ++{ ++ m_bStop = true; ++ m_quitEvent.Set(); ++ StopThread(true); ++} ++ ++void CLinuxInputDevicesCheckHotplugged::Process() ++{ ++ while (!m_bStop) ++ { ++ m_parent.CheckHotplugged(); ++ // every ten seconds ++ m_quitEvent.WaitMSec(10000); ++ } ++} ++ + bool CLinuxInputDevices::CheckDevice(const char *device) { - m_src_component = NULL; - m_dst_component = NULL; -@@ -74,6 +75,7 @@ COMXCoreTunel::~COMXCoreTunel() - - void COMXCoreTunel::Initialize(COMXCoreComponent *src_component, unsigned int src_port, COMXCoreComponent *dst_component, unsigned int dst_port) + int fd; +@@ -1147,10 +1171,6 @@ void CLinuxInputDevices::InitAvailable() + */ + void CLinuxInputDevices::CheckHotplugged() { -+ CSingleLock lock(m_sharedSection); - m_src_component = src_component; - m_src_port = src_port; - m_dst_component = dst_component; -@@ -82,6 +84,7 @@ void COMXCoreTunel::Initialize(COMXCoreComponent *src_component, unsigned int sr +- CSingleLock lock(m_devicesListLock); +- +- int deviceId = m_devices.size(); +- + /* No devices specified. Try to guess some. */ + for (int i = 0; i < MAX_LINUX_INPUT_DEVICES; i++) + { +@@ -1158,18 +1178,22 @@ void CLinuxInputDevices::CheckHotplugged() + bool ispresent = false; - OMX_ERRORTYPE COMXCoreTunel::Deestablish(bool noWait) + snprintf(buf, 32, "/dev/input/event%d", i); +- +- for (size_t j = 0; j < m_devices.size(); j++) + { +- if (m_devices[j]->GetFileName().compare(buf) == 0) ++ CSingleLock lock(m_devicesListLock); ++ for (size_t j = 0; j < m_devices.size(); j++) + { +- ispresent = true; +- break; ++ if (m_devices[j]->GetFileName().compare(buf) == 0) ++ { ++ ispresent = true; ++ break; ++ } + } + } + + if (!ispresent && CheckDevice(buf)) + { ++ CSingleLock lock(m_devicesListLock); ++ int deviceId = m_devices.size(); + CLog::Log(LOGINFO, "Found input device %s", buf); + m_devices.push_back(new CLinuxInputDevice(buf, deviceId)); + ++deviceId; +@@ -1360,18 +1384,6 @@ XBMC_Event CLinuxInputDevices::ReadEvent() + InitAvailable(); + m_bReInitialize = false; + } +- else +- { +- time_t now; +- time(&now); +- +- if ((now - m_lastHotplugCheck) >= 10) +- { +- CheckHotplugged(); +- m_lastHotplugCheck = now; +- } +- } +- + CSingleLock lock(m_devicesListLock); + + XBMC_Event event; +diff --git a/xbmc/input/linux/LinuxInputDevices.h b/xbmc/input/linux/LinuxInputDevices.h +index 8c88a1d..4fde1aa 100644 +--- a/xbmc/input/linux/LinuxInputDevices.h ++++ b/xbmc/input/linux/LinuxInputDevices.h +@@ -28,6 +28,7 @@ + #include "threads/SingleLock.h" + #include "input/touch/ITouchInputHandler.h" + #include "input/touch/generic/IGenericTouchGestureDetector.h" ++#include "threads/Thread.h" + + struct KeymapEntry { -+ CSingleLock lock(m_sharedSection); - if(!m_src_component || !m_dst_component || !IsInitialized()) - return OMX_ErrorUndefined; - -@@ -156,6 +159,7 @@ OMX_ERRORTYPE COMXCoreTunel::Deestablish(bool noWait) - - OMX_ERRORTYPE COMXCoreTunel::Establish(bool enable_ports /* = true */, bool disable_ports /* = false */) - { -+ CSingleLock lock(m_sharedSection); - OMX_ERRORTYPE omx_err = OMX_ErrorNone; - OMX_PARAM_U32TYPE param; - OMX_INIT_STRUCTURE(param); -@@ -293,6 +297,7 @@ OMX_ERRORTYPE COMXCoreTunel::Establish(bool enable_ports /* = true */, bool disa - //////////////////////////////////////////////////////////////////////////////////////////// - - COMXCoreComponent::COMXCoreComponent() -+: m_sharedSection(g_RBP.GetLock()) - { - m_input_port = 0; - m_output_port = 0; -@@ -332,6 +337,7 @@ COMXCoreComponent::COMXCoreComponent() - - COMXCoreComponent::~COMXCoreComponent() - { -+ CSingleLock lock(m_sharedSection); - Deinitialize(); - - pthread_mutex_destroy(&m_omx_input_mutex); -@@ -357,6 +363,7 @@ void COMXCoreComponent::TransitionToStateLoaded() - - OMX_ERRORTYPE COMXCoreComponent::EmptyThisBuffer(OMX_BUFFERHEADERTYPE *omx_buffer) - { -+ CSingleLock lock(m_sharedSection); - OMX_ERRORTYPE omx_err = OMX_ErrorNone; - - #if defined(OMX_DEBUG_EVENTHANDLER) -@@ -377,6 +384,7 @@ OMX_ERRORTYPE COMXCoreComponent::EmptyThisBuffer(OMX_BUFFERHEADERTYPE *omx_buffe - - OMX_ERRORTYPE COMXCoreComponent::FillThisBuffer(OMX_BUFFERHEADERTYPE *omx_buffer) - { -+ CSingleLock lock(m_sharedSection); - OMX_ERRORTYPE omx_err = OMX_ErrorNone; - - #if defined(OMX_DEBUG_EVENTHANDLER) -@@ -397,6 +405,7 @@ OMX_ERRORTYPE COMXCoreComponent::FillThisBuffer(OMX_BUFFERHEADERTYPE *omx_buffer - - OMX_ERRORTYPE COMXCoreComponent::FreeOutputBuffer(OMX_BUFFERHEADERTYPE *omx_buffer) - { -+ CSingleLock lock(m_sharedSection); - OMX_ERRORTYPE omx_err = OMX_ErrorNone; - - if(!m_handle || !omx_buffer) -@@ -420,6 +429,7 @@ void COMXCoreComponent::FlushAll() - - void COMXCoreComponent::FlushInput() - { -+ CSingleLock lock(m_sharedSection); - if(!m_handle || m_resource_error) - return; - -@@ -435,6 +445,7 @@ void COMXCoreComponent::FlushInput() - - void COMXCoreComponent::FlushOutput() - { -+ CSingleLock lock(m_sharedSection); - if(!m_handle || m_resource_error) - return; - -@@ -568,6 +579,7 @@ OMX_ERRORTYPE COMXCoreComponent::WaitForOutputDone(long timeout /*=200*/) - - OMX_ERRORTYPE COMXCoreComponent::AllocInputBuffers(bool use_buffers /* = false **/) - { -+ CSingleLock lock(m_sharedSection); - OMX_ERRORTYPE omx_err = OMX_ErrorNone; - - m_omx_input_use_buffers = use_buffers; -@@ -649,6 +661,7 @@ OMX_ERRORTYPE COMXCoreComponent::AllocInputBuffers(bool use_buffers /* = false * - - OMX_ERRORTYPE COMXCoreComponent::AllocOutputBuffers(bool use_buffers /* = false */) - { -+ CSingleLock lock(m_sharedSection); - OMX_ERRORTYPE omx_err = OMX_ErrorNone; - - if(!m_handle) -@@ -730,6 +743,7 @@ OMX_ERRORTYPE COMXCoreComponent::AllocOutputBuffers(bool use_buffers /* = false - - OMX_ERRORTYPE COMXCoreComponent::FreeInputBuffers() - { -+ CSingleLock lock(m_sharedSection); - OMX_ERRORTYPE omx_err = OMX_ErrorNone; - - if(!m_handle) -@@ -788,6 +802,7 @@ OMX_ERRORTYPE COMXCoreComponent::FreeInputBuffers() - - OMX_ERRORTYPE COMXCoreComponent::FreeOutputBuffers() - { -+ CSingleLock lock(m_sharedSection); - OMX_ERRORTYPE omx_err = OMX_ErrorNone; - - if(!m_handle) -@@ -846,6 +861,7 @@ OMX_ERRORTYPE COMXCoreComponent::FreeOutputBuffers() - - OMX_ERRORTYPE COMXCoreComponent::DisableAllPorts() - { -+ CSingleLock lock(m_sharedSection); - if(!m_handle) - return OMX_ErrorUndefined; - -@@ -1074,6 +1090,7 @@ OMX_ERRORTYPE COMXCoreComponent::WaitForCommand(OMX_U32 command, OMX_U32 nData2, - - OMX_ERRORTYPE COMXCoreComponent::SetStateForComponent(OMX_STATETYPE state) - { -+ CSingleLock lock(m_sharedSection); - if(!m_handle) - return OMX_ErrorUndefined; - -@@ -1112,6 +1129,7 @@ OMX_ERRORTYPE COMXCoreComponent::SetStateForComponent(OMX_STATETYPE state) - - OMX_STATETYPE COMXCoreComponent::GetState() const - { -+ CSingleLock lock(m_sharedSection); - if(!m_handle) - return (OMX_STATETYPE)0; - -@@ -1123,6 +1141,7 @@ OMX_STATETYPE COMXCoreComponent::GetState() const - - OMX_ERRORTYPE COMXCoreComponent::SetParameter(OMX_INDEXTYPE paramIndex, OMX_PTR paramStruct) - { -+ CSingleLock lock(m_sharedSection); - if(!m_handle) - return OMX_ErrorUndefined; - -@@ -1139,6 +1158,7 @@ OMX_ERRORTYPE COMXCoreComponent::SetParameter(OMX_INDEXTYPE paramIndex, OMX_PTR - - OMX_ERRORTYPE COMXCoreComponent::GetParameter(OMX_INDEXTYPE paramIndex, OMX_PTR paramStruct) const - { -+ CSingleLock lock(m_sharedSection); - if(!m_handle) - return OMX_ErrorUndefined; - -@@ -1155,6 +1175,7 @@ OMX_ERRORTYPE COMXCoreComponent::GetParameter(OMX_INDEXTYPE paramIndex, OMX_PTR - - OMX_ERRORTYPE COMXCoreComponent::SetConfig(OMX_INDEXTYPE configIndex, OMX_PTR configStruct) - { -+ CSingleLock lock(m_sharedSection); - if(!m_handle) - return OMX_ErrorUndefined; - -@@ -1171,6 +1192,7 @@ OMX_ERRORTYPE COMXCoreComponent::SetConfig(OMX_INDEXTYPE configIndex, OMX_PTR co - - OMX_ERRORTYPE COMXCoreComponent::GetConfig(OMX_INDEXTYPE configIndex, OMX_PTR configStruct) const - { -+ CSingleLock lock(m_sharedSection); - if(!m_handle) - return OMX_ErrorUndefined; - -@@ -1187,6 +1209,7 @@ OMX_ERRORTYPE COMXCoreComponent::GetConfig(OMX_INDEXTYPE configIndex, OMX_PTR co - - OMX_ERRORTYPE COMXCoreComponent::SendCommand(OMX_COMMANDTYPE cmd, OMX_U32 cmdParam, OMX_PTR cmdParamData) - { -+ CSingleLock lock(m_sharedSection); - if(!m_handle) - return OMX_ErrorUndefined; - -@@ -1203,6 +1226,7 @@ OMX_ERRORTYPE COMXCoreComponent::SendCommand(OMX_COMMANDTYPE cmd, OMX_U32 cmdPar - - OMX_ERRORTYPE COMXCoreComponent::EnablePort(unsigned int port, bool wait) - { -+ CSingleLock lock(m_sharedSection); - if(!m_handle) - return OMX_ErrorUndefined; - -@@ -1237,6 +1261,7 @@ OMX_ERRORTYPE COMXCoreComponent::EnablePort(unsigned int port, bool wait) - - OMX_ERRORTYPE COMXCoreComponent::DisablePort(unsigned int port, bool wait) - { -+ CSingleLock lock(m_sharedSection); - if(!m_handle) - return OMX_ErrorUndefined; - -@@ -1271,6 +1296,7 @@ OMX_ERRORTYPE COMXCoreComponent::DisablePort(unsigned int port, bool wait) - - OMX_ERRORTYPE COMXCoreComponent::UseEGLImage(OMX_BUFFERHEADERTYPE** ppBufferHdr, OMX_U32 nPortIndex, OMX_PTR pAppPrivate, void* eglImage) - { -+ CSingleLock lock(m_sharedSection); - OMX_ERRORTYPE omx_err = OMX_ErrorNone; - - if(!m_handle) -@@ -1350,6 +1376,7 @@ OMX_ERRORTYPE COMXCoreComponent::UseEGLImage(OMX_BUFFERHEADERTYPE** ppBufferHdr, - - bool COMXCoreComponent::Initialize( const std::string &component_name, OMX_INDEXTYPE index) - { -+ CSingleLock lock(m_sharedSection); - OMX_ERRORTYPE omx_err; - - m_input_port = 0; -@@ -1437,6 +1464,7 @@ bool COMXCoreComponent::Initialize( const std::string &component_name, OMX_INDEX - - void COMXCoreComponent::ResetEos() - { -+ CSingleLock lock(m_sharedSection); - pthread_mutex_lock(&m_omx_eos_mutex); - m_eos = false; - pthread_mutex_unlock(&m_omx_eos_mutex); -@@ -1444,6 +1472,7 @@ void COMXCoreComponent::ResetEos() - - bool COMXCoreComponent::Deinitialize() - { -+ CSingleLock lock(m_sharedSection); - OMX_ERRORTYPE omx_err; - - m_exit = true; -diff --git a/xbmc/linux/OMXCore.h b/xbmc/linux/OMXCore.h -index 05052e5..2c2f91c 100644 ---- a/xbmc/linux/OMXCore.h -+++ b/xbmc/linux/OMXCore.h -@@ -78,6 +78,7 @@ class COMXCoreTunel - unsigned int m_dst_port; - DllOMX *m_DllOMX; - bool m_tunnel_set; -+ CCriticalSection &m_sharedSection; +@@ -105,7 +106,18 @@ private: + bool CheckDevice(const char *device); + std::vector m_devices; + bool m_bReInitialize; +- time_t m_lastHotplugCheck; ++}; ++ ++class CLinuxInputDevicesCheckHotplugged : protected CThread ++{ ++public: ++ CLinuxInputDevicesCheckHotplugged(CLinuxInputDevices &parent); ++ ~CLinuxInputDevicesCheckHotplugged(); ++private: ++ CLinuxInputDevices &m_parent; ++ CEvent m_quitEvent; ++protected: ++ virtual void Process(); }; - class COMXCoreComponent -@@ -199,6 +200,7 @@ class COMXCoreComponent - bool m_flush_input; - bool m_flush_output; - bool m_resource_error; -+ CCriticalSection &m_sharedSection; - }; + #endif /* LINUXINPUTDEVICES_H_ */ +diff --git a/xbmc/windowing/WinEventsLinux.cpp b/xbmc/windowing/WinEventsLinux.cpp +index 2b3d77a..fb6c987 100644 +--- a/xbmc/windowing/WinEventsLinux.cpp ++++ b/xbmc/windowing/WinEventsLinux.cpp +@@ -134,6 +134,7 @@ bool CWinEventsLinux::MessagePump() + if (!m_initialized) + { + m_devices.InitAvailable(); ++ m_checkHotplug = std::unique_ptr(new CLinuxInputDevicesCheckHotplugged(m_devices)); + m_initialized = true; + #ifdef TARGET_RASPBERRY_PI + LoadXML("Pointer.xml"); +diff --git a/xbmc/windowing/WinEventsLinux.h b/xbmc/windowing/WinEventsLinux.h +index 23244a2..c82ba84 100644 +--- a/xbmc/windowing/WinEventsLinux.h ++++ b/xbmc/windowing/WinEventsLinux.h +@@ -22,6 +22,7 @@ + #define WINDOW_EVENTS_LINUX_H - class COMXCore + #pragma once ++#include + #include "windowing/WinEvents.h" + #include "input/linux/LinuxInputDevices.h" + #include "guilib/TextureManager.h" +@@ -44,6 +45,7 @@ public: + private: + static bool m_initialized; + static CLinuxInputDevices m_devices; ++ std::unique_ptr m_checkHotplug; + #ifdef TARGET_RASPBERRY_PI + bool LoadXML(const std::string strFileName); + int64_t m_last_mouse_move_time; +-- +2.5.0 + + +From 19d44a0062028cc3b1625989de2492f39c5af9b3 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 28 Jul 2015 17:47:33 +0100 +Subject: [PATCH 88/94] [rbp] Refactor the vsync handle to support multiple + callers + +--- + xbmc/linux/RBP.cpp | 100 ++++++++++++++++++++++++++++++++++------------------- + xbmc/linux/RBP.h | 10 ++++-- + 2 files changed, 73 insertions(+), 37 deletions(-) + +diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp +index 13b0504..ddc2b9c 100644 +--- a/xbmc/linux/RBP.cpp ++++ b/xbmc/linux/RBP.cpp +@@ -34,6 +34,7 @@ + #include + #include + #include "rpi_user_vcsm.h" ++#include "utils/TimeUtils.h" + + #define MAJOR_NUM 100 + #define IOCTL_MBOX_PROPERTY _IOWR(MAJOR_NUM, 0, char *) +@@ -56,6 +57,8 @@ CRBP::CRBP() + m_enabled = 0; + m_mb = mbox_open(); + vcsm_init(); ++ m_vsync_count = 0; ++ m_last_vsync = 0; + } + + CRBP::~CRBP() +@@ -73,7 +76,7 @@ void CRBP::InitializeSettings() + + bool CRBP::Initialize() + { +- CSingleLock lock (m_critSection); ++ CSingleLock lock(m_critSection); + if (m_initialized) + return true; + +@@ -133,11 +136,62 @@ void CRBP::LogFirmwareVerison() + CLog::Log(LOGNOTICE, "Config:\n%s", response); + } + ++static void vsync_callback_static(DISPMANX_UPDATE_HANDLE_T u, void *arg) ++{ ++ CRBP *rbp = reinterpret_cast(arg); ++ rbp->VSyncCallback(); ++} ++ ++void CRBP::VSyncCallback() ++{ ++ CSingleLock lock(m_vsync_lock); ++ m_vsync_count++; ++ m_last_vsync = CurrentHostCounter(); ++ m_vsync_cond.notifyAll(); ++} ++ ++unsigned int CRBP::VsyncCount() ++{ ++ CSingleLock lock(m_vsync_lock); ++ return m_vsync_count; ++} ++ ++int64_t CRBP::LastVsync() ++{ ++ CSingleLock lock(m_vsync_lock); ++ return m_last_vsync; ++} ++ ++unsigned int CRBP::WaitVsync(unsigned int target) ++{ ++ CSingleLock vlock(m_vsync_lock); ++ DISPMANX_DISPLAY_HANDLE_T display = m_display; ++ XbmcThreads::EndTime delay(50); ++ if (target == ~0U) ++ target = m_vsync_count+1; ++ while (!delay.IsTimePast()) ++ { ++ CSingleLock lock(m_critSection); ++ if (m_vsync_count >= target) ++ break; ++ lock.Leave(); ++ if (!m_vsync_cond.wait(vlock, delay.MillisLeft())) ++ break; ++ } ++ if (m_vsync_count < target) ++ CLog::Log(LOGDEBUG, "CRBP::%s no vsync %d/%d display:%x(%x) delay:%d", __FUNCTION__, m_vsync_count, target, m_display, display, delay.MillisLeft()); ++ ++ return m_vsync_count; ++} ++ + DISPMANX_DISPLAY_HANDLE_T CRBP::OpenDisplay(uint32_t device) + { ++ CSingleLock lock(m_critSection); + if (m_display == DISPMANX_NO_HANDLE) + { + m_display = vc_dispmanx_display_open( 0 /*screen*/ ); ++ int s = vc_dispmanx_vsync_callback(m_display, vsync_callback_static, (void *)this); ++ assert(s == 0); + init_cursor(); + } + return m_display; +@@ -145,16 +199,20 @@ DISPMANX_DISPLAY_HANDLE_T CRBP::OpenDisplay(uint32_t device) + + void CRBP::CloseDisplay(DISPMANX_DISPLAY_HANDLE_T display) + { ++ CSingleLock lock(m_critSection); + assert(display == m_display); ++ int s = vc_dispmanx_vsync_callback(m_display, NULL, NULL); ++ assert(s == 0); ++ uninit_cursor(); + vc_dispmanx_display_close(m_display); + m_display = DISPMANX_NO_HANDLE; +- uninit_cursor(); + } + + void CRBP::GetDisplaySize(int &width, int &height) + { ++ CSingleLock lock(m_critSection); + DISPMANX_MODEINFO_T info; +- if (vc_dispmanx_display_get_info(m_display, &info) == 0) ++ if (m_display != DISPMANX_NO_HANDLE && vc_dispmanx_display_get_info(m_display, &info) == 0) + { + width = info.width; + height = info.height; +@@ -183,13 +241,13 @@ unsigned char *CRBP::CaptureDisplay(int width, int height, int *pstride, bool sw + flags |= DISPMANX_SNAPSHOT_PACK; + + stride = ((width + 15) & ~15) * 4; +- image = new unsigned char [height * stride]; + +- if (image) ++ CSingleLock lock(m_critSection); ++ if (m_display != DISPMANX_NO_HANDLE) + { ++ image = new unsigned char [height * stride]; + resource = vc_dispmanx_resource_create( VC_IMAGE_RGBA32, width, height, &vc_image_ptr ); + +- assert(m_display != DISPMANX_NO_HANDLE); + vc_dispmanx_snapshot(m_display, resource, (DISPMANX_TRANSFORM_T)flags); + + vc_dispmanx_rect_set(&rect, 0, 0, width, height); +@@ -201,35 +259,6 @@ unsigned char *CRBP::CaptureDisplay(int width, int height, int *pstride, bool sw + return image; + } + +- +-static void vsync_callback(DISPMANX_UPDATE_HANDLE_T u, void *arg) +-{ +- CEvent *sync = (CEvent *)arg; +- sync->Set(); +-} +- +-void CRBP::WaitVsync() +-{ +- int s; +- DISPMANX_DISPLAY_HANDLE_T m_display = vc_dispmanx_display_open( 0 /*screen*/ ); +- if (m_display == DISPMANX_NO_HANDLE) +- { +- CLog::Log(LOGDEBUG, "CRBP::%s skipping while display closed", __func__); +- return; +- } +- m_vsync.Reset(); +- s = vc_dispmanx_vsync_callback(m_display, vsync_callback, (void *)&m_vsync); +- if (s == 0) +- { +- m_vsync.WaitMSec(1000); +- } +- else assert(0); +- s = vc_dispmanx_vsync_callback(m_display, NULL, NULL); +- assert(s == 0); +- vc_dispmanx_display_close( m_display ); +-} +- +- + void CRBP::Deinitialize() + { + if (m_omx_image_init) +@@ -260,6 +289,7 @@ void CRBP::Deinitialize() + + double CRBP::AdjustHDMIClock(double adjust) + { ++ CSingleLock lock(m_critSection); + char response[80]; + vc_gencmd(response, sizeof response, "hdmi_adjust_clock %f", adjust); + char *p = strchr(response, '='); diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h -index 2eee35d..884d7c2 100644 +index 2eee35d..3b59cd9 100644 --- a/xbmc/linux/RBP.h +++ b/xbmc/linux/RBP.h -@@ -81,6 +81,7 @@ class CRBP +@@ -77,7 +77,10 @@ public: + // stride can be null for packed output + unsigned char *CaptureDisplay(int width, int height, int *stride, bool swap_red_blue, bool video_only = true); + DllOMX *GetDllOMX() { return m_OMX ? m_OMX->GetDll() : NULL; } +- void WaitVsync(); ++ unsigned int WaitVsync(unsigned int target = ~0U); ++ int64_t LastVsync(); ++ unsigned int VsyncCount(); ++ void VSyncCallback(); double AdjustHDMIClock(double adjust); double GetAdjustHDMIClock() { return m_last_pll_adjust; } int GetMBox() { return m_mb; } -+ CCriticalSection &GetLock() { return m_critSection; } +@@ -94,7 +97,10 @@ private: + bool m_codec_wvc1_enabled; + COMXCore *m_OMX; + DISPMANX_DISPLAY_HANDLE_T m_display; +- CEvent m_vsync; ++ CCriticalSection m_vsync_lock; ++ XbmcThreads::ConditionVariable m_vsync_cond; ++ unsigned int m_vsync_count; ++ int64_t m_last_vsync; + class DllLibOMXCore; + CCriticalSection m_critSection; + double m_last_pll_adjust; +-- +2.5.0 + + +From 8a52d5281d3f5f6e4b33016233cecdcc6775f4b7 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Thu, 24 Mar 2016 23:24:18 +0000 +Subject: [PATCH 89/94] [mmalrenderer] Wait for vsync before submitting to mmal + when display sync is disabled + +This avoids an issue where video occasionally goes stuttery after a seek, until the next pause/play or seek. +The issue is when display sync is disabled, and framerate of video matches display, and render times are coincident with vsync +you find that depending on timestamp/scheduling jitter, you may or may not get an update each vsync resulting in stuttery video. + +Some scheme to force render times to be dependent on vsync is required. We do this by using a queue that is popped following vsyncs. +We ensure the queue always has 1 or 2 frames so it doesn't underrun with a late frame, but this adds a frame of latency. +--- + xbmc/cores/VideoRenderers/MMALRenderer.cpp | 52 ++++++++++++++++++++++++++---- + xbmc/cores/VideoRenderers/MMALRenderer.h | 5 ++- + 2 files changed, 50 insertions(+), 7 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +index ad3f66f..e879cba 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +@@ -239,7 +239,7 @@ bool CMMALRenderer::init_vout(ERenderFormat format) + return true; + } - private: - DllBcmHost *m_DllBcmHost; +-CMMALRenderer::CMMALRenderer() ++CMMALRenderer::CMMALRenderer() : CThread("MMALRenderer") + { + CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); + m_vout = NULL; +@@ -253,15 +253,41 @@ CMMALRenderer::CMMALRenderer() + m_iYV12RenderBuffer = 0; + m_inflight = 0; + m_sharpness = -2.0f; ++ m_queue = mmal_queue_create(); ++ Create(); + } + + CMMALRenderer::~CMMALRenderer() + { + CSingleLock lock(m_sharedSection); + CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); ++ StopThread(true); ++ mmal_queue_destroy(m_queue); + UnInit(); + } + ++void CMMALRenderer::Process() ++{ ++ bool started = false; ++ SetPriority(THREAD_PRIORITY_ABOVE_NORMAL); ++ while (!m_bStop) ++ { ++ g_RBP.WaitVsync(); ++ if (!started && mmal_queue_length(m_queue) >= 2) ++ started = true; ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - vsync:%d queue:%d started:%d", CLASSNAME, __func__, g_RBP.VsyncCount(), mmal_queue_length(m_queue), started); ++ if (started) ++ { ++ MMAL_BUFFER_HEADER_T *buffer = mmal_queue_get(m_queue); ++ if (buffer) ++ mmal_port_send_buffer(m_vout_input, buffer); ++ else ++ started = false; ++ } ++ } ++} ++ + void CMMALRenderer::AddProcessor(CMMALVideoBuffer *buffer, int index) + { + #if defined(MMAL_DEBUG_VERBOSE) +@@ -496,10 +522,17 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + return; + omvb->Acquire(); + omvb->mmal_buffer->flags |= MMAL_BUFFER_HEADER_FLAG_USER1 | MMAL_BUFFER_HEADER_FLAG_USER2; +- mmal_port_send_buffer(m_vout_input, omvb->mmal_buffer); +- } +- else +- CLog::Log(LOGDEBUG, "%s::%s - No buffer to update", CLASSNAME, __func__); ++ if (!CSettings::GetInstance().GetBool("videoplayer.usedisplayasclock") && m_fps > 0.0 && fabs(m_fps - g_graphicsContext.GetFPS()) < 1e-2) ++ { ++ while (mmal_queue_length(m_queue) >= 2) ++ Sleep(1); ++ mmal_queue_put(m_queue, omvb->mmal_buffer); ++ } ++ else ++ mmal_port_send_buffer(m_vout_input, omvb->mmal_buffer); ++ } ++ else ++ CLog::Log(LOGDEBUG, "%s::%s - No buffer to update", CLASSNAME, __func__); + } + else if (m_format == RENDER_FMT_YUV420P) + { +@@ -516,7 +549,14 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + omvb->Acquire(); + omvb->mmal_buffer->flags |= MMAL_BUFFER_HEADER_FLAG_USER1 | MMAL_BUFFER_HEADER_FLAG_USER2; + omvb->mmal_buffer->user_data = omvb; +- mmal_port_send_buffer(m_vout_input, omvb->mmal_buffer); ++ if (!CSettings::GetInstance().GetBool("videoplayer.usedisplayasclock") && m_fps > 0.0 && fabs(m_fps - g_graphicsContext.GetFPS()) < 1e-2) ++ { ++ while (mmal_queue_length(m_queue) >= 2) ++ Sleep(1); ++ mmal_queue_put(m_queue, omvb->mmal_buffer); ++ } ++ else ++ mmal_port_send_buffer(m_vout_input, omvb->mmal_buffer); + } + else + CLog::Log(LOGDEBUG, "%s::%s - No buffer to update: clear:%d flags:%x alpha:%d source:%d", CLASSNAME, __func__, clear, flags, alpha, source); +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.h b/xbmc/cores/VideoRenderers/MMALRenderer.h +index a71e645..f17dc47 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.h ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.h +@@ -29,6 +29,7 @@ + #include "cores/dvdplayer/DVDStreamInfo.h" + #include "guilib/Geometry.h" + #include "BaseRenderer.h" ++#include "threads/Thread.h" + + #include + #include +@@ -55,7 +56,7 @@ protected: + long m_refs; + }; + +-class CMMALRenderer : public CBaseRenderer ++class CMMALRenderer : public CBaseRenderer, public CThread + { + struct YUVBUFFER + { +@@ -66,6 +67,7 @@ public: + CMMALRenderer(); + ~CMMALRenderer(); + ++ void Process(); + virtual void Update(); + virtual void SetupScreenshot() {}; + +@@ -125,6 +127,7 @@ protected: + MMAL_COMPONENT_T *m_vout; + MMAL_PORT_T *m_vout_input; + MMAL_POOL_T *m_vout_input_pool; ++ MMAL_QUEUE_T *m_queue; + + bool init_vout(ERenderFormat format); + void ReleaseBuffers(); +-- +2.5.0 + + +From c262dea07c4ae5c6b280f534dcce4699f9ffdaf8 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 25 Mar 2016 11:36:25 +0000 +Subject: [PATCH 90/94] Revert "[mmalrenderer] Wait for vsync before submitting + to mmal when display sync is disabled" + +This reverts commit bc61a9f7823b5a934ae46ed9bac6cfa0f4b520fa. +--- + xbmc/cores/VideoRenderers/MMALRenderer.cpp | 52 ++++-------------------------- + xbmc/cores/VideoRenderers/MMALRenderer.h | 5 +-- + 2 files changed, 7 insertions(+), 50 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +index e879cba..ad3f66f 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +@@ -239,7 +239,7 @@ bool CMMALRenderer::init_vout(ERenderFormat format) + return true; + } + +-CMMALRenderer::CMMALRenderer() : CThread("MMALRenderer") ++CMMALRenderer::CMMALRenderer() + { + CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); + m_vout = NULL; +@@ -253,41 +253,15 @@ CMMALRenderer::CMMALRenderer() : CThread("MMALRenderer") + m_iYV12RenderBuffer = 0; + m_inflight = 0; + m_sharpness = -2.0f; +- m_queue = mmal_queue_create(); +- Create(); + } + + CMMALRenderer::~CMMALRenderer() + { + CSingleLock lock(m_sharedSection); + CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); +- StopThread(true); +- mmal_queue_destroy(m_queue); + UnInit(); + } + +-void CMMALRenderer::Process() +-{ +- bool started = false; +- SetPriority(THREAD_PRIORITY_ABOVE_NORMAL); +- while (!m_bStop) +- { +- g_RBP.WaitVsync(); +- if (!started && mmal_queue_length(m_queue) >= 2) +- started = true; +- if (g_advancedSettings.CanLogComponent(LOGVIDEO)) +- CLog::Log(LOGDEBUG, "%s::%s - vsync:%d queue:%d started:%d", CLASSNAME, __func__, g_RBP.VsyncCount(), mmal_queue_length(m_queue), started); +- if (started) +- { +- MMAL_BUFFER_HEADER_T *buffer = mmal_queue_get(m_queue); +- if (buffer) +- mmal_port_send_buffer(m_vout_input, buffer); +- else +- started = false; +- } +- } +-} +- + void CMMALRenderer::AddProcessor(CMMALVideoBuffer *buffer, int index) + { + #if defined(MMAL_DEBUG_VERBOSE) +@@ -522,17 +496,10 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + return; + omvb->Acquire(); + omvb->mmal_buffer->flags |= MMAL_BUFFER_HEADER_FLAG_USER1 | MMAL_BUFFER_HEADER_FLAG_USER2; +- if (!CSettings::GetInstance().GetBool("videoplayer.usedisplayasclock") && m_fps > 0.0 && fabs(m_fps - g_graphicsContext.GetFPS()) < 1e-2) +- { +- while (mmal_queue_length(m_queue) >= 2) +- Sleep(1); +- mmal_queue_put(m_queue, omvb->mmal_buffer); +- } +- else +- mmal_port_send_buffer(m_vout_input, omvb->mmal_buffer); +- } +- else +- CLog::Log(LOGDEBUG, "%s::%s - No buffer to update", CLASSNAME, __func__); ++ mmal_port_send_buffer(m_vout_input, omvb->mmal_buffer); ++ } ++ else ++ CLog::Log(LOGDEBUG, "%s::%s - No buffer to update", CLASSNAME, __func__); + } + else if (m_format == RENDER_FMT_YUV420P) + { +@@ -549,14 +516,7 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + omvb->Acquire(); + omvb->mmal_buffer->flags |= MMAL_BUFFER_HEADER_FLAG_USER1 | MMAL_BUFFER_HEADER_FLAG_USER2; + omvb->mmal_buffer->user_data = omvb; +- if (!CSettings::GetInstance().GetBool("videoplayer.usedisplayasclock") && m_fps > 0.0 && fabs(m_fps - g_graphicsContext.GetFPS()) < 1e-2) +- { +- while (mmal_queue_length(m_queue) >= 2) +- Sleep(1); +- mmal_queue_put(m_queue, omvb->mmal_buffer); +- } +- else +- mmal_port_send_buffer(m_vout_input, omvb->mmal_buffer); ++ mmal_port_send_buffer(m_vout_input, omvb->mmal_buffer); + } + else + CLog::Log(LOGDEBUG, "%s::%s - No buffer to update: clear:%d flags:%x alpha:%d source:%d", CLASSNAME, __func__, clear, flags, alpha, source); +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.h b/xbmc/cores/VideoRenderers/MMALRenderer.h +index f17dc47..a71e645 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.h ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.h +@@ -29,7 +29,6 @@ + #include "cores/dvdplayer/DVDStreamInfo.h" + #include "guilib/Geometry.h" + #include "BaseRenderer.h" +-#include "threads/Thread.h" + + #include + #include +@@ -56,7 +55,7 @@ protected: + long m_refs; + }; + +-class CMMALRenderer : public CBaseRenderer, public CThread ++class CMMALRenderer : public CBaseRenderer + { + struct YUVBUFFER + { +@@ -67,7 +66,6 @@ public: + CMMALRenderer(); + ~CMMALRenderer(); + +- void Process(); + virtual void Update(); + virtual void SetupScreenshot() {}; + +@@ -127,7 +125,6 @@ protected: + MMAL_COMPONENT_T *m_vout; + MMAL_PORT_T *m_vout_input; + MMAL_POOL_T *m_vout_input_pool; +- MMAL_QUEUE_T *m_queue; + + bool init_vout(ERenderFormat format); + void ReleaseBuffers(); +-- +2.5.0 + + +From aabdf8c31cbdea15c399219d99826e469fa007af Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 23 Mar 2016 15:54:43 +0000 +Subject: [PATCH 91/94] [mmalrenderer] Wait for vsync before submitting to mmal + when display sync is disabled + +This avoids an issue where video occasionally goes stuttery after a seek, until the next pause/play or seek. +The issue is when display sync is disabled, and framerate of video matches display, and render times are coincident with vsync +you find that depending on timestamp/scheduling jitter, you may or may not get an update each vsync resulting in stuttery video. + +Some scheme to force render times to be dependent on vsync is required. We do this by blocking in RenderUpdate unto next vsync. +--- + xbmc/cores/VideoRenderers/MMALRenderer.cpp | 34 ++++++++++++++++++++++++++++-- + xbmc/cores/VideoRenderers/MMALRenderer.h | 2 ++ + 2 files changed, 34 insertions(+), 2 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +index ad3f66f..a2e0df2 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +@@ -33,6 +33,7 @@ + #include "windowing/WindowingFactory.h" + #include "cores/dvdplayer/DVDCodecs/Video/MMALCodec.h" + #include "xbmc/Application.h" ++#include "utils/TimeUtils.h" + + #define CLASSNAME "CMMALRenderer" + +@@ -253,6 +254,7 @@ CMMALRenderer::CMMALRenderer() + m_iYV12RenderBuffer = 0; + m_inflight = 0; + m_sharpness = -2.0f; ++ m_vsyncCount = ~0; + } + + CMMALRenderer::~CMMALRenderer() +@@ -444,6 +446,32 @@ void CMMALRenderer::Update() + ManageDisplay(); + } + ++void CMMALRenderer::SubmitFrame(MMAL_BUFFER_HEADER_T *buffer) ++{ ++ if (!CSettings::GetInstance().GetBool("videoplayer.usedisplayasclock") && m_fps > 0.0f) ++ { ++ float ratio = g_graphicsContext.GetFPS() / m_fps; ++ long int factor = lrint(ratio); ++ float diff = ratio - (float)factor; ++ if (fabsf(diff) < 1e-2) ++ { ++ int64_t lastvsync = g_RBP.LastVsync(); ++ int64_t start = CurrentHostCounter(); ++ unsigned int vsynccount = g_RBP.WaitVsync(m_vsyncCount) + factor; ++ int64_t now = CurrentHostCounter(); ++ bool normal = m_vsyncCount + factor == vsynccount || m_vsyncCount + factor + 1 == vsynccount; ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - buffer:%p vfps:%.3f dfps:%.3f vsync:%d/%d delay:%.1f/%.1f dsync:%d normal:%d", CLASSNAME, __func__, buffer, m_fps, g_graphicsContext.GetFPS(), vsynccount, m_vsyncCount, ++ (now - start)*1e-6, (now - lastvsync)*1e-6, CSettings::GetInstance().GetBool("videoplayer.usedisplayasclock"), normal); ++ if (normal) ++ m_vsyncCount += factor; ++ else ++ m_vsyncCount = vsynccount; ++ } ++ } ++ mmal_port_send_buffer(m_vout_input, buffer); ++} ++ + void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + { + CSingleLock lock(m_sharedSection); +@@ -496,7 +524,8 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + return; + omvb->Acquire(); + omvb->mmal_buffer->flags |= MMAL_BUFFER_HEADER_FLAG_USER1 | MMAL_BUFFER_HEADER_FLAG_USER2; +- mmal_port_send_buffer(m_vout_input, omvb->mmal_buffer); ++ lock.Leave(); ++ SubmitFrame(omvb->mmal_buffer); + } + else + CLog::Log(LOGDEBUG, "%s::%s - No buffer to update", CLASSNAME, __func__); +@@ -516,7 +545,8 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + omvb->Acquire(); + omvb->mmal_buffer->flags |= MMAL_BUFFER_HEADER_FLAG_USER1 | MMAL_BUFFER_HEADER_FLAG_USER2; + omvb->mmal_buffer->user_data = omvb; +- mmal_port_send_buffer(m_vout_input, omvb->mmal_buffer); ++ lock.Leave(); ++ SubmitFrame(omvb->mmal_buffer); + } + else + CLog::Log(LOGDEBUG, "%s::%s - No buffer to update: clear:%d flags:%x alpha:%d source:%d", CLASSNAME, __func__, clear, flags, alpha, source); +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.h b/xbmc/cores/VideoRenderers/MMALRenderer.h +index a71e645..19e38f7 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.h ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.h +@@ -112,6 +112,7 @@ protected: + unsigned int m_destWidth; + unsigned int m_destHeight; + int m_neededBuffers; ++ int m_vsyncCount; + + CRect m_src_rect; + CRect m_dst_rect; +@@ -129,4 +130,5 @@ protected: + bool init_vout(ERenderFormat format); + void ReleaseBuffers(); + void UnInitMMAL(); ++ void SubmitFrame(MMAL_BUFFER_HEADER_T *buffer); + }; +-- +2.5.0 + + +From c29b3010d9bd0bbd845bebacea0af8855f0eca71 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 23 Mar 2016 16:57:19 +0000 +Subject: [PATCH 92/94] mmal: Include mmal renderer logging in video category + +On Pi the decoder and renderer are closely coupled so combining the +logging category makes sense to me. +--- + xbmc/cores/VideoRenderers/MMALRenderer.cpp | 109 +++++++++++------------------ + 1 file changed, 42 insertions(+), 67 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +index a2e0df2..a4db9af 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +@@ -37,10 +37,6 @@ + + #define CLASSNAME "CMMALRenderer" + +-#ifdef _DEBUG +-#define MMAL_DEBUG_VERBOSE +-#endif +- + + CYUVVideoBuffer::CYUVVideoBuffer() + { +@@ -57,9 +53,8 @@ CYUVVideoBuffer::~CYUVVideoBuffer() + CYUVVideoBuffer *CYUVVideoBuffer::Acquire() + { + long count = AtomicIncrement(&m_refs); +-#ifdef MMAL_DEBUG_VERBOSE +- CLog::Log(LOGDEBUG, "%s::%s omvb:%p mmal:%p ref:%ld", CLASSNAME, __func__, this, mmal_buffer, count); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s omvb:%p mmal:%p ref:%ld", CLASSNAME, __func__, this, mmal_buffer, count); + (void)count; + return this; + } +@@ -67,9 +62,8 @@ CYUVVideoBuffer *CYUVVideoBuffer::Acquire() + long CYUVVideoBuffer::Release() + { + long count = AtomicDecrement(&m_refs); +-#ifdef MMAL_DEBUG_VERBOSE +- CLog::Log(LOGDEBUG, "%s::%s omvb:%p mmal:%p ref:%ld", CLASSNAME, __func__, this, mmal_buffer, count); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s omvb:%p mmal:%p ref:%ld", CLASSNAME, __func__, this, mmal_buffer, count); + if (count == 0) + { + mmal_buffer_header_release(mmal_buffer); +@@ -89,9 +83,8 @@ CRenderInfo CMMALRenderer::GetRenderInfo() + if (!m_bMMALConfigured) + m_bMMALConfigured = init_vout(RENDER_FMT_MMAL); + +- #if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s cookie:%p", CLASSNAME, __func__, (void *)m_vout_input_pool); +- #endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s cookie:%p", CLASSNAME, __func__, (void *)m_vout_input_pool); + + info.max_buffer_size = NUM_BUFFERS; + info.optimal_buffer_size = NUM_BUFFERS; +@@ -113,18 +106,16 @@ void CMMALRenderer::vout_input_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T * + { + CMMALVideoBuffer *omvb = (CMMALVideoBuffer *)buffer->user_data; + assert(buffer == omvb->mmal_buffer); +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s port:%p omvb:%p mmal:%p len:%d cmd:%x flags:%x flight:%d", CLASSNAME, __func__, port, omvb, omvb->mmal_buffer, buffer->length, buffer->cmd, buffer->flags, m_inflight); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s port:%p omvb:%p mmal:%p len:%d cmd:%x flags:%x flight:%d", CLASSNAME, __func__, port, omvb, omvb->mmal_buffer, buffer->length, buffer->cmd, buffer->flags, m_inflight); + omvb->Release(); + } + else if (m_format == RENDER_FMT_YUV420P) + { + CYUVVideoBuffer *omvb = (CYUVVideoBuffer *)buffer->user_data; + assert(buffer == omvb->mmal_buffer); +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s port:%p omvb:%p mmal:%p len:%d cmd:%x flags:%x flight:%d", CLASSNAME, __func__, port, omvb, omvb->mmal_buffer, buffer->length, buffer->cmd, buffer->flags, m_inflight); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s port:%p omvb:%p mmal:%p len:%d cmd:%x flags:%x flight:%d", CLASSNAME, __func__, port, omvb, omvb->mmal_buffer, buffer->length, buffer->cmd, buffer->flags, m_inflight); + m_inflight--; + omvb->Release(); + } +@@ -266,9 +257,8 @@ CMMALRenderer::~CMMALRenderer() + + void CMMALRenderer::AddProcessor(CMMALVideoBuffer *buffer, int index) + { +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - %p (%p) %i", CLASSNAME, __func__, buffer, buffer->mmal_buffer, index); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - %p (%p) %i", CLASSNAME, __func__, buffer, buffer->mmal_buffer, index); + + YUVBUFFER &buf = m_buffers[index]; + assert(!buf.MMALBuffer); +@@ -320,17 +310,15 @@ int CMMALRenderer::GetImage(YV12Image *image, int source, bool readonly) + { + if (!image || source < 0) + { +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - invalid: image:%p source:%d ro:%d flight:%d", CLASSNAME, __func__, image, source, readonly, m_inflight); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - invalid: image:%p source:%d ro:%d flight:%d", CLASSNAME, __func__, image, source, readonly, m_inflight); + return -1; + } + + if (m_format == RENDER_FMT_MMAL) + { +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - MMAL: image:%p source:%d ro:%d flight:%d", CLASSNAME, __func__, image, source, readonly, m_inflight); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - MMAL: image:%p source:%d ro:%d flight:%d", CLASSNAME, __func__, image, source, readonly, m_inflight); + } + else if (m_format == RENDER_FMT_YUV420P) + { +@@ -373,9 +361,8 @@ int CMMALRenderer::GetImage(YV12Image *image, int source, bool readonly) + if (!buf.YUVBuffer) + return -1; + buf.YUVBuffer->mmal_buffer = buffer; +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - YUV: image:%p source:%d ro:%d omvb:%p mmal:%p flight:%d", CLASSNAME, __func__, image, source, readonly, buf.YUVBuffer, buffer, m_inflight); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - YUV: image:%p source:%d ro:%d omvb:%p mmal:%p flight:%d", CLASSNAME, __func__, image, source, readonly, buf.YUVBuffer, buffer, m_inflight); + buf.YUVBuffer->Acquire(); + } + else assert(0); +@@ -388,16 +375,14 @@ void CMMALRenderer::ReleaseBuffer(int idx) + CSingleLock lock(m_sharedSection); + if (!m_bMMALConfigured) + { +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - not configured: source:%d", CLASSNAME, __func__, idx); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - not configured: source:%d", CLASSNAME, __func__, idx); + return; + } + if (m_format == RENDER_FMT_BYPASS) + { +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - bypass: source:%d", CLASSNAME, __func__, idx); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - bypass: source:%d", CLASSNAME, __func__, idx); + return; + } + +@@ -405,17 +390,15 @@ void CMMALRenderer::ReleaseBuffer(int idx) + if (m_format == RENDER_FMT_MMAL) + { + CMMALVideoBuffer *omvb = buffer->MMALBuffer; +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - MMAL: source:%d omvb:%p mmal:%p", CLASSNAME, __func__, idx, omvb, omvb ? omvb->mmal_buffer:NULL); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - MMAL: source:%d omvb:%p mmal:%p", CLASSNAME, __func__, idx, omvb, omvb ? omvb->mmal_buffer:NULL); + SAFE_RELEASE(buffer->MMALBuffer); + } + else if (m_format == RENDER_FMT_YUV420P) + { + CYUVVideoBuffer *omvb = buffer->YUVBuffer; +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - YUV: source:%d omvb:%p mmal:%p flight:%d", CLASSNAME, __func__, idx, omvb, omvb ? omvb->mmal_buffer:NULL, m_inflight); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - YUV: source:%d omvb:%p mmal:%p flight:%d", CLASSNAME, __func__, idx, omvb, omvb ? omvb->mmal_buffer:NULL, m_inflight); + if (omvb && omvb->mmal_buffer) + SAFE_RELEASE(buffer->YUVBuffer); + } +@@ -439,9 +422,8 @@ void CMMALRenderer::Flush() + + void CMMALRenderer::Update() + { +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); + if (!m_bConfigured) return; + ManageDisplay(); + } +@@ -479,9 +461,8 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + + if (!m_bConfigured) + { +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - not configured: clear:%d flags:%x alpha:%d source:%d", CLASSNAME, __func__, clear, flags, alpha, source); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - not configured: clear:%d flags:%x alpha:%d source:%d", CLASSNAME, __func__, clear, flags, alpha, source); + return; + } + +@@ -503,9 +484,8 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + + if (m_format == RENDER_FMT_BYPASS) + { +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - bypass: clear:%d flags:%x alpha:%d source:%d", CLASSNAME, __func__, clear, flags, alpha, source); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - bypass: clear:%d flags:%x alpha:%d source:%d", CLASSNAME, __func__, clear, flags, alpha, source); + return; + } + SetVideoRect(m_sourceRect, m_destRect); +@@ -516,9 +496,8 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + CMMALVideoBuffer *omvb = buffer->MMALBuffer; + if (omvb && omvb->mmal_buffer) + { +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - MMAL: clear:%d flags:%x alpha:%d source:%d omvb:%p mmal:%p mflags:%x", CLASSNAME, __func__, clear, flags, alpha, source, omvb, omvb->mmal_buffer, omvb->mmal_buffer->flags); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - MMAL: clear:%d flags:%x alpha:%d source:%d omvb:%p mmal:%p mflags:%x", CLASSNAME, __func__, clear, flags, alpha, source, omvb, omvb->mmal_buffer, omvb->mmal_buffer->flags); + // we only want to upload frames once + if (omvb->mmal_buffer->flags & MMAL_BUFFER_HEADER_FLAG_USER1) + return; +@@ -535,9 +514,8 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + CYUVVideoBuffer *omvb = buffer->YUVBuffer; + if (omvb && omvb->mmal_buffer) + { +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - YUV: clear:%d flags:%x alpha:%d source:%d omvb:%p mmal:%p mflags:%x", CLASSNAME, __func__, clear, flags, alpha, source, omvb, omvb->mmal_buffer, omvb->mmal_buffer->flags); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - YUV: clear:%d flags:%x alpha:%d source:%d omvb:%p mmal:%p mflags:%x", CLASSNAME, __func__, clear, flags, alpha, source, omvb, omvb->mmal_buffer, omvb->mmal_buffer->flags); + // we only want to upload frames once + if (omvb->mmal_buffer->flags & MMAL_BUFFER_HEADER_FLAG_USER1) + return; +@@ -559,15 +537,13 @@ void CMMALRenderer::FlipPage(int source) + CSingleLock lock(m_sharedSection); + if (!m_bConfigured || m_format == RENDER_FMT_BYPASS) + { +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - not configured: source:%d", CLASSNAME, __func__, source); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - not configured: source:%d", CLASSNAME, __func__, source); + return; + } + +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - source:%d", CLASSNAME, __func__, source); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s - source:%d", CLASSNAME, __func__, source); + + m_iYV12RenderBuffer = source; + } +@@ -600,9 +576,8 @@ unsigned int CMMALRenderer::PreInit() + + void CMMALRenderer::ReleaseBuffers() + { +-#if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); +-#endif ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); + for (int i=0; i +Date: Wed, 23 Mar 2016 17:34:48 +0000 +Subject: [PATCH 93/94] rendermanager: Increase configure timeout to see if it + fixes video playing in background issues + +--- + xbmc/cores/VideoRenderers/RenderManager.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp +index 7a99ac4..4b03c86 100644 +--- a/xbmc/cores/VideoRenderers/RenderManager.cpp ++++ b/xbmc/cores/VideoRenderers/RenderManager.cpp +@@ -244,7 +244,7 @@ bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsi + CSingleLock lock2(m_presentlock); + + /* make sure any queued frame was fully presented */ +- XbmcThreads::EndTime endtime(5000); ++ XbmcThreads::EndTime endtime(10000); + while(m_presentstep != PRESENT_IDLE && m_presentstep != PRESENT_READY) + { + if(endtime.IsTimePast()) +-- +2.5.0 + + +From 6d406c27db47e8ac260f436a2a09187bb495a6ba Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 23 Mar 2016 17:39:47 +0000 +Subject: [PATCH 94/94] Revert "[rbp] Use default resampling setting on Pi2" + +This reverts commit e6b2f1693480ad5d8062acaed512393e72fb9b1d. +--- + system/settings/rbp2.xml | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/system/settings/rbp2.xml b/system/settings/rbp2.xml +index 52778ec..8cc8f19 100644 +--- a/system/settings/rbp2.xml ++++ b/system/settings/rbp2.xml +@@ -23,11 +23,6 @@ + + + +- +- +- 30 +- +- + + + +-- +2.5.0 +