From def092089d51746cba12119d433ee1a8e38c5f33 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Sat, 10 Aug 2019 09:54:48 +0200 Subject: [PATCH 1/5] [guiinfo] Fix black screen for videos in slide shows on systems that do not render video to a video layer. --- xbmc/guilib/guiinfo/PicturesGUIInfo.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/xbmc/guilib/guiinfo/PicturesGUIInfo.cpp b/xbmc/guilib/guiinfo/PicturesGUIInfo.cpp index 33765d8bab386..da1c8e265298f 100644 --- a/xbmc/guilib/guiinfo/PicturesGUIInfo.cpp +++ b/xbmc/guilib/guiinfo/PicturesGUIInfo.cpp @@ -93,15 +93,20 @@ CPicturesGUIInfo::~CPicturesGUIInfo() void CPicturesGUIInfo::SetCurrentSlide(CFileItem *item) { + if (m_currentSlide && item && m_currentSlide->GetPath() == item->GetPath()) + return; + if (item) { - CPictureInfoTag* tag = item->GetPictureInfoTag(); // creates item if not yet set, so no nullptr checks needed - if (!tag->Loaded()) // If picture metadata has not been loaded yet, load it now - tag->Load(item->GetPath()); - + if (item->HasPictureInfoTag()) // Note: item may also be a video + { + CPictureInfoTag* tag = item->GetPictureInfoTag(); + if (!tag->Loaded()) // If picture metadata has not been loaded yet, load it now + tag->Load(item->GetPath()); + } m_currentSlide.reset(new CFileItem(*item)); } - else + else if (m_currentSlide) { m_currentSlide.reset(); } From 00053126a5183ad7ebf6642a39e671f2344ec2c9 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Sat, 10 Aug 2019 23:12:41 +0200 Subject: [PATCH 2/5] [pictures] Fix previous video playing in the background while displaying next picture in mixed picture/video slide shows when skipping to next picture manually while a video is playing. --- xbmc/pictures/GUIWindowSlideShow.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/xbmc/pictures/GUIWindowSlideShow.cpp b/xbmc/pictures/GUIWindowSlideShow.cpp index ef8a4eaf1c658..3a6028ff9cd59 100644 --- a/xbmc/pictures/GUIWindowSlideShow.cpp +++ b/xbmc/pictures/GUIWindowSlideShow.cpp @@ -509,13 +509,9 @@ void CGUIWindowSlideShow::Process(unsigned int currentTime, CDirtyRegionList &re } } - if (m_slides.at(m_iCurrentSlide)->IsVideo() && - m_iVideoSlide != m_iCurrentSlide) - { - if (!PlayVideo()) - return; + bool bPlayVideo = m_slides.at(m_iCurrentSlide)->IsVideo() && m_iVideoSlide != m_iCurrentSlide; + if (bPlayVideo) bSlideShow = false; - } // render the current image if (m_Image[m_iCurrentPic].IsLoaded()) @@ -603,6 +599,8 @@ void CGUIWindowSlideShow::Process(unsigned int currentTime, CDirtyRegionList &re } m_iCurrentSlide = m_iNextSlide; m_iNextSlide = GetNextSlide(); + + bPlayVideo = m_slides.at(m_iCurrentSlide)->IsVideo() && m_iVideoSlide != m_iCurrentSlide; } AnnouncePlayerPlay(m_slides.at(m_iCurrentSlide)); @@ -611,6 +609,9 @@ void CGUIWindowSlideShow::Process(unsigned int currentTime, CDirtyRegionList &re m_fRotate = 0.0f; } + if (bPlayVideo && !PlayVideo()) + return; + if (m_Image[m_iCurrentPic].IsLoaded()) CServiceBroker::GetGUI()->GetInfoManager().GetInfoProviders().GetPicturesInfoProvider().SetCurrentSlide(m_slides.at(m_iCurrentSlide).get()); From b58708dbad81fd934fafbc1f8069cd835025a3e9 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Sun, 11 Aug 2019 15:20:54 +0200 Subject: [PATCH 3/5] [guiinfo] CPicturesGUIInfo: Fix LISTITEM_PICTURE_PATH. --- xbmc/guilib/guiinfo/PicturesGUIInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/guilib/guiinfo/PicturesGUIInfo.cpp b/xbmc/guilib/guiinfo/PicturesGUIInfo.cpp index da1c8e265298f..b13cfb4954c61 100644 --- a/xbmc/guilib/guiinfo/PicturesGUIInfo.cpp +++ b/xbmc/guilib/guiinfo/PicturesGUIInfo.cpp @@ -207,7 +207,7 @@ bool CPicturesGUIInfo::GetLabel(std::string& value, const CFileItem *item, int c { case LISTITEM_PICTURE_PATH: { - if (!item->IsZIP() || item->IsRAR() || item->IsCBZ() || item->IsCBR()) + if (!(item->IsZIP() || item->IsRAR() || item->IsCBZ() || item->IsCBR())) { value = item->GetPath(); return true; From 4c90040943d9f38610a05bd920e49fbd4fbd6a75 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Sun, 11 Aug 2019 17:28:12 +0200 Subject: [PATCH 4/5] [pictures] Fix black screen for videos in slide shows on systems that do render video to a video layer. --- xbmc/pictures/GUIWindowSlideShow.cpp | 34 ++++++++++++++++++++++++---- xbmc/pictures/GUIWindowSlideShow.h | 1 + 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/xbmc/pictures/GUIWindowSlideShow.cpp b/xbmc/pictures/GUIWindowSlideShow.cpp index 3a6028ff9cd59..bbb4906ae862e 100644 --- a/xbmc/pictures/GUIWindowSlideShow.cpp +++ b/xbmc/pictures/GUIWindowSlideShow.cpp @@ -630,14 +630,30 @@ void CGUIWindowSlideShow::Render() if (m_slides.empty()) return; - CServiceBroker::GetWinSystem()->GetGfxContext().Clear(0xff000000); + CGraphicContext& gfxCtx = CServiceBroker::GetWinSystem()->GetGfxContext(); + gfxCtx.Clear(0xff000000); if (m_slides.at(m_iCurrentSlide)->IsVideo()) { - CServiceBroker::GetWinSystem()->GetGfxContext().SetViewWindow(0, 0, m_coordsRes.iWidth, m_coordsRes.iHeight); - CServiceBroker::GetWinSystem()->GetGfxContext().SetRenderingResolution(CServiceBroker::GetWinSystem()->GetGfxContext().GetVideoResolution(), false); - g_application.GetAppPlayer().Render(true, 255); - CServiceBroker::GetWinSystem()->GetGfxContext().SetRenderingResolution(m_coordsRes, m_needsScaling); + gfxCtx.SetViewWindow(0, 0, m_coordsRes.iWidth, m_coordsRes.iHeight); + gfxCtx.SetRenderingResolution(gfxCtx.GetVideoResolution(), false); + + if (g_application.GetAppPlayer().IsRenderingVideoLayer()) + { + const CRect old = gfxCtx.GetScissors(); + CRect region = GetRenderRegion(); + region.Intersect(old); + gfxCtx.SetScissors(region); + gfxCtx.Clear(0); + gfxCtx.SetScissors(old); + } + else + { + const UTILS::Color alpha = gfxCtx.MergeAlpha(0xff000000) >> 24; + g_application.GetAppPlayer().Render(false, alpha); + } + + gfxCtx.SetRenderingResolution(m_coordsRes, m_needsScaling); } else { @@ -652,6 +668,14 @@ void CGUIWindowSlideShow::Render() CGUIWindow::Render(); } +void CGUIWindowSlideShow::RenderEx() +{ + if (m_slides.at(m_iCurrentSlide)->IsVideo()) + g_application.GetAppPlayer().Render(false, 255, false); + + CGUIWindow::RenderEx(); +} + int CGUIWindowSlideShow::GetNextSlide() { if (m_slides.size() <= 1) diff --git a/xbmc/pictures/GUIWindowSlideShow.h b/xbmc/pictures/GUIWindowSlideShow.h index ca68784841b42..7971db2210c8b 100644 --- a/xbmc/pictures/GUIWindowSlideShow.h +++ b/xbmc/pictures/GUIWindowSlideShow.h @@ -57,6 +57,7 @@ class CGUIWindowSlideShow : public CGUIDialog EVENT_RESULT OnMouseEvent(const CPoint &point, const CMouseEvent &event) override; bool OnAction(const CAction &action) override; void Render() override; + void RenderEx() override; void Process(unsigned int currentTime, CDirtyRegionList ®ions) override; void OnDeinitWindow(int nextWindowID) override; From 051e5126cff0e96ace2e16401d1cac6df2596ad0 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Sun, 11 Aug 2019 19:55:33 +0200 Subject: [PATCH 5/5] [Estuary] PictureInfoDialog: Fix picture title and and date when slideshow is active. --- addons/skin.estuary/xml/DialogPictureInfo.xml | 4 ++-- addons/skin.estuary/xml/Variables.xml | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/addons/skin.estuary/xml/DialogPictureInfo.xml b/addons/skin.estuary/xml/DialogPictureInfo.xml index 92c2fe040585e..2a6d20e2d07aa 100644 --- a/addons/skin.estuary/xml/DialogPictureInfo.xml +++ b/addons/skin.estuary/xml/DialogPictureInfo.xml @@ -119,8 +119,8 @@ - - + + TouchBackButton diff --git a/addons/skin.estuary/xml/Variables.xml b/addons/skin.estuary/xml/Variables.xml index 2755604acf05b..94a340cfa6176 100644 --- a/addons/skin.estuary/xml/Variables.xml +++ b/addons/skin.estuary/xml/Variables.xml @@ -273,6 +273,14 @@ $INFO[ListItem.LastPlayed,$LOCALIZE[568]: ] $INFO[ListItem.FileNameAndPath] + + $INFO[SlideShow.Filename] + $INFO[ListItem.Label] + + + $INFO[SlideShow.EXIFtime] + $INFO[ListItem.PictureDateTime] + $INFO[VideoPlayer.Title] $INFO[VideoPlayer.Season,[COLOR button_focus]S,[/COLOR]]$INFO[VideoPlayer.Episode,[COLOR button_focus]E,: [/COLOR]]$INFO[VideoPlayer.Title]