From 3092dbcc6a691adbc40e62a2e8ddfffdb0de5471 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Thu, 22 May 2014 14:54:22 +0200 Subject: [PATCH] xbmc-master: update to xbmc-master-14-0bf4fd0, update RPi support patch, update FM patch Signed-off-by: Stephan Raue --- .../xbmc-master-theme-Confluence/package.mk | 2 +- packages/mediacenter/xbmc-master/package.mk | 2 +- .../xbmc-master-995.01-fernetmenta.patch | 572 ++- .../xbmc-master/xbmc-master-newclock3.patch | 3667 ++++++----------- 4 files changed, 1534 insertions(+), 2709 deletions(-) diff --git a/packages/mediacenter/xbmc-master-theme-Confluence/package.mk b/packages/mediacenter/xbmc-master-theme-Confluence/package.mk index 5c581eccb3..c84362db87 100644 --- a/packages/mediacenter/xbmc-master-theme-Confluence/package.mk +++ b/packages/mediacenter/xbmc-master-theme-Confluence/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="xbmc-master-theme-Confluence" -PKG_VERSION="14-354a362" +PKG_VERSION="14-0bf4fd0" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/xbmc-master/package.mk b/packages/mediacenter/xbmc-master/package.mk index e9c22f2b70..e427449528 100644 --- a/packages/mediacenter/xbmc-master/package.mk +++ b/packages/mediacenter/xbmc-master/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="xbmc-master" -PKG_VERSION="14-354a362" +PKG_VERSION="14-0bf4fd0" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/xbmc-master/patches/xbmc-master-995.01-fernetmenta.patch b/packages/mediacenter/xbmc-master/patches/xbmc-master-995.01-fernetmenta.patch index 3268595eb8..ea2920908f 100644 --- a/packages/mediacenter/xbmc-master/patches/xbmc-master-995.01-fernetmenta.patch +++ b/packages/mediacenter/xbmc-master/patches/xbmc-master-995.01-fernetmenta.patch @@ -1,18 +1,18 @@ -From 9ab9c627f63078aa198c86dc29411f36ce7f8ff1 Mon Sep 17 00:00:00 2001 +From daa708d34f474b893c548bc410001bc858683a33 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:34:39 +0200 -Subject: [PATCH 01/30] videoplayer: adapt lateness detection and dropping to +Subject: [PATCH 01/25] videoplayer: adapt lateness detection and dropping to buffering --- xbmc/cores/VideoRenderers/RenderManager.cpp | 16 +- xbmc/cores/VideoRenderers/RenderManager.h | 12 +- - .../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 15 +- - .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 31 ++++ + .../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 38 +++- + .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 41 +++++ .../DVDCodecs/Video/DVDVideoCodecFFmpeg.h | 7 + - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 194 +++++++++++++++++---- + xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 197 +++++++++++++++++---- xbmc/cores/dvdplayer/DVDPlayerVideo.h | 23 +++ - 7 files changed, 260 insertions(+), 38 deletions(-) + 7 files changed, 296 insertions(+), 38 deletions(-) diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp index 6832721..f4b381e 100644 @@ -114,31 +114,30 @@ index c469795..949c652b 100644 double m_presenterr; double m_errorbuff[ERRORBUFFSIZE]; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -index 1553789..7761f7fa 100644 +index 741017d..c5b24d6 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -@@ -134,6 +134,10 @@ struct DVDVideoUserData +@@ -136,6 +136,10 @@ struct DVDVideoUserData #define DVP_FLAG_NOSKIP 0x00000010 // indicate this picture should never be dropped #define DVP_FLAG_DROPPED 0x00000020 // indicate that this picture has been dropped in decoder stage, will have no data +#define DVP_FLAG_DROPDEINT 0x00000040 // indicate that this picture was requested to have been dropped in deint stage -+#define DVP_FLAG_NO_POSTPROC 0x00000100 -+#define DVP_FLAG_DRAIN 0x00000200 ++#define DVP_FLAG_NO_POSTPROC 0x00000100 // see GetCodecStats ++#define DVP_FLAG_DRAIN 0x00000200 // see GetCodecStats + // DVP_FLAG 0x00000100 - 0x00000f00 is in use by libmpeg2! #define DVP_QSCALE_UNKNOWN 0 -@@ -151,6 +155,9 @@ class CDVDCodecOptions; +@@ -153,6 +157,8 @@ class CDVDCodecOptions; #define VC_PICTURE 0x00000004 // the decoder got a picture, call Decode(NULL, 0) again to parse the rest of the data #define VC_USERDATA 0x00000008 // the decoder found some userdata, call Decode(NULL, 0) again to parse the rest of the data #define VC_FLUSHED 0x00000010 // the decoder lost it's state, we need to restart decoding again +#define VC_DROPPED 0x00000020 // needed to identify if a picture was dropped -+#define VC_HURRY 0x00000040 + class CDVDVideoCodec { public: -@@ -268,7 +275,6 @@ class CDVDVideoCodec +@@ -270,7 +276,6 @@ class CDVDVideoCodec return 0; } @@ -146,20 +145,44 @@ index 1553789..7761f7fa 100644 /** * Number of references to old pictures that are allowed to * be retained when calling decode on the next demux packet -@@ -285,4 +291,11 @@ class CDVDVideoCodec +@@ -287,4 +292,35 @@ class CDVDVideoCodec * Interact with user settings so that user disabled codecs are disabled */ static bool IsCodecDisabled(DVDCodecAvailableType* map, unsigned int size, AVCodecID id); + -+ virtual bool GetPts(double &pts, int &skippedDeint, int &interlaced) ++ /* For calculation of dropping requirements player asks for some information. ++ * ++ * - pts : right after decoder, used to detect gaps (dropped frames in decoder) ++ * - droppedPics : indicates if decoder has dropped a picture ++ * -1 means that decoder has no info on this. ++ * ++ * If codec does not implement this method, pts of decoded frame at input ++ * video player is used. In case decoder does post-proc and de-interlacing there ++ * may be quite some frames queued up between exit decoder and entry player. ++ */ ++ virtual bool GetCodecStats(double &pts, int &droppedPics) + { ++ droppedPics= -1; + return false; + } + ++ /** ++ * Codec can be informed by player with the following flags: ++ * ++ * DVP_FLAG_NO_POSTPROC : if speed is not normal the codec can switch off ++ * postprocessing and de-interlacing ++ * ++ * DVP_FLAG_DRAIN : codecs may do postprocessing and de-interlacing. ++ * If video buffers in RenderManager are about to run dry, ++ * this is signaled to codec. Codec can wait for post-proc ++ * to be finished instead of returning empty and getting another ++ * packet. ++ * ++ */ + virtual void SetCodecControl(int flags) {} }; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index b6c1e04..275a0a1 100644 +index b6c1e04..c48108f 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -167,6 +167,7 @@ CDVDVideoCodecFFmpeg::CDVDVideoCodecFFmpeg() : CDVDVideoCodec() @@ -216,17 +239,27 @@ index b6c1e04..275a0a1 100644 if(!m_started) pDvdVideoPicture->iFlags |= DVP_FLAG_DROPPED; -@@ -821,3 +847,8 @@ unsigned CDVDVideoCodecFFmpeg::GetAllowedReferences() +@@ -821,3 +847,18 @@ unsigned CDVDVideoCodecFFmpeg::GetAllowedReferences() else return 0; } + ++bool CDVDVideoCodecFFmpeg::GetCodecStats(double &pts, int &droppedPics) ++{ ++ pts = m_decoderPts; ++ if (m_skippedDeint) ++ droppedPics = m_skippedDeint; ++ else ++ droppedPics = -1; ++ return true; ++} ++ +void CDVDVideoCodecFFmpeg::SetCodecControl(int flags) +{ + m_codecControlFlags = flags; +} diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h -index 75ac0f2..51e4c80 100644 +index 75ac0f2..1a80a48 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h @@ -50,6 +50,7 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec @@ -241,7 +274,7 @@ index 75ac0f2..51e4c80 100644 virtual const char* GetName() { return m_name.c_str(); }; // m_name is never changed after open virtual unsigned GetConvergeCount(); virtual unsigned GetAllowedReferences(); -+ virtual bool GetPts(double &pts, int &skippedDeint, int &interlaced) {pts=m_decoderPts; skippedDeint=m_skippedDeint; if (m_pFrame) interlaced = m_pFrame->interlaced_frame; return true;} ++ virtual bool GetCodecStats(double &pts, int &droppedPics); + virtual void SetCodecControl(int flags); bool IsHardwareAllowed() { return !m_bSoftware; } @@ -256,7 +289,7 @@ index 75ac0f2..51e4c80 100644 + int m_codecControlFlags; }; diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 99b3155..4fad1a3 100644 +index 99b3155..e8c587f 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -38,6 +38,7 @@ @@ -294,18 +327,15 @@ index 99b3155..4fad1a3 100644 m_stalled = true; m_started = false; -@@ -460,8 +465,10 @@ void CDVDPlayerVideo::Process() - m_speed = static_cast(pMsg)->m_value; - if(m_speed == DVD_PLAYSPEED_PAUSE) +@@ -462,6 +467,7 @@ void CDVDPlayerVideo::Process() m_iNrOfPicturesNotToSkip = 0; -+ if (m_pVideoCodec) m_pVideoCodec->SetSpeed(m_speed); + m_droppingStats.Reset(); } else if (pMsg->IsType(CDVDMsg::PLAYER_STARTED)) { -@@ -507,6 +514,28 @@ void CDVDPlayerVideo::Process() +@@ -507,6 +513,28 @@ void CDVDPlayerVideo::Process() m_iNrOfPicturesNotToSkip = 1; } @@ -334,7 +364,7 @@ index 99b3155..4fad1a3 100644 if (m_messageQueue.GetDataSize() == 0 || m_speed < 0) { -@@ -559,15 +588,7 @@ void CDVDPlayerVideo::Process() +@@ -559,15 +587,7 @@ void CDVDPlayerVideo::Process() } m_videoStats.AddSampleBytes(pPacket->iSize); @@ -351,7 +381,7 @@ index 99b3155..4fad1a3 100644 // reset the request, the following while loop may break before // setting the flag to a new value bRequestDrop = false; -@@ -1176,33 +1197,12 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) +@@ -1176,33 +1196,12 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) m_FlipTimeStamp += max(0.0, iSleepTime); m_FlipTimeStamp += iFrameDuration; @@ -389,7 +419,7 @@ index 99b3155..4fad1a3 100644 // set fieldsync if picture is interlaced EFIELDSYNC mDisplayField = FS_NONE; -@@ -1235,7 +1235,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) +@@ -1235,7 +1234,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) if (index < 0) return EOS_DROPPED; @@ -398,7 +428,7 @@ index 99b3155..4fad1a3 100644 return result; #else -@@ -1535,3 +1535,127 @@ void CDVDPlayerVideo::CalcFrameRate() +@@ -1535,3 +1534,131 @@ void CDVDPlayerVideo::CalcFrameRate() m_iFrameRateCount = 0; } } @@ -409,15 +439,14 @@ index 99b3155..4fad1a3 100644 + double iSleepTime; + double iDecoderPts, iRenderPts; + double iInterval; -+ int interlaced; + double iGain; + double iLateness; + bool bNewFrame; -+ int iSkippedDeint = 0; ++ int iDroppedPics = -1; + int iBufferLevel; + + // get decoder stats -+ if (!m_pVideoCodec->GetPts(iDecoderPts, iSkippedDeint, interlaced)) ++ if (!m_pVideoCodec->GetCodecStats(iDecoderPts, iDroppedPics)) + iDecoderPts = pts; + if (iDecoderPts == DVD_NOPTS_VALUE) + iDecoderPts = pts; @@ -435,29 +464,32 @@ index 99b3155..4fad1a3 100644 + + bNewFrame = iDecoderPts != m_droppingStats.m_lastDecoderPts; + -+ if (interlaced) -+ iInterval = 2/m_fFrameRate*(double)DVD_TIME_BASE; ++ iInterval = 1/m_fFrameRate*(double)DVD_TIME_BASE; ++ ++ m_FlipTimeStamp = m_pClock->GetAbsoluteClock() + max(0.0, iSleepTime) + iInterval; ++ ++ if (m_stalled) ++ m_iCurrentPts = DVD_NOPTS_VALUE; + else -+ iInterval = 1/m_fFrameRate*(double)DVD_TIME_BASE; ++ m_iCurrentPts = iRenderPts - max(0.0, iSleepTime); + + if (m_droppingStats.m_lastDecoderPts > 0 + && bNewFrame -+ && m_bAllowDrop -+ && m_droppingStats.m_dropRequests > 0) ++ && m_bAllowDrop) + { + iGain = (iDecoderPts - m_droppingStats.m_lastDecoderPts - iInterval)/(double)DVD_TIME_BASE; -+ if (iSkippedDeint) ++ if (iDroppedPics > 0) + { + CDroppingStats::CGain gain; -+ gain.gain = 1/m_fFrameRate; ++ gain.gain = iDroppedPics * 1/m_fFrameRate; + gain.pts = iDecoderPts; + m_droppingStats.m_gain.push_back(gain); + m_droppingStats.m_totalGain += gain.gain; + result |= EOS_DROPPED; + m_droppingStats.m_dropRequests = 0; -+ CLog::Log(LOGDEBUG,"CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: %f, Bufferlevel: %d", iSleepTime, iBufferLevel); ++ CLog::Log(LOGDEBUG,"CDVDPlayerVideo::CalcDropRequirement - dropped pictures, Sleeptime: %f, Bufferlevel: %d, Gain: %f", iSleepTime, iBufferLevel, iGain); + } -+ else if (iGain > 1/m_fFrameRate) ++ else if (iDroppedPics < 0 && iGain > 1/m_fFrameRate) + { + CDroppingStats::CGain gain; + gain.gain = iGain; @@ -493,9 +525,11 @@ index 99b3155..4fad1a3 100644 + // is frame allowed to skip + if (m_iNrOfPicturesNotToSkip <= 0) + { -+ result |= EOS_VERYLATE; -+ if (bNewFrame) -+ m_droppingStats.m_dropRequests++; ++ if (bNewFrame || m_droppingStats.m_dropRequests < 5) ++ { ++ result |= EOS_VERYLATE; ++ } ++ m_droppingStats.m_dropRequests++; + } + } + } @@ -581,25 +615,25 @@ index f8ad541..186e271 100644 }; -- -1.9.1 +1.9.3 -From 8a6227c0661401600c276a73e3ad5dc4c08fea89 Mon Sep 17 00:00:00 2001 +From b66b34da3d5c0744bea11e3aaffafa4346f8ca83 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 2 Sep 2012 16:05:21 +0200 -Subject: [PATCH 02/30] video player: present correct pts to user for a/v sync +Subject: [PATCH 02/25] video player: present correct pts to user for a/v sync (after buffering in renderer) --- - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 25 +++++++++++++++++++++++++ + xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 16 ++++++++++++++++ xbmc/cores/dvdplayer/DVDPlayerVideo.h | 2 +- - 2 files changed, 26 insertions(+), 1 deletion(-) + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 4fad1a3..1d29b6f 100644 +index e8c587f..e7781dc 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1455,6 +1455,22 @@ void CDVDPlayerVideo::ResetFrameRateCalc() +@@ -1454,6 +1454,22 @@ void CDVDPlayerVideo::ResetFrameRateCalc() g_advancedSettings.m_videoFpsDetect == 0; } @@ -622,22 +656,6 @@ index 4fad1a3..1d29b6f 100644 #define MAXFRAMERATEDIFF 0.01 #define MAXFRAMESERR 1000 -@@ -1573,6 +1589,15 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts) - else - iInterval = 1/m_fFrameRate*(double)DVD_TIME_BASE; - -+ -+ m_FlipTimeStamp = m_pClock->GetAbsoluteClock() + max(0.0, iSleepTime) + iInterval; -+ -+ if( m_stalled ) -+ m_iCurrentPts = DVD_NOPTS_VALUE; -+ else -+ m_iCurrentPts = iRenderPts - max(0.0, iSleepTime); -+ -+ - if (m_droppingStats.m_lastDecoderPts > 0 - && bNewFrame - && m_bAllowDrop diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.h b/xbmc/cores/dvdplayer/DVDPlayerVideo.h index 186e271..59c7f09 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.h @@ -652,133 +670,20 @@ index 186e271..59c7f09 100644 double GetOutputDelay(); /* returns the expected delay, from that a packet is put in queue */ -- -1.9.1 +1.9.3 -From 056680ce851e00ffe2f9ceffe6775ad7d59872b5 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sat, 16 Feb 2013 18:25:53 +0100 -Subject: [PATCH 03/30] videoplayer: some rework and documentation - ---- - .../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 28 ++++++++++++++++++++-- - .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 11 +++++++++ - .../DVDCodecs/Video/DVDVideoCodecFFmpeg.h | 2 +- - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 2 +- - 4 files changed, 39 insertions(+), 4 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -index 7761f7fa..2fbc656 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -@@ -156,7 +156,6 @@ class CDVDCodecOptions; - #define VC_USERDATA 0x00000008 // the decoder found some userdata, call Decode(NULL, 0) again to parse the rest of the data - #define VC_FLUSHED 0x00000010 // the decoder lost it's state, we need to restart decoding again - #define VC_DROPPED 0x00000020 // needed to identify if a picture was dropped --#define VC_HURRY 0x00000040 - - class CDVDVideoCodec - { -@@ -292,10 +291,35 @@ class CDVDVideoCodec - */ - static bool IsCodecDisabled(DVDCodecAvailableType* map, unsigned int size, AVCodecID id); - -- virtual bool GetPts(double &pts, int &skippedDeint, int &interlaced) -+ /* For calculation of dropping requirements player asks for some information. -+ * -+ * - pts : right after decoder, used to detect gaps (dropped frames in decoder) -+ * - skippedDeint : indicates if decoder has just skipped a deinterlacing cycle -+ * instead of dropping a full frame -+ * - interlaced : when detecting gaps in pts, player needs to know whether -+ * it's interlaced or not -+ * -+ * If codec does not implement this method, pts of decoded frame at input -+ * video player is used. In case coded does post-proc and de-interlacing there -+ * may be quite some frames queued up between exit decoder and entry player. -+ */ -+ virtual bool GetCodecStats(double &pts, int &skippedDeint, int &interlaced) - { - return false; - } - -+ /** -+ * Codec can be informed by player with the following flags: -+ * -+ * DVP_FLAG_NO_POSTPROC : if speed is not normal the codec can switch off -+ * postprocessing and de-interlacing -+ * -+ * DVP_FLAG_DRAIN : codecs may do postprocessing and de-interlacing. -+ * If video buffers in RenderManager are about to run dry, -+ * this is signaled to codec. Codec can wait for post-proc -+ * to be finished instead of returning empty and getting another -+ * packet. -+ * -+ */ - virtual void SetCodecControl(int flags) {} - }; -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index 275a0a1..6bbb84d 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -@@ -848,6 +848,17 @@ unsigned CDVDVideoCodecFFmpeg::GetAllowedReferences() - return 0; - } - -+bool CDVDVideoCodecFFmpeg::GetCodecStats(double &pts, int &skippedDeint, int &interlaced) -+{ -+ pts = m_decoderPts; -+ skippedDeint = m_skippedDeint; -+ if (m_pFrame) -+ interlaced = m_pFrame->interlaced_frame; -+ else -+ interlaced = 0; -+ return true; -+} -+ - void CDVDVideoCodecFFmpeg::SetCodecControl(int flags) - { - m_codecControlFlags = flags; -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h -index 51e4c80..fa3269c 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h -@@ -68,7 +68,7 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec - virtual const char* GetName() { return m_name.c_str(); }; // m_name is never changed after open - virtual unsigned GetConvergeCount(); - virtual unsigned GetAllowedReferences(); -- virtual bool GetPts(double &pts, int &skippedDeint, int &interlaced) {pts=m_decoderPts; skippedDeint=m_skippedDeint; if (m_pFrame) interlaced = m_pFrame->interlaced_frame; return true;} -+ virtual bool GetCodecStats(double &pts, int &skippedDeint, int &interlaced); - virtual void SetCodecControl(int flags); - - bool IsHardwareAllowed() { return !m_bSoftware; } -diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 1d29b6f..ee07f30 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1566,7 +1566,7 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts) - int iBufferLevel; - - // get decoder stats -- if (!m_pVideoCodec->GetPts(iDecoderPts, iSkippedDeint, interlaced)) -+ if (!m_pVideoCodec->GetCodecStats(iDecoderPts, iSkippedDeint, interlaced)) - iDecoderPts = pts; - if (iDecoderPts == DVD_NOPTS_VALUE) - iDecoderPts = pts; --- -1.9.1 - - -From ad8a1def3f5d317b00a7aed6d0857d5e525257dd Mon Sep 17 00:00:00 2001 +From 0014b029b1513d7d0d10c19d28662557ea15ecbb Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sat, 1 Jun 2013 11:21:19 +0200 -Subject: [PATCH 04/30] renderer: bump buffers to 5 +Subject: [PATCH 03/25] renderer: bump buffers to 5 --- xbmc/cores/VideoRenderers/BaseRenderer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.h b/xbmc/cores/VideoRenderers/BaseRenderer.h -index dc2712a..9edfbd4 100644 +index fb41ccf..f5e5677 100644 --- a/xbmc/cores/VideoRenderers/BaseRenderer.h +++ b/xbmc/cores/VideoRenderers/BaseRenderer.h @@ -29,7 +29,7 @@ @@ -791,13 +696,13 @@ index dc2712a..9edfbd4 100644 class CSetting; -- -1.9.1 +1.9.3 -From c785c3aa9634deee616f6048d9a31406178bc64f Mon Sep 17 00:00:00 2001 +From 380fb6663c28e31fcc2582d7bd2412b854f0deee Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:41:31 +0200 -Subject: [PATCH 05/30] videoplayer: update frametime, it might change due to +Subject: [PATCH 04/25] videoplayer: update frametime, it might change due to fps detection --- @@ -805,10 +710,10 @@ Subject: [PATCH 05/30] videoplayer: update frametime, it might change due to 1 file changed, 2 insertions(+) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index ee07f30..b3175cd 100644 +index e7781dc..24e34d4 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -708,6 +708,8 @@ void CDVDPlayerVideo::Process() +@@ -707,6 +707,8 @@ void CDVDPlayerVideo::Process() int iResult = OutputPicture(&picture, pts); @@ -818,13 +723,13 @@ index ee07f30..b3175cd 100644 { m_codecname = m_pVideoCodec->GetName(); -- -1.9.1 +1.9.3 -From 05e2699c87bf92ece23ffccefaa92a3ed0d23c90 Mon Sep 17 00:00:00 2001 +From 8a0a481b0c24822b1e59aeea83182f6f80206f9f Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:43:06 +0200 -Subject: [PATCH 06/30] videoplayer: give streams with invalid fps a chance for +Subject: [PATCH 05/25] videoplayer: give streams with invalid fps a chance for fps detection --- @@ -832,10 +737,10 @@ Subject: [PATCH 06/30] videoplayer: give streams with invalid fps a chance for 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index b3175cd..9c36bdb 100644 +index 24e34d4..e1911f5 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1497,7 +1497,7 @@ void CDVDPlayerVideo::CalcFrameRate() +@@ -1496,7 +1496,7 @@ void CDVDPlayerVideo::CalcFrameRate() double frameduration = m_pullupCorrection.GetFrameDuration(); if (frameduration == DVD_NOPTS_VALUE || @@ -845,13 +750,13 @@ index b3175cd..9c36bdb 100644 //reset the stored framerates if no good framerate was detected m_fStableFrameRate = 0.0; -- -1.9.1 +1.9.3 -From a91f302ef87ae3cf159b0115637bc9a714281994 Mon Sep 17 00:00:00 2001 +From 55ddff9f371b63a8adbe9aa0e0faf68638a94bfb Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:49:05 +0200 -Subject: [PATCH 07/30] dvdplayer: allow rewinding at end of stream, do a seek +Subject: [PATCH 06/25] dvdplayer: allow rewinding at end of stream, do a seek after rewind --- @@ -885,13 +790,13 @@ index 3f2e0df..097af37 100644 // audioplayer, stops outputing audio to audiorendere, but still tries to // sleep an correct amount for each packet -- -1.9.1 +1.9.3 -From 827fb89744264491d5ad5e00ca02390c34433fdc Mon Sep 17 00:00:00 2001 +From 199783edad6c1f95ee2d8029b6e8b19658ed474b Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 20 Aug 2012 16:06:39 +0200 -Subject: [PATCH 08/30] dvdplayer: observe pts counter overflow +Subject: [PATCH 07/25] dvdplayer: observe pts counter overflow --- .../cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 197 ++++++++++++++++++++- @@ -899,7 +804,7 @@ Subject: [PATCH 08/30] dvdplayer: observe pts counter overflow 2 files changed, 200 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index 411ff02..33a3ea1 100644 +index 710482f..49eff5c 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp @@ -18,7 +18,6 @@ @@ -1171,13 +1076,13 @@ index 44e101c..3b0f615 100644 }; -- -1.9.1 +1.9.3 -From 8d1d8ad97251676ab67f32f6141ab4b63399912d Mon Sep 17 00:00:00 2001 +From 5a36af71402f870b29bf408eb332d9a6edd28f14 Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 2 Oct 2012 13:02:10 +0200 -Subject: [PATCH 09/30] dvdplayer: avoid short screen flicker caused by +Subject: [PATCH 08/25] dvdplayer: avoid short screen flicker caused by unnecessary reconfigure of renderer --- @@ -1185,10 +1090,10 @@ Subject: [PATCH 09/30] dvdplayer: avoid short screen flicker caused by 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 9c36bdb..322a581 100644 +index e1911f5..71add2f 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1054,13 +1054,16 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) +@@ -1053,13 +1053,16 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) #ifdef HAS_VIDEO_PLAYBACK double config_framerate = m_bFpsInvalid ? 0.0 : m_fFrameRate; @@ -1207,13 +1112,13 @@ index 9c36bdb..322a581 100644 || ( m_output.extended_format != pPicture->extended_format ) || ( m_output.color_matrix != pPicture->color_matrix && pPicture->color_matrix != 0 ) // don't reconfigure on unspecified -- -1.9.1 +1.9.3 -From 7f13866c50c6966e4353bd3f50f94e76bfffccc3 Mon Sep 17 00:00:00 2001 +From 929e16dbbbfe8ffca980e4c67b5538c5bc4c2714 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 11 Oct 2012 12:05:50 +0200 -Subject: [PATCH 10/30] vdpau: advanced settings for auto deinterlacing +Subject: [PATCH 09/25] vdpau: advanced settings for auto deinterlacing --- xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 8 ++++---- @@ -1222,10 +1127,10 @@ Subject: [PATCH 10/30] vdpau: advanced settings for auto deinterlacing 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 719b70a..9c962ae 100644 +index e58681b..3f87a7d 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -1962,10 +1962,10 @@ EINTERLACEMETHOD CMixer::GetDeinterlacingMethod(bool log /* = false */) +@@ -1970,10 +1970,10 @@ EINTERLACEMETHOD CMixer::GetDeinterlacingMethod(bool log /* = false */) if (method == VS_INTERLACEMETHOD_AUTO) { int deint = -1; @@ -1241,10 +1146,10 @@ index 719b70a..9c962ae 100644 if (deint != -1) { diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index a13330f..0d5e546 100644 +index 342299c..5484918 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp -@@ -163,6 +163,8 @@ void CAdvancedSettings::Initialize() +@@ -157,6 +157,8 @@ void CAdvancedSettings::Initialize() m_videoAutoScaleMaxFps = 30.0f; m_videoDisableBackgroundDeinterlace = false; m_videoCaptureUseOcclusionQuery = -1; //-1 is auto detect @@ -1253,7 +1158,7 @@ index a13330f..0d5e546 100644 m_videoVDPAUtelecine = false; m_videoVDPAUdeintSkipChromaHD = false; m_DXVACheckCompatibility = false; -@@ -600,6 +602,8 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) +@@ -596,6 +598,8 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) XMLUtils::GetBoolean(pElement,"disableswmultithreading",m_videoDisableSWMultithreading); XMLUtils::GetBoolean(pElement, "disablebackgrounddeinterlace", m_videoDisableBackgroundDeinterlace); XMLUtils::GetInt(pElement, "useocclusionquery", m_videoCaptureUseOcclusionQuery, -1, 1); @@ -1263,10 +1168,10 @@ index a13330f..0d5e546 100644 XMLUtils::GetBoolean(pElement,"vdpauHDdeintSkipChroma",m_videoVDPAUdeintSkipChromaHD); diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h -index 3b417a6..7075f05 100644 +index c57a9fb..6c505a8 100644 --- a/xbmc/settings/AdvancedSettings.h +++ b/xbmc/settings/AdvancedSettings.h -@@ -160,6 +160,8 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler +@@ -163,6 +163,8 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler int m_videoPercentSeekBackwardBig; CStdString m_videoPPFFmpegDeint; CStdString m_videoPPFFmpegPostProc; @@ -1276,13 +1181,13 @@ index 3b417a6..7075f05 100644 bool m_videoVDPAUdeintSkipChromaHD; bool m_musicUseTimeSeeking; -- -1.9.1 +1.9.3 -From bc6f2e1d7ad1c10e936f64a09ca88c9b450dd672 Mon Sep 17 00:00:00 2001 +From 69722824d597a55fc378ecef601c900e4ff8e2ac Mon Sep 17 00:00:00 2001 From: xbmc Date: Fri, 2 Nov 2012 13:20:03 +0100 -Subject: [PATCH 11/30] player: fix rewind +Subject: [PATCH 10/25] player: fix rewind --- xbmc/cores/dvdplayer/DVDMessage.h | 5 ++++- @@ -1460,10 +1365,10 @@ index e2a836b..6ecaf3f 100644 int m_errorCount; diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 322a581..9c5469b 100644 +index 71add2f..b2bd1b0 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1470,7 +1470,7 @@ double CDVDPlayerVideo::GetCurrentPts() +@@ -1469,7 +1469,7 @@ double CDVDPlayerVideo::GetCurrentPts() if( m_stalled ) iRenderPts = DVD_NOPTS_VALUE; @@ -1472,14 +1377,14 @@ index 322a581..9c5469b 100644 iRenderPts = iRenderPts - max(0.0, iSleepTime); return iRenderPts; -@@ -1570,6 +1570,8 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts) - int iSkippedDeint = 0; +@@ -1568,6 +1568,8 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts) + int iDroppedPics = -1; int iBufferLevel; + m_droppingStats.m_lastPts = pts; + // get decoder stats - if (!m_pVideoCodec->GetCodecStats(iDecoderPts, iSkippedDeint, interlaced)) + if (!m_pVideoCodec->GetCodecStats(iDecoderPts, iDroppedPics)) iDecoderPts = pts; diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.h b/xbmc/cores/dvdplayer/DVDPlayerVideo.h index 59c7f09..65dea76 100644 @@ -1494,13 +1399,13 @@ index 59c7f09..65dea76 100644 unsigned int m_dropRequests; }; -- -1.9.1 +1.9.3 -From d98d7e1ebdb7edfb9bd646019def36e88f7fef40 Mon Sep 17 00:00:00 2001 +From 80b5227a15454f9412bb4d201e7865b8f9be54d8 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 28 Mar 2013 15:18:53 +0100 -Subject: [PATCH 15/30] OMXPlayer: some caching fixes for pvr +Subject: [PATCH 11/25] OMXPlayer: some caching fixes for pvr --- xbmc/cores/omxplayer/OMXPlayer.cpp | 3 ++- @@ -1521,23 +1426,23 @@ index 502df4a..c8579a2 100644 m_av_clock.OMXSetSpeed(speed); m_av_clock.OMXPause(); -- -1.9.1 +1.9.3 -From 0aea7d3018163a00b42df5824b4223ea33c569f1 Mon Sep 17 00:00:00 2001 +From d7e72dead7ae1e29cd59d23a7b68da41bd84bf01 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 28 Mar 2013 20:50:59 +0100 -Subject: [PATCH 16/30] fix incorrect display of fps when dr kicks in +Subject: [PATCH 12/25] fix incorrect display of fps when dr kicks in --- xbmc/Application.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index 42607dc..c133663 100644 +index e1539bf..dfdc55d 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -2331,10 +2331,11 @@ void CApplication::Render() +@@ -2323,10 +2323,11 @@ void CApplication::Render() if (frameTime < singleFrameTime) Sleep(singleFrameTime - frameTime); } @@ -1551,13 +1456,13 @@ index 42607dc..c133663 100644 g_renderManager.UpdateResolution(); -- -1.9.1 +1.9.3 -From e9308bb44a229062ce1df03d326f4a30b0793db5 Mon Sep 17 00:00:00 2001 +From 22decd379c0779cb2fe4b2ead6bb3dcf50138c5c Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Tue, 11 Jun 2013 16:20:29 +0200 -Subject: [PATCH 17/30] renderer: allow some lateness within vblank interval +Subject: [PATCH 13/25] renderer: allow some lateness within vblank interval --- xbmc/cores/VideoRenderers/RenderManager.cpp | 12 ++++++++++-- @@ -1614,13 +1519,13 @@ index 949c652b..d84ff6c 100644 OVERLAY::CRenderer m_overlays; -- -1.9.1 +1.9.3 -From 86cc71987837ad77025e5b49f04063929a9cbe4e Mon Sep 17 00:00:00 2001 +From c7e7a518bb40afdd81b4324514cceecb853ed37c Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Thu, 25 Jul 2013 17:18:13 +0200 -Subject: [PATCH 18/30] ActiveAE: slightly reduce buffer size +Subject: [PATCH 14/25] ActiveAE: slightly reduce buffer size --- xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 4 ++-- @@ -1642,13 +1547,13 @@ index 4bd2c32..4350ac8 100644 void CEngineStats::Reset(unsigned int sampleRate) -- -1.9.1 +1.9.3 -From 8fd5dcb98ea869a82eba92ada598e0c7037aaf44 Mon Sep 17 00:00:00 2001 +From e22c5b2da20a654fd121bd8701fca43be77b4b38 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sun, 4 Aug 2013 10:11:16 +0200 -Subject: [PATCH 19/30] Revert "vdpau: comment some features that will be added +Subject: [PATCH 15/25] Revert "vdpau: comment some features that will be added later" This reverts commit e00b4f65864d623ab4d2e9e5c06db138e661f1cf. @@ -1657,10 +1562,10 @@ This reverts commit e00b4f65864d623ab4d2e9e5c06db138e661f1cf. 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 9c962ae..485c5d3 100644 +index 3f87a7d..f7418e8 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -1092,8 +1092,7 @@ int CDecoder::Decode(AVCodecContext *avctx, AVFrame *pFrame) +@@ -1097,8 +1097,7 @@ int CDecoder::Decode(AVCodecContext *avctx, AVFrame *pFrame) m_bufferStats.IncDecoded(); m_vdpauOutput.m_dataPort.SendOutMessage(COutputDataProtocol::NEWFRAME, &pic, sizeof(pic)); @@ -1670,7 +1575,7 @@ index 9c962ae..485c5d3 100644 } int retval = 0; -@@ -2286,8 +2285,7 @@ void CMixer::InitCycle() +@@ -2294,8 +2293,7 @@ void CMixer::InitCycle() int flags; uint64_t latency; m_config.stats->GetParams(latency, flags); @@ -1680,7 +1585,7 @@ index 9c962ae..485c5d3 100644 SetPostProcFeatures(false); else SetPostProcFeatures(true); -@@ -2299,8 +2297,7 @@ void CMixer::InitCycle() +@@ -2307,8 +2305,7 @@ void CMixer::InitCycle() bool interlaced = m_mixerInput[1].DVDPic.iFlags & DVP_FLAG_INTERLACED; m_SeenInterlaceFlag |= interlaced; @@ -1690,7 +1595,7 @@ index 9c962ae..485c5d3 100644 (mode == VS_DEINTERLACEMODE_FORCE || (mode == VS_DEINTERLACEMODE_AUTO && interlaced))) { -@@ -2322,8 +2319,7 @@ void CMixer::InitCycle() +@@ -2330,8 +2327,7 @@ void CMixer::InitCycle() m_config.stats->SetCanSkipDeint(true); } @@ -1701,13 +1606,13 @@ index 9c962ae..485c5d3 100644 m_mixersteps = 1; } -- -1.9.1 +1.9.3 -From f507d9f789433eb8e82788d25930f14240de25d0 Mon Sep 17 00:00:00 2001 +From 387cf368b3c9c55600f286c7dd59cd2558809ee5 Mon Sep 17 00:00:00 2001 From: Marcel Groothuis Date: Thu, 5 Dec 2013 22:02:50 +0100 -Subject: [PATCH 20/30] ffmpeg demuxer: faster channel change for PVR addons +Subject: [PATCH 16/25] ffmpeg demuxer: faster channel change for PVR addons without internal demuxing (such as MediaPortal, ArgusTV, MythTV, NextPVR) Credits: FernetMenta, Davilla, Popcornmix, Whaupt @@ -1718,7 +1623,7 @@ Subject: [PATCH 20/30] ffmpeg demuxer: faster channel change for PVR addons 3 files changed, 139 insertions(+), 22 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index 33a3ea1..4616a6d 100644 +index 49eff5c..4d4be02 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp @@ -52,6 +52,8 @@ @@ -1838,7 +1743,7 @@ index 33a3ea1..4616a6d 100644 if (pPacket) { -@@ -1621,3 +1632,101 @@ bool CDVDDemuxFFmpeg::IsProgramChange() +@@ -1623,3 +1634,101 @@ bool CDVDDemuxFFmpeg::IsProgramChange() } return false; } @@ -2018,13 +1923,13 @@ index ca689d0..f383563 100644 else return NULL; -- -1.9.1 +1.9.3 -From ff1c95948a2feb97b714f975c1ec46bb2a73836c Mon Sep 17 00:00:00 2001 +From 487c7e4d49ca83752ce7f5459ebbdcb416450c9f Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Thu, 14 Nov 2013 20:35:04 +0100 -Subject: [PATCH 21/30] ffmpeg demuxer: make sure we start mpegts video with an +Subject: [PATCH 17/25] ffmpeg demuxer: make sure we start mpegts video with an i-frame --- @@ -2033,7 +1938,7 @@ Subject: [PATCH 21/30] ffmpeg demuxer: make sure we start mpegts video with an 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index 4616a6d..b2401fc 100644 +index 4d4be02..56eaccc 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp @@ -386,6 +386,13 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput, bool streaminfo) @@ -2063,7 +1968,7 @@ index 4616a6d..b2401fc 100644 } else m_program = 0; -@@ -1668,7 +1681,7 @@ void CDVDDemuxFFmpeg::ParsePacket(AVPacket *pkt) +@@ -1670,7 +1683,7 @@ void CDVDDemuxFFmpeg::ParsePacket(AVPacket *pkt) } // for video we need a decoder to get desired information into codec context @@ -2072,7 +1977,7 @@ index 4616a6d..b2401fc 100644 (!st->codec->width || st->codec->pix_fmt == PIX_FMT_NONE)) { // open a decoder, it will be cleared down by ffmpeg on closing the stream -@@ -1730,3 +1743,19 @@ bool CDVDDemuxFFmpeg::IsVideoReady() +@@ -1732,3 +1745,19 @@ bool CDVDDemuxFFmpeg::IsVideoReady() } return true; } @@ -2105,13 +2010,13 @@ index 083182e..26ee264 100644 AVDictionary *GetFFMpegOptionsFromURL(const CURL &url); double ConvertTimestamp(int64_t pts, int den, int num); -- -1.9.1 +1.9.3 -From e4b926317f94da822655617f90895ff6ec76c3e1 Mon Sep 17 00:00:00 2001 +From c06bbd9a5b92781fb824661bfbebe7031e7dc16b Mon Sep 17 00:00:00 2001 From: Wolfgang Haupt Date: Thu, 5 Dec 2013 22:11:57 +0100 -Subject: [PATCH 22/30] DVDFactoryDemuxer: skip streaminfo for udp tcp and +Subject: [PATCH 18/25] DVDFactoryDemuxer: skip streaminfo for udp tcp and pvr-channels --- @@ -2232,23 +2137,23 @@ index b94e94c..b45630f 100644 static void AddSlashAtEnd(std::string& strFolder); static bool HasSlashAtEnd(const std::string& strFile, bool checkURL = false); -- -1.9.1 +1.9.3 -From ca39086aa377763796ee634d86969a0af6516bc1 Mon Sep 17 00:00:00 2001 +From 3fb4abe57203eef44151b7dbac505143c5cf1012 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Tue, 28 Jan 2014 08:43:29 +0100 -Subject: [PATCH 23/30] squash fast switch +Subject: [PATCH 19/25] squash fast switch --- .../cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index b2401fc..6eedf1f7 100644 +index 56eaccc..d0f13a1 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -@@ -1720,15 +1720,19 @@ void CDVDDemuxFFmpeg::ParsePacket(AVPacket *pkt) +@@ -1722,15 +1722,19 @@ void CDVDDemuxFFmpeg::ParsePacket(AVPacket *pkt) bool CDVDDemuxFFmpeg::IsVideoReady() { AVStream *st; @@ -2271,7 +2176,7 @@ index b2401fc..6eedf1f7 100644 } } else -@@ -1736,12 +1740,15 @@ bool CDVDDemuxFFmpeg::IsVideoReady() +@@ -1738,12 +1742,15 @@ bool CDVDDemuxFFmpeg::IsVideoReady() for (unsigned int i = 0; i < m_pFormatContext->nb_streams; i++) { st = m_pFormatContext->streams[i]; @@ -2291,7 +2196,7 @@ index b2401fc..6eedf1f7 100644 } void CDVDDemuxFFmpeg::ResetVideoStreams() -@@ -1753,7 +1760,7 @@ void CDVDDemuxFFmpeg::ResetVideoStreams() +@@ -1755,7 +1762,7 @@ void CDVDDemuxFFmpeg::ResetVideoStreams() if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { if (st->codec->extradata) @@ -2301,13 +2206,13 @@ index b2401fc..6eedf1f7 100644 st->codec->width = 0; } -- -1.9.1 +1.9.3 -From 95f5612000b79f805b4e8342ed1f3250eb17b76a Mon Sep 17 00:00:00 2001 +From 13dddaee3f4bece06863773163ed1465422f3a91 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sun, 13 Apr 2014 10:52:26 +0200 -Subject: [PATCH 24/30] squash fast channel +Subject: [PATCH 20/25] squash fast channel --- xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 13 ++++++++++--- @@ -2315,7 +2220,7 @@ Subject: [PATCH 24/30] squash fast channel 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index 6eedf1f7..90618e8 100644 +index d0f13a1..1aeae2b 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp @@ -156,6 +156,7 @@ CDVDDemuxFFmpeg::CDVDDemuxFFmpeg() : CDVDDemux() @@ -2358,7 +2263,7 @@ index 6eedf1f7..90618e8 100644 // reset any timeout m_timeout.SetInfinite(); -@@ -1721,6 +1724,10 @@ bool CDVDDemuxFFmpeg::IsVideoReady() +@@ -1723,6 +1726,10 @@ bool CDVDDemuxFFmpeg::IsVideoReady() { AVStream *st; bool hasVideo = false; @@ -2381,13 +2286,13 @@ index 26ee264..322a3b8 100644 }; -- -1.9.1 +1.9.3 -From cf700a9420c35c07950ebcbe494d07cfb71471aa Mon Sep 17 00:00:00 2001 +From 43e72f96912322ad4bbfc664ee0a593f6e471c1b Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sun, 22 Dec 2013 14:52:29 +0100 -Subject: [PATCH 25/30] linux: add shared lib for sse4 operations +Subject: [PATCH 21/25] linux: add shared lib for sse4 operations --- Makefile.in | 8 ++- @@ -2402,10 +2307,10 @@ Subject: [PATCH 25/30] linux: add shared lib for sse4 operations create mode 100644 xbmc/linux/sse4/Makefile.in diff --git a/Makefile.in b/Makefile.in -index a91a38b..2d2c187 100644 +index e07970f..6a6346d 100644 --- a/Makefile.in +++ b/Makefile.in -@@ -311,6 +311,12 @@ CHECK_LIBADD=@WAYLAND_TEST_LIBS@ +@@ -314,6 +314,12 @@ CHECK_LIBADD=@WAYLAND_TEST_LIBS@ endif endif @@ -2418,7 +2323,7 @@ index a91a38b..2d2c187 100644 CHECK_PROGRAMS = xbmc-test CLEAN_FILES += $(CHECK_PROGRAMS) $(CHECK_EXTENSIONS) -@@ -438,7 +444,7 @@ endif +@@ -441,7 +447,7 @@ endif codecs: papcodecs dvdpcodecs dvdpextcodecs @@ -2428,10 +2333,10 @@ index a91a38b..2d2c187 100644 externals: codecs libs visualizations screensavers libaddon pvraddons diff --git a/configure.in b/configure.in -index af674d8..0b532d5 100644 +index 1766ce1..abbfcdf 100644 --- a/configure.in +++ b/configure.in -@@ -827,6 +827,19 @@ elif test "$use_arch" = "arm"; then +@@ -832,6 +832,19 @@ elif test "$use_arch" = "arm"; then fi fi @@ -2451,7 +2356,7 @@ index af674d8..0b532d5 100644 # Checks for library functions. AC_FUNC_ALLOCA AC_FUNC_CHOWN -@@ -2596,6 +2609,10 @@ if test "$use_codec_libstagefright" = "yes"; then +@@ -2583,6 +2596,10 @@ if test "$use_codec_libstagefright" = "yes"; then OUTPUT_FILES="$OUTPUT_FILES xbmc/cores/dvdplayer/DVDCodecs/Video/libstagefrightICS/Makefile" fi @@ -2462,19 +2367,19 @@ index af674d8..0b532d5 100644 OUTPUT_FILES="$OUTPUT_FILES \ xbmc/interfaces/python/Makefile \ xbmc/interfaces/python/test/Makefile" -@@ -2673,6 +2690,7 @@ AC_SUBST(USE_ANDROID) - AC_SUBST(GTEST_CONFIGURED) +@@ -2661,6 +2678,7 @@ AC_SUBST(GTEST_CONFIGURED) AC_SUBST(USE_DOXYGEN) AC_SUBST(USE_PVR_ADDONS) + AC_SUBST(UPNP_DEFINES) +AC_SUBST(USE_SSE4) # pushd and popd are not available in other shells besides bash, so implement # our own pushd/popd functions diff --git a/xbmc/DllPaths_generated.h.in b/xbmc/DllPaths_generated.h.in -index 8c0b453..668b4a4 100644 +index baebb4d..dacbbd6 100644 --- a/xbmc/DllPaths_generated.h.in +++ b/xbmc/DllPaths_generated.h.in -@@ -93,4 +93,7 @@ +@@ -92,4 +92,7 @@ /* xkbcommon */ #define DLL_PATH_XKBCOMMON "@XKBCOMMON_LIBRARY_SONAME@" @@ -2679,31 +2584,32 @@ index 0000000..45aa826 + +include ../../../Makefile.include -- -1.9.1 +1.9.3 -From 7bac41adfaac4f20008ea4ca7d45927b87cc3d67 Mon Sep 17 00:00:00 2001 +From ea04c03cee4da4575110d94655d9949585517b77 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Thu, 19 Dec 2013 15:36:11 +0100 -Subject: [PATCH 26/30] vaapi: option to enable sw filters +Subject: [PATCH 22/25] vaapi: option to enable sw filters --- language/English/strings.po | 17 ++- system/settings/settings.xml | 15 ++ xbmc/cores/VideoRenderers/RenderManager.cpp | 4 +- xbmc/cores/dvdplayer/DVDCodecs/DVDCodecUtils.cpp | 1 + - .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 76 +++++++++-- - .../DVDCodecs/Video/DVDVideoCodecFFmpeg.h | 3 + + .../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 2 + + .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 71 ++++++++-- + .../DVDCodecs/Video/DVDVideoCodecFFmpeg.h | 4 + xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp | 152 +++++++++++++++++++++ xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h | 31 +++++ - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 32 ++--- - 9 files changed, 290 insertions(+), 41 deletions(-) + xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 30 ++-- + 10 files changed, 290 insertions(+), 37 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index a2e539e..17c9274 100755 +index 951bfcb..df4cd0d 100755 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -6092,7 +6092,13 @@ msgctxt "#13456" +@@ -6157,7 +6157,13 @@ msgctxt "#13456" msgid "Hardware accelerated" msgstr "" @@ -2718,7 +2624,7 @@ index a2e539e..17c9274 100755 #: system/settings/settings.xml msgctxt "#13500" -@@ -15167,7 +15173,14 @@ msgctxt "#36431" +@@ -15274,7 +15280,14 @@ msgctxt "#36431" msgid "Defines whether video decoding should be performed in software (requires more CPU) or with hardware acceleration where possible." msgstr "" @@ -2735,7 +2641,7 @@ index a2e539e..17c9274 100755 #: system/settings/settings.xml diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 0e4e952..ba17337 100644 +index 391bcee..c0f64ab 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -715,6 +715,21 @@ @@ -2789,8 +2695,19 @@ index 2958d43..06e0010 100644 , { PIX_FMT_VAAPI_VLD, RENDER_FMT_VAAPI } , { PIX_FMT_DXVA2_VLD, RENDER_FMT_DXVA } , { PIX_FMT_NONE , RENDER_FMT_NONE } +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h +index c5b24d6..3efc007 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h +@@ -323,4 +323,6 @@ class CDVDVideoCodec + * + */ + virtual void SetCodecControl(int flags) {} ++ ++ virtual bool IsInterlaced() { return false; } + }; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index 6bbb84d..f308c09 100644 +index c48108f..3b70aa0 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -38,6 +38,7 @@ @@ -2960,20 +2877,8 @@ index 6bbb84d..f308c09 100644 m_pCodecContext->time_base.num, m_pCodecContext->time_base.den, m_pCodecContext->sample_aspect_ratio.num, -@@ -852,10 +901,7 @@ bool CDVDVideoCodecFFmpeg::GetCodecStats(double &pts, int &skippedDeint, int &in - { - pts = m_decoderPts; - skippedDeint = m_skippedDeint; -- if (m_pFrame) -- interlaced = m_pFrame->interlaced_frame; -- else -- interlaced = 0; -+ interlaced = m_interlace; - return true; - } - diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h -index fa3269c..6baf42a 100644 +index 1a80a48..25f1d25 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h @@ -53,6 +53,8 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec @@ -2985,7 +2890,15 @@ index fa3269c..6baf42a 100644 }; CDVDVideoCodecFFmpeg(); -@@ -129,4 +131,5 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec +@@ -70,6 +72,7 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec + virtual unsigned GetAllowedReferences(); + virtual bool GetCodecStats(double &pts, int &droppedPics); + virtual void SetCodecControl(int flags); ++ virtual bool IsInterlaced() { return m_interlace; } + + bool IsHardwareAllowed() { return !m_bSoftware; } + IHardwareDecoder * GetHardware() { return m_pHardware; }; +@@ -129,4 +132,5 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec int m_skippedDeint; bool m_requestSkipDeint; int m_codecControlFlags; @@ -3270,10 +3183,10 @@ index ec99162..616b124 100644 } diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 9c5469b..b30e450 100644 +index b2bd1b0..2580c76 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -554,28 +554,6 @@ void CDVDPlayerVideo::Process() +@@ -553,28 +553,6 @@ void CDVDPlayerVideo::Process() // decoder still needs to provide an empty image structure, with correct flags m_pVideoCodec->SetDropState(bRequestDrop); @@ -3302,7 +3215,7 @@ index 9c5469b..b30e450 100644 int iDecoderState = m_pVideoCodec->Decode(pPacket->pData, pPacket->iSize, pPacket->dts, pPacket->pts); // buffer packets so we can recover should decoder flush for some reason -@@ -662,6 +640,8 @@ void CDVDPlayerVideo::Process() +@@ -661,6 +639,8 @@ void CDVDPlayerVideo::Process() //Deinterlace if codec said format was interlaced or if we have selected we want to deinterlace //this video @@ -3311,14 +3224,12 @@ index 9c5469b..b30e450 100644 if ((mDeintMode == VS_DEINTERLACEMODE_AUTO && (picture.iFlags & DVP_FLAG_INTERLACED)) || mDeintMode == VS_DEINTERLACEMODE_FORCE) { if(mInt == VS_INTERLACEMETHOD_SW_BLEND) -@@ -704,7 +684,15 @@ void CDVDPlayerVideo::Process() +@@ -703,7 +683,13 @@ void CDVDPlayerVideo::Process() } if (picture.iRepeatPicture) + { -+ double pts; -+ int skipped, deint; -+ m_pVideoCodec->GetCodecStats(pts, skipped, deint); ++ bool deint = m_pVideoCodec->IsInterlaced(); + picture.iDuration = frametime; + if (deint && (frametime <= 0.02*DVD_TIME_BASE)) + picture.iDuration *= 2; @@ -3328,20 +3239,20 @@ index 9c5469b..b30e450 100644 int iResult = OutputPicture(&picture, pts); -- -1.9.1 +1.9.3 -From 5b5c312c9a49f54cf53b0e67e9de00abe612db8f Mon Sep 17 00:00:00 2001 +From 69220053875bda76dbea5a40aefdbbcc94226dc5 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Tue, 28 Jan 2014 10:05:26 +0100 -Subject: [PATCH 27/30] xbmc pr 3080 +Subject: [PATCH 23/25] xbmc pr 3080 --- .../dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index f308c09..4bc3b76 100644 +index 3b70aa0..80915d4 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -477,6 +477,14 @@ int CDVDVideoCodecFFmpeg::Decode(uint8_t* pData, int iSize, double dts, double p @@ -3373,20 +3284,20 @@ index f308c09..4bc3b76 100644 pDvdVideoPicture->pts = DVD_NOPTS_VALUE; -- -1.9.1 +1.9.3 -From 2783a6e973bacfb17e088e717ea33a11948ad64e Mon Sep 17 00:00:00 2001 +From b73554bcf7b32421b806a6dd94978f560ecd6877 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Tue, 28 Jan 2014 17:24:58 +0100 -Subject: [PATCH 28/30] set preatpicture if pts is equal to last frame +Subject: [PATCH 24/25] set preatpicture if pts is equal to last frame --- xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index 4bc3b76..755b7aa 100644 +index 80915d4..ab36704 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -704,7 +704,15 @@ bool CDVDVideoCodecFFmpeg::GetPictureCommon(DVDVideoPicture* pDvdVideoPicture) @@ -3406,13 +3317,13 @@ index 4bc3b76..755b7aa 100644 pDvdVideoPicture->pts = DVD_NOPTS_VALUE; -- -1.9.1 +1.9.3 -From 80c9b818dfc0bf082ef3df6225f4683a76d68f99 Mon Sep 17 00:00:00 2001 +From 22f8e9a540ac656ee113988288600bcd14346b77 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Tue, 11 Feb 2014 18:15:06 +0100 -Subject: [PATCH 29/30] ActiveAE: add some debug logging +Subject: [PATCH 25/25] ActiveAE: add some debug logging --- xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp | 6 ++++++ @@ -3437,4 +3348,5 @@ index 0287e73..6904cb9 100644 return copied; } -- -1.9.1 +1.9.3 + diff --git a/projects/RPi/patches/xbmc-master/xbmc-master-newclock3.patch b/projects/RPi/patches/xbmc-master/xbmc-master-newclock3.patch index e3140480f2..463e039265 100644 --- a/projects/RPi/patches/xbmc-master/xbmc-master-newclock3.patch +++ b/projects/RPi/patches/xbmc-master/xbmc-master-newclock3.patch @@ -1,7 +1,7 @@ -From 8349c53bd0a06bdb9df1039309684aa5c859e4f9 Mon Sep 17 00:00:00 2001 +From 13b8378adee5d09762f609cb3b1ccf20b798099d Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 14 Nov 2013 19:48:41 +0000 -Subject: [PATCH 01/87] More efficient infobool expression evaluator +Subject: [PATCH 01/83] More efficient infobool expression evaluator Expession infobools are evaluated at runtime from one or more single infobools and a combination of boolean NOT, AND and OR operators. Previously, parsing @@ -497,13 +497,13 @@ index 4e0faee..0a91399 100644 }; -- -1.9.1 +1.9.3 -From 098f8bef95e72987f9087bd8d0449d26f16f9a12 Mon Sep 17 00:00:00 2001 +From dbcf34de3e9ed5204dee8c5bba47ef8a94be54c1 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 24 Mar 2014 22:26:21 +0000 -Subject: [PATCH 02/87] Where an infobool expression failed to parse, evaluate +Subject: [PATCH 02/83] Where an infobool expression failed to parse, evaluate the infobool as false. Previously, this would result in a segfault due to the dereferencing of an uninitialised pointer to the head of the expression tree. @@ -527,13 +527,13 @@ index db461dd..7c54064 100644 void InfoExpression::Update(const CGUIListItem *item) -- -1.9.1 +1.9.3 -From b921267e3af8929a3c87448917cdbdb66249b1d6 Mon Sep 17 00:00:00 2001 +From c870a027cdf8b392559d743b9f73da434847a354 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Tue, 26 Nov 2013 20:09:48 +0000 -Subject: [PATCH 03/87] Add caching of infolabels +Subject: [PATCH 03/83] Add caching of infolabels The functions CGUIInfoLabel::GetLabel and CGUIInfoLabel::GetItemLabel take a number of strings returned from CGUIInfoManager::GetImage or @@ -743,13 +743,13 @@ index 8c1c1dc..418b2c4 100644 #endif -- -1.9.1 +1.9.3 -From d3d046f2e6d4c719536cd52ab2873f44949fbb68 Mon Sep 17 00:00:00 2001 +From a90a90832b182a1d38470318913387633a2502e3 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Tue, 10 Dec 2013 01:12:31 +0000 -Subject: [PATCH 04/87] De-duplication of string cache for non-item and item +Subject: [PATCH 04/83] De-duplication of string cache for non-item and item labels --- @@ -886,13 +886,13 @@ index 418b2c4..6d9ebf7 100644 #endif -- -1.9.1 +1.9.3 -From 8d559fc50029b968d48b7d07e9079a25607e91e2 Mon Sep 17 00:00:00 2001 +From 8b429464f60a948944515770a5bc71e37ca0dce1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 21 Feb 2014 15:16:13 +0000 -Subject: [PATCH 05/87] Faster and simpler portable implementation of +Subject: [PATCH 05/83] Faster and simpler portable implementation of MathUtils::round_int(). Much as I like a bit of inline assembler, I have also removed the ARM versions @@ -1095,13 +1095,13 @@ index 96af9f4..0dae77d 100644 inline int64_t abs(int64_t a) -- -1.9.1 +1.9.3 -From 97887a1279cd18f6390b2ce468d2e7d1fa2f13d7 Mon Sep 17 00:00:00 2001 +From 2ec44685277c1b1c939aafb40a330675081c4cf7 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 11 Dec 2013 17:21:54 +0000 -Subject: [PATCH 06/87] Move the reference-counting of Begin and End calls from +Subject: [PATCH 06/83] Move the reference-counting of Begin and End calls from DX and GL source files into GUIFontTTF.cpp. --- @@ -1453,13 +1453,13 @@ index a0dacba..6736cf7 100644 protected: virtual CBaseTexture* ReallocTexture(unsigned int& newHeight); -- -1.9.1 +1.9.3 -From af8a4562323136bed46cdfa515798d455c44a1f5 Mon Sep 17 00:00:00 2001 +From c463ee014a96d3ba4499233e6b0cbee7c8533754 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 11 Dec 2013 18:47:54 +0000 -Subject: [PATCH 07/87] Convert CGUIFontTTFBase::m_vertex to be managed as a +Subject: [PATCH 07/83] Convert CGUIFontTTFBase::m_vertex to be managed as a std::vector. Also retired CGUIFontTTFBase::m_vertex_count and CGUIFontTTFBase::m_vertex_size because these can be derived from vector member functions. @@ -1638,13 +1638,13 @@ index 93b7ea6..a4e8571 100644 *vertices++ = m_vertex[i]; *vertices++ = m_vertex[i+1]; -- -1.9.1 +1.9.3 -From 749c79fa62a92b90551eb2ba2320f839c6716cf2 Mon Sep 17 00:00:00 2001 +From ababb440c75265ad8129cd76f1a78583da9cbb58 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 16 Dec 2013 18:58:12 +0000 -Subject: [PATCH 08/87] CGUIFontTTFBase::RenderCharacter can now append to +Subject: [PATCH 08/83] CGUIFontTTFBase::RenderCharacter can now append to arbitrary vectors of vertices rather than only CGUIFontTTFBase::m_vertex --- @@ -1717,13 +1717,13 @@ index 35e3cf9..4a6a696 100644 virtual CBaseTexture* ReallocTexture(unsigned int& newHeight) = 0; -- -1.9.1 +1.9.3 -From 583cc1c7b60209251e660b9b7cb4ec38871279e6 Mon Sep 17 00:00:00 2001 +From 1a623a32e19f38b2ae68095607cc0cde36d97db8 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 17:18:38 +0000 -Subject: [PATCH 09/87] Add a cache of font glyph bounding box vertices. This +Subject: [PATCH 09/83] Add a cache of font glyph bounding box vertices. This is implemented as a template because ultimately we will key on different parameters and store values of different types, depending upon whether we have a GLES or non-GLES backend, and for GLES, whether or not the currently @@ -2380,13 +2380,13 @@ index f351c99..9036ba9 100644 + return !operator==(a, b); +} -- -1.9.1 +1.9.3 -From f3a492fd813b9b428bce58596c10681a931cba7a Mon Sep 17 00:00:00 2001 +From a9ced9f250a703ea48b033654f8453fdfd01b486 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 23 Jan 2014 22:24:17 +0000 -Subject: [PATCH 10/87] Lay the groundwork for hardware clipping. +Subject: [PATCH 10/83] Lay the groundwork for hardware clipping. For glScissor() to replace CGraphicContext::ClipRect, a necessary condition is that no shear or rotation is introduced between the coordinate systems @@ -2648,13 +2648,13 @@ index 98e398a..81ee49e 100644 virtual void ResetScissors(); -- -1.9.1 +1.9.3 -From f8753a3e6a1d027f5a9c608d4adf74be19d37192 Mon Sep 17 00:00:00 2001 +From 710f111ec5c24473d30cfb99489e20f381818041 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 23 Jan 2014 16:42:22 +0000 -Subject: [PATCH 11/87] Increase font cache hit rate by keying on the +Subject: [PATCH 11/83] Increase font cache hit rate by keying on the fractional part of m_originX and m_originY *after* they have been through the graphics context's transformation matrix, plus the scale/rotation elements of the matrix, rather than the origin in the original frame of reference plus @@ -2855,13 +2855,13 @@ index 7cb4669..78445ab 100644 private: virtual bool FirstBegin() = 0; -- -1.9.1 +1.9.3 -From e30b742c2ed710c33f51fc29ad58f17a934c6e05 Mon Sep 17 00:00:00 2001 +From e7a44feaecf29ab26eadc95fc5d783bfe48c7eb7 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 8 Jan 2014 12:16:33 +0000 -Subject: [PATCH 12/87] Rewrite of scrolling text code. +Subject: [PATCH 12/83] Rewrite of scrolling text code. No longer shuffles the string round to minimise the number of characters before the clipping rectangle; this doesn't save much on rendering time but @@ -3177,13 +3177,13 @@ index 2c6f366..b74faf2 100644 private: void Process(); -- -1.9.1 +1.9.3 -From 76fca75e29aeace270a012bec65732158221f26e Mon Sep 17 00:00:00 2001 +From f97bf020cb07cb6ba5dab59a4af7dc36eb1297d7 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 27 Jan 2014 23:21:10 +0000 -Subject: [PATCH 13/87] Move the application of the translation offsets into +Subject: [PATCH 13/83] Move the application of the translation offsets into the GLES code. Still all pure software at this stage. Main change is in the data types at the interface between CGUIFontTTFBase and CGUIFontTTFGL. The old way (array of vertices in m_vertex) are retained in addition, for the @@ -3376,13 +3376,13 @@ index cb56987..f6aa081 100644 memset(newTexture->GetPixels(), 0, m_textureHeight * newTexture->GetPitch()); if (m_texture) -- -1.9.1 +1.9.3 -From 91585f33a25b63782a3ed713d07edc488b0a6e3b Mon Sep 17 00:00:00 2001 +From 43a8a3806dce00f88b1c1b9bb42e79c8a0e5f823 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 15:28:06 +0000 -Subject: [PATCH 14/87] Rather than applying the translation offsets to the +Subject: [PATCH 14/83] Rather than applying the translation offsets to the vertices, now applies them to the model view matrix from the top of the matrix stack and pushes it over to OpenGL. The vertices themselves are still all held client-side. @@ -3526,13 +3526,13 @@ index 81ee49e..d2f9cd1 100644 protected: virtual void SetVSyncImpl(bool enable) = 0; -- -1.9.1 +1.9.3 -From c74b6f7c42671588a5e4ef4c344cc0fd7afed9c4 Mon Sep 17 00:00:00 2001 +From 3874d526859bbb475e28095fb2a91a3a38acaf4a Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 29 Jan 2014 13:21:19 +0000 -Subject: [PATCH 15/87] Enable hardware clipping. +Subject: [PATCH 15/83] Enable hardware clipping. --- xbmc/guilib/GUIFontTTF.cpp | 4 ++-- @@ -3605,13 +3605,13 @@ index fbffaa0..b7618e1 100644 glUniformMatrix4fv(modelLoc, 1, GL_FALSE, g_matrices.GetMatrix(MM_MODELVIEW)); } -- -1.9.1 +1.9.3 -From 7c249440f97ec8d62763c26691a2583b6a98ac53 Mon Sep 17 00:00:00 2001 +From 69fc55b7b0a7f67b6f9bd567ea4ae8a818907bcd Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 15:32:51 +0000 -Subject: [PATCH 16/87] Move the vertex data across to a vertex buffer object +Subject: [PATCH 16/83] Move the vertex data across to a vertex buffer object just prior to drawing. --- @@ -3662,13 +3662,13 @@ index b7618e1..0df3749 100644 // Disable the attributes used by this shader -- -1.9.1 +1.9.3 -From 75d1ce22e0f0aa256b44277f39f3ca2ac6e80636 Mon Sep 17 00:00:00 2001 +From 8ebdf87dbe17f7a259b91e36f5e80e6437cca9b3 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 16:04:04 +0000 -Subject: [PATCH 17/87] Move vertex data into an OpenGL VBO when the font cache +Subject: [PATCH 17/83] Move vertex data into an OpenGL VBO when the font cache entry is populated. The font cache now stores the "name" (handle) of the VBO, rather than a vector of vertices. @@ -3940,13 +3940,13 @@ index 6736cf7..168fb21 100644 protected: virtual CBaseTexture* ReallocTexture(unsigned int& newHeight); -- -1.9.1 +1.9.3 -From f0b097c8829d25f29eddc832d602db9a83971b6c Mon Sep 17 00:00:00 2001 +From 910cb2e120b831b9901d334a54177eb879b535d0 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 16 Jan 2014 16:29:42 +0000 -Subject: [PATCH 18/87] Switch from glDrawArrays() to glDrawElements(). This +Subject: [PATCH 18/83] Switch from glDrawArrays() to glDrawElements(). This involves setting up a static VBO containing the indexes necessary to convert from quads to triangles on the fly in the GPU. @@ -4109,7 +4109,7 @@ index 168fb21..a14ab7a 100644 #endif diff --git a/xbmc/windowing/egl/WinSystemEGL.cpp b/xbmc/windowing/egl/WinSystemEGL.cpp -index dfc4672..0c32947 100644 +index 6de3532..258a293 100644 --- a/xbmc/windowing/egl/WinSystemEGL.cpp +++ b/xbmc/windowing/egl/WinSystemEGL.cpp @@ -29,6 +29,7 @@ @@ -4120,7 +4120,7 @@ index dfc4672..0c32947 100644 #include "utils/log.h" #include "EGLWrapper.h" #include "EGLQuirks.h" -@@ -192,6 +193,9 @@ bool CWinSystemEGL::CreateWindow(RESOLUTION_INFO &res) +@@ -193,6 +194,9 @@ bool CWinSystemEGL::CreateWindow(RESOLUTION_INFO &res) return false; } @@ -4130,7 +4130,7 @@ index dfc4672..0c32947 100644 if (m_context == EGL_NO_CONTEXT) { if (!m_egl->CreateContext(m_display, m_config, contextAttrs, &m_context)) -@@ -199,6 +203,9 @@ bool CWinSystemEGL::CreateWindow(RESOLUTION_INFO &res) +@@ -200,6 +204,9 @@ bool CWinSystemEGL::CreateWindow(RESOLUTION_INFO &res) CLog::Log(LOGERROR, "%s: Could not create context",__FUNCTION__); return false; } @@ -4140,7 +4140,7 @@ index dfc4672..0c32947 100644 } if (!m_egl->BindContext(m_display, m_surface, m_context)) -@@ -207,6 +214,11 @@ bool CWinSystemEGL::CreateWindow(RESOLUTION_INFO &res) +@@ -208,6 +215,11 @@ bool CWinSystemEGL::CreateWindow(RESOLUTION_INFO &res) return false; } @@ -4152,7 +4152,7 @@ index dfc4672..0c32947 100644 // for the non-trivial dirty region modes, we need the EGL buffer to be preserved across updates if (g_advancedSettings.m_guiAlgorithmDirtyRegions == DIRTYREGION_SOLVER_COST_REDUCTION || g_advancedSettings.m_guiAlgorithmDirtyRegions == DIRTYREGION_SOLVER_UNION) -@@ -228,7 +240,12 @@ bool CWinSystemEGL::DestroyWindowSystem() +@@ -229,7 +241,12 @@ bool CWinSystemEGL::DestroyWindowSystem() DestroyWindow(); if (m_context != EGL_NO_CONTEXT) @@ -4166,13 +4166,13 @@ index dfc4672..0c32947 100644 if (m_display != EGL_NO_DISPLAY) -- -1.9.1 +1.9.3 -From a66221bb6201af2293dde51c7de183fb93a27a87 Mon Sep 17 00:00:00 2001 +From cf3399b12c339337663d5044938fcb79479be030 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Tue, 4 Feb 2014 16:17:57 +0000 -Subject: [PATCH 19/87] Update Windows project files +Subject: [PATCH 19/83] Update Windows project files --- project/VS2010Express/XBMC.vcxproj | 2 ++ @@ -4180,10 +4180,10 @@ Subject: [PATCH 19/87] Update Windows project files 2 files changed, 8 insertions(+) diff --git a/project/VS2010Express/XBMC.vcxproj b/project/VS2010Express/XBMC.vcxproj -index 2a7b908..30aeae7 100644 +index dd3abd1..b7622b2 100644 --- a/project/VS2010Express/XBMC.vcxproj +++ b/project/VS2010Express/XBMC.vcxproj -@@ -543,6 +543,7 @@ +@@ -545,6 +545,7 @@ @@ -4191,7 +4191,7 @@ index 2a7b908..30aeae7 100644 -@@ -2061,6 +2062,7 @@ +@@ -2073,6 +2074,7 @@ @@ -4200,7 +4200,7 @@ index 2a7b908..30aeae7 100644 diff --git a/project/VS2010Express/XBMC.vcxproj.filters b/project/VS2010Express/XBMC.vcxproj.filters -index 994db7f..fd7f1ac 100644 +index 43c0c75..226daaf 100644 --- a/project/VS2010Express/XBMC.vcxproj.filters +++ b/project/VS2010Express/XBMC.vcxproj.filters @@ -1024,6 +1024,9 @@ @@ -4213,7 +4213,7 @@ index 994db7f..fd7f1ac 100644 guilib -@@ -3975,6 +3978,9 @@ +@@ -3987,6 +3990,9 @@ guilib @@ -4224,20 +4224,20 @@ index 994db7f..fd7f1ac 100644 guilib -- -1.9.1 +1.9.3 -From 91b642b79018b70aa6ee6ee6987574ca97b7c7a2 Mon Sep 17 00:00:00 2001 +From e2f86e9ceced0252f858ca5d751d2c2840bebf03 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Tue, 4 Feb 2014 16:49:45 +0000 -Subject: [PATCH 20/87] Update XCode project file +Subject: [PATCH 20/83] Update XCode project file --- XBMC.xcodeproj/project.pbxproj | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/XBMC.xcodeproj/project.pbxproj b/XBMC.xcodeproj/project.pbxproj -index 878016b..0ab5927 100644 +index 5e32a35..ea1828a 100644 --- a/XBMC.xcodeproj/project.pbxproj +++ b/XBMC.xcodeproj/project.pbxproj @@ -168,6 +168,9 @@ @@ -4250,7 +4250,7 @@ index 878016b..0ab5927 100644 32C631281423A90F00F18420 /* JpegIO.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32C631261423A90F00F18420 /* JpegIO.cpp */; }; 36A9443D15821E2800727135 /* DatabaseUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 36A9443B15821E2800727135 /* DatabaseUtils.cpp */; }; 36A9444115821E7C00727135 /* SortUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 36A9443F15821E7C00727135 /* SortUtils.cpp */; }; -@@ -3546,6 +3549,8 @@ +@@ -4028,6 +4031,8 @@ 1DAFDB7B16DFDCA7007F8C68 /* PeripheralBusCEC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PeripheralBusCEC.h; sourceTree = ""; }; 1DE0443315828F4B005DDB4D /* Exception.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Exception.cpp; path = commons/Exception.cpp; sourceTree = ""; }; 1DE0443415828F4B005DDB4D /* Exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Exception.h; path = commons/Exception.h; sourceTree = ""; }; @@ -4259,7 +4259,7 @@ index 878016b..0ab5927 100644 32C631261423A90F00F18420 /* JpegIO.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JpegIO.cpp; sourceTree = ""; }; 32C631271423A90F00F18420 /* JpegIO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JpegIO.h; sourceTree = ""; }; 36A9443B15821E2800727135 /* DatabaseUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseUtils.cpp; sourceTree = ""; }; -@@ -5921,6 +5926,8 @@ +@@ -6546,6 +6551,8 @@ 18B7C76A1294222E009E7A26 /* GUIFixedListContainer.cpp */, 18B7C7101294222D009E7A26 /* GUIFixedListContainer.h */, 18B7C76B1294222E009E7A26 /* GUIFont.cpp */, @@ -4268,38 +4268,38 @@ index 878016b..0ab5927 100644 18B7C7111294222D009E7A26 /* GUIFont.h */, 18B7C76C1294222E009E7A26 /* GUIFontManager.cpp */, 18B7C7121294222D009E7A26 /* GUIFontManager.h */, -@@ -10926,6 +10933,7 @@ - 7C8AE854189DE47F00C33786 /* CoreAudioHelpers.cpp in Sources */, - 7CF0504B190A1D7200222135 /* FFmpeg.cpp in Sources */, - 7CF05056191195DA00222135 /* MediaType.cpp in Sources */, +@@ -11870,6 +11877,7 @@ + 7CCDACB019275D1F0074CF51 /* NptStdcEnvironment.cpp in Sources */, + 7CCDACC119275D790074CF51 /* NptAppleAutoreleasePool.mm in Sources */, + 7CCDACCA19275D790074CF51 /* NptAppleLogConfig.mm in Sources */, + 2FD7EC5F18A14FE50047F86C /* GUIFontCache.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; -@@ -11974,6 +11982,7 @@ - DF374B2518AC2BA20076B514 /* CoreAudioHelpers.cpp in Sources */, - 7CF0504D190A1D7200222135 /* FFmpeg.cpp in Sources */, - 7CF05058191195DA00222135 /* MediaType.cpp in Sources */, +@@ -13067,6 +13075,7 @@ + 7CCDACB219275D1F0074CF51 /* NptStdcEnvironment.cpp in Sources */, + 7CCDACC319275D790074CF51 /* NptAppleAutoreleasePool.mm in Sources */, + 7CCDACCC19275D790074CF51 /* NptAppleLogConfig.mm in Sources */, + 2FD7EC6118A14FE50047F86C /* GUIFontCache.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; -@@ -13024,6 +13033,7 @@ - DF374B2418AC2BA20076B514 /* CoreAudioHelpers.cpp in Sources */, - 7CF0504C190A1D7200222135 /* FFmpeg.cpp in Sources */, - 7CF05057191195DA00222135 /* MediaType.cpp in Sources */, +@@ -14266,6 +14275,7 @@ + 7CCDACB119275D1F0074CF51 /* NptStdcEnvironment.cpp in Sources */, + 7CCDACC219275D790074CF51 /* NptAppleAutoreleasePool.mm in Sources */, + 7CCDACCB19275D790074CF51 /* NptAppleLogConfig.mm in Sources */, + 2FD7EC6018A14FE50047F86C /* GUIFontCache.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; -- -1.9.1 +1.9.3 -From 8787ed2a579254fc70dc01cf28129fc0baba82da Mon Sep 17 00:00:00 2001 +From f13ecead9710858f84865b67aab494874dc4abaf Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Tue, 4 Feb 2014 17:44:34 +0000 -Subject: [PATCH 21/87] Clang seems to be more picky than gcc about some C++ +Subject: [PATCH 21/83] Clang seems to be more picky than gcc about some C++ template syntax --- @@ -4364,13 +4364,13 @@ index 895fa72..bd84b9a 100644 template void CGUIFontCacheEntry::Reassign::operator()(CGUIFontCacheEntry &entry); -- -1.9.1 +1.9.3 -From 30903babcce5e1b57077f5e6cdb12f2630d39128 Mon Sep 17 00:00:00 2001 +From 4f63ce17314bb3fc030628578d88ca90f6546494 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Tue, 4 Feb 2014 18:52:14 +0000 -Subject: [PATCH 22/87] Fix header to hopefully permit iOS builds to work +Subject: [PATCH 22/83] Fix header to hopefully permit iOS builds to work again. GUIShader.cpp added #include windowing/egl/WinSystemEGL.h inside a but also need the header windowing/osx/WinSystemIOS.h instead. The only thing GUIShader.cpp needed was g_windowing.GetViewPort, which is provided by the @@ -4396,13 +4396,13 @@ index 53bce09..86330cc 100644 CGUIShader::CGUIShader( const char *shader ) : CGLSLShaderProgram("guishader_vert.glsl", shader) -- -1.9.1 +1.9.3 -From adea09111aefbd2c6f1f5374efc785b5415e60e9 Mon Sep 17 00:00:00 2001 +From 3d7db7972dd3c60284b6fff15d16847bbdebd170 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Tue, 8 Apr 2014 18:14:55 +0100 -Subject: [PATCH 23/87] Fix font display in stereoscopic modes +Subject: [PATCH 23/83] Fix font display in stereoscopic modes CGUIFontTTFGL::LastEnd was previously using the relatively high-level CGraphicContext::SetScissors function to enforce hardware clipping. However, the coordinates it passed in already contained the stereoscopic offset, so @@ -4440,13 +4440,13 @@ index d476409..8466a81 100644 glUniformMatrix4fv(modelLoc, 1, GL_FALSE, g_matrices.GetMatrix(MM_MODELVIEW)); // Unbind GL_ARRAY_BUFFER and GL_ELEMENT_ARRAY_BUFFER -- -1.9.1 +1.9.3 -From c1337b31a8b6e789bdc5544d3373eb1396ba0bac Mon Sep 17 00:00:00 2001 +From 18f6219dad05dd8a0b98565a01d1667ebf2ec516 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 10 Jan 2014 12:10:43 +0000 -Subject: [PATCH 24/87] [rbp] Don't override dvdplayer with omxplayer. +Subject: [PATCH 24/83] [rbp] Don't override dvdplayer with omxplayer. Using dvdplayer can be useful on the Pi. We can actually play sd (up to 640x480 MPEG-4 video) video in real time. This is useful for codec variants like DivX3 which we don't currently play. @@ -4476,13 +4476,13 @@ index 27f0bec..fc12bb7 100644 case EPC_EXTPLAYER: pPlayer = new CExternalPlayer(callback); break; #if defined(HAS_OMXPLAYER) -- -1.9.1 +1.9.3 -From b0d145c6e2f111ebaf96a6570d9a108eff5f831e Mon Sep 17 00:00:00 2001 +From f6572e7b870991de1bd939f12fafb50434ed0ee9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 10 Jan 2014 15:37:41 +0000 -Subject: [PATCH 25/87] [players] Use default players rather than hard coded +Subject: [PATCH 25/83] [players] Use default players rather than hard coded DVDPlayer/PAPlayer --- @@ -4538,23 +4538,23 @@ index 57dfcdd..7be9799 100644 -- -1.9.1 +1.9.3 -From b1e99d09eac33c5664ad95e4f097349733be2c36 Mon Sep 17 00:00:00 2001 +From 51f412cdecaf55c5d491ba4a73825f932c61e2c0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 11 Jan 2014 18:23:42 +0000 -Subject: [PATCH 26/87] [rbp] Don't force dvdplayer for airplay +Subject: [PATCH 26/83] [rbp] Don't force dvdplayer for airplay --- xbmc/network/AirPlayServer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xbmc/network/AirPlayServer.cpp b/xbmc/network/AirPlayServer.cpp -index 127a765..13b7ead 100644 +index 472463d..9f86eb7 100644 --- a/xbmc/network/AirPlayServer.cpp +++ b/xbmc/network/AirPlayServer.cpp -@@ -895,9 +895,11 @@ int CAirPlayServer::CTCPClient::ProcessRequest( CStdString& responseHeader, +@@ -906,9 +906,11 @@ int CAirPlayServer::CTCPClient::ProcessRequest( CStdString& responseHeader, CFileItem fileToPlay(location, false); fileToPlay.SetProperty("StartPercent", position*100.0f); ServerInstance->AnnounceToClients(EVENT_LOADING); @@ -4567,13 +4567,13 @@ index 127a765..13b7ead 100644 } } -- -1.9.1 +1.9.3 -From 27c8db174cbcd49f4f49525c7af1a9702234db22 Mon Sep 17 00:00:00 2001 +From 26fc732b89630fea2585b8fde188418aa68afea2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Jan 2014 13:11:06 +0000 -Subject: [PATCH 27/87] [rbp] Give plugins omxplayer when they request +Subject: [PATCH 27/83] [rbp] Give plugins omxplayer when they request dvdplayer on pi --- @@ -4581,10 +4581,10 @@ Subject: [PATCH 27/87] [rbp] Give plugins omxplayer when they request 1 file changed, 4 insertions(+) diff --git a/xbmc/interfaces/legacy/ModuleXbmc.cpp b/xbmc/interfaces/legacy/ModuleXbmc.cpp -index 16f0174..b172d47 100644 +index cf6693c..1170189 100644 --- a/xbmc/interfaces/legacy/ModuleXbmc.cpp +++ b/xbmc/interfaces/legacy/ModuleXbmc.cpp -@@ -536,7 +536,11 @@ namespace XBMCAddon +@@ -530,7 +530,11 @@ namespace XBMCAddon int getPLAYLIST_MUSIC() { return PLAYLIST_MUSIC; } int getPLAYLIST_VIDEO() { return PLAYLIST_VIDEO; } int getPLAYER_CORE_AUTO() { return EPC_NONE; } @@ -4597,13 +4597,13 @@ index 16f0174..b172d47 100644 int getPLAYER_CORE_PAPLAYER() { return EPC_PAPLAYER; } int getTRAY_OPEN() { return TRAY_OPEN; } -- -1.9.1 +1.9.3 -From aa43ec56948e31e1b5fa426566d024bf7001df99 Mon Sep 17 00:00:00 2001 +From c45299f967373d7d33cc911dfafef748f8cf4342 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 14 Jan 2014 18:04:07 +0000 -Subject: [PATCH 28/87] [rbp] Allow ALSA to be chosen in addition to Pi sink +Subject: [PATCH 28/83] [rbp] Allow ALSA to be chosen in addition to Pi sink Needs --enable-alsa in ./configure step and alsa support on platform --- @@ -4613,10 +4613,10 @@ Needs --enable-alsa in ./configure step and alsa support on platform 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/configure.in b/configure.in -index 83e2da5..c568fc4 100644 +index 1766ce1..cb4728b 100644 --- a/configure.in +++ b/configure.in -@@ -700,7 +700,6 @@ case $use_platform in +@@ -705,7 +705,6 @@ case $use_platform in use_arch="arm" use_cpu=arm1176jzf-s use_hardcoded_tables="yes" @@ -4625,7 +4625,7 @@ index 83e2da5..c568fc4 100644 AC_DEFINE(HAS_EGLGLES, [1], [Define if supporting EGL based GLES Framebuffer]) USE_OMXLIB=1; AC_DEFINE([HAVE_OMXLIB],[1],["Define to 1 if OMX libs is enabled"]) diff --git a/tools/depends/target/Makefile b/tools/depends/target/Makefile -index 8368a24..c1dc0f3 100644 +index 3e02fc0..eea2a06 100644 --- a/tools/depends/target/Makefile +++ b/tools/depends/target/Makefile @@ -57,10 +57,11 @@ LINUX_SYSTEM_LIBS= @@ -4692,13 +4692,13 @@ index e493123..7df6807 100644 info.m_deviceInfoList.clear(); -- -1.9.1 +1.9.3 -From 7bcdcbaa9fcdcdbfc03340464fce93e741887460 Mon Sep 17 00:00:00 2001 +From 8473f6c8e9f065966faf6b12803ad123c92d3f7a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 16 Jan 2014 01:39:29 +0000 -Subject: [PATCH 29/87] [omxcodec] Add hardware decode to dvdplayer for Pi +Subject: [PATCH 29/83] [omxcodec] Add hardware decode to dvdplayer for Pi Hijack the abandoned OpenMaxVideo codec --- @@ -4724,10 +4724,10 @@ Hijack the abandoned OpenMaxVideo codec delete mode 100644 xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMax.h diff --git a/configure.in b/configure.in -index c568fc4..ebef6f4 100644 +index cb4728b..66ddeb9 100644 --- a/configure.in +++ b/configure.in -@@ -1961,9 +1961,24 @@ if test "$host_vendor" = "apple" ; then +@@ -1947,9 +1947,24 @@ if test "$host_vendor" = "apple" ; then USE_OPENMAX=0 AC_MSG_NOTICE($openmax_disabled) elif test "$target_platform" = "target_raspberry_pi"; then @@ -4858,10 +4858,10 @@ index 402093d..b61f616 100644 if ( (pCodec = OpenCodec(new CDVDVideoCodecOpenMax(), hint, options)) ) return pCodec; } diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -index 1553789..73ed571 100644 +index 741017d..7daed00 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -@@ -46,9 +46,7 @@ struct DVDCodecAvailableType +@@ -48,9 +48,7 @@ struct DVDCodecAvailableType namespace DXVA { class CSurfaceContext; } namespace VAAPI { struct CHolder; } namespace VDPAU { class CVdpauRenderPicture; } @@ -4872,7 +4872,7 @@ index 1553789..73ed571 100644 class CDVDVideoCodecStageFright; class CDVDMediaCodecInfo; typedef void* EGLImageKHR; -@@ -77,8 +75,7 @@ struct DVDVideoPicture +@@ -79,8 +77,7 @@ struct DVDVideoPicture }; struct { @@ -7751,13 +7751,13 @@ index 1b24fc1..2f1e8a9 100644 bool Deinitialize(); -- -1.9.1 +1.9.3 -From c527c16fd94d84b7b81f54b3d996decaf67d2e82 Mon Sep 17 00:00:00 2001 +From 660f02293891e09419be65ecb68aa8bc7495e8fd Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 20 Jan 2014 16:03:40 +0000 -Subject: [PATCH 30/87] [omxcodec] Enable for dvd menus +Subject: [PATCH 30/83] [omxcodec] Enable for dvd menus --- xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp | 4 ++++ @@ -7779,13 +7779,13 @@ index b61f616..526581a 100644 { // If dvd is an mpeg2 and hint.stills -- -1.9.1 +1.9.3 -From b4a4cd596d65b7355098492568f8b424aba2a2d8 Mon Sep 17 00:00:00 2001 +From e7de1e07ab547617f9a625505a1779f17047591b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Feb 2014 22:27:44 +0000 -Subject: [PATCH 31/87] [omxcodec] Add omx specific texture +Subject: [PATCH 31/83] [omxcodec] Add omx specific texture create/upload/delete functions --- @@ -7860,13 +7860,13 @@ index 5a6a2be..52df291 100644 // renderers -- -1.9.1 +1.9.3 -From e46397b416451151da2a2bb768707de48b3175db Mon Sep 17 00:00:00 2001 +From 5ef286e734b1ac596ab1a9799dc6dbcfd55f180f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Feb 2014 22:50:43 +0000 -Subject: [PATCH 32/87] [omxcodec] Add shared pointer to delay shutdown of +Subject: [PATCH 32/83] [omxcodec] Add shared pointer to delay shutdown of codec until buffers are returned --- @@ -8044,13 +8044,13 @@ index 9079c13..0975e8a 100644 std::queue m_dts_queue; std::queue m_demux_queue; -- -1.9.1 +1.9.3 -From 83c560df919718abc94bf52de8716be3e674b044 Mon Sep 17 00:00:00 2001 +From 1948299e952d200e7246d281dc76f2fb0e8eb5cd Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Feb 2014 23:11:31 +0000 -Subject: [PATCH 33/87] [omxcodec] Fix for aspect ratio in non-square pixel +Subject: [PATCH 33/83] [omxcodec] Fix for aspect ratio in non-square pixel modes --- @@ -8136,13 +8136,13 @@ index 0975e8a..9138a20 100644 bool m_port_settings_changed; const char *m_pFormatName; -- -1.9.1 +1.9.3 -From e20efe786e192af041bda157f02a26ea391d26ee Mon Sep 17 00:00:00 2001 +From 03f2627fdece679f63571be0670977f61492f82c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Feb 2014 23:19:22 +0000 -Subject: [PATCH 34/87] [omxcodec] Report error when codec not enabled +Subject: [PATCH 34/83] [omxcodec] Report error when codec not enabled --- xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp | 10 +++++++++- @@ -8184,13 +8184,13 @@ index 7e23c87..2ae722b 100644 if (!m_omx_decoder.Initialize("OMX.broadcom.video_decode", OMX_IndexParamVideoInit)) { -- -1.9.1 +1.9.3 -From 8f7705c208256a45801ddfb1970a53ba9e673a44 Mon Sep 17 00:00:00 2001 +From 29821d2bc9e7f8ecd5370c72faa228cf58ca19cb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 4 Feb 2014 17:29:37 +0000 -Subject: [PATCH 35/87] [omxcodec] Add deinterlace support +Subject: [PATCH 35/83] [omxcodec] Add deinterlace support --- xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp | 2 +- @@ -8424,406 +8424,13 @@ index 9138a20..c8ad4d8 100644 bool SendDecoderConfig(uint8_t *extradata, int extrasize); bool NaluFormatStartCodes(enum AVCodecID codec, uint8_t *extradata, int extrasize); -- -1.9.1 +1.9.3 -From 2a78b3f85aa987b7cc86de6cd9854088d6ccfd09 Mon Sep 17 00:00:00 2001 -From: Ben Avison -Date: Wed, 12 Feb 2014 18:43:14 +0000 -Subject: [PATCH 36/87] Improved file buffering in CArchive. - -CArchive already did some file buffering, but only on writes. Added the -equivalent code for reads. Also improved the write buffer case so that it -only ever issues sector-aligned writes (the read code does this from the -start). Shuffled various bits of code into the header file to squeeze a bit -more performance out of it. - -Profiled the effect on CFileItemList::Archive(), which is one of the slow -parts of the process of reopening a media library, on a non-overclocked -Raspberry Pi. Times are in seconds: - -TV shows (253 items) - -Before After -Mean StdDev Mean StdDev Confidence Change -0.394 0.005 0.151 0.005 100.0% +159.8% - -Songs (4115 items) - -Before After -Mean StdDev Mean StdDev Confidence Change -2.931 0.045 0.690 0.019 100.0% +324.4% ---- - xbmc/utils/Archive.cpp | 158 ++++++++++++++++++------------------------------- - xbmc/utils/Archive.h | 130 ++++++++++++++++++++++++++++++++++------ - 2 files changed, 172 insertions(+), 116 deletions(-) - -diff --git a/xbmc/utils/Archive.cpp b/xbmc/utils/Archive.cpp -index 4519e19..b2ad273 100644 ---- a/xbmc/utils/Archive.cpp -+++ b/xbmc/utils/Archive.cpp -@@ -30,24 +30,29 @@ - - using namespace XFILE; - --#define BUFFER_MAX 4096 -- - CArchive::CArchive(CFile* pFile, int mode) - { - m_pFile = pFile; - m_iMode = mode; - -- m_pBuffer = new uint8_t[BUFFER_MAX]; -- memset(m_pBuffer, 0, BUFFER_MAX); -- -- m_BufferPos = 0; -+ m_pBuffer = new uint8_t[CARCHIVE_BUFFER_MAX]; -+ memset(m_pBuffer, 0, CARCHIVE_BUFFER_MAX); -+ if (mode == load) -+ { -+ m_BufferPos = m_pBuffer + CARCHIVE_BUFFER_MAX; -+ m_BufferRemain = 0; -+ } -+ else -+ { -+ m_BufferPos = m_pBuffer; -+ m_BufferRemain = CARCHIVE_BUFFER_MAX; -+ } - } - - CArchive::~CArchive() - { - FlushBuffer(); - delete[] m_pBuffer; -- m_BufferPos = 0; - } - - void CArchive::Close() -@@ -214,89 +219,6 @@ CArchive& CArchive::operator<<(const std::vector& iArray) - return *this; - } - --inline CArchive& CArchive::streamout(const void* dataPtr, size_t size) --{ -- const uint8_t* ptr = (const uint8_t*)dataPtr; -- -- if (size + m_BufferPos >= BUFFER_MAX) -- { -- FlushBuffer(); -- while (size >= BUFFER_MAX) -- { -- memcpy(m_pBuffer, ptr, BUFFER_MAX); -- m_BufferPos = BUFFER_MAX; -- ptr += BUFFER_MAX; -- size -= BUFFER_MAX; -- FlushBuffer(); -- } -- } -- -- memcpy(m_pBuffer + m_BufferPos, ptr, size); -- m_BufferPos += size; -- -- return *this; --} -- --CArchive& CArchive::operator>>(float& f) --{ -- return streamin(&f, sizeof(f)); --} -- --CArchive& CArchive::operator>>(double& d) --{ -- return streamin(&d, sizeof(d)); --} -- --CArchive& CArchive::operator>>(short int& s) --{ -- return streamin(&s, sizeof(s)); --} -- --CArchive& CArchive::operator>>(unsigned short int& us) --{ -- return streamin(&us, sizeof(us)); --} -- --CArchive& CArchive::operator>>(int& i) --{ -- return streamin(&i, sizeof(i)); --} -- --CArchive& CArchive::operator>>(unsigned int& ui) --{ -- return streamin(&ui, sizeof(ui)); --} -- --CArchive& CArchive::operator>>(long int& l) --{ -- return streamin(&l, sizeof(l)); --} -- --CArchive& CArchive::operator>>(unsigned long int& ul) --{ -- return streamin(&ul, sizeof(ul)); --} -- --CArchive& CArchive::operator>>(long long int& ll) --{ -- return streamin(&ll, sizeof(ll)); --} -- --CArchive& CArchive::operator>>(unsigned long long int& ull) --{ -- return streamin(&ull, sizeof(ull)); --} -- --CArchive& CArchive::operator>>(bool& b) --{ -- return streamin(&b, sizeof(b)); --} -- --CArchive& CArchive::operator>>(char& c) --{ -- return streamin(&c, sizeof(c)); --} -- - CArchive& CArchive::operator>>(std::string& str) - { - size_t iLength = 0; -@@ -450,23 +372,61 @@ CArchive& CArchive::operator>>(std::vector& iArray) - return *this; - } - --inline CArchive& CArchive::streamin(void* dataPtr, const size_t size) -+void CArchive::FlushBuffer() - { -- size_t read = m_pFile->Read(dataPtr, size); -- if (read < size) -+ if (m_iMode == store && m_BufferPos != m_pBuffer) - { -- CLog::Log(LOGERROR, "%s: can't stream out: requested %lu bytes, was read %lu bytes", __FUNCTION__, (unsigned long)size, (unsigned long)read); -- memset(dataPtr, 0, size); -+ m_pFile->Write(m_pBuffer, m_BufferPos - m_pBuffer); -+ m_BufferPos = m_pBuffer; -+ m_BufferRemain = CARCHIVE_BUFFER_MAX; - } -+} - -+CArchive &CArchive::streamout_bufferwrap(const uint8_t *ptr, size_t size) -+{ -+ do -+ { -+ size_t chunkSize = std::min(size, m_BufferRemain); -+ m_BufferPos = std::copy(ptr, ptr + chunkSize, m_BufferPos); -+ ptr += chunkSize; -+ size -= chunkSize; -+ m_BufferRemain -= chunkSize; -+ if (m_BufferRemain == 0) -+ FlushBuffer(); -+ } while (size > 0); - return *this; - } - --void CArchive::FlushBuffer() -+void CArchive::FillBuffer() - { -- if (m_BufferPos > 0) -+ if (m_iMode == load && m_BufferRemain == 0) - { -- m_pFile->Write(m_pBuffer, m_BufferPos); -- m_BufferPos = 0; -+ m_BufferRemain = m_pFile->Read(m_pBuffer, CARCHIVE_BUFFER_MAX); -+ m_BufferPos = m_pBuffer; - } - } -+ -+CArchive &CArchive::streamin_bufferwrap(uint8_t *ptr, size_t size) -+{ -+ uint8_t *orig_ptr = ptr; -+ size_t orig_size = size; -+ do -+ { -+ if (m_BufferRemain == 0) -+ { -+ FillBuffer(); -+ if (m_BufferRemain < CARCHIVE_BUFFER_MAX && m_BufferRemain < size) -+ { -+ CLog::Log(LOGERROR, "%s: can't stream in: requested %lu bytes, was read %lu bytes", __FUNCTION__, (unsigned long) orig_size, (unsigned long) (ptr - orig_ptr + m_BufferRemain)); -+ memset(orig_ptr, 0, orig_size); -+ return *this; -+ } -+ } -+ size_t chunkSize = std::min(size, m_BufferRemain); -+ ptr = std::copy(m_BufferPos, m_BufferPos + chunkSize, ptr); -+ m_BufferPos += chunkSize; -+ m_BufferRemain -= chunkSize; -+ size -= chunkSize; -+ } while (size > 0); -+ return *this; -+} -diff --git a/xbmc/utils/Archive.h b/xbmc/utils/Archive.h -index 0148fcb..5b25be5 100644 ---- a/xbmc/utils/Archive.h -+++ b/xbmc/utils/Archive.h -@@ -24,6 +24,8 @@ - #include - #include "PlatformDefs.h" // for SYSTEMTIME - -+#define CARCHIVE_BUFFER_MAX 4096 -+ - namespace XFILE - { - class CFile; -@@ -77,18 +79,66 @@ class CArchive - CArchive& operator<<(const std::vector& iArray); - - // loading -- CArchive& operator>>(float& f); -- CArchive& operator>>(double& d); -- CArchive& operator>>(short int& s); -- CArchive& operator>>(unsigned short int& us); -- CArchive& operator>>(int& i); -- CArchive& operator>>(unsigned int& ui); -- CArchive& operator>>(long int& l); -- CArchive& operator>>(unsigned long int& ul); -- CArchive& operator>>(long long int& ll); -- CArchive& operator>>(unsigned long long int& ull); -- CArchive& operator>>(bool& b); -- CArchive& operator>>(char& c); -+ inline CArchive& operator>>(float& f) -+ { -+ return streamin(&f, sizeof(f)); -+ } -+ -+ inline CArchive& operator>>(double& d) -+ { -+ return streamin(&d, sizeof(d)); -+ } -+ -+ inline CArchive& operator>>(short int& s) -+ { -+ return streamin(&s, sizeof(s)); -+ } -+ -+ inline CArchive& operator>>(unsigned short int& us) -+ { -+ return streamin(&us, sizeof(us)); -+ } -+ -+ inline CArchive& operator>>(int& i) -+ { -+ return streamin(&i, sizeof(i)); -+ } -+ -+ inline CArchive& operator>>(unsigned int& ui) -+ { -+ return streamin(&ui, sizeof(ui)); -+ } -+ -+ inline CArchive& operator>>(long int& l) -+ { -+ return streamin(&l, sizeof(l)); -+ } -+ -+ inline CArchive& operator>>(unsigned long int& ul) -+ { -+ return streamin(&ul, sizeof(ul)); -+ } -+ -+ inline CArchive& operator>>(long long int& ll) -+ { -+ return streamin(&ll, sizeof(ll)); -+ } -+ -+ inline CArchive& operator>>(unsigned long long int& ull) -+ { -+ return streamin(&ull, sizeof(ull)); -+ } -+ -+ inline CArchive& operator>>(bool& b) -+ { -+ return streamin(&b, sizeof(b)); -+ } -+ -+ inline CArchive& operator>>(char& c) -+ { -+ return streamin(&c, sizeof(c)); -+ } -+ - CArchive& operator>>(std::string &str); - CArchive& operator>>(std::wstring& wstr); - CArchive& operator>>(SYSTEMTIME& time); -@@ -105,12 +155,58 @@ class CArchive - enum Mode {load = 0, store}; - - protected: -- CArchive& streamout(const void* dataPtr, size_t size); -- CArchive& streamin(void* dataPtr, const size_t size); -- void FlushBuffer(); -+ inline CArchive &streamout(const void *dataPtr, size_t size) -+ { -+ const uint8_t *ptr = (const uint8_t *) dataPtr; -+ /* Note, the buffer is flushed as soon as it is full (m_BufferRemain == size) rather -+ * than waiting until we attempt to put more data into an already full buffer */ -+ if (m_BufferRemain > size) -+ { -+ switch (size) -+ { -+ case 1: *m_BufferPos++ = *ptr; m_BufferRemain--; break; -+ case 2: *(uint16_t *) m_BufferPos = *(const uint16_t *) ptr; m_BufferPos += 2; m_BufferRemain -= 2; break; -+ case 4: *(uint32_t *) m_BufferPos = *(const uint32_t *) ptr; m_BufferPos += 4; m_BufferRemain -= 4; break; -+ default: m_BufferPos = std::copy(ptr, ptr + size, m_BufferPos); m_BufferRemain -= size; break; -+ } -+ return *this; -+ } -+ else -+ { -+ return streamout_bufferwrap(ptr, size); -+ } -+ } -+ -+ inline CArchive &streamin(void *dataPtr, size_t size) -+ { -+ uint8_t *ptr = (uint8_t *) dataPtr; -+ /* Note, refilling the buffer is deferred until we know we need to read more from it */ -+ if (m_BufferRemain >= size) -+ { -+ switch (size) -+ { -+ case 1: *ptr = *m_BufferPos++; m_BufferRemain--; break; -+ case 2: *(uint16_t *) ptr = *(const uint16_t *) m_BufferPos; m_BufferPos += 2; m_BufferRemain -= 2; break; -+ case 4: *(uint32_t *) ptr = *(const uint32_t *) m_BufferPos; m_BufferPos += 4; m_BufferRemain -= 4; break; -+ default: std::copy(m_BufferPos, m_BufferPos + size, ptr); m_BufferPos += size; m_BufferRemain -= size; break; -+ } -+ return *this; -+ } -+ else -+ { -+ return streamin_bufferwrap(ptr, size); -+ } -+ } -+ - XFILE::CFile* m_pFile; - int m_iMode; - uint8_t *m_pBuffer; -- int m_BufferPos; --}; -+ uint8_t *m_BufferPos; -+ size_t m_BufferRemain; - -+private: -+ void FlushBuffer(); -+ CArchive &streamout_bufferwrap(const uint8_t *ptr, size_t size); -+ void FillBuffer(); -+ CArchive &streamin_bufferwrap(uint8_t *ptr, size_t size); -+}; --- -1.9.1 - - -From 99c624097e21b95d144a5770120177f01fb7fda1 Mon Sep 17 00:00:00 2001 +From a5680463506e0115aa646635122b05aa3bb01243 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 5 Feb 2014 11:46:33 +0000 -Subject: [PATCH 37/87] [rbp/settings] Allow av sync type to be enabled +Subject: [PATCH 36/83] [rbp/settings] Allow av sync type to be enabled It works for dvdplayer --- @@ -8849,13 +8456,79 @@ index 2b7d0a6..1429256 100644 false -- -1.9.1 +1.9.3 -From 439af01f645e7bba8699fc5a3554649f542a8896 Mon Sep 17 00:00:00 2001 +From 0dad6fb7d5bece6e8c08312f5c2214562691909b Mon Sep 17 00:00:00 2001 +From: Ben Avison +Date: Thu, 1 May 2014 16:28:39 +0100 +Subject: [PATCH 37/83] 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 +byte loads/stores are encountered in cases where the size is *not* +determinable at compile time is still high enough that it's worth handling +these specially. On the ARM1176JZF-S in the Raspberry Pi, this improves the +total time to open a library (in the case where it's fetched from a CArchive) +by around 4%. + +It should be noted that this code uses 16-bit and 32-bit word loads and +stores that are not necessarily aligned to their respective widths. It is +possible that there are some architectures out there which do not support +this, although all ARMs since ARMv6 have supported it (and ARMs earlier than +that are probably not powerful enough to be good targets for XBMC). +--- + xbmc/utils/Archive.h | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/xbmc/utils/Archive.h b/xbmc/utils/Archive.h +index 1618237..d525761 100644 +--- a/xbmc/utils/Archive.h ++++ b/xbmc/utils/Archive.h +@@ -154,9 +154,17 @@ class CArchive + * than waiting until we attempt to put more data into an already full buffer */ + if (m_BufferRemain > size) + { ++ switch (size) ++ { ++ case 1: *m_BufferPos++ = *ptr; m_BufferRemain--; break; ++ case 2: *(uint16_t *) m_BufferPos = *(const uint16_t *) ptr; m_BufferPos += 2; m_BufferRemain -= 2; break; ++ case 4: *(uint32_t *) m_BufferPos = *(const uint32_t *) ptr; m_BufferPos += 4; m_BufferRemain -= 4; break; ++ default: + memcpy(m_BufferPos, ptr, size); + m_BufferPos += size; + m_BufferRemain -= size; ++ break; ++ } + return *this; + } + else +@@ -171,9 +179,17 @@ class CArchive + /* Note, refilling the buffer is deferred until we know we need to read more from it */ + if (m_BufferRemain >= size) + { ++ switch (size) ++ { ++ case 1: *ptr = *m_BufferPos++; m_BufferRemain--; break; ++ case 2: *(uint16_t *) ptr = *(const uint16_t *) m_BufferPos; m_BufferPos += 2; m_BufferRemain -= 2; break; ++ case 4: *(uint32_t *) ptr = *(const uint32_t *) m_BufferPos; m_BufferPos += 4; m_BufferRemain -= 4; break; ++ default: + memcpy(ptr, m_BufferPos, size); + m_BufferPos += size; + m_BufferRemain -= size; ++ break; ++ } + return *this; + } + else +-- +1.9.3 + + +From 76c2fe5d00ab298f61e63d62ddd2f1965a78c7a1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 16 Feb 2014 17:38:05 +0000 -Subject: [PATCH 38/87] [omxcodec] Only do essential calls in texture thread +Subject: [PATCH 38/83] [omxcodec] Only do essential calls in texture thread [omxcodec] Fix for files with no valid pts values. [omxcodec] Fix stall on seek/trickplay - need to reset start flag [omxcodec] Make sure we have a valid context when video decode starts before first fanart is decoded @@ -9202,13 +8875,13 @@ index c8ad4d8..f234f6d 100644 bool SendDecoderConfig(uint8_t *extradata, int extrasize); bool NaluFormatStartCodes(enum AVCodecID codec, uint8_t *extradata, int extrasize); -- -1.9.1 +1.9.3 -From 80ec3ffe4da3e6501d36c31a1afdc74d4ac86e0e Mon Sep 17 00:00:00 2001 +From c5c72dd03675040584b7417bed4301b772a6bd29 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 1 Mar 2014 14:24:08 +0000 -Subject: [PATCH 39/87] [omxplayer] Allow small audio packets to be +Subject: [PATCH 39/83] [omxplayer] Allow small audio packets to be concatenated to make better use of audio fifo Some audio codecs produce small packets which causes a high overhead when submitting to GPU, and doesn't make full use of GPU side buffering. @@ -9225,7 +8898,7 @@ and then deal with the awkardness of concatenated planar formats. 5 files changed, 111 insertions(+), 51 deletions(-) diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp -index 17c7d46..fa8bb15 100644 +index 233dfbc..f9db0f2 100644 --- a/xbmc/cores/omxplayer/OMXAudio.cpp +++ b/xbmc/cores/omxplayer/OMXAudio.cpp @@ -47,6 +47,10 @@ extern "C" { @@ -9623,13 +9296,13 @@ index 8219015..a4c11777 100644 m_audioStats.AddSampleBytes(pkt->iSize); -- -1.9.1 +1.9.3 -From 749b212b143176a8f217bfe1602fdd87e318439d Mon Sep 17 00:00:00 2001 +From a65df8146aca7ac336b211fcdd65b8c26c26cb1f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 5 Mar 2014 22:10:01 +0000 -Subject: [PATCH 40/87] [omxplayer] Use media for determing audio delay and +Subject: [PATCH 40/83] [omxplayer] Use media for determing audio delay and cache time I've also added caching to the call to OMXMediaTime as the GPU round trip is expensive when called too frequently @@ -9640,7 +9313,7 @@ I've also added caching to the call to OMXMediaTime as the GPU round trip is exp 3 files changed, 68 insertions(+), 29 deletions(-) diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp -index fa8bb15..d0d770b 100644 +index f9db0f2..7c7ba25 100644 --- a/xbmc/cores/omxplayer/OMXAudio.cpp +++ b/xbmc/cores/omxplayer/OMXAudio.cpp @@ -1117,29 +1117,40 @@ void COMXAudio::UpdateAttenuation() @@ -9670,7 +9343,7 @@ index fa8bb15..d0d770b 100644 + else // just measure the input fifo + { + unsigned int used = m_omx_decoder.GetInputBufferSize() - m_omx_decoder.GetInputBufferSpace(); -+ float ret = m_InputBytesPerSec ? (float)used / (float)m_InputBytesPerSec : 0.0f; ++ ret = m_InputBytesPerSec ? (float)used / (float)m_InputBytesPerSec : 0.0f; + //CLog::Log(LOGINFO, "%s::%s - %.2f %d, %d, %d", CLASSNAME, __func__, ret, used, m_omx_decoder.GetInputBufferSize(), m_omx_decoder.GetInputBufferSpace()); + } + return ret; @@ -9696,10 +9369,10 @@ index fa8bb15..d0d770b 100644 } diff --git a/xbmc/linux/OMXClock.cpp b/xbmc/linux/OMXClock.cpp -index 241657b..bee7bac 100644 +index 0bc74bb..c631ab6 100644 --- a/xbmc/linux/OMXClock.cpp +++ b/xbmc/linux/OMXClock.cpp -@@ -45,6 +45,8 @@ OMXClock::OMXClock() +@@ -44,6 +44,8 @@ OMXClock::OMXClock() m_eState = OMX_TIME_ClockStateStopped; m_eClock = OMX_TIME_RefClockNone; m_clock = NULL; @@ -9708,7 +9381,7 @@ index 241657b..bee7bac 100644 pthread_mutex_init(&m_lock, NULL); } -@@ -113,6 +115,7 @@ bool OMXClock::OMXSetReferenceClock(bool has_audio, bool lock /* = true */) +@@ -112,6 +114,7 @@ bool OMXClock::OMXSetReferenceClock(bool has_audio, bool lock /* = true */) } m_eClock = refClock.eClock; } @@ -9716,7 +9389,7 @@ index 241657b..bee7bac 100644 if(lock) UnLock(); -@@ -142,6 +145,7 @@ void OMXClock::OMXDeinitialize() +@@ -141,6 +144,7 @@ void OMXClock::OMXDeinitialize() m_omx_clock.Deinitialize(); m_omx_speed = DVD_PLAYSPEED_NORMAL; @@ -9724,7 +9397,7 @@ index 241657b..bee7bac 100644 } bool OMXClock::OMXStateExecute(bool lock /* = true */) -@@ -169,6 +173,7 @@ bool OMXClock::OMXStateExecute(bool lock /* = true */) +@@ -168,6 +172,7 @@ bool OMXClock::OMXStateExecute(bool lock /* = true */) } } @@ -9732,7 +9405,7 @@ index 241657b..bee7bac 100644 if(lock) UnLock(); -@@ -186,6 +191,7 @@ void OMXClock::OMXStateIdle(bool lock /* = true */) +@@ -185,6 +190,7 @@ void OMXClock::OMXStateIdle(bool lock /* = true */) if(m_omx_clock.GetState() != OMX_StateIdle) m_omx_clock.SetStateForComponent(OMX_StateIdle); @@ -9740,7 +9413,7 @@ index 241657b..bee7bac 100644 if(lock) UnLock(); } -@@ -222,6 +228,7 @@ bool OMXClock::OMXStop(bool lock /* = true */) +@@ -221,6 +227,7 @@ bool OMXClock::OMXStop(bool lock /* = true */) } m_eState = clock.eState; @@ -9748,7 +9421,7 @@ index 241657b..bee7bac 100644 if(lock) UnLock(); -@@ -252,6 +259,7 @@ bool OMXClock::OMXStep(int steps /* = 1 */, bool lock /* = true */) +@@ -251,6 +258,7 @@ bool OMXClock::OMXStep(int steps /* = 1 */, bool lock /* = true */) return false; } @@ -9756,7 +9429,7 @@ index 241657b..bee7bac 100644 if(lock) UnLock(); -@@ -302,6 +310,7 @@ bool OMXClock::OMXReset(bool has_video, bool has_audio, bool lock /* = true */) +@@ -301,6 +309,7 @@ bool OMXClock::OMXReset(bool has_video, bool has_audio, bool lock /* = true */) } } @@ -9764,7 +9437,7 @@ index 241657b..bee7bac 100644 if(lock) UnLock(); -@@ -310,33 +319,45 @@ bool OMXClock::OMXReset(bool has_video, bool has_audio, bool lock /* = true */) +@@ -309,33 +318,45 @@ bool OMXClock::OMXReset(bool has_video, bool has_audio, bool lock /* = true */) double OMXClock::OMXMediaTime(bool lock /* = true */) { @@ -9828,7 +9501,7 @@ index 241657b..bee7bac 100644 return pts; } -@@ -409,6 +430,7 @@ bool OMXClock::OMXMediaTime(double pts, bool lock /* = true*/) +@@ -408,6 +429,7 @@ bool OMXClock::OMXMediaTime(double pts, bool lock /* = true*/) CLog::Log(LOGDEBUG, "OMXClock::OMXMediaTime set config %s = %.2f", index == OMX_IndexConfigTimeCurrentAudioReference ? "OMX_IndexConfigTimeCurrentAudioReference":"OMX_IndexConfigTimeCurrentVideoReference", pts); @@ -9836,7 +9509,7 @@ index 241657b..bee7bac 100644 if(lock) UnLock(); -@@ -428,6 +450,7 @@ bool OMXClock::OMXPause(bool lock /* = true */) +@@ -427,6 +449,7 @@ bool OMXClock::OMXPause(bool lock /* = true */) if (OMXSetSpeed(0, false, true)) m_pause = true; @@ -9844,7 +9517,7 @@ index 241657b..bee7bac 100644 if(lock) UnLock(); } -@@ -447,6 +470,7 @@ bool OMXClock::OMXResume(bool lock /* = true */) +@@ -446,6 +469,7 @@ bool OMXClock::OMXResume(bool lock /* = true */) if (OMXSetSpeed(m_omx_speed, false, true)) m_pause = false; @@ -9852,7 +9525,7 @@ index 241657b..bee7bac 100644 if(lock) UnLock(); } -@@ -485,6 +509,7 @@ bool OMXClock::OMXSetSpeed(int speed, bool lock /* = true */, bool pause_resume +@@ -484,6 +508,7 @@ bool OMXClock::OMXSetSpeed(int speed, bool lock /* = true */, bool pause_resume if (!pause_resume) m_omx_speed = speed; @@ -9860,7 +9533,7 @@ index 241657b..bee7bac 100644 if(lock) UnLock(); -@@ -521,6 +546,7 @@ bool OMXClock::HDMIClockSync(bool lock /* = true */) +@@ -520,6 +545,7 @@ bool OMXClock::HDMIClockSync(bool lock /* = true */) return false; } @@ -9869,10 +9542,10 @@ index 241657b..bee7bac 100644 UnLock(); diff --git a/xbmc/linux/OMXClock.h b/xbmc/linux/OMXClock.h -index d7d06fe..f83074a 100644 +index ccc277e..7bb6d4d 100644 --- a/xbmc/linux/OMXClock.h +++ b/xbmc/linux/OMXClock.h -@@ -58,6 +58,8 @@ class OMXClock +@@ -57,6 +57,8 @@ class OMXClock CDVDClock *m_clock; private: COMXCoreComponent m_omx_clock; @@ -9882,367 +9555,13 @@ index d7d06fe..f83074a 100644 OMXClock(); ~OMXClock(); -- -1.9.1 +1.9.3 -From 9cebd355dd66bf326c79bb17b2ac68edbcbfa7ca Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 3 Mar 2014 22:24:19 +0000 -Subject: [PATCH 41/87] [omx] Skip the resize when not needed when decoding - jpegs - -The decode to texture path almost always uses cached jpegs that are the correct size, so the resize is rarely needed. -The re-enc path usually needs resizing, but may not where the source is small. - -Skipping the resize stage saves a little time and memory on GPU and also saves some setup time. ---- - xbmc/cores/omxplayer/OMXImage.cpp | 262 ++++++++++++++++++++++---------------- - 1 file changed, 152 insertions(+), 110 deletions(-) - -diff --git a/xbmc/cores/omxplayer/OMXImage.cpp b/xbmc/cores/omxplayer/OMXImage.cpp -index 4456fdb..262a004 100644 ---- a/xbmc/cores/omxplayer/OMXImage.cpp -+++ b/xbmc/cores/omxplayer/OMXImage.cpp -@@ -1477,9 +1477,22 @@ bool COMXImageReEnc::HandlePortSettingChange(unsigned int resize_width, unsigned - return false; - } - -+ if (resize_width != port_def.format.image.nFrameWidth || resize_height != port_def.format.image.nFrameHeight || (orientation & 4)) -+ { -+ if(!m_omx_resize.Initialize("OMX.broadcom.resize", OMX_IndexParamImageInit)) -+ { -+ CLog::Log(LOGERROR, "%s::%s error m_omx_resize.Initialize\n", CLASSNAME, __func__); -+ return false; -+ } -+ } -+ - // TODO: jpeg decoder can decimate by factors of 2 - port_def.format.image.eColorFormat = OMX_COLOR_FormatYUV420PackedPlanar; -- port_def.format.image.nSliceHeight = 16;//(port_def.format.image.nFrameHeight+15) & ~15; -+ if (m_omx_resize.IsInitialized()) -+ port_def.format.image.nSliceHeight = 16; -+ else -+ port_def.format.image.nSliceHeight = (resize_height+15) & ~15; -+ - port_def.format.image.nStride = 0; - - m_omx_decoder.SetParameter(OMX_IndexParamPortDefinition, &port_def); -@@ -1489,38 +1502,35 @@ bool COMXImageReEnc::HandlePortSettingChange(unsigned int resize_width, unsigned - return false; - } - -- if(!m_omx_resize.Initialize("OMX.broadcom.resize", OMX_IndexParamImageInit)) -+ if (m_omx_resize.IsInitialized()) - { -- CLog::Log(LOGERROR, "%s::%s error m_omx_resize.Initialize\n", CLASSNAME, __func__); -- return false; -- } -- -- port_def.nPortIndex = m_omx_resize.GetInputPort(); -+ port_def.nPortIndex = m_omx_resize.GetInputPort(); - -- m_omx_resize.SetParameter(OMX_IndexParamPortDefinition, &port_def); -- if(omx_err != OMX_ErrorNone) -- { -- CLog::Log(LOGERROR, "%s::%s m_omx_resize.SetParameter result(0x%x)\n", CLASSNAME, __func__, omx_err); -- return false; -- } -+ m_omx_resize.SetParameter(OMX_IndexParamPortDefinition, &port_def); -+ if(omx_err != OMX_ErrorNone) -+ { -+ CLog::Log(LOGERROR, "%s::%s m_omx_resize.SetParameter result(0x%x)\n", CLASSNAME, __func__, omx_err); -+ return false; -+ } - -- port_def.nPortIndex = m_omx_resize.GetOutputPort(); -- m_omx_resize.GetParameter(OMX_IndexParamPortDefinition, &port_def); -- if(omx_err != OMX_ErrorNone) -- { -- CLog::Log(LOGERROR, "%s::%s m_omx_resize.GetParameter result(0x%x)\n", CLASSNAME, __func__, omx_err); -- return false; -- } -- port_def.format.image.eColorFormat = OMX_COLOR_FormatYUV420PackedPlanar; -- port_def.format.image.nFrameWidth = resize_width; -- port_def.format.image.nFrameHeight = resize_height; -- port_def.format.image.nSliceHeight = (resize_height+15) & ~15; -- port_def.format.image.nStride = 0; -- m_omx_resize.SetParameter(OMX_IndexParamPortDefinition, &port_def); -- if(omx_err != OMX_ErrorNone) -- { -- CLog::Log(LOGERROR, "%s::%s m_omx_resize.SetParameter result(0x%x)\n", CLASSNAME, __func__, omx_err); -- return false; -+ port_def.nPortIndex = m_omx_resize.GetOutputPort(); -+ m_omx_resize.GetParameter(OMX_IndexParamPortDefinition, &port_def); -+ if(omx_err != OMX_ErrorNone) -+ { -+ CLog::Log(LOGERROR, "%s::%s m_omx_resize.GetParameter result(0x%x)\n", CLASSNAME, __func__, omx_err); -+ return false; -+ } -+ port_def.format.image.eColorFormat = OMX_COLOR_FormatYUV420PackedPlanar; -+ port_def.format.image.nFrameWidth = resize_width; -+ port_def.format.image.nFrameHeight = resize_height; -+ port_def.format.image.nSliceHeight = (resize_height+15) & ~15; -+ port_def.format.image.nStride = 0; -+ m_omx_resize.SetParameter(OMX_IndexParamPortDefinition, &port_def); -+ if(omx_err != OMX_ErrorNone) -+ { -+ CLog::Log(LOGERROR, "%s::%s m_omx_resize.SetParameter result(0x%x)\n", CLASSNAME, __func__, omx_err); -+ return false; -+ } - } - - if(!m_omx_encoder.Initialize("OMX.broadcom.image_encode", OMX_IndexParamImageInit)) -@@ -1621,31 +1631,44 @@ bool COMXImageReEnc::HandlePortSettingChange(unsigned int resize_width, unsigned - return false; - } - -- m_omx_tunnel_decode.Initialize(&m_omx_decoder, m_omx_decoder.GetOutputPort(), &m_omx_resize, m_omx_resize.GetInputPort()); -- -- omx_err = m_omx_tunnel_decode.Establish(); -- if(omx_err != OMX_ErrorNone) -+ if (m_omx_resize.IsInitialized()) - { -- CLog::Log(LOGERROR, "%s::%s m_omx_tunnel_decode.Establish\n", CLASSNAME, __func__); -- return false; -- } -+ m_omx_tunnel_decode.Initialize(&m_omx_decoder, m_omx_decoder.GetOutputPort(), &m_omx_resize, m_omx_resize.GetInputPort()); - -- m_omx_tunnel_resize.Initialize(&m_omx_resize, m_omx_resize.GetOutputPort(), &m_omx_encoder, m_omx_encoder.GetInputPort()); -+ omx_err = m_omx_tunnel_decode.Establish(); -+ if(omx_err != OMX_ErrorNone) -+ { -+ CLog::Log(LOGERROR, "%s::%s m_omx_tunnel_decode.Establish\n", CLASSNAME, __func__); -+ return false; -+ } - -- omx_err = m_omx_tunnel_resize.Establish(); -- if(omx_err != OMX_ErrorNone) -- { -- CLog::Log(LOGERROR, "%s::%s m_omx_tunnel_resize.Establish\n", CLASSNAME, __func__); -- return false; -- } -+ m_omx_tunnel_resize.Initialize(&m_omx_resize, m_omx_resize.GetOutputPort(), &m_omx_encoder, m_omx_encoder.GetInputPort()); - -- omx_err = m_omx_resize.SetStateForComponent(OMX_StateExecuting); -- if(omx_err != OMX_ErrorNone) -- { -- CLog::Log(LOGERROR, "%s::%s m_omx_resize.SetStateForComponent result(0x%x)\n", CLASSNAME, __func__, omx_err); -- return false; -+ omx_err = m_omx_tunnel_resize.Establish(); -+ if(omx_err != OMX_ErrorNone) -+ { -+ CLog::Log(LOGERROR, "%s::%s m_omx_tunnel_resize.Establish\n", CLASSNAME, __func__); -+ return false; -+ } -+ -+ omx_err = m_omx_resize.SetStateForComponent(OMX_StateExecuting); -+ if(omx_err != OMX_ErrorNone) -+ { -+ CLog::Log(LOGERROR, "%s::%s m_omx_resize.SetStateForComponent result(0x%x)\n", CLASSNAME, __func__, omx_err); -+ return false; -+ } - } -+ else -+ { -+ m_omx_tunnel_decode.Initialize(&m_omx_decoder, m_omx_decoder.GetOutputPort(), &m_omx_encoder, m_omx_encoder.GetInputPort()); - -+ omx_err = m_omx_tunnel_decode.Establish(); -+ if(omx_err != OMX_ErrorNone) -+ { -+ CLog::Log(LOGERROR, "%s::%s m_omx_tunnel_decode.Establish\n", CLASSNAME, __func__); -+ return false; -+ } -+ } - omx_err = m_omx_encoder.SetStateForComponent(OMX_StateExecuting); - if (omx_err != OMX_ErrorNone) - { -@@ -1662,24 +1685,27 @@ bool COMXImageReEnc::HandlePortSettingChange(unsigned int resize_width, unsigned - // a little surprising, make a note - CLog::Log(LOGDEBUG, "%s::%s m_omx_resize second port changed event\n", CLASSNAME, __func__); - m_omx_decoder.DisablePort(m_omx_decoder.GetOutputPort(), true); -- m_omx_resize.DisablePort(m_omx_resize.GetInputPort(), true); -+ if (m_omx_resize.IsInitialized()) -+ { -+ m_omx_resize.DisablePort(m_omx_resize.GetInputPort(), true); - -- OMX_PARAM_PORTDEFINITIONTYPE port_def; -- OMX_INIT_STRUCTURE(port_def); -+ OMX_PARAM_PORTDEFINITIONTYPE port_def; -+ OMX_INIT_STRUCTURE(port_def); - -- port_def.nPortIndex = m_omx_decoder.GetOutputPort(); -- m_omx_decoder.GetParameter(OMX_IndexParamPortDefinition, &port_def); -- port_def.nPortIndex = m_omx_resize.GetInputPort(); -- m_omx_resize.SetParameter(OMX_IndexParamPortDefinition, &port_def); -+ port_def.nPortIndex = m_omx_decoder.GetOutputPort(); -+ m_omx_decoder.GetParameter(OMX_IndexParamPortDefinition, &port_def); -+ port_def.nPortIndex = m_omx_resize.GetInputPort(); -+ m_omx_resize.SetParameter(OMX_IndexParamPortDefinition, &port_def); - -- omx_err = m_omx_resize.WaitForEvent(OMX_EventPortSettingsChanged); -- if(omx_err != OMX_ErrorNone) -- { -- CLog::Log(LOGERROR, "%s::%s m_omx_resize.WaitForEvent=%x\n", CLASSNAME, __func__, omx_err); -- return false; -+ omx_err = m_omx_resize.WaitForEvent(OMX_EventPortSettingsChanged); -+ if(omx_err != OMX_ErrorNone) -+ { -+ CLog::Log(LOGERROR, "%s::%s m_omx_resize.WaitForEvent=%x\n", CLASSNAME, __func__, omx_err); -+ return false; -+ } -+ m_omx_resize.EnablePort(m_omx_resize.GetInputPort(), true); - } - m_omx_decoder.EnablePort(m_omx_decoder.GetOutputPort(), true); -- m_omx_resize.EnablePort(m_omx_resize.GetInputPort(), true); - } - return true; - } -@@ -1918,42 +1944,45 @@ bool COMXTexture::HandlePortSettingChange(unsigned int resize_width, unsigned in - CLog::Log(LOGERROR, "%s::%s m_omx_decoder.SetParameter result(0x%x)\n", CLASSNAME, __func__, omx_err); - return false; - } -- -- if (!m_omx_resize.Initialize("OMX.broadcom.resize", OMX_IndexParamImageInit)) -+ if (resize_width != port_def.format.image.nFrameWidth || resize_height != port_def.format.image.nFrameHeight) - { -- CLog::Log(LOGERROR, "%s::%s error m_omx_resize.Initialize", CLASSNAME, __func__); -- return false; -+ if (!m_omx_resize.Initialize("OMX.broadcom.resize", OMX_IndexParamImageInit)) -+ { -+ CLog::Log(LOGERROR, "%s::%s error m_omx_resize.Initialize", CLASSNAME, __func__); -+ return false; -+ } - } -- -- port_def.nPortIndex = m_omx_resize.GetInputPort(); -- -- omx_err = m_omx_resize.SetParameter(OMX_IndexParamPortDefinition, &port_def); -- if (omx_err != OMX_ErrorNone) -+ if (m_omx_resize.IsInitialized()) - { -- CLog::Log(LOGERROR, "%s::%s m_omx_resize.SetParameter result(0x%x)\n", CLASSNAME, __func__, omx_err); -- return false; -- } -+ port_def.nPortIndex = m_omx_resize.GetInputPort(); - -- port_def.nPortIndex = m_omx_resize.GetOutputPort(); -- omx_err = m_omx_resize.GetParameter(OMX_IndexParamPortDefinition, &port_def); -- if (omx_err != OMX_ErrorNone) -- { -- CLog::Log(LOGERROR, "%s::%s m_omx_resize.GetParameter result(0x%x)\n", CLASSNAME, __func__, omx_err); -- return false; -- } -+ omx_err = m_omx_resize.SetParameter(OMX_IndexParamPortDefinition, &port_def); -+ if (omx_err != OMX_ErrorNone) -+ { -+ CLog::Log(LOGERROR, "%s::%s m_omx_resize.SetParameter result(0x%x)\n", CLASSNAME, __func__, omx_err); -+ return false; -+ } - -- port_def.format.image.eColorFormat = OMX_COLOR_FormatYUV420PackedPlanar; -- port_def.format.image.nFrameWidth = resize_width; -- port_def.format.image.nFrameHeight = resize_height; -- port_def.format.image.nSliceHeight = 16; -- port_def.format.image.nStride = 0; -- omx_err = m_omx_resize.SetParameter(OMX_IndexParamPortDefinition, &port_def); -- if (omx_err != OMX_ErrorNone) -- { -- CLog::Log(LOGERROR, "%s::%s m_omx_resize.SetParameter result(0x%x)\n", CLASSNAME, __func__, omx_err); -- return false; -- } -+ port_def.nPortIndex = m_omx_resize.GetOutputPort(); -+ omx_err = m_omx_resize.GetParameter(OMX_IndexParamPortDefinition, &port_def); -+ if (omx_err != OMX_ErrorNone) -+ { -+ CLog::Log(LOGERROR, "%s::%s m_omx_resize.GetParameter result(0x%x)\n", CLASSNAME, __func__, omx_err); -+ return false; -+ } - -+ port_def.format.image.eColorFormat = OMX_COLOR_FormatYUV420PackedPlanar; -+ port_def.format.image.nFrameWidth = resize_width; -+ port_def.format.image.nFrameHeight = resize_height; -+ port_def.format.image.nSliceHeight = 16; -+ port_def.format.image.nStride = 0; -+ omx_err = m_omx_resize.SetParameter(OMX_IndexParamPortDefinition, &port_def); -+ if (omx_err != OMX_ErrorNone) -+ { -+ CLog::Log(LOGERROR, "%s::%s m_omx_resize.SetParameter result(0x%x)\n", CLASSNAME, __func__, omx_err); -+ return false; -+ } -+ } - if (!m_omx_egl_render.Initialize("OMX.broadcom.egl_render", OMX_IndexParamVideoInit)) - { - CLog::Log(LOGERROR, "%s::%s error m_omx_egl_render.Initialize", CLASSNAME, __func__); -@@ -1983,30 +2012,43 @@ bool COMXTexture::HandlePortSettingChange(unsigned int resize_width, unsigned in - CLog::Log(LOGERROR, "%s::%s error m_omx_egl_render.UseEGLImage (%x)", CLASSNAME, __func__, omx_err); - return false; - } -+ if (m_omx_resize.IsInitialized()) -+ { -+ m_omx_tunnel_decode.Initialize(&m_omx_decoder, m_omx_decoder.GetOutputPort(), &m_omx_resize, m_omx_resize.GetInputPort()); - -- m_omx_tunnel_decode.Initialize(&m_omx_decoder, m_omx_decoder.GetOutputPort(), &m_omx_resize, m_omx_resize.GetInputPort()); -+ omx_err = m_omx_tunnel_decode.Establish(); -+ if (omx_err != OMX_ErrorNone) -+ { -+ CLog::Log(LOGERROR, "%s::%s m_omx_tunnel_decode.Establish (%x)", CLASSNAME, __func__, omx_err); -+ return false; -+ } - -- omx_err = m_omx_tunnel_decode.Establish(); -- if (omx_err != OMX_ErrorNone) -- { -- CLog::Log(LOGERROR, "%s::%s m_omx_tunnel_decode.Establish (%x)", CLASSNAME, __func__, omx_err); -- return false; -- } -+ m_omx_tunnel_egl.Initialize(&m_omx_resize, m_omx_resize.GetOutputPort(), &m_omx_egl_render, m_omx_egl_render.GetInputPort()); - -- m_omx_tunnel_egl.Initialize(&m_omx_resize, m_omx_resize.GetOutputPort(), &m_omx_egl_render, m_omx_egl_render.GetInputPort()); -+ omx_err = m_omx_tunnel_egl.Establish(); -+ if (omx_err != OMX_ErrorNone) -+ { -+ CLog::Log(LOGERROR, "%s::%s m_omx_tunnel_egl.Establish (%x)", CLASSNAME, __func__, omx_err); -+ return false; -+ } - -- omx_err = m_omx_tunnel_egl.Establish(); -- if (omx_err != OMX_ErrorNone) -- { -- CLog::Log(LOGERROR, "%s::%s m_omx_tunnel_egl.Establish (%x)", CLASSNAME, __func__, omx_err); -- return false; -+ omx_err = m_omx_resize.SetStateForComponent(OMX_StateExecuting); -+ if (omx_err != OMX_ErrorNone) -+ { -+ CLog::Log(LOGERROR, "%s::%s error m_omx_egl_render.GetParameter (%x)", CLASSNAME, __func__, omx_err); -+ return false; -+ } - } -- -- omx_err = m_omx_resize.SetStateForComponent(OMX_StateExecuting); -- if (omx_err != OMX_ErrorNone) -+ else - { -- CLog::Log(LOGERROR, "%s::%s error m_omx_egl_render.GetParameter (%x)", CLASSNAME, __func__, omx_err); -- return false; -+ m_omx_tunnel_decode.Initialize(&m_omx_decoder, m_omx_decoder.GetOutputPort(), &m_omx_egl_render, m_omx_egl_render.GetInputPort()); -+ -+ omx_err = m_omx_tunnel_decode.Establish(); -+ if (omx_err != OMX_ErrorNone) -+ { -+ CLog::Log(LOGERROR, "%s::%s m_omx_tunnel_decode.Establish (%x)", CLASSNAME, __func__, omx_err); -+ return false; -+ } - } - - omx_err = m_omx_egl_render.SetStateForComponent(OMX_StateExecuting); --- -1.9.1 - - -From a2a208a547f0d81e6032e767a4b21179fa0d8980 Mon Sep 17 00:00:00 2001 +From fd8aa746b60ccff173b9c0e50bb6855bcc8ad70b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 8 Mar 2014 15:36:06 +0000 -Subject: [PATCH 42/87] [hifiberry] Hack: force it to be recognised as IEC958 +Subject: [PATCH 41/83] [hifiberry] Hack: force it to be recognised as IEC958 capable to enable passthrough options --- @@ -10250,7 +9569,7 @@ Subject: [PATCH 42/87] [hifiberry] Hack: force it to be recognised as IEC958 1 file changed, 4 insertions(+) diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp -index b48a4fc..d9897e5 100644 +index 079c46f..eb9b559 100644 --- a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp +++ b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp @@ -932,6 +932,10 @@ void CAESinkALSA::EnumerateDevice(AEDeviceInfoList &list, const std::string &dev @@ -10265,13 +9584,13 @@ index b48a4fc..d9897e5 100644 info.m_displayName.substr(info.m_displayName.size()-5) == " HDMI") { -- -1.9.1 +1.9.3 -From 36f3c9d9c72ee8942dee1ccc2d9f1d3f4c8fee95 Mon Sep 17 00:00:00 2001 +From d293de69125c466ba2d9dc9d9d76853ecdcca1a7 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 11 Mar 2014 18:50:23 +0000 -Subject: [PATCH 43/87] [dvdplayer] Use inexact seeking like omxplayer +Subject: [PATCH 42/83] [dvdplayer] Use inexact seeking like omxplayer --- xbmc/cores/dvdplayer/DVDPlayer.cpp | 11 +++++++++++ @@ -10319,13 +9638,13 @@ index e3dfa2e..6279584 100644 /* call with demuxer pts */ -- -1.9.1 +1.9.3 -From 1585dc00652ac6501ee59731d74995951d3aed03 Mon Sep 17 00:00:00 2001 +From f5e0ceed71fb8e65ef73217e4e6ee4bd0388b40a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 13 Mar 2014 16:08:46 +0000 -Subject: [PATCH 44/87] [omxplayer] Make use of TrueHD fastpath when downmixing +Subject: [PATCH 43/83] [omxplayer] Make use of TrueHD fastpath when downmixing The TrueHD codec actually works in 3 stages. It decodes the downmixed stereo. It then decodes the differences required to produce 5.1. It then decodes the differences required to produce 7.1. @@ -10367,50 +9686,13 @@ index ce8a71d..aac84ad 100644 // vorbis has variable sized planar output, so skip concatenation if (hints.codec == AV_CODEC_ID_VORBIS) -- -1.9.1 +1.9.3 -From e6d81853464525bec4810a4af3789a72348b880f Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sat, 15 Mar 2014 19:38:38 +0000 -Subject: [PATCH 45/87] [omxplayer] When in dual audio mode, make one output - the slave - -May help audio sync between the two outputs ---- - xbmc/cores/omxplayer/OMXAudio.cpp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp -index d0d770b..4e6d5fa 100644 ---- a/xbmc/cores/omxplayer/OMXAudio.cpp -+++ b/xbmc/cores/omxplayer/OMXAudio.cpp -@@ -249,7 +249,7 @@ bool COMXAudio::PortSettingsChanged() - { - // By default audio_render is the clock master, and if output samples don't fit the timestamps, it will speed up/slow down the clock. - // This tends to be better for maintaining audio sync and avoiding audio glitches, but can affect video/display sync -- if(CSettings::Get().GetBool("videoplayer.usedisplayasclock")) -+ if(CSettings::Get().GetBool("videoplayer.usedisplayasclock") || (CSettings::Get().GetBool("audiooutput.dualaudio") && CSettings::Get().GetString("audiooutput.audiodevice") != "PI:Analogue")) - { - OMX_CONFIG_BOOLEANTYPE configBool; - OMX_INIT_STRUCTURE(configBool); -@@ -275,7 +275,7 @@ bool COMXAudio::PortSettingsChanged() - { - // By default audio_render is the clock master, and if output samples don't fit the timestamps, it will speed up/slow down the clock. - // This tends to be better for maintaining audio sync and avoiding audio glitches, but can affect video/display sync -- if(CSettings::Get().GetBool("videoplayer.usedisplayasclock")) -+ if(CSettings::Get().GetBool("videoplayer.usedisplayasclock") || (CSettings::Get().GetBool("audiooutput.dualaudio") && CSettings::Get().GetString("audiooutput.audiodevice") == "PI:Analogue")) - { - OMX_CONFIG_BOOLEANTYPE configBool; - OMX_INIT_STRUCTURE(configBool); --- -1.9.1 - - -From c8ae3845737afc7413eeb2a7775c89aafadc5786 Mon Sep 17 00:00:00 2001 +From 5467f3abd2eb34502d97b61645ed46726aa8522c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 30 Dec 2013 12:02:14 +0000 -Subject: [PATCH 46/87] [rbp] Hardware accelerated resampling +Subject: [PATCH 44/83] [rbp] Hardware accelerated resampling This replaces the format conversion, up/down mixing and resampling code from ActiveAE with a GPU accelerated version. Should significantly reduce CPU when using paplayer or dvdplayer. @@ -11142,7 +10424,7 @@ index 0000000..a72d867 + +} diff --git a/xbmc/cores/AudioEngine/Makefile.in b/xbmc/cores/AudioEngine/Makefile.in -index b49c3cc..2ba50f9 100644 +index c219653..8ef688e 100644 --- a/xbmc/cores/AudioEngine/Makefile.in +++ b/xbmc/cores/AudioEngine/Makefile.in @@ -31,6 +31,7 @@ SRCS += Engines/ActiveAE/ActiveAESink.cpp @@ -11176,13 +10458,13 @@ index 99e407a..8d3c86a 100644 OMX_ERRORTYPE omx_err = OMX_ErrorNone; -- -1.9.1 +1.9.3 -From 070e2679ed5d3ab3a5b44c1a64de9f5810563237 Mon Sep 17 00:00:00 2001 +From 12332808387e5a2b245f94f575349befb11719e3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 27 Mar 2014 00:22:05 +0000 -Subject: [PATCH 47/87] [PiResample] Work around AE not providing correct +Subject: [PATCH 45/83] [PiResample] Work around AE not providing correct src_bits --- @@ -11222,13 +10504,13 @@ index aa6344b..f88b239 100644 if (m_dst_chan_layout == 0) m_dst_chan_layout = av_get_default_channel_layout(m_dst_channels); -- -1.9.1 +1.9.3 -From 0d96c28509139dfb080f2cf7ff7f4a9a17d9bd35 Mon Sep 17 00:00:00 2001 +From eaa971449804b7608855b8fbb456800609f02f14 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 18:19:32 +0100 -Subject: [PATCH 48/87] [rbp/omxplayer] When opening a stream don't try to +Subject: [PATCH 46/83] [rbp/omxplayer] When opening a stream don't try to update gui so often --- @@ -11252,13 +10534,13 @@ index e9ba7d3..0fdc3c2 100644 g_windowManager.ProcessRenderLoop(false); if (allowCancel && dialog->IsCanceled()) -- -1.9.1 +1.9.3 -From c0016265b22990e4b2c0d9dee3a609e67117a89a Mon Sep 17 00:00:00 2001 +From e3909a230e28a861bdd26d24189e2da6ffef2470 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 15:28:57 +0100 -Subject: [PATCH 49/87] [omxcodec] Clamp video texture at edges to avoid image +Subject: [PATCH 47/83] [omxcodec] Clamp video texture at edges to avoid image wrapping --- @@ -11279,13 +10561,13 @@ index 51f56aa..2929a37 100644 g_Windowing.EnableGUIShader(SM_TEXTURE_RGBA); -- -1.9.1 +1.9.3 -From e173bfbb886cf5eff30f8b546111df5ff18afdb0 Mon Sep 17 00:00:00 2001 +From 49ca1a34d169dd31209477da37b88ee226000297 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 17:36:19 +0100 -Subject: [PATCH 50/87] [PiSink] Remove unneeded header and use CAEChannelInfo +Subject: [PATCH 48/83] [PiSink] Remove unneeded header and use CAEChannelInfo directly --- @@ -11358,75 +10640,29 @@ index 9ce00e3..070e6eb 100644 m_format = format; m_sinkbuffer_sec_per_byte = 1.0 / (double)(m_format.m_frameSize * m_format.m_sampleRate); -- -1.9.1 +1.9.3 -From 7e123717843e6fa84dadb8347705a6ad46426f89 Mon Sep 17 00:00:00 2001 +From 6d261f34bd92792853eed19700be95447b0903e9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 17:37:41 +0100 -Subject: [PATCH 51/87] [omxplayer] Remove PCMRemap and handle multichannel +Subject: [PATCH 49/83] [omxplayer] Remove PCMRemap and handle multichannel mixing like ActiveAE does --- - tools/buildsteps/rbpi/config-xbmc-makefile | 4 +- - tools/depends/target/alsa-lib/Makefile | 2 +- - tools/depends/target/libcec/Makefile | 2 +- - xbmc/cores/omxplayer/Makefile.in | 1 - - xbmc/cores/omxplayer/OMXAudio.cpp | 390 +++++++++----- - xbmc/cores/omxplayer/OMXAudio.h | 9 +- - xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp | 41 +- - xbmc/cores/omxplayer/OMXAudioCodecOMX.h | 5 +- - xbmc/cores/omxplayer/OMXPlayerAudio.cpp | 4 +- - xbmc/cores/omxplayer/PCMRemap.cpp | 813 ----------------------------- - xbmc/cores/omxplayer/PCMRemap.h | 151 ------ - xbmc/linux/OMXCore.h | 2 - - 12 files changed, 291 insertions(+), 1133 deletions(-) + xbmc/cores/omxplayer/Makefile.in | 1 - + xbmc/cores/omxplayer/OMXAudio.cpp | 390 ++++++++------ + xbmc/cores/omxplayer/OMXAudio.h | 9 +- + xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp | 41 +- + xbmc/cores/omxplayer/OMXAudioCodecOMX.h | 5 +- + xbmc/cores/omxplayer/OMXPlayerAudio.cpp | 4 +- + xbmc/cores/omxplayer/PCMRemap.cpp | 813 ------------------------------ + xbmc/cores/omxplayer/PCMRemap.h | 151 ------ + xbmc/linux/OMXCore.h | 2 - + 9 files changed, 287 insertions(+), 1129 deletions(-) delete mode 100644 xbmc/cores/omxplayer/PCMRemap.cpp delete mode 100644 xbmc/cores/omxplayer/PCMRemap.h -diff --git a/tools/buildsteps/rbpi/config-xbmc-makefile b/tools/buildsteps/rbpi/config-xbmc-makefile -index 761a3b4..18600e2 100644 ---- a/tools/buildsteps/rbpi/config-xbmc-makefile -+++ b/tools/buildsteps/rbpi/config-xbmc-makefile -@@ -12,10 +12,10 @@ CONFIGURE = cp -f $(CONFIG_SUB) $(CONFIG_GUESS) build-aux/ ;\ - --disable-gl --enable-gles --enable-airplay \ - --enable-airtunes --enable-libcec --enable-player=omxplayer \ - --disable-sdl --disable-x11 --disable-xrandr --disable-openmax \ -- --disable-optical-drive --disable-dvdcss --disable-joystick \ -+ --disable-optical-drive --enable-dvdcss --enable-openmax --disable-joystick \ - --disable-crystalhd --disable-vtbdecoder --disable-vaapi \ - --disable-vdpau --disable-projectm --disable-rsxs --disable-fishbmc \ -- --disable-alsa -+ --enable-alsa - - all: $(SOURCE)/libxbmc.so - -diff --git a/tools/depends/target/alsa-lib/Makefile b/tools/depends/target/alsa-lib/Makefile -index b03fc19..a04d933 100644 ---- a/tools/depends/target/alsa-lib/Makefile -+++ b/tools/depends/target/alsa-lib/Makefile -@@ -19,7 +19,7 @@ CONFIGURE=cp -f $(CONFIG_SUB) $(CONFIG_GUESS) .; \ - --with-ctl-plugins=ext \ - --with-pcm-plugins="copy,linear,route,mulaw,alaw,adpcm,rate,plug,multi,file,null,empty,share,meter,hooks,lfloat,ladspa,asym,iec958,softvol,extplug,ioplug,mmap_emul" \ - --disable-resmgr --enable-aload --enable-mixer --enable-pcm --disable-rawmidi --enable-hwdep --disable-seq --disable-alisp --disable-old-symbols --disable-python \ -- --with-softfloat=yes --with-libdl=yes --with-pthread=yes --with-librt=no --disable-shared \ -+ --with-softfloat=yes --with-libdl=yes --with-pthread=yes --with-librt=no --enable-shared \ - - LIBDYLIB=$(PLATFORM)/src/.libs/$(LIBNAME).a - -diff --git a/tools/depends/target/libcec/Makefile b/tools/depends/target/libcec/Makefile -index 16fec1b..d18f1c8 100644 ---- a/tools/depends/target/libcec/Makefile -+++ b/tools/depends/target/libcec/Makefile -@@ -8,7 +8,7 @@ SOURCE=$(LIBNAME)-$(VERSION)-2 - ARCHIVE=$(SOURCE).tar.gz - - # configuration settings --CONFIGURE=./configure --prefix=$(PREFIX) --disable-rpi \ -+CONFIGURE=./configure --prefix=$(PREFIX) --enable-rpi \ - - LIBDYLIB=$(PLATFORM)/src/lib/.libs/libcec.la - diff --git a/xbmc/cores/omxplayer/Makefile.in b/xbmc/cores/omxplayer/Makefile.in index 3163282..e5cad70 100644 --- a/xbmc/cores/omxplayer/Makefile.in @@ -11440,7 +10676,7 @@ index 3163282..e5cad70 100644 LIB = omxplayer.a diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp -index 4e6d5fa..2e0c450 100644 +index 7c7ba25..774656d 100644 --- a/xbmc/cores/omxplayer/OMXAudio.cpp +++ b/xbmc/cores/omxplayer/OMXAudio.cpp @@ -29,6 +29,7 @@ @@ -13036,150 +12272,13 @@ index 2f1e8a9..b4c8626 100644 typedef struct omx_event { -- -1.9.1 +1.9.3 -From 2e13ca8b34e03e01fbbba88d307f9ede8a21b003 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sun, 13 Apr 2014 15:13:10 +0100 -Subject: [PATCH 52/87] [omxplayer] Fix for 3d video in mono mode - -The test for no aspect wasn't correct, causing large black bars ---- - xbmc/cores/omxplayer/OMXVideo.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp -index 66a351d..f058a35 100644 ---- a/xbmc/cores/omxplayer/OMXVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXVideo.cpp -@@ -848,7 +848,7 @@ void COMXVideo::SetVideoRect(const CRect& SrcRect, const CRect& DestRect) - - if (configDisplay.dest_rect.width == 0 || configDisplay.dest_rect.height == 0) - configDisplay.fullscreen = OMX_TRUE; -- else -+ if (configDisplay.src_rect.width != 0 && configDisplay.src_rect.height != 0) - configDisplay.noaspect = OMX_TRUE; - - m_omx_render.SetConfig(OMX_IndexConfigDisplayRegion, &configDisplay); --- -1.9.1 - - -From 6c1828f31f662d73cf029a85729ecacefb1ef6d1 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 10 Apr 2014 17:19:18 +0100 -Subject: [PATCH 53/87] [omxplayer] Remove unused framerate functions - ---- - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 4 +--- - xbmc/linux/OMXClock.cpp | 35 --------------------------------- - xbmc/linux/OMXClock.h | 4 ---- - 3 files changed, 1 insertion(+), 42 deletions(-) - -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index a5620da..019f4b2 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -527,7 +527,7 @@ bool OMXPlayerVideo::OpenDecoder() - return false; - - if (m_hints.fpsrate && m_hints.fpsscale) -- m_fFrameRate = DVD_TIME_BASE / OMXClock::NormalizeFrameduration((double)DVD_TIME_BASE * m_hints.fpsscale / m_hints.fpsrate); -+ m_fFrameRate = DVD_TIME_BASE / CDVDCodecUtils::NormalizeFrameduration((double)DVD_TIME_BASE * m_hints.fpsscale / m_hints.fpsrate); - else - m_fFrameRate = 25; - -@@ -564,8 +564,6 @@ bool OMXPlayerVideo::OpenDecoder() - sprintf(command, "hdmi_ntsc_freqs %d", bNtscFreq); - CLog::Log(LOGINFO, "OMXPlayerVideo::OpenDecoder fps: %f %s\n", m_fFrameRate, command); - m_DllBcmHost.vc_gencmd(response, sizeof response, command); -- -- m_av_clock->SetRefreshRate(m_fFrameRate); - } - - // start from assuming all recent frames had valid pts -diff --git a/xbmc/linux/OMXClock.cpp b/xbmc/linux/OMXClock.cpp -index bee7bac..c631ab6 100644 ---- a/xbmc/linux/OMXClock.cpp -+++ b/xbmc/linux/OMXClock.cpp -@@ -39,7 +39,6 @@ OMXClock::OMXClock() - { - m_pause = false; - -- m_fps = 25.0f; - m_omx_speed = DVD_PLAYSPEED_NORMAL; - m_WaitMask = 0; - m_eState = OMX_TIME_ClockStateStopped; -@@ -565,38 +564,4 @@ int64_t OMXClock::CurrentHostFrequency(void) - return( (int64_t)1000000000L ); - } - --int OMXClock::GetRefreshRate(double* interval) --{ -- if(!interval) -- return false; -- -- *interval = m_fps; -- return true; --} -- --double OMXClock::NormalizeFrameduration(double frameduration) --{ -- //if the duration is within 20 microseconds of a common duration, use that -- const double durations[] = {DVD_TIME_BASE * 1.001 / 24.0, DVD_TIME_BASE / 24.0, DVD_TIME_BASE / 25.0, -- DVD_TIME_BASE * 1.001 / 30.0, DVD_TIME_BASE / 30.0, DVD_TIME_BASE / 50.0, -- DVD_TIME_BASE * 1.001 / 60.0, DVD_TIME_BASE / 60.0}; -- -- double lowestdiff = DVD_TIME_BASE; -- int selected = -1; -- for (size_t i = 0; i < sizeof(durations) / sizeof(durations[0]); i++) -- { -- double diff = fabs(frameduration - durations[i]); -- if (diff < DVD_MSEC_TO_TIME(0.02) && diff < lowestdiff) -- { -- selected = i; -- lowestdiff = diff; -- } -- } -- -- if (selected != -1) -- return durations[selected]; -- else -- return frameduration; --} -- - #endif -diff --git a/xbmc/linux/OMXClock.h b/xbmc/linux/OMXClock.h -index f83074a..7bb6d4d 100644 ---- a/xbmc/linux/OMXClock.h -+++ b/xbmc/linux/OMXClock.h -@@ -50,7 +50,6 @@ class OMXClock - protected: - bool m_pause; - pthread_mutex_t m_lock; -- double m_fps; - int m_omx_speed; - OMX_U32 m_WaitMask; - OMX_TIME_CLOCKSTATE m_eState; -@@ -91,9 +90,6 @@ class OMXClock - static int64_t CurrentHostCounter(void); - static int64_t CurrentHostFrequency(void); - -- int GetRefreshRate(double* interval = NULL); -- void SetRefreshRate(double fps) { m_fps = fps; }; -- - static double NormalizeFrameduration(double frameduration); - }; - --- -1.9.1 - - -From fe1b6f90adaf964ba53bca351989f50a08281766 Mon Sep 17 00:00:00 2001 +From b52643dbb7f6252012b977ebeacea110e23fa791 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 30 Mar 2014 15:54:34 +0100 -Subject: [PATCH 54/87] [omxplayer] Make the sharpness control act as a +Subject: [PATCH 50/83] [omxplayer] Make the sharpness control act as a sharpness control. This fixes scaling kernel as Mitchell Netravali, and varies sharpness over range B=[5/3,0] C=[-1/3,1/2] @@ -13558,339 +12657,13 @@ index 502df4a..f16743d 100644 void COMXPlayer::GetDeinterlaceMethods(std::vector &deinterlaceMethods) -- -1.9.1 +1.9.3 -From 3c2e46f2d0d96866dbbe34a6f373da4b498f1e33 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 10 Apr 2014 17:24:51 +0100 -Subject: [PATCH 55/87] [rpi] Include ntsc frequencies in list of supported - resolutions - ---- - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 8 ------ - xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 35 ++++++++++++++++++++++++- - xbmc/windowing/egl/WinSystemEGL.cpp | 3 ++- - 3 files changed, 36 insertions(+), 10 deletions(-) - -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index 019f4b2..b8a3871 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -556,14 +556,6 @@ bool OMXPlayerVideo::OpenDecoder() - m_omxVideo.GetDecoderName().c_str() , m_hints.width, m_hints.height, m_hints.profile, m_fFrameRate); - - m_codecname = m_omxVideo.GetDecoderName(); -- -- // if we are closer to ntsc version of framerate, let gpu know -- int iFrameRate = (int)(m_fFrameRate + 0.5f); -- bool bNtscFreq = fabs(m_fFrameRate * 1001.0f / 1000.0f - iFrameRate) < fabs(m_fFrameRate - iFrameRate); -- char response[80], command[80]; -- sprintf(command, "hdmi_ntsc_freqs %d", bNtscFreq); -- CLog::Log(LOGINFO, "OMXPlayerVideo::OpenDecoder fps: %f %s\n", m_fFrameRate, command); -- m_DllBcmHost.vc_gencmd(response, sizeof response, command); - } - - // start from assuming all recent frames had valid pts -diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -index dc47095..21b8cc4 100644 ---- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -+++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -@@ -20,6 +20,7 @@ - #include "system.h" - - #include -+#include - #include "EGLNativeTypeRaspberryPI.h" - #include "utils/log.h" - #include "guilib/gui3d.h" -@@ -236,6 +237,18 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) - property.param2 = 0; - vc_tv_hdmi_set_property(&property); - } -+ -+ HDMI_PROPERTY_PARAM_T property; -+ property.property = HDMI_PROPERTY_PIXEL_CLOCK_TYPE; -+ // if we are closer to ntsc version of framerate, let gpu know -+ int iFrameRate = (int)(res.fRefreshRate + 0.5f); -+ if (fabsf(res.fRefreshRate * (1001.0f / 1000.0f) - iFrameRate) < fabsf(res.fRefreshRate - iFrameRate)) -+ property.param1 = HDMI_PIXEL_CLOCK_TYPE_NTSC; -+ else -+ property.param1 = HDMI_PIXEL_CLOCK_TYPE_PAL; -+ property.param2 = 0; -+ vc_tv_hdmi_set_property(&property); -+ - int success = m_DllBcmHost->vc_tv_hdmi_power_on_explicit_new(HDMI_MODE_HDMI, GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags)); - - if (success == 0) -@@ -442,7 +455,10 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r - m_desktopRes.dwFlags |= D3DPRESENTFLAG_MODE3DTB; - m_desktopRes.fPixelRatio *= 0.5; - } -- m_desktopRes.fRefreshRate = (float)tv_state.display.hdmi.frame_rate; -+ HDMI_PROPERTY_PARAM_T property; -+ property.property = HDMI_PROPERTY_PIXEL_CLOCK_TYPE; -+ vc_tv_hdmi_get_property(&property); -+ m_desktopRes.fRefreshRate = property.param1 == HDMI_PIXEL_CLOCK_TYPE_NTSC ? tv_state.display.hdmi.frame_rate * (1000.0f/1001.0f) : tv_state.display.hdmi.frame_rate; - } - else // sdtv - { -@@ -576,6 +592,12 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v - res.iSubtitles = (int)(0.965 * res.iHeight); - - AddUniqueResolution(res, resolutions); -+ if (tv->frame_rate == 24 || tv->frame_rate == 30 || tv->frame_rate == 60) -+ { -+ RESOLUTION_INFO res2 = res; -+ res2.fRefreshRate = (float)tv->frame_rate * (1000.0f/1001.0f); -+ AddUniqueResolution(res2, resolutions); -+ } - - // Also add 3D versions of modes - if (tv->struct_3d_mask & HDMI_3D_STRUCT_SIDE_BY_SIDE_HALF_HORIZONTAL) -@@ -590,6 +612,11 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v - res2.iSubtitles = (int)(0.965 * res2.iHeight); - - AddUniqueResolution(res2, resolutions); -+ if (tv->frame_rate == 24 || tv->frame_rate == 30 || tv->frame_rate == 60) -+ { -+ res2.fRefreshRate = (float)tv->frame_rate * (1000.0f/1001.0f); -+ AddUniqueResolution(res2, resolutions); -+ } - } - if (tv->struct_3d_mask & HDMI_3D_STRUCT_TOP_AND_BOTTOM) - { -@@ -603,6 +630,12 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v - res2.iSubtitles = (int)(0.965 * res2.iHeight); - - AddUniqueResolution(res2, resolutions); -+ if (tv->frame_rate == 24 || tv->frame_rate == 30 || tv->frame_rate == 60) -+ { -+ res2.fRefreshRate = (float)tv->frame_rate * (1000.0f/1001.0f); -+ AddUniqueResolution(res2, resolutions); -+ } -+ - } - } - } -diff --git a/xbmc/windowing/egl/WinSystemEGL.cpp b/xbmc/windowing/egl/WinSystemEGL.cpp -index 0c32947..258a293 100644 ---- a/xbmc/windowing/egl/WinSystemEGL.cpp -+++ b/xbmc/windowing/egl/WinSystemEGL.cpp -@@ -34,6 +34,7 @@ - #include "EGLWrapper.h" - #include "EGLQuirks.h" - #include -+#include - //////////////////////////////////////////////////////////////////////////////////////////// - CWinSystemEGL::CWinSystemEGL() : CWinSystemBase() - { -@@ -399,7 +400,7 @@ void CWinSystemEGL::UpdateResolutions() - resDesktop.iScreenWidth == resolutions[i].iScreenWidth && - resDesktop.iScreenHeight == resolutions[i].iScreenHeight && - (resDesktop.dwFlags & D3DPRESENTFLAG_MODEMASK) == (resolutions[i].dwFlags & D3DPRESENTFLAG_MODEMASK) && -- resDesktop.fRefreshRate == resolutions[i].fRefreshRate) -+ fabs(resDesktop.fRefreshRate - resolutions[i].fRefreshRate) < FLT_EPSILON) - { - ResDesktop = res_index; - } --- -1.9.1 - - -From 76398fc236fccea75580bc5f0796760e0df140b4 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 10 Apr 2014 17:26:20 +0100 -Subject: [PATCH 56/87] [omxplayer] Allow a framerate callback from GPU to - trigger a hdmi mode change - ---- - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 8 +++++--- - xbmc/cores/omxplayer/OMXPlayerVideo.h | 4 ++-- - xbmc/cores/omxplayer/OMXVideo.cpp | 35 +++++++++++++++++---------------- - xbmc/cores/omxplayer/OMXVideo.h | 2 +- - 4 files changed, 26 insertions(+), 23 deletions(-) - -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index b8a3871..e9010b1 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -694,7 +694,7 @@ void OMXPlayerVideo::RenderUpdateCallBack(const void *ctx, const CRect &SrcRect, - player->SetVideoRect(SrcRect, DestRect); - } - --void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, float display_aspect) -+void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, float framerate, float display_aspect) - { - RESOLUTION res = g_graphicsContext.GetVideoResolution(); - uint32_t video_width = CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth; -@@ -743,6 +743,8 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f - else if( display_aspect != 0.0f ) - iDisplayWidth = (int) (iDisplayHeight * display_aspect); - -+ m_fFrameRate = DVD_TIME_BASE / CDVDCodecUtils::NormalizeFrameduration((double)DVD_TIME_BASE / framerate); -+ - CLog::Log(LOGDEBUG,"%s - change configuration. video:%dx%d. framerate: %4.2f. %dx%d format: BYPASS", - __FUNCTION__, video_width, video_height, m_fFrameRate, iDisplayWidth, iDisplayHeight); - -@@ -757,9 +759,9 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f - g_renderManager.RegisterRenderUpdateCallBack((const void*)this, RenderUpdateCallBack); - } - --void OMXPlayerVideo::ResolutionUpdateCallBack(void *ctx, uint32_t width, uint32_t height, float display_aspect) -+void OMXPlayerVideo::ResolutionUpdateCallBack(void *ctx, uint32_t width, uint32_t height, float framerate, float display_aspect) - { - OMXPlayerVideo *player = static_cast(ctx); -- player->ResolutionUpdateCallBack(width, height, display_aspect); -+ player->ResolutionUpdateCallBack(width, height, framerate, display_aspect); - } - -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.h b/xbmc/cores/omxplayer/OMXPlayerVideo.h -index b49748f..33564dd 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.h -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.h -@@ -125,7 +125,7 @@ class OMXPlayerVideo : public CThread - int GetFreeSpace(); - void SetVideoRect(const CRect &SrcRect, const CRect &DestRect); - static void RenderUpdateCallBack(const void *ctx, const CRect &SrcRect, const CRect &DestRect); -- void ResolutionUpdateCallBack(uint32_t width, uint32_t height, float pixel_aspect); -- static void ResolutionUpdateCallBack(void *ctx, uint32_t width, uint32_t height, float pixel_aspect); -+ void ResolutionUpdateCallBack(uint32_t width, uint32_t height, float framerate, float pixel_aspect); -+ static void ResolutionUpdateCallBack(void *ctx, uint32_t width, uint32_t height, float framerate, float pixel_aspect); - }; - #endif -diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp -index f058a35..02bf554 100644 ---- a/xbmc/cores/omxplayer/OMXVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXVideo.cpp -@@ -171,6 +171,22 @@ bool COMXVideo::PortSettingsChanged() - CLog::Log(LOGERROR, "%s::%s - error m_omx_decoder.GetParameter(OMX_IndexParamBrcmPixelAspectRatio) omx_err(0x%08x)", CLASSNAME, __func__, omx_err); - } - -+ OMX_CONFIG_INTERLACETYPE interlace; -+ OMX_INIT_STRUCTURE(interlace); -+ interlace.nPortIndex = m_omx_decoder.GetOutputPort(); -+ omx_err = m_omx_decoder.GetConfig(OMX_IndexConfigCommonInterlace, &interlace); -+ -+ if(m_deinterlace_request == VS_DEINTERLACEMODE_FORCE) -+ m_deinterlace = true; -+ else if(m_deinterlace_request == VS_DEINTERLACEMODE_OFF) -+ m_deinterlace = false; -+ else -+ m_deinterlace = interlace.eMode != OMX_InterlaceProgressive; -+ -+ CLog::Log(LOGDEBUG, "%s::%s - %dx%d@%.2f interlace:%d deinterlace:%d", CLASSNAME, __func__, -+ port_image.format.video.nFrameWidth, port_image.format.video.nFrameHeight, -+ port_image.format.video.xFramerate / (float)(1<<16), interlace.eMode, m_deinterlace); -+ - // let OMXPlayerVideo know about resolution so it can inform RenderManager - if (m_res_callback) - { -@@ -178,7 +194,8 @@ bool COMXVideo::PortSettingsChanged() - if (pixel_aspect.nX && pixel_aspect.nY) - display_aspect = (float)pixel_aspect.nX * port_image.format.video.nFrameWidth / - ((float)pixel_aspect.nY * port_image.format.video.nFrameHeight); -- m_res_callback(m_res_ctx, port_image.format.video.nFrameWidth, port_image.format.video.nFrameHeight, display_aspect); -+ m_res_callback(m_res_ctx, port_image.format.video.nFrameWidth, port_image.format.video.nFrameHeight, -+ port_image.format.video.xFramerate / (float)(1<<16), display_aspect); - } - - if (m_settings_changed) -@@ -187,27 +204,11 @@ bool COMXVideo::PortSettingsChanged() - return true; - } - -- OMX_CONFIG_INTERLACETYPE interlace; -- OMX_INIT_STRUCTURE(interlace); -- interlace.nPortIndex = m_omx_decoder.GetOutputPort(); -- omx_err = m_omx_decoder.GetConfig(OMX_IndexConfigCommonInterlace, &interlace); -- -- if(m_deinterlace_request == VS_DEINTERLACEMODE_FORCE) -- m_deinterlace = true; -- else if(m_deinterlace_request == VS_DEINTERLACEMODE_OFF) -- m_deinterlace = false; -- else -- m_deinterlace = interlace.eMode != OMX_InterlaceProgressive; -- - if(!m_omx_render.Initialize("OMX.broadcom.video_render", OMX_IndexParamVideoInit)) - return false; - - m_omx_render.ResetEos(); - -- CLog::Log(LOGDEBUG, "%s::%s - %dx%d@%.2f interlace:%d deinterlace:%d", CLASSNAME, __func__, -- port_image.format.video.nFrameWidth, port_image.format.video.nFrameHeight, -- port_image.format.video.xFramerate / (float)(1<<16), interlace.eMode, m_deinterlace); -- - if(!m_omx_sched.Initialize("OMX.broadcom.video_scheduler", OMX_IndexParamVideoInit)) - return false; - -diff --git a/xbmc/cores/omxplayer/OMXVideo.h b/xbmc/cores/omxplayer/OMXVideo.h -index d69f854..fd23e70 100644 ---- a/xbmc/cores/omxplayer/OMXVideo.h -+++ b/xbmc/cores/omxplayer/OMXVideo.h -@@ -38,7 +38,7 @@ - - #define CLASSNAME "COMXVideo" - --typedef void (*ResolutionUpdateCallBackFn)(void *ctx, uint32_t width, uint32_t height, float display_aspect); -+typedef void (*ResolutionUpdateCallBackFn)(void *ctx, uint32_t width, uint32_t height, float framerate, float display_aspect); - - class COMXVideo - { --- -1.9.1 - - -From 6050d7f19dfe941169e01e357f4110e32298432d Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 11 Apr 2014 19:01:26 +0100 -Subject: [PATCH 57/87] [omxplayer] Request to be notified about framerate - changes - ---- - xbmc/cores/omxplayer/OMXVideo.cpp | 14 ++++++++++++-- - 1 file changed, 12 insertions(+), 2 deletions(-) - -diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp -index 02bf554..1b1711d 100644 ---- a/xbmc/cores/omxplayer/OMXVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXVideo.cpp -@@ -183,7 +183,7 @@ bool COMXVideo::PortSettingsChanged() - else - m_deinterlace = interlace.eMode != OMX_InterlaceProgressive; - -- CLog::Log(LOGDEBUG, "%s::%s - %dx%d@%.2f interlace:%d deinterlace:%d", CLASSNAME, __func__, -+ CLog::Log(LOGDEBUG, "%s::%s - %dx%d@%.2f interlace:%d deinterlace:%d", CLASSNAME, __func__, - port_image.format.video.nFrameWidth, port_image.format.video.nFrameHeight, - port_image.format.video.xFramerate / (float)(1<<16), interlace.eMode, m_deinterlace); - -@@ -558,7 +558,17 @@ bool COMXVideo::Open(CDVDStreamInfo &hints, OMXClock *clock, EDEINTERLACEMODE de - CLog::Log(LOGERROR, "COMXVideo::Open OMX_IndexConfigRequestCallback error (0%08x)\n", omx_err); - return false; - } -- -+ // request portsettingschanged on refresh rate change -+ if (CSettings::Get().GetInt("videoplayer.adjustrefreshrate") == ADJUST_REFRESHRATE_ALWAYS) -+ { -+ notifications.nIndex = OMX_IndexParamPortDefinition; -+ omx_err = m_omx_decoder.SetParameter((OMX_INDEXTYPE)OMX_IndexConfigRequestCallback, ¬ifications); -+ if (omx_err != OMX_ErrorNone) -+ { -+ CLog::Log(LOGERROR, "COMXVideo::Open OMX_IndexConfigRequestCallback error (0%08x)\n", omx_err); -+ //return false; -+ } -+ } - OMX_PARAM_BRCMVIDEODECODEERRORCONCEALMENTTYPE concanParam; - OMX_INIT_STRUCTURE(concanParam); - if(g_advancedSettings.m_omxDecodeStartWithValidFrame) --- -1.9.1 - - -From 4b3eac55402d47abdafe3de5967a39cc0c6d2eef Mon Sep 17 00:00:00 2001 +From 872af38b40480ea1af4906637653d3f39e924294 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 16 Apr 2014 21:18:06 +0100 -Subject: [PATCH 58/87] [omxplayer] Don't propagate 3d flags based on supported +Subject: [PATCH 51/83] [omxplayer] Don't propagate 3d flags based on supported 3d modes --- @@ -13898,10 +12671,10 @@ Subject: [PATCH 58/87] [omxplayer] Don't propagate 3d flags based on supported 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index e9010b1..c170cfb 100644 +index 11d141a..b3786f6 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -703,36 +703,15 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f +@@ -746,36 +746,15 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f unsigned flags = 0; ERenderFormat format = RENDER_FMT_BYPASS; @@ -13943,294 +12716,13 @@ index e9010b1..c170cfb 100644 unsigned int iDisplayWidth = width; unsigned int iDisplayHeight = height; -- -1.9.1 +1.9.3 -From 4702c3f840275c50b25010ba74253a0354ff42c2 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 14 Apr 2014 17:04:57 +0100 -Subject: [PATCH 59/87] [omxplayer] Support stereo view modes with scaling - -The Pi only supported a single view rectangle, which is sufficient for all mono view modes, -but only supports a subset of stereo modes. - -To work around this, the scaling rectangles were ignored in 3D modes and 3D video was treated as unscaled. -While this worked or square pixel, 16:9 content on a 16:9 display, it went wrong is various other conditions. - -@sraue reported that mono view of SBS/TAB content wasn't scaled correctly, and other forum reports -aspect ratio errors in widescreen 3D videos. - -As it wasn't trivial to work around these bug reports, I've added a new stereo flags to the firmware -that allows a second display region to be created for the second eye, allowing scaling to work. - -I've been through the video stereo modes (none, sbs, tab) and the display stereo modes (mono, sbs, tab) -and all the zoom modes, and compared the scaling to xbmc on windows and all seem to match - -Requires udpated firmware. ---- - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 103 +++++++++++++++++++++----------- - xbmc/cores/omxplayer/OMXPlayerVideo.h | 4 +- - xbmc/cores/omxplayer/OMXVideo.cpp | 47 +++++++++------ - xbmc/cores/omxplayer/OMXVideo.h | 3 +- - 4 files changed, 101 insertions(+), 56 deletions(-) - -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index c170cfb..e9f86f3 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -97,6 +97,9 @@ OMXPlayerVideo::OMXPlayerVideo(OMXClock *av_clock, - - m_src_rect.SetRect(0, 0, 0, 0); - m_dst_rect.SetRect(0, 0, 0, 0); -+ m_video_stereo_mode = RENDER_STEREO_MODE_OFF; -+ m_display_stereo_mode = RENDER_STEREO_MODE_OFF; -+ m_StereoInvert = false; - m_started = false; - m_iCurrentPts = DVD_NOPTS_VALUE; - m_nextOverlay = DVD_NOPTS_VALUE; -@@ -120,6 +123,9 @@ bool OMXPlayerVideo::OpenStream(CDVDStreamInfo &hints) - // force SetVideoRect to be called initially - m_src_rect.SetRect(0, 0, 0, 0); - m_dst_rect.SetRect(0, 0, 0, 0); -+ m_video_stereo_mode = RENDER_STEREO_MODE_OFF; -+ m_display_stereo_mode = RENDER_STEREO_MODE_OFF; -+ m_StereoInvert = false; - - if (!m_DllBcmHost.Load()) - return false; -@@ -634,58 +640,85 @@ int OMXPlayerVideo::GetFreeSpace() - - void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRect) - { -- CRect SrcRect = InSrcRect, DestRect = InDestRect; -+ // we get called twice a frame for left/right. Can ignore the rights. -+ if (g_graphicsContext.GetStereoView() == RENDER_STEREO_VIEW_RIGHT) -+ return; - -- // in 3d modes skip this - we get called as the gui switches from left eye to right eye -+ CRect SrcRect = InSrcRect, DestRect = InDestRect; - unsigned flags = GetStereoModeFlags(GetStereoMode()); -- -- if (CONF_FLAGS_STEREO_MODE_MASK(flags)) -- { -- if (g_graphicsContext.GetStereoMode() == RENDER_STEREO_MODE_MONO) -- { -- if (GetStereoMode() == "left_right") -- SrcRect.SetRect(0, 0, m_hints.width>>1, m_hints.height); -- else if (GetStereoMode() == "right_left") -- SrcRect.SetRect(m_hints.width>>1, 0, m_hints.width, m_hints.height); -- else if (GetStereoMode() == "top_bottom") -- SrcRect.SetRect(0, 0, m_hints.width, m_hints.height>>1); -- else if (GetStereoMode() == "bottom_top") -- SrcRect.SetRect(0, m_hints.height>>1, m_hints.width, m_hints.height); -- } -- else -- SrcRect.SetRect(0, 0, m_hints.width, m_hints.height); -- // interpreted as fullscreen -- DestRect.SetRect(0, 0, 0, 0); -- } -+ RENDER_STEREO_MODE video_stereo_mode = (flags & CONF_FLAGS_STEREO_MODE_SBS) ? RENDER_STEREO_MODE_SPLIT_VERTICAL : -+ (flags & CONF_FLAGS_STEREO_MODE_TAB) ? RENDER_STEREO_MODE_SPLIT_HORIZONTAL : RENDER_STEREO_MODE_OFF; -+ bool stereo_invert = (flags & CONF_FLAGS_STEREO_CADANCE_RIGHT_LEFT) ? true : false; -+ RENDER_STEREO_MODE display_stereo_mode = g_graphicsContext.GetStereoMode(); - - // check if destination rect or video view mode has changed -- if (m_dst_rect != DestRect || m_src_rect != SrcRect) -- { -- m_src_rect = SrcRect; -- m_dst_rect = DestRect; -- } -- else -- { -+ if (!(m_dst_rect != DestRect) && !(m_src_rect != SrcRect) && m_video_stereo_mode == video_stereo_mode && m_display_stereo_mode == display_stereo_mode && m_StereoInvert == stereo_invert) - return; -- } -+ -+ CLog::Log(LOGDEBUG, "OMXPlayerVideo::%s %d,%d,%d,%d -> %d,%d,%d,%d (%d,%d,%d,%d,%s)", __func__, -+ (int)SrcRect.x1, (int)SrcRect.y1, (int)SrcRect.x2, (int)SrcRect.y2, -+ (int)DestRect.x1, (int)DestRect.y1, (int)DestRect.x2, (int)DestRect.y2, -+ video_stereo_mode, display_stereo_mode, CMediaSettings::Get().GetCurrentVideoSettings().m_StereoInvert, g_graphicsContext.GetStereoView(), OMXPlayerVideo::GetStereoMode().c_str()); -+ -+ m_src_rect = SrcRect; -+ m_dst_rect = DestRect; -+ m_video_stereo_mode = video_stereo_mode; -+ m_display_stereo_mode = display_stereo_mode; -+ m_StereoInvert = stereo_invert; - - // might need to scale up m_dst_rect to display size as video decodes - // to separate video plane that is at display size. - RESOLUTION res = g_graphicsContext.GetVideoResolution(); - CRect gui(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iWidth, CDisplaySettings::Get().GetResolutionInfo(res).iHeight); - CRect display(0, 0, CDisplaySettings::Get().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::Get().GetResolutionInfo(res).iScreenHeight); -- CRect dst_rect(m_dst_rect); -+ -+ switch (video_stereo_mode) -+ { -+ case RENDER_STEREO_MODE_SPLIT_VERTICAL: -+ // optimisation - use simpler display mode in common case of unscaled 3d with same display mode -+ if (video_stereo_mode == display_stereo_mode && DestRect.x1 == 0.0f && DestRect.x2 * 2.0f == gui.Width() && !stereo_invert) -+ { -+ SrcRect.x2 *= 2.0f; -+ DestRect.x2 *= 2.0f; -+ video_stereo_mode = RENDER_STEREO_MODE_OFF; -+ display_stereo_mode = RENDER_STEREO_MODE_OFF; -+ } -+ else if (stereo_invert) -+ { -+ SrcRect.x1 += m_hints.width / 2; -+ SrcRect.x2 += m_hints.width / 2; -+ } -+ break; -+ -+ case RENDER_STEREO_MODE_SPLIT_HORIZONTAL: -+ // optimisation - use simpler display mode in common case of unscaled 3d with same display mode -+ if (video_stereo_mode == display_stereo_mode && DestRect.y1 == 0.0f && DestRect.y2 * 2.0f == gui.Height() && !stereo_invert) -+ { -+ SrcRect.y2 *= 2.0f; -+ DestRect.y2 *= 2.0f; -+ video_stereo_mode = RENDER_STEREO_MODE_OFF; -+ display_stereo_mode = RENDER_STEREO_MODE_OFF; -+ } -+ else if (stereo_invert) -+ { -+ SrcRect.y1 += m_hints.height / 2; -+ SrcRect.y2 += m_hints.height / 2; -+ } -+ break; -+ -+ default: break; -+ } - - if (gui != display) - { - float xscale = display.Width() / gui.Width(); - float yscale = display.Height() / gui.Height(); -- dst_rect.x1 *= xscale; -- dst_rect.x2 *= xscale; -- dst_rect.y1 *= yscale; -- dst_rect.y2 *= yscale; -+ DestRect.x1 *= xscale; -+ DestRect.x2 *= xscale; -+ DestRect.y1 *= yscale; -+ DestRect.y2 *= yscale; - } -- m_omxVideo.SetVideoRect(SrcRect, dst_rect); -+ m_omxVideo.SetVideoRect(SrcRect, DestRect, video_stereo_mode, display_stereo_mode); - } - - void OMXPlayerVideo::RenderUpdateCallBack(const void *ctx, const CRect &SrcRect, const CRect &DestRect) -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.h b/xbmc/cores/omxplayer/OMXPlayerVideo.h -index 33564dd..6f19395 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.h -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.h -@@ -69,7 +69,9 @@ class OMXPlayerVideo : public CThread - - CRect m_src_rect; - CRect m_dst_rect; -- -+ RENDER_STEREO_MODE m_video_stereo_mode; -+ RENDER_STEREO_MODE m_display_stereo_mode; -+ bool m_StereoInvert; - uint32_t m_history_valid_pts; - DllBcmHost m_DllBcmHost; - -diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp -index 1b1711d..dceb8bf 100644 ---- a/xbmc/cores/omxplayer/OMXVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXVideo.cpp -@@ -836,7 +836,7 @@ void COMXVideo::Reset(void) - } - - /////////////////////////////////////////////////////////////////////////////////////////// --void COMXVideo::SetVideoRect(const CRect& SrcRect, const CRect& DestRect) -+void COMXVideo::SetVideoRect(const CRect& SrcRect, const CRect& DestRect, RENDER_STEREO_MODE video_mode, RENDER_STEREO_MODE display_mode) - { - CSingleLock lock (m_critSection); - if(!m_is_open) -@@ -846,27 +846,36 @@ void COMXVideo::SetVideoRect(const CRect& SrcRect, const CRect& DestRect) - - OMX_INIT_STRUCTURE(configDisplay); - configDisplay.nPortIndex = m_omx_render.GetInputPort(); -- configDisplay.set = (OMX_DISPLAYSETTYPE)(OMX_DISPLAY_SET_DEST_RECT|OMX_DISPLAY_SET_SRC_RECT|OMX_DISPLAY_SET_FULLSCREEN|OMX_DISPLAY_SET_NOASPECT); -- configDisplay.dest_rect.x_offset = (int)(DestRect.x1+0.5f); -- configDisplay.dest_rect.y_offset = (int)(DestRect.y1+0.5f); -- configDisplay.dest_rect.width = (int)(DestRect.Width()+0.5f); -- configDisplay.dest_rect.height = (int)(DestRect.Height()+0.5f); -- -- configDisplay.src_rect.x_offset = (int)(SrcRect.x1+0.5f); -- configDisplay.src_rect.y_offset = (int)(SrcRect.y1+0.5f); -- configDisplay.src_rect.width = (int)(SrcRect.Width()+0.5f); -- configDisplay.src_rect.height = (int)(SrcRect.Height()+0.5f); -- -- if (configDisplay.dest_rect.width == 0 || configDisplay.dest_rect.height == 0) -- configDisplay.fullscreen = OMX_TRUE; -- if (configDisplay.src_rect.width != 0 && configDisplay.src_rect.height != 0) -- configDisplay.noaspect = OMX_TRUE; -+ configDisplay.set = (OMX_DISPLAYSETTYPE)(OMX_DISPLAY_SET_DEST_RECT|OMX_DISPLAY_SET_SRC_RECT|OMX_DISPLAY_SET_FULLSCREEN|OMX_DISPLAY_SET_NOASPECT|OMX_DISPLAY_SET_MODE); -+ configDisplay.dest_rect.x_offset = lrintf(DestRect.x1); -+ configDisplay.dest_rect.y_offset = lrintf(DestRect.y1); -+ configDisplay.dest_rect.width = lrintf(DestRect.Width()); -+ configDisplay.dest_rect.height = lrintf(DestRect.Height()); -+ -+ configDisplay.src_rect.x_offset = lrintf(SrcRect.x1); -+ configDisplay.src_rect.y_offset = lrintf(SrcRect.y1); -+ configDisplay.src_rect.width = lrintf(SrcRect.Width()); -+ configDisplay.src_rect.height = lrintf(SrcRect.Height()); -+ -+ configDisplay.fullscreen = OMX_FALSE; -+ configDisplay.noaspect = OMX_TRUE; -+ -+ if (video_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL && display_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) -+ configDisplay.mode = OMX_DISPLAY_MODE_STEREO_TOP_TO_TOP; -+ else if (video_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL && display_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) -+ configDisplay.mode = OMX_DISPLAY_MODE_STEREO_TOP_TO_LEFT; -+ else if (video_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL && display_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) -+ configDisplay.mode = OMX_DISPLAY_MODE_STEREO_LEFT_TO_TOP; -+ else if (video_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL && display_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) -+ configDisplay.mode = OMX_DISPLAY_MODE_STEREO_LEFT_TO_LEFT; -+ else -+ configDisplay.mode = OMX_DISPLAY_MODE_LETTERBOX; - - m_omx_render.SetConfig(OMX_IndexConfigDisplayRegion, &configDisplay); - -- CLog::Log(LOGDEBUG, "dest_rect.x_offset %d dest_rect.y_offset %d dest_rect.width %d dest_rect.height %d\n", -- configDisplay.dest_rect.x_offset, configDisplay.dest_rect.y_offset, -- configDisplay.dest_rect.width, configDisplay.dest_rect.height); -+ CLog::Log(LOGDEBUG, "%s::%s %d,%d,%d,%d -> %d,%d,%d,%d mode:%d", CLASSNAME, __func__, -+ configDisplay.src_rect.x_offset, configDisplay.src_rect.y_offset, configDisplay.src_rect.width, configDisplay.src_rect.height, -+ configDisplay.dest_rect.x_offset, configDisplay.dest_rect.y_offset, configDisplay.dest_rect.width, configDisplay.dest_rect.height, configDisplay.mode); - } - - int COMXVideo::GetInputBufferSize() -diff --git a/xbmc/cores/omxplayer/OMXVideo.h b/xbmc/cores/omxplayer/OMXVideo.h -index fd23e70..226000e 100644 ---- a/xbmc/cores/omxplayer/OMXVideo.h -+++ b/xbmc/cores/omxplayer/OMXVideo.h -@@ -32,6 +32,7 @@ - #include "DVDDemuxers/DVDDemux.h" - #include "xbmc/settings/VideoSettings.h" - #include "threads/CriticalSection.h" -+#include "xbmc/rendering/RenderSystem.h" - #include - - #define VIDEO_BUFFERS 60 -@@ -58,7 +59,7 @@ class COMXVideo - void Reset(void); - void SetDropState(bool bDrop); - std::string GetDecoderName() { return m_video_codec_name; }; -- void SetVideoRect(const CRect& SrcRect, const CRect& DestRect); -+ void SetVideoRect(const CRect& SrcRect, const CRect& DestRect, RENDER_STEREO_MODE video_mode, RENDER_STEREO_MODE display_mode); - int GetInputBufferSize(); - void SubmitEOS(); - bool IsEOS(); --- -1.9.1 - - -From 0d07e2e76c3fb172584c82084807a491b8fc2c9e Mon Sep 17 00:00:00 2001 +From 0605cdb1bc3d9634c8e917c7112660aceaffff20 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:00:52 +0100 -Subject: [PATCH 60/87] [graphics] Don't set stereo mode based on resolution +Subject: [PATCH 52/83] [graphics] Don't set stereo mode based on resolution The resolution change should follow stereo mode --- @@ -14271,13 +12763,13 @@ index 5bffdf5..7e4fdd4 100644 m_iScreenWidth = info_mod.iWidth; -- -1.9.1 +1.9.3 -From 1cae7064a28a486b605e7406bb49eb4fcfbf7f93 Mon Sep 17 00:00:00 2001 +From 0a4ad0213e5b48a69b4926c0a9633080c747565a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:01:51 +0100 -Subject: [PATCH 61/87] [graphics] Allow switching to a more suitable 3D +Subject: [PATCH 53/83] [graphics] Allow switching to a more suitable 3D resolution --- @@ -14364,13 +12856,13 @@ index 0a27643..df55e92 100644 void ResetOverscan(RESOLUTION_INFO &resinfo); void ResetScreenParameters(RESOLUTION res); -- -1.9.1 +1.9.3 -From 18daa05f62612818e9ad1da46d23312f74057341 Mon Sep 17 00:00:00 2001 +From cb4e23e1579c170a3d7a04e69c9919aef7363593 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:38:55 +0100 -Subject: [PATCH 62/87] [3D] Support switching to 3D resolutions +Subject: [PATCH 54/83] [3D] Support switching to 3D resolutions Include matching 3D flags (SBS/TAB) in the score of a resolution to switch to, to enable switching to 3d modes. Also remove the old code that treated 3D modes differently when assigning a score. @@ -14379,7 +12871,7 @@ Also remove the old code that treated 3D modes differently when assigning a scor 1 file changed, 17 insertions(+), 30 deletions(-) diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.cpp b/xbmc/cores/VideoRenderers/BaseRenderer.cpp -index 970b822..9ca1be1 100644 +index 83c3adb..8076e76 100644 --- a/xbmc/cores/VideoRenderers/BaseRenderer.cpp +++ b/xbmc/cores/VideoRenderers/BaseRenderer.cpp @@ -222,10 +222,14 @@ void CBaseRenderer::FindResolutionFromFpsMatch(float fps, float& weight) @@ -14452,13 +12944,13 @@ index 970b822..9ca1be1 100644 return current; } -- -1.9.1 +1.9.3 -From 5daa10c64f7983cc83d89addde1cd80f2e83b05a Mon Sep 17 00:00:00 2001 +From 52c6dee71ffd7a440247f080d41dd360116791c1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 23 Apr 2014 00:05:07 +0100 -Subject: [PATCH 63/87] [graphics] Make pixel ratio for 3d modes consistent +Subject: [PATCH 55/83] [graphics] Make pixel ratio for 3d modes consistent Note: Use the stored stereo flags from lists of resolutions. Use current stereo mode for current resolution. @@ -14466,11 +12958,11 @@ Use current stereo mode for current resolution. xbmc/cores/VideoRenderers/BaseRenderer.cpp | 10 ++++---- xbmc/guilib/GraphicContext.cpp | 32 ++++++++++--------------- xbmc/guilib/GraphicContext.h | 4 ++-- - xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 9 +------ - 4 files changed, 20 insertions(+), 35 deletions(-) + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 8 ------- + 4 files changed, 19 insertions(+), 35 deletions(-) diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.cpp b/xbmc/cores/VideoRenderers/BaseRenderer.cpp -index 9ca1be1..6bf42bf 100644 +index 8076e76..beda4e9 100644 --- a/xbmc/cores/VideoRenderers/BaseRenderer.cpp +++ b/xbmc/cores/VideoRenderers/BaseRenderer.cpp @@ -119,7 +119,7 @@ bool CBaseRenderer::FindResolutionFromOverride(float fps, float& weight, bool fa @@ -14607,10 +13099,10 @@ index df55e92..c77f2ff 100644 /* \brief Get UI scaling information from a given resolution to the screen resolution. Takes account of overscan and UI zooming. diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -index 21b8cc4..4268f78 100644 +index 90b57e1..5b26b20 100644 --- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -@@ -446,15 +446,10 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r +@@ -448,15 +448,9 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r m_desktopRes.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv_state.display.hdmi.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); // Also add 3D flags if (tv_state.display.hdmi.format_3d == HDMI_3D_FORMAT_SBS_HALF) @@ -14623,34 +13115,33 @@ index 21b8cc4..4268f78 100644 m_desktopRes.dwFlags |= D3DPRESENTFLAG_MODE3DTB; - m_desktopRes.fPixelRatio *= 0.5; - } -+ HDMI_PROPERTY_PARAM_T property; property.property = HDMI_PROPERTY_PIXEL_CLOCK_TYPE; vc_tv_hdmi_get_property(&property); -@@ -605,7 +600,6 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v +@@ -602,7 +596,6 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v RESOLUTION_INFO res2 = res; res2.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; res2.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res2.iScreenWidth / (float)res2.iScreenHeight); - res2.fPixelRatio *= 2.0f; - SetResolutionString(res2); CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f)\n", i, res2.strMode.c_str(), res2.fPixelRatio); -@@ -623,7 +617,6 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v + res2.iSubtitles = (int)(0.965 * res2.iHeight); +@@ -619,7 +612,6 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v RESOLUTION_INFO res2 = res; res2.dwFlags |= D3DPRESENTFLAG_MODE3DTB; res2.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res2.iScreenWidth / (float)res2.iScreenHeight); - res2.fPixelRatio *= 0.5f; - SetResolutionString(res2); CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f)\n", i, res2.strMode.c_str(), res2.fPixelRatio); + res2.iSubtitles = (int)(0.965 * res2.iHeight); -- -1.9.1 +1.9.3 -From e3f5ac03f972182ddf56dc314cbcb00bb380b3be Mon Sep 17 00:00:00 2001 +From 3cb9672df4ea51cc8fa0f4f5d6a90eea3481f8ce Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 23 Apr 2014 21:07:51 +0100 -Subject: [PATCH 64/87] [PiSink] More attempts to reduce underrun audio +Subject: [PATCH 56/83] [PiSink] More attempts to reduce underrun audio glitches with multichannl and high samplerate --- @@ -14769,47 +13260,13 @@ index 070e6eb..133b9f6 100644 void CAESinkPi::Drain() -- -1.9.1 +1.9.3 -From 53d24fd1c9804d48ccb7e856e130b37766f02c04 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 23 Apr 2014 22:36:01 +0100 -Subject: [PATCH 65/87] [omxplayer] Fix for aspect ratio of portrait videos - ---- - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index e9f86f3..7e2c644 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -651,6 +651,16 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec - bool stereo_invert = (flags & CONF_FLAGS_STEREO_CADANCE_RIGHT_LEFT) ? true : false; - RENDER_STEREO_MODE display_stereo_mode = g_graphicsContext.GetStereoMode(); - -+ // fix up transposed video -+ if (m_hints.orientation == 90 || m_hints.orientation == 270) -+ { -+ float diff = (DestRect.Height() - DestRect.Width()) * 0.5f; -+ DestRect.x1 -= diff; -+ DestRect.x2 += diff; -+ DestRect.y1 += diff; -+ DestRect.y2 -= diff; -+ } -+ - // check if destination rect or video view mode has changed - if (!(m_dst_rect != DestRect) && !(m_src_rect != SrcRect) && m_video_stereo_mode == video_stereo_mode && m_display_stereo_mode == display_stereo_mode && m_StereoInvert == stereo_invert) - return; --- -1.9.1 - - -From 068ec806a384f4472c00cb34f2acf47464435bee Mon Sep 17 00:00:00 2001 +From 1b8454bacca84a29010f6810dde8dde83cbd47d3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 22 Apr 2014 12:23:23 +0100 -Subject: [PATCH 66/87] [omxplayer] Make dvdplayer the default for dvd images +Subject: [PATCH 57/83] [omxplayer] Make dvdplayer the default for dvd images --- xbmc/cores/omxplayer/omxplayer_advancedsettings.xml | 2 +- @@ -14828,13 +13285,13 @@ index 77c6a15..51c0daf 100644 -- -1.9.1 +1.9.3 -From 5105e668ede725a7a7b5909a010363af889a9bd2 Mon Sep 17 00:00:00 2001 +From 6278c63886b9ade6f58a3c8af365d861319e9a1e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 26 Apr 2014 17:27:52 +0100 -Subject: [PATCH 67/87] [cec] Don't suspend pi on tv switch off - it can't wake +Subject: [PATCH 58/83] [cec] Don't suspend pi on tv switch off - it can't wake up --- @@ -14855,40 +13312,13 @@ index a906628..9b5271a 100644 -- -1.9.1 +1.9.3 -From b8d95d8b97cbcbb01f3c55a6457ec847009ada55 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sat, 12 Apr 2014 17:57:19 +0100 -Subject: [PATCH 68/87] [omxplayer] Ignore occasionally valid pts values, they - cause live tv stutter - ---- - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index 7e2c644..b3786f6 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -490,7 +490,7 @@ void OMXPlayerVideo::Process() - // if a stream has had more than 4 valid pts values in the last 16, the use UNKNOWN, otherwise use dts - m_history_valid_pts = (m_history_valid_pts << 1) | (pPacket->pts != DVD_NOPTS_VALUE); - double pts = pPacket->pts; -- if(pPacket->pts == DVD_NOPTS_VALUE && count_bits(m_history_valid_pts & 0xffff) < 4) -+ if(count_bits(m_history_valid_pts & 0xffff) < 4) - pts = pPacket->dts; - - if (pts != DVD_NOPTS_VALUE) --- -1.9.1 - - -From 371943edd85a24f964d5e0058f02cb768e1fcb73 Mon Sep 17 00:00:00 2001 +From 85581e5fd18c80c8709071fabd1b9b2c5a34fa52 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 27 Jun 2013 01:25:57 +0100 -Subject: [PATCH 70/87] [rbp/omxplayer] Do we need discontinuity handling? +Subject: [PATCH 60/83] [rbp/omxplayer] Do we need discontinuity handling? So far I've not seen what this is needed for and it does cause problems for some files. --- @@ -14908,13 +13338,13 @@ index f16743d..92dd5c5 100644 return; -- -1.9.1 +1.9.3 -From a98afeb975b6e4f4d9f632e2f1dc3ebb17310646 Mon Sep 17 00:00:00 2001 +From daadc25a3515e74d8712b6942b4465372c7c4abc Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 24 Oct 2013 00:53:26 +0100 -Subject: [PATCH 71/87] [rbp/omxplayer] Avoid marking non-monotonic timestamps +Subject: [PATCH 61/83] [rbp/omxplayer] Avoid marking non-monotonic timestamps as unknown Following a single spurious timestamp that is in the future, @@ -14924,7 +13354,7 @@ all subsequent timestamps will be marked unknown causing out of sync. 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp -index 2e0c450..863209c 100644 +index 774656d..c277af3 100644 --- a/xbmc/cores/omxplayer/OMXAudio.cpp +++ b/xbmc/cores/omxplayer/OMXAudio.cpp @@ -1206,22 +1206,10 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt @@ -14953,13 +13383,13 @@ index 2e0c450..863209c 100644 omx_buffer->nTimeStamp = ToOMXTime(val); -- -1.9.1 +1.9.3 -From cc3efe44c20b4a6cdf9ec840b7f422cb34362225 Mon Sep 17 00:00:00 2001 +From b9f64144349c6eef41f1cf01b3604de495326365 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 13 Dec 2013 16:25:23 +0000 -Subject: [PATCH 73/87] Add time taken to resample to log +Subject: [PATCH 63/83] Add time taken to resample to log --- xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 7 +++++++ @@ -15000,13 +13430,13 @@ index 9324e1e..4405f66 100644 bool m_isSeekPosible; int m_fileSize; -- -1.9.1 +1.9.3 -From f19c27d73c47403f2e0f1f97abaedb2b497383a1 Mon Sep 17 00:00:00 2001 +From 2005ee812373eed2d91f274fcf97738eb0f25436 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 14 Dec 2013 16:55:05 +0000 -Subject: [PATCH 74/87] logging: Add microsecond timer to log messages +Subject: [PATCH 64/83] logging: Add microsecond timer to log messages --- xbmc/utils/log.cpp | 12 +++++++++--- @@ -15064,13 +13494,13 @@ index 6d7c6c8..45f68bc 100644 levelNames[loglevel]); -- -1.9.1 +1.9.3 -From 8ed285a66a00d3dd9018b9295e948612b12c0d19 Mon Sep 17 00:00:00 2001 +From 91253a2c4dbd96a326a4283437fe7802dcef68b0 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:49:17 +1300 -Subject: [PATCH 75/87] adds GetTvShowSeasons +Subject: [PATCH 65/83] adds GetTvShowSeasons --- xbmc/video/VideoDatabase.cpp | 30 ++++++++++++++++++++++++------ @@ -15078,10 +13508,10 @@ Subject: [PATCH 75/87] adds GetTvShowSeasons 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp -index 2352ef1..3b08330 100644 +index 65c7eb3..bbabe0e 100644 --- a/xbmc/video/VideoDatabase.cpp +++ b/xbmc/video/VideoDatabase.cpp -@@ -3872,7 +3872,7 @@ bool CVideoDatabase::RemoveArtForItem(int mediaId, const MediaType &mediaType, c +@@ -3873,7 +3873,7 @@ bool CVideoDatabase::RemoveArtForItem(int mediaId, const MediaType &mediaType, c return result; } @@ -15090,7 +13520,7 @@ index 2352ef1..3b08330 100644 { try { -@@ -3883,19 +3883,37 @@ bool CVideoDatabase::GetTvShowSeasonArt(int showId, map +@@ -3884,19 +3884,37 @@ bool CVideoDatabase::GetTvShowSeasonArt(int showId, map CStdString sql = PrepareSQL("select idSeason,season from seasons where idShow=%i", showId); m_pDS2->query(sql.c_str()); @@ -15134,7 +13564,7 @@ index 2352ef1..3b08330 100644 return true; } diff --git a/xbmc/video/VideoDatabase.h b/xbmc/video/VideoDatabase.h -index eb8af19..7796feb 100644 +index cc45c6f..c117a03 100644 --- a/xbmc/video/VideoDatabase.h +++ b/xbmc/video/VideoDatabase.h @@ -697,6 +697,7 @@ class CVideoDatabase : public CDatabase @@ -15146,20 +13576,20 @@ index eb8af19..7796feb 100644 bool GetArtTypes(const MediaType &mediaType, std::vector &artTypes); -- -1.9.1 +1.9.3 -From 37cb9864b79917a32bdec4a2a11df34a91adaa17 Mon Sep 17 00:00:00 2001 +From 4dbc9ca025d40f120d16cf2aed7d273f1ec1ee72 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:50:10 +1300 -Subject: [PATCH 76/87] move AddSeason() public. +Subject: [PATCH 66/83] move AddSeason() public. --- xbmc/video/VideoDatabase.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/video/VideoDatabase.h b/xbmc/video/VideoDatabase.h -index 7796feb..670474c 100644 +index c117a03..5f0139e 100644 --- a/xbmc/video/VideoDatabase.h +++ b/xbmc/video/VideoDatabase.h @@ -708,6 +708,7 @@ class CVideoDatabase : public CDatabase @@ -15179,13 +13609,13 @@ index 7796feb..670474c 100644 // link functions - these two do all the work void AddLinkToActor(const char *table, int actorID, const char *secondField, int secondID, const CStdString &role, int order); -- -1.9.1 +1.9.3 -From aec4cd70d20b37b36151ddf76442e04410f738b1 Mon Sep 17 00:00:00 2001 +From f31d83bdc99bc5ffcbb42f4e406df8efbfca87e1 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:48:24 +1300 -Subject: [PATCH 77/87] adds GetArt function to (video) scraper, allowing art +Subject: [PATCH 67/83] adds GetArt function to (video) scraper, allowing art to be fetched given the video identifier. --- @@ -15196,7 +13626,7 @@ Subject: [PATCH 77/87] adds GetArt function to (video) scraper, allowing art 4 files changed, 53 insertions(+) diff --git a/xbmc/addons/Scraper.cpp b/xbmc/addons/Scraper.cpp -index 7c41a90..8811c7e 100644 +index 44f6693..a67b243 100644 --- a/xbmc/addons/Scraper.cpp +++ b/xbmc/addons/Scraper.cpp @@ -925,6 +925,44 @@ EPISODELIST CScraper::GetEpisodeList(XFILE::CCurlFile &fcurl, const CScraperUrl @@ -15208,7 +13638,7 @@ index 7c41a90..8811c7e 100644 +{ + CLog::Log(LOGDEBUG, "%s: Reading art for '%s' using %s scraper " + "(file: '%s', content: '%s', version: '%s')", __FUNCTION__, id.c_str(), Name().c_str(), Path().c_str(), -+ ADDON::TranslateContent(Content()).c_str(), Version().c_str()); ++ ADDON::TranslateContent(Content()).c_str(), Version().asString().c_str()); + + video.Reset(); + vector vcsIn; @@ -15300,13 +13730,13 @@ index 22ac229..75bc341 100644 enum LOOKUP_STATE { DO_NOTHING = 0, FIND_MOVIE = 1, -- -1.9.1 +1.9.3 -From cd95294b81587b20bc825152c18636501d646c7c Mon Sep 17 00:00:00 2001 +From 1a1a60df1d1ea44a2ae89895f7dfabe6d986a86c Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:53:14 +1300 -Subject: [PATCH 78/87] refresh season art if a new season is found that isn't +Subject: [PATCH 68/83] refresh season art if a new season is found that isn't recorded in the database yet. Fixes #14339 --- @@ -15315,10 +13745,10 @@ Subject: [PATCH 78/87] refresh season art if a new season is found that isn't 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/xbmc/video/VideoInfoScanner.cpp b/xbmc/video/VideoInfoScanner.cpp -index 717d336..3c2e5b0 100644 +index d755c52..76c0926 100644 --- a/xbmc/video/VideoInfoScanner.cpp +++ b/xbmc/video/VideoInfoScanner.cpp -@@ -1309,6 +1309,10 @@ namespace VIDEO +@@ -1312,6 +1312,10 @@ namespace VIDEO pDlgProgress->Progress(); } @@ -15329,7 +13759,7 @@ index 717d336..3c2e5b0 100644 EPISODELIST episodes; bool hasEpisodeGuide = false; -@@ -1357,6 +1361,8 @@ namespace VIDEO +@@ -1360,6 +1364,8 @@ namespace VIDEO } if (AddVideo(&item, CONTENT_TVSHOWS, file->isFolder, true, &showInfo) < 0) return INFO_ERROR; @@ -15338,7 +13768,7 @@ index 717d336..3c2e5b0 100644 continue; } -@@ -1486,6 +1492,8 @@ namespace VIDEO +@@ -1489,6 +1495,8 @@ namespace VIDEO if (AddVideo(&item, CONTENT_TVSHOWS, file->isFolder, useLocal, &showInfo) < 0) return INFO_ERROR; @@ -15347,7 +13777,7 @@ index 717d336..3c2e5b0 100644 } else { -@@ -1494,9 +1502,27 @@ namespace VIDEO +@@ -1497,9 +1505,27 @@ namespace VIDEO file->cDate.GetAsLocalizedDate().c_str(), file->strTitle.c_str()); } } @@ -15375,7 +13805,7 @@ index 717d336..3c2e5b0 100644 CStdString CVideoInfoScanner::GetnfoFile(CFileItem *item, bool bGrabAny) const { CStdString nfoFile; -@@ -1717,6 +1743,11 @@ namespace VIDEO +@@ -1720,6 +1746,11 @@ namespace VIDEO } for (int season = -1; season <= maxSeasons; season++) { @@ -15387,7 +13817,7 @@ index 717d336..3c2e5b0 100644 map art; if (useLocal) { -@@ -1770,7 +1801,7 @@ namespace VIDEO +@@ -1773,7 +1804,7 @@ namespace VIDEO art.insert(make_pair(artTypes.front(), image)); } @@ -15410,13 +13840,13 @@ index bb177d4..1ea47fd 100644 bool EnumerateEpisodeItem(const CFileItem *item, EPISODELIST& episodeList); bool ProcessItemByVideoInfoTag(const CFileItem *item, EPISODELIST &episodeList); -- -1.9.1 +1.9.3 -From 324ef7e6b156d4230977c7111cf5c2cab3de340f Mon Sep 17 00:00:00 2001 +From e4c7efbedf99acd123abab14792d094ab1a8fe26 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:53:34 +1300 -Subject: [PATCH 79/87] REMOVEME: updated thetvdb.com scraper to support art +Subject: [PATCH 69/83] REMOVEME: updated thetvdb.com scraper to support art updates --- @@ -15524,20 +13954,20 @@ index 4e2cc2f..2636c56 100644 -- -1.9.1 +1.9.3 -From f397ab9df7c4ed21297fc7d770c0e3055549922c Mon Sep 17 00:00:00 2001 +From c3720b83197964cef75806b9ee82fd7b38de890d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 22 Mar 2014 16:40:01 +0000 -Subject: [PATCH 80/87] Enable PYTHONOPTIMIZE for Pi +Subject: [PATCH 70/83] Enable PYTHONOPTIMIZE for Pi --- xbmc/interfaces/python/XBPython.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xbmc/interfaces/python/XBPython.cpp b/xbmc/interfaces/python/XBPython.cpp -index 01a129e..3937034 100644 +index 3793e39..6d099f8 100644 --- a/xbmc/interfaces/python/XBPython.cpp +++ b/xbmc/interfaces/python/XBPython.cpp @@ -436,6 +436,10 @@ bool XBPython::InitializeEngine() @@ -15552,13 +13982,13 @@ index 01a129e..3937034 100644 // Darwin packs .pyo files, we need PYTHONOPTIMIZE on in order to load them. #if defined(TARGET_DARWIN) -- -1.9.1 +1.9.3 -From 1644df774d77ac6643b03dd0db7da1ada4edd5c5 Mon Sep 17 00:00:00 2001 +From 2eeb62c3a9da20abd8bd81ef8a224829f148f014 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 4 Apr 2014 13:06:41 +0100 -Subject: [PATCH 81/87] [info] Only extract thumbnails and video info from real +Subject: [PATCH 71/83] [info] Only extract thumbnails and video info from real video stream --- @@ -15589,434 +14019,13 @@ index 4670fe5..dfbf323 100644 CStreamDetailVideo *p = new CStreamDetailVideo(); p->m_iWidth = ((CDemuxStreamVideo *)stream)->iWidth; -- -1.9.1 +1.9.3 -From 1392517ab0754b8f8696e7be361a764268f1ae38 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 7 Apr 2014 23:13:55 +0100 -Subject: [PATCH 82/87] [omxplayer] Add ability to dump out audio/video data - for later debugging - ---- - .../resources/language/English/strings.po | 8 ++++ - addons/xbmc.debug/resources/settings.xml | 2 + - xbmc/commons/ilog.h | 2 + - xbmc/cores/omxplayer/OMXAudio.cpp | 49 ++++++++++++++++++++++ - xbmc/cores/omxplayer/OMXVideo.cpp | 47 +++++++++++++++++++++ - 5 files changed, 108 insertions(+) - -diff --git a/addons/xbmc.debug/resources/language/English/strings.po b/addons/xbmc.debug/resources/language/English/strings.po -index 3f8b25a..5814c98 100644 ---- a/addons/xbmc.debug/resources/language/English/strings.po -+++ b/addons/xbmc.debug/resources/language/English/strings.po -@@ -47,3 +47,11 @@ msgstr "" - msgctxt "#30007" - msgid "Verbose logging for AUDIO component" - msgstr "" -+ -+msgctxt "#30008" -+msgid "Dump video frames to debug file" -+msgstr "" -+ -+msgctxt "#30009" -+msgid "Dump audio frames to debug file" -+msgstr "" -diff --git a/addons/xbmc.debug/resources/settings.xml b/addons/xbmc.debug/resources/settings.xml -index fe0a3d6..48577d5 100644 ---- a/addons/xbmc.debug/resources/settings.xml -+++ b/addons/xbmc.debug/resources/settings.xml -@@ -8,4 +8,6 @@ - - - -+ -+ - -diff --git a/xbmc/commons/ilog.h b/xbmc/commons/ilog.h -index ea3f6ba..5307caa 100644 ---- a/xbmc/commons/ilog.h -+++ b/xbmc/commons/ilog.h -@@ -50,6 +50,8 @@ - #define LOGDBUS (1 << (LOGMASKBIT+5)) - #define LOGJSONRPC (1 << (LOGMASKBIT+6)) - #define LOGAUDIO (1 << (LOGMASKBIT+7)) -+#define LOGDUMPVIDEO (1 << (LOGMASKBIT+8)) -+#define LOGDUMPAUDIO (1 << (LOGMASKBIT+9)) - - #ifdef __GNUC__ - #define ATTRIB_LOG_FORMAT __attribute__((format(printf,3,4))) -diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp -index 863209c..4bfd4e0 100644 ---- a/xbmc/cores/omxplayer/OMXAudio.cpp -+++ b/xbmc/cores/omxplayer/OMXAudio.cpp -@@ -60,6 +60,49 @@ static const uint16_t AC3FSCod [] = {48000, 44100, 32000, 0}; - - static const uint16_t DTSFSCod [] = {0, 8000, 16000, 32000, 0, 0, 11025, 22050, 44100, 0, 0, 12000, 24000, 48000, 0, 0}; - -+//#define DEBUG_PLAYBACK -+static void dump_omx_buffer(OMX_BUFFERHEADERTYPE *omx_buffer) -+{ -+ if (!(g_advancedSettings.m_extraLogLevels & LOGDUMPAUDIO)) -+ return; -+ static FILE *fp; -+ if (!omx_buffer) -+ { -+ if (fp) -+ { -+ fclose(fp); -+ fp = NULL; -+ } -+ return; -+ } -+ if (!fp) -+ { -+ char filename[1024]; -+ strcpy(filename, g_advancedSettings.m_logFolder.c_str()); -+ strcat(filename, "audio.dat"); -+#ifdef DEBUG_PLAYBACK -+ fp = fopen(filename, "rb"); -+#else -+ fp = fopen(filename, "wb"); -+#endif -+ } -+ if (fp) -+ { -+#ifdef DEBUG_PLAYBACK -+ OMX_BUFFERHEADERTYPE omx = {0}; -+ int s = fread(&omx, sizeof omx, 1, fp); -+ omx_buffer->nFilledLen = omx.nFilledLen; -+ omx_buffer->nFlags = omx.nFlags; -+ omx_buffer->nTimeStamp = omx.nTimeStamp; -+ if (s==1) -+ fread(omx_buffer->pBuffer, omx_buffer->nFilledLen, 1, fp); -+#else -+ if (fwrite(omx_buffer, sizeof *omx_buffer, 1, fp) == 1) -+ fwrite(omx_buffer->pBuffer, omx_buffer->nFilledLen, 1, fp); -+#endif -+ } -+} -+ - ////////////////////////////////////////////////////////////////////// - // Construction/Destruction - ////////////////////////////////////////////////////////////////////// -@@ -862,6 +905,7 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo - memcpy((unsigned char *)omx_buffer->pBuffer, &m_wave_header, omx_buffer->nFilledLen); - omx_buffer->nFlags = OMX_BUFFERFLAG_CODECCONFIG | OMX_BUFFERFLAG_ENDOFFRAME; - -+ dump_omx_buffer(omx_buffer); - omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); - if (omx_err != OMX_ErrorNone) - { -@@ -894,6 +938,7 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo - memcpy((unsigned char *)omx_buffer->pBuffer, m_extradata, omx_buffer->nFilledLen); - omx_buffer->nFlags = OMX_BUFFERFLAG_CODECCONFIG | OMX_BUFFERFLAG_ENDOFFRAME; - -+ dump_omx_buffer(omx_buffer); - omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); - if (omx_err != OMX_ErrorNone) - { -@@ -930,6 +975,8 @@ bool COMXAudio::Deinitialize() - { - CSingleLock lock (m_critSection); - -+ dump_omx_buffer(NULL); -+ - if ( m_omx_tunnel_clock_analog.IsInitialized() ) - m_omx_tunnel_clock_analog.Deestablish(); - if ( m_omx_tunnel_clock_hdmi.IsInitialized() ) -@@ -1222,6 +1269,7 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt - int nRetry = 0; - while(true) - { -+ dump_omx_buffer(omx_buffer); - omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); - if (omx_err == OMX_ErrorNone) - { -@@ -1490,6 +1538,7 @@ void COMXAudio::SubmitEOS() - - omx_buffer->nFlags = OMX_BUFFERFLAG_ENDOFFRAME | OMX_BUFFERFLAG_EOS | OMX_BUFFERFLAG_TIME_UNKNOWN; - -+ dump_omx_buffer(omx_buffer); - omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); - if (omx_err != OMX_ErrorNone) - { -diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp -index dceb8bf..2694bb3 100644 ---- a/xbmc/cores/omxplayer/OMXVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXVideo.cpp -@@ -63,6 +63,49 @@ - - #define MAX_TEXT_LENGTH 1024 - -+//#define DEBUG_PLAYBACK -+static void dump_omx_buffer(OMX_BUFFERHEADERTYPE *omx_buffer) -+{ -+ if (!(g_advancedSettings.m_extraLogLevels & LOGDUMPVIDEO)) -+ return; -+ static FILE *fp; -+ if (!omx_buffer) -+ { -+ if (fp) -+ { -+ fclose(fp); -+ fp = NULL; -+ } -+ return; -+ } -+ if (!fp) -+ { -+ char filename[1024]; -+ strcpy(filename, g_advancedSettings.m_logFolder.c_str()); -+ strcat(filename, "video.dat"); -+#ifdef DEBUG_PLAYBACK -+ fp = fopen(filename, "rb"); -+#else -+ fp = fopen(filename, "wb"); -+#endif -+ } -+ if (fp) -+ { -+#ifdef DEBUG_PLAYBACK -+ OMX_BUFFERHEADERTYPE omx = {0}; -+ int s = fread(&omx, sizeof omx, 1, fp); -+ omx_buffer->nFilledLen = omx.nFilledLen; -+ omx_buffer->nFlags = omx.nFlags; -+ omx_buffer->nTimeStamp = omx.nTimeStamp; -+ if (s==1) -+ fread(omx_buffer->pBuffer, omx_buffer->nFilledLen, 1, fp); -+#else -+ if (fwrite(omx_buffer, sizeof *omx_buffer, 1, fp) == 1) -+ fwrite(omx_buffer->pBuffer, omx_buffer->nFilledLen, 1, fp); -+#endif -+ } -+} -+ - COMXVideo::COMXVideo() : m_video_codec_name("") - { - m_is_open = false; -@@ -118,6 +161,7 @@ bool COMXVideo::SendDecoderConfig() - memcpy((unsigned char *)omx_buffer->pBuffer, m_extradata, omx_buffer->nFilledLen); - omx_buffer->nFlags = OMX_BUFFERFLAG_CODECCONFIG | OMX_BUFFERFLAG_ENDOFFRAME; - -+ dump_omx_buffer(omx_buffer); - omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); - if (omx_err != OMX_ErrorNone) - { -@@ -686,6 +730,7 @@ bool COMXVideo::Open(CDVDStreamInfo &hints, OMXClock *clock, EDEINTERLACEMODE de - void COMXVideo::Close() - { - CSingleLock lock (m_critSection); -+ dump_omx_buffer(NULL); - m_omx_tunnel_clock.Deestablish(); - m_omx_tunnel_decoder.Deestablish(); - if(m_deinterlace) -@@ -780,6 +825,7 @@ int COMXVideo::Decode(uint8_t *pData, int iSize, double pts) - int nRetry = 0; - while(true) - { -+ dump_omx_buffer(omx_buffer); - omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); - if (omx_err == OMX_ErrorNone) - { -@@ -909,6 +955,7 @@ void COMXVideo::SubmitEOS() - - omx_buffer->nFlags = OMX_BUFFERFLAG_ENDOFFRAME | OMX_BUFFERFLAG_EOS | OMX_BUFFERFLAG_TIME_UNKNOWN; - -+ dump_omx_buffer(omx_buffer); - omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); - if (omx_err != OMX_ErrorNone) - { --- -1.9.1 - - -From 83f08f4f74c356b64fa298f35d3e8d2462d5a365 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 11 Apr 2014 16:12:27 +0100 -Subject: [PATCH 83/87] [omxplayer] Add ability to log more timestamp info in - extra debug settings - ---- - .../resources/language/English/strings.po | 6 ++- - addons/xbmc.debug/resources/settings.xml | 1 + - xbmc/commons/ilog.h | 5 ++- - xbmc/cores/omxplayer/OMXPlayer.cpp | 52 +++++++++++----------- - xbmc/cores/omxplayer/OMXPlayerAudio.cpp | 8 ++-- - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 9 ++-- - 6 files changed, 44 insertions(+), 37 deletions(-) - -diff --git a/addons/xbmc.debug/resources/language/English/strings.po b/addons/xbmc.debug/resources/language/English/strings.po -index 5814c98..6a60966 100644 ---- a/addons/xbmc.debug/resources/language/English/strings.po -+++ b/addons/xbmc.debug/resources/language/English/strings.po -@@ -49,9 +49,13 @@ msgid "Verbose logging for AUDIO component" - msgstr "" - - msgctxt "#30008" --msgid "Dump video frames to debug file" -+msgid "Verbose logging for OMXPLAYER" - msgstr "" - - msgctxt "#30009" -+msgid "Dump video frames to debug file" -+msgstr "" -+ -+msgctxt "#30010" - msgid "Dump audio frames to debug file" - msgstr "" -diff --git a/addons/xbmc.debug/resources/settings.xml b/addons/xbmc.debug/resources/settings.xml -index 48577d5..3a59d15 100644 ---- a/addons/xbmc.debug/resources/settings.xml -+++ b/addons/xbmc.debug/resources/settings.xml -@@ -10,4 +10,5 @@ - - - -+ - -diff --git a/xbmc/commons/ilog.h b/xbmc/commons/ilog.h -index 5307caa..5b24d9d 100644 ---- a/xbmc/commons/ilog.h -+++ b/xbmc/commons/ilog.h -@@ -50,8 +50,9 @@ - #define LOGDBUS (1 << (LOGMASKBIT+5)) - #define LOGJSONRPC (1 << (LOGMASKBIT+6)) - #define LOGAUDIO (1 << (LOGMASKBIT+7)) --#define LOGDUMPVIDEO (1 << (LOGMASKBIT+8)) --#define LOGDUMPAUDIO (1 << (LOGMASKBIT+9)) -+#define LOGOMXPLAYER (1 << (LOGMASKBIT+8)) -+#define LOGDUMPVIDEO (1 << (LOGMASKBIT+9)) -+#define LOGDUMPAUDIO (1 << (LOGMASKBIT+10)) - - #ifdef __GNUC__ - #define ATTRIB_LOG_FORMAT __attribute__((format(printf,3,4))) -diff --git a/xbmc/cores/omxplayer/OMXPlayer.cpp b/xbmc/cores/omxplayer/OMXPlayer.cpp -index 92dd5c5..32eff2c 100644 ---- a/xbmc/cores/omxplayer/OMXPlayer.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayer.cpp -@@ -1554,27 +1554,28 @@ void COMXPlayer::Process() - m_video_fifo = (int)(100.0*(m_omxPlayerVideo.GetDecoderBufferSize()-m_omxPlayerVideo.GetDecoderFreeSpace())/m_omxPlayerVideo.GetDecoderBufferSize()); - m_audio_fifo = (int)(100.0*audio_fifo/m_omxPlayerAudio.GetCacheTotal()); - -- #ifdef _DEBUG -- static unsigned count; -- if ((count++ & 7) == 0) -+ if (g_advancedSettings.m_extraLogLevels & LOGOMXPLAYER) - { -- char response[80]; -- if (m_omxPlayerVideo.GetDecoderBufferSize() && m_omxPlayerAudio.GetCacheTotal()) -- vc_gencmd(response, sizeof response, "render_bar 4 video_fifo %d %d %d %d", -- m_video_fifo, -- (int)(100.0*video_fifo/m_omxPlayerAudio.GetCacheTotal()), -- 0, 100); -- if (m_omxPlayerAudio.GetCacheTotal()) -- vc_gencmd(response, sizeof response, "render_bar 5 audio_fifo %d %d %d %d", -- m_audio_fifo, -- (int)(100.0*m_omxPlayerAudio.GetDelay()/m_omxPlayerAudio.GetCacheTotal()), -- 0, 100); -- vc_gencmd(response, sizeof response, "render_bar 6 video_queue %d %d %d %d", -- m_omxPlayerVideo.GetLevel(), 0, 0, 100); -- vc_gencmd(response, sizeof response, "render_bar 7 audio_queue %d %d %d %d", -- m_omxPlayerAudio.GetLevel(), 0, 0, 100); -+ static unsigned count; -+ if ((count++ & 7) == 0) -+ { -+ char response[80]; -+ if (m_omxPlayerVideo.GetDecoderBufferSize() && m_omxPlayerAudio.GetCacheTotal()) -+ vc_gencmd(response, sizeof response, "render_bar 4 video_fifo %d %d %d %d", -+ m_video_fifo, -+ (int)(100.0*video_fifo/m_omxPlayerAudio.GetCacheTotal()), -+ 0, 100); -+ if (m_omxPlayerAudio.GetCacheTotal()) -+ vc_gencmd(response, sizeof response, "render_bar 5 audio_fifo %d %d %d %d", -+ m_audio_fifo, -+ (int)(100.0*m_omxPlayerAudio.GetDelay()/m_omxPlayerAudio.GetCacheTotal()), -+ 0, 100); -+ vc_gencmd(response, sizeof response, "render_bar 6 video_queue %d %d %d %d", -+ m_omxPlayerVideo.GetLevel(), 0, 0, 100); -+ vc_gencmd(response, sizeof response, "render_bar 7 audio_queue %d %d %d %d", -+ m_omxPlayerAudio.GetLevel(), 0, 0, 100); -+ } - } -- #endif - if (audio_pts != DVD_NOPTS_VALUE) - { - audio_fifo_low = m_HasAudio && audio_fifo < threshold; -@@ -1590,13 +1591,12 @@ void COMXPlayer::Process() - if (!m_HasVideo && m_HasAudio) - video_fifo_high = true; - -- #ifdef _DEBUG -- CLog::Log(LOGDEBUG, "%s - M:%.6f-%.6f (A:%.6f V:%.6f) PEF:%d%d%d S:%.2f A:%.2f V:%.2f/T:%.2f (A:%d%d V:%d%d) A:%d%% V:%d%% (%.2f,%.2f)", __FUNCTION__, -- m_stamp*1e-6, m_av_clock.OMXClockAdjustment()*1e-6, audio_pts*1e-6, video_pts*1e-6, m_av_clock.OMXIsPaused(), bOmxSentEOFs, not_accepts_data, m_playSpeed * (1.0f/DVD_PLAYSPEED_NORMAL), -- audio_pts == DVD_NOPTS_VALUE ? 0.0:audio_fifo, video_pts == DVD_NOPTS_VALUE ? 0.0:video_fifo, m_threshold, -- audio_fifo_low, audio_fifo_high, video_fifo_low, video_fifo_high, -- m_omxPlayerAudio.GetLevel(), m_omxPlayerVideo.GetLevel(), m_omxPlayerAudio.GetDelay(), (float)m_omxPlayerAudio.GetCacheTotal()); -- #endif -+ if (g_advancedSettings.m_extraLogLevels & LOGOMXPLAYER) -+ CLog::Log(LOGDEBUG, "%s - M:%.6f-%.6f (A:%.6f V:%.6f) PEF:%d%d%d S:%.2f A:%.2f V:%.2f/T:%.2f (A:%d%d V:%d%d) A:%d%% V:%d%% (%.2f,%.2f)", __FUNCTION__, -+ m_stamp*1e-6, m_av_clock.OMXClockAdjustment()*1e-6, audio_pts*1e-6, video_pts*1e-6, m_av_clock.OMXIsPaused(), bOmxSentEOFs, not_accepts_data, m_playSpeed * (1.0f/DVD_PLAYSPEED_NORMAL), -+ audio_pts == DVD_NOPTS_VALUE ? 0.0:audio_fifo, video_pts == DVD_NOPTS_VALUE ? 0.0:video_fifo, m_threshold, -+ audio_fifo_low, audio_fifo_high, video_fifo_low, video_fifo_high, -+ m_omxPlayerAudio.GetLevel(), m_omxPlayerVideo.GetLevel(), m_omxPlayerAudio.GetDelay(), (float)m_omxPlayerAudio.GetCacheTotal()); - - if (TP(m_playSpeed)) - { -diff --git a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp -index d3348ec..7ec004b 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp -@@ -364,10 +364,10 @@ void OMXPlayerAudio::Process() - DemuxPacket* pPacket = ((CDVDMsgDemuxerPacket*)pMsg)->GetPacket(); - bool bPacketDrop = ((CDVDMsgDemuxerPacket*)pMsg)->GetPacketDrop(); - -- #ifdef _DEBUG -- CLog::Log(LOGINFO, "Audio: dts:%.0f pts:%.0f size:%d (s:%d f:%d d:%d l:%d) s:%d %d/%d late:%d,%d", pPacket->dts, pPacket->pts, -- (int)pPacket->iSize, m_started, m_flush, bPacketDrop, m_stalled, m_speed, 0, 0, (int)m_omxAudio.GetAudioRenderingLatency(), (int)m_hints_current.samplerate); -- #endif -+ if (g_advancedSettings.m_extraLogLevels & LOGOMXPLAYER) -+ CLog::Log(LOGINFO, "Audio: dts:%.0f pts:%.0f size:%d (s:%d f:%d d:%d l:%d) s:%d %d/%d late:%d,%d", pPacket->dts, pPacket->pts, -+ (int)pPacket->iSize, m_started, m_flush, bPacketDrop, m_stalled, m_speed, 0, 0, (int)m_omxAudio.GetAudioRenderingLatency(), (int)m_hints_current.samplerate); -+ - if(Decode(pPacket, m_speed > DVD_PLAYSPEED_NORMAL || m_speed < 0 || bPacketDrop)) - { - // we are not running until something is cached in output device -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index b3786f6..b54b065 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -42,6 +42,7 @@ - #include "DVDOverlayRenderer.h" - #include "settings/DisplaySettings.h" - #include "settings/Settings.h" -+#include "settings/AdvancedSettings.h" - #include "settings/MediaSettings.h" - #include "cores/VideoRenderers/RenderFormats.h" - #include "cores/VideoRenderers/RenderFlags.h" -@@ -451,10 +452,10 @@ void OMXPlayerVideo::Process() - DemuxPacket* pPacket = ((CDVDMsgDemuxerPacket*)pMsg)->GetPacket(); - bool bPacketDrop = ((CDVDMsgDemuxerPacket*)pMsg)->GetPacketDrop(); - -- #ifdef _DEBUG -- CLog::Log(LOGINFO, "Video: dts:%.0f pts:%.0f size:%d (s:%d f:%d d:%d l:%d) s:%d %d/%d late:%d\n", pPacket->dts, pPacket->pts, -- (int)pPacket->iSize, m_started, m_flush, bPacketDrop, m_stalled, m_speed, 0, 0, 0); -- #endif -+ if (g_advancedSettings.m_extraLogLevels & LOGOMXPLAYER) -+ CLog::Log(LOGINFO, "Video: dts:%.0f pts:%.0f size:%d (s:%d f:%d d:%d l:%d) s:%d %d/%d late:%d\n", pPacket->dts, pPacket->pts, -+ (int)pPacket->iSize, m_started, m_flush, bPacketDrop, m_stalled, m_speed, 0, 0, 0); -+ - if (m_messageQueue.GetDataSize() == 0 - || m_speed < 0) - { --- -1.9.1 - - -From 0d3fa7732391422063597baa6da49fd2edc1d09c Mon Sep 17 00:00:00 2001 +From c7f36106aea4b3e72b770464608b59f6a28d56ca Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 28 Apr 2014 18:07:45 +0100 -Subject: [PATCH 84/87] [rpi] Make ActiveAE thread higher priority to make +Subject: [PATCH 72/83] [rpi] Make ActiveAE thread higher priority to make audio underrun less likely --- @@ -16041,13 +14050,13 @@ index 974a852..318f1d4 100644 if (m_controlPort.SendOutMessageSync(CActiveAEControlProtocol::INIT, &reply, -- -1.9.1 +1.9.3 -From 2f08e08290c2cc7325b6fb7df15223ca19205226 Mon Sep 17 00:00:00 2001 +From 77f22f1884ff5b9a536ea9e7bb29cd99b704575a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 29 Apr 2014 15:23:22 +0100 -Subject: [PATCH 85/87] [ffmpeg] Speed up wtv index creation +Subject: [PATCH 73/83] [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. @@ -16060,7 +14069,7 @@ By replacing with an O(N) loop, this takes virtually zero time create mode 100644 tools/depends/target/ffmpeg/ffmpeg_Speed_up_wtv_index_creation.patch diff --git a/tools/depends/target/ffmpeg/Makefile b/tools/depends/target/ffmpeg/Makefile -index cb6b6be..bd3f0ee 100644 +index 51e1918..f514ae6 100644 --- a/tools/depends/target/ffmpeg/Makefile +++ b/tools/depends/target/ffmpeg/Makefile @@ -1,6 +1,6 @@ @@ -16071,7 +14080,7 @@ index cb6b6be..bd3f0ee 100644 # set to "yes" to enable patching # we don't apply patches until we move to a vanilla ffmpeg tarball -@@ -62,6 +62,7 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) +@@ -63,6 +63,7 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) rm -rf $(PLATFORM); mkdir -p $(PLATFORM) cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) cd $(PLATFORM); sed -i".bak" -e "s%pkg_config_default=pkg-config%export PKG_CONFIG_LIBDIR=$(PREFIX)/lib/pkgconfig\npkg_config_default=$(NATIVEPREFIX)/bin/pkg-config%" configure @@ -16133,13 +14142,13 @@ index 0000000..8f5f989 + } + } -- -1.9.1 +1.9.3 -From 8616d0bb74f44f0dd9e29fd44bd61b079614cbff Mon Sep 17 00:00:00 2001 +From d6045f93b286a1f6b37e69032c9119d13dda9451 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 29 Apr 2014 15:55:28 +0100 -Subject: [PATCH 86/87] [ffmpeg] vc-1: Optimise parser (with special attention +Subject: [PATCH 74/83] [ffmpeg] vc-1: Optimise parser (with special attention to ARM) Backport from upstream ffmpeg @@ -17468,7 +15477,7 @@ index 0000000..1f0cf40 +-- +1.9.1 diff --git a/tools/depends/target/ffmpeg/Makefile b/tools/depends/target/ffmpeg/Makefile -index bd3f0ee..61b5fc2 100644 +index f514ae6..863ee41 100644 --- a/tools/depends/target/ffmpeg/Makefile +++ b/tools/depends/target/ffmpeg/Makefile @@ -1,6 +1,9 @@ @@ -17482,7 +15491,7 @@ index bd3f0ee..61b5fc2 100644 # set to "yes" to enable patching # we don't apply patches until we move to a vanilla ffmpeg tarball -@@ -63,6 +66,9 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) +@@ -64,6 +67,9 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) cd $(PLATFORM); sed -i".bak" -e "s%pkg_config_default=pkg-config%export PKG_CONFIG_LIBDIR=$(PREFIX)/lib/pkgconfig\npkg_config_default=$(NATIVEPREFIX)/bin/pkg-config%" configure cd $(PLATFORM); patch -p3 < ../ffmpeg_Speed_up_wtv_index_creation.patch @@ -17493,13 +15502,13 @@ index bd3f0ee..61b5fc2 100644 CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \ ./configure $(ffmpg_config) -- -1.9.1 +1.9.3 -From 5a939a017a10aaef41f90d46bd1d73f8a830ce2c Mon Sep 17 00:00:00 2001 +From a800607bcf003b0958995e402428b19411d87c89 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 29 Apr 2014 16:53:32 +0100 -Subject: [PATCH 87/87] [ffmpeg] truehd: Optimise with special attention to ARM +Subject: [PATCH 75/83] [ffmpeg] truehd: Optimise with special attention to ARM Backport from upstream ffmpeg --- @@ -19506,7 +17515,7 @@ index 0000000..93add62 +-- +1.9.1 diff --git a/tools/depends/target/ffmpeg/Makefile b/tools/depends/target/ffmpeg/Makefile -index 61b5fc2..e3790c3 100644 +index 863ee41..b56fbdd 100644 --- a/tools/depends/target/ffmpeg/Makefile +++ b/tools/depends/target/ffmpeg/Makefile @@ -2,8 +2,10 @@ include ../../Makefile.include @@ -19522,7 +17531,7 @@ index 61b5fc2..e3790c3 100644 # set to "yes" to enable patching # we don't apply patches until we move to a vanilla ffmpeg tarball -@@ -69,6 +71,13 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) +@@ -70,6 +72,13 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) cd $(PLATFORM); patch -p1 < ../0001-h264-Move-search-code-search-functions-into-separate.patch cd $(PLATFORM); patch -p1 < ../0002-vc-1-Add-platform-specific-start-code-search-routine.patch cd $(PLATFORM); patch -p1 < ../0003-vc-1-Optimise-parser-with-special-attention-to-ARM.patch @@ -19537,5 +17546,909 @@ index 61b5fc2..e3790c3 100644 CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \ ./configure $(ffmpg_config) -- -1.9.1 +1.9.3 + + +From a0abed3c234d1362471766d2248ed3937e41eed1 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sat, 10 May 2014 11:40:41 +0100 +Subject: [PATCH 76/83] [omxplayer] Skip out of submit loop when closing. + +Avoids a permanent hang at EOF when using IPTV streams +--- + xbmc/cores/omxplayer/OMXPlayerAudio.cpp | 7 +++++-- + xbmc/cores/omxplayer/OMXPlayerAudio.h | 1 + + xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 7 +++++-- + xbmc/cores/omxplayer/OMXPlayerVideo.h | 1 + + 4 files changed, 12 insertions(+), 4 deletions(-) + +diff --git a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp +index d3348ec..4435d22 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp +@@ -89,6 +89,7 @@ OMXPlayerAudio::OMXPlayerAudio(OMXClock *av_clock, CDVDMessageQueue& parent) + m_hw_decode = false; + m_silence = false; + m_flush = false; ++ m_bClose = false; + } + + +@@ -145,11 +146,13 @@ void OMXPlayerAudio::OpenStream(CDVDStreamInfo &hints, COMXAudioCodecOMX *codec) + m_format.m_dataFormat = GetDataFormat(m_hints); + m_format.m_sampleRate = 0; + m_format.m_channelLayout = 0; ++ m_bClose = false; + } + + bool OMXPlayerAudio::CloseStream(bool bWaitForBuffers) + { + // wait until buffers are empty ++ m_bClose = true; + if (bWaitForBuffers && m_speed > 0) m_messageQueue.WaitUntilEmpty(); + + m_messageQueue.Abort(); +@@ -259,8 +262,8 @@ bool OMXPlayerAudio::Decode(DemuxPacket *pkt, bool bDropPacket) + + while(!m_bStop) + { +- // discard if flushing as clocks may be stopped and we'll never submit it +- if(m_flush) ++ // discard if flushing or closing as clocks may be stopped and we'll never submit it ++ if(m_flush || m_bClose) + break; + + if(m_omxAudio.GetSpace() < (unsigned int)decoded_size) +diff --git a/xbmc/cores/omxplayer/OMXPlayerAudio.h b/xbmc/cores/omxplayer/OMXPlayerAudio.h +index 685a686..7b55e48 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerAudio.h ++++ b/xbmc/cores/omxplayer/OMXPlayerAudio.h +@@ -70,6 +70,7 @@ class OMXPlayerAudio : public CThread + bool m_DecoderOpen; + + bool m_bad_state; ++ bool m_bClose; + + virtual void OnStartup(); + virtual void OnExit(); +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +index b3786f6..61b884e 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +@@ -104,6 +104,7 @@ OMXPlayerVideo::OMXPlayerVideo(OMXClock *av_clock, + m_iCurrentPts = DVD_NOPTS_VALUE; + m_nextOverlay = DVD_NOPTS_VALUE; + m_flush = false; ++ m_bClose = false; + m_history_valid_pts = 0; + } + +@@ -118,6 +119,7 @@ bool OMXPlayerVideo::OpenStream(CDVDStreamInfo &hints) + m_hdmi_clock_sync = (CSettings::Get().GetInt("videoplayer.adjustrefreshrate") != ADJUST_REFRESHRATE_OFF); + m_started = false; + m_flush = false; ++ m_bClose = false; + m_stalled = m_messageQueue.GetPacketCount(CDVDMsg::DEMUXER_PACKET) == 0; + m_nextOverlay = DVD_NOPTS_VALUE; + // force SetVideoRect to be called initially +@@ -161,6 +163,7 @@ bool OMXPlayerVideo::OpenStream(CDVDStreamInfo &hints, COMXVideo *codec) + bool OMXPlayerVideo::CloseStream(bool bWaitForBuffers) + { + // wait until buffers are empty ++ m_bClose = true; + if (bWaitForBuffers && m_speed > 0) m_messageQueue.WaitUntilEmpty(); + + m_messageQueue.Abort(); +@@ -469,8 +472,8 @@ void OMXPlayerVideo::Process() + + while (!m_bStop) + { +- // discard if flushing as clocks may be stopped and we'll never submit it +- if (m_flush) ++ // discard if flushing or closing as clocks may be stopped and we'll never submit it ++ if (m_flush || m_bClose) + break; + + if((int)m_omxVideo.GetFreeSpace() < pPacket->iSize) +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.h b/xbmc/cores/omxplayer/OMXPlayerVideo.h +index 6f19395..8eff32f 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.h ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.h +@@ -66,6 +66,7 @@ class OMXPlayerVideo : public CThread + + float m_fForcedAspectRatio; + unsigned m_flags; ++ bool m_bClose; + + CRect m_src_rect; + CRect m_dst_rect; +-- +1.9.3 + + +From e2c1e3c26e97a7804da7e752213a049a54dec50c Mon Sep 17 00:00:00 2001 +From: Alex Deryskyba +Date: Thu, 8 May 2014 18:54:54 +0300 +Subject: [PATCH 77/83] Reset display region when video stream properties + change + +Currently when video stream properties change, e.g. when user switches to next or previous Live TV channel, and has the same frame width and height, the COMXVideo::SetVideoRect() method is not called, causing the video to play back with default source and destination rectangles, not respecting the user-defined zoom settings. + +This commit fixes the issue. +--- + xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +index 61b884e..eaa1e34 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +@@ -781,6 +781,9 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f + return; + } + ++ m_src_rect.SetRect(0, 0, 0, 0); ++ m_dst_rect.SetRect(0, 0, 0, 0); ++ + g_renderManager.RegisterRenderUpdateCallBack((const void*)this, RenderUpdateCallBack); + } + +-- +1.9.3 + + +From c3fd848dc3b6951473edd405b27bc2fd73d01625 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 11 May 2014 16:13:45 +0100 +Subject: [PATCH 78/83] [rbp] Add config.txt settings to log file + +--- + xbmc/linux/RBP.cpp | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp +index 49dcbb8..9a5e9cb 100644 +--- a/xbmc/linux/RBP.cpp ++++ b/xbmc/linux/RBP.cpp +@@ -79,11 +79,17 @@ bool CRBP::Initialize() + + void CRBP::LogFirmwareVerison() + { +- char response[160]; ++ char response[1024]; + m_DllBcmHost->vc_gencmd(response, sizeof response, "version"); + response[sizeof(response) - 1] = '\0'; + CLog::Log(LOGNOTICE, "Raspberry PI firmware version: %s", response); + CLog::Log(LOGNOTICE, "ARM mem: %dMB GPU mem: %dMB MPG2:%d WVC1:%d", m_arm_mem, m_gpu_mem, m_codec_mpg2_enabled, m_codec_wvc1_enabled); ++ m_DllBcmHost->vc_gencmd(response, sizeof response, "get_config int"); ++ response[sizeof(response) - 1] = '\0'; ++ CLog::Log(LOGNOTICE, "Config:\n%s", response); ++ m_DllBcmHost->vc_gencmd(response, sizeof response, "get_config str"); ++ response[sizeof(response) - 1] = '\0'; ++ CLog::Log(LOGNOTICE, "Config:\n%s", response); + } + + void CRBP::GetDisplaySize(int &width, int &height) +-- +1.9.3 + + +From b79741f61b5b0f589446e6dd3d5fdbcf83617590 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 12 May 2014 23:06:43 +0100 +Subject: [PATCH 81/83] [omxcodec] Updates to work better with dropping and + lateness detection + +--- + .../DVDCodecs/Video/DVDVideoCodecOpenMax.cpp | 5 ++ + .../DVDCodecs/Video/DVDVideoCodecOpenMax.h | 1 + + .../dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp | 95 ++++++++++++++++------ + .../cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.h | 9 +- + 4 files changed, 84 insertions(+), 26 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecOpenMax.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecOpenMax.cpp +index ef10555..8323497 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecOpenMax.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecOpenMax.cpp +@@ -91,4 +91,9 @@ bool CDVDVideoCodecOpenMax::ClearPicture(DVDVideoPicture* pDvdVideoPicture) + return m_omx_decoder->ClearPicture(pDvdVideoPicture); + } + ++bool CDVDVideoCodecOpenMax::GetCodecStats(double &pts, int &droppedPics) ++{ ++ return m_omx_decoder->GetCodecStats(pts, droppedPics); ++} ++ + #endif +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecOpenMax.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecOpenMax.h +index b7c0c1b..4f243df 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecOpenMax.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecOpenMax.h +@@ -41,6 +41,7 @@ class CDVDVideoCodecOpenMax : public CDVDVideoCodec + virtual unsigned GetAllowedReferences(); + virtual void SetDropState(bool bDrop); + virtual const char* GetName(void); ++ virtual bool GetCodecStats(double &pts, int &droppedPics); + + protected: + OpenMaxVideoPtr m_omx_decoder; +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp +index 71d19af..93cf521 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp +@@ -37,6 +37,7 @@ + #include "ApplicationMessenger.h" + #include "Application.h" + #include "threads/Atomics.h" ++#include "guilib/GUIWindowManager.h" + + #include + #include +@@ -57,6 +58,7 @@ + + #define OMX_BUFFERFLAG_PTS_INVALID (1<<28) + #define OMX_BUFFERFLAG_DROPPED (1<<29) ++#define OMX_BUFFERFLAG_FIRST_FIELD (1<<30) + + COpenMaxVideoBuffer::COpenMaxVideoBuffer(COpenMaxVideo *omv) + : m_omv(omv), m_refs(0) +@@ -139,8 +141,11 @@ COpenMaxVideo::COpenMaxVideo() + + m_deinterlace = false; + m_deinterlace_request = VS_DEINTERLACEMODE_OFF; +- m_deinterlace_second_field = false; + m_startframe = false; ++ m_decoderPts = DVD_NOPTS_VALUE; ++ m_droppedPics = 0; ++ m_decode_frame_number = 1; ++ m_skipDeinterlaceFields = false; + } + + COpenMaxVideo::~COpenMaxVideo() +@@ -369,7 +374,10 @@ void COpenMaxVideo::Dispose() + m_finished = true; + pthread_mutex_unlock(&m_omx_output_mutex); + if (done) ++ { ++ assert(m_dts_queue.empty()); + m_myself.reset(); ++ } + } + + void COpenMaxVideo::SetDropState(bool bDrop) +@@ -730,6 +738,7 @@ int COpenMaxVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) + omx_buffer->nFilledLen = (demuxer_bytes > omx_buffer->nAllocLen) ? omx_buffer->nAllocLen : demuxer_bytes; + omx_buffer->nTimeStamp = ToOMXTime((uint64_t)(pts == DVD_NOPTS_VALUE) ? 0 : pts); + omx_buffer->pAppPrivate = omx_buffer; ++ omx_buffer->pMarkData = (OMX_PTR)m_decode_frame_number; + memcpy(omx_buffer->pBuffer, demuxer_content, omx_buffer->nFilledLen); + + demuxer_bytes -= omx_buffer->nFilledLen; +@@ -742,12 +751,18 @@ int COpenMaxVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) + omx_buffer->nFlags |= OMX_BUFFERFLAG_TIME_UNKNOWN; + if (pts == DVD_NOPTS_VALUE) // hijack an omx flag to indicate there wasn't a real timestamp - it will be returned with the picture (but otherwise ignored) + omx_buffer->nFlags |= OMX_BUFFERFLAG_PTS_INVALID; +- if (m_drop_state) // hijack an omx flag to signal this frame to be dropped - it will be returned with the picture (but otherwise ignored) ++ if (m_drop_state) ++ { ++ // hijack an omx flag to signal this frame to be dropped - it will be returned with the picture (but otherwise ignored) + omx_buffer->nFlags |= OMX_BUFFERFLAG_DECODEONLY | OMX_BUFFERFLAG_DROPPED; ++ m_droppedPics += m_deinterlace ? 2:1; ++ } ++ // always set this flag on input. It won't be set on second field of interlaced video. ++ omx_buffer->nFlags |= OMX_BUFFERFLAG_FIRST_FIELD; + + #if defined(OMX_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - %-6d dts:%.3f pts:%.3f flags:%x", +- CLASSNAME, __func__, omx_buffer->nFilledLen, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, omx_buffer->nFlags); ++ CLog::Log(LOGDEBUG, "%s::%s - %-6d dts:%.3f pts:%.3f flags:%x frame:%d", ++ CLASSNAME, __func__, omx_buffer->nFilledLen, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, omx_buffer->nFlags, (int)omx_buffer->pMarkData); + #endif + + omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); +@@ -758,13 +773,16 @@ int COpenMaxVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) + } + if (demuxer_bytes == 0) + { ++ m_decode_frame_number++; + m_startframe = true; + #ifdef DTS_QUEUE + if (!m_drop_state) + { + // only push if we are successful with feeding OMX_EmptyThisBuffer ++ pthread_mutex_lock(&m_omx_output_mutex); + m_dts_queue.push(dts); + assert(m_dts_queue.size() < 32); ++ pthread_mutex_unlock(&m_omx_output_mutex); + } + #endif + if (buffer_to_free) +@@ -840,13 +858,18 @@ void COpenMaxVideo::Reset(void) + SetDropState(true); + SetDropState(false); + #ifdef DTS_QUEUE ++ pthread_mutex_lock(&m_omx_output_mutex); + while (!m_dts_queue.empty()) + m_dts_queue.pop(); ++ pthread_mutex_unlock(&m_omx_output_mutex); + #endif + + while (!m_demux_queue.empty()) + m_demux_queue.pop(); + m_startframe = false; ++ m_decoderPts = DVD_NOPTS_VALUE; ++ m_droppedPics = 0; ++ m_decode_frame_number = 1; + } + + +@@ -928,26 +951,17 @@ bool COpenMaxVideo::GetPicture(DVDVideoPicture* pDvdVideoPicture) + } + } + +-#ifdef DTS_QUEUE +- if (!m_deinterlace_second_field) +- { +- assert(!m_dts_queue.empty()); +- pDvdVideoPicture->dts = m_dts_queue.front(); +- m_dts_queue.pop(); +- } +- if (m_deinterlace) +- m_deinterlace_second_field = !m_deinterlace_second_field; +-#endif + // nTimeStamp is in microseconds ++ pDvdVideoPicture->dts = buffer->dts; + pDvdVideoPicture->pts = FromOMXTime(buffer->omx_buffer->nTimeStamp); + pDvdVideoPicture->openMaxBuffer->Acquire(); + pDvdVideoPicture->iFlags = DVP_FLAG_ALLOCATED; + if (buffer->omx_buffer->nFlags & OMX_BUFFERFLAG_PTS_INVALID) + pDvdVideoPicture->pts = DVD_NOPTS_VALUE; + #if defined(OMX_DEBUG_VERBOSE) +- CLog::Log(LOGINFO, "%s::%s dts:%.3f pts:%.3f flags:%x:%x openMaxBuffer:%p omx_buffer:%p egl_image:%p texture_id:%x", CLASSNAME, __func__, ++ CLog::Log(LOGINFO, "%s::%s dts:%.3f pts:%.3f flags:%x:%x frame:%d openMaxBuffer:%p omx_buffer:%p egl_image:%p texture_id:%x", CLASSNAME, __func__, + pDvdVideoPicture->dts == DVD_NOPTS_VALUE ? 0.0 : pDvdVideoPicture->dts*1e-6, pDvdVideoPicture->pts == DVD_NOPTS_VALUE ? 0.0 : pDvdVideoPicture->pts*1e-6, +- pDvdVideoPicture->iFlags, buffer->omx_buffer->nFlags, pDvdVideoPicture->openMaxBuffer, pDvdVideoPicture->openMaxBuffer->omx_buffer, pDvdVideoPicture->openMaxBuffer->egl_image, pDvdVideoPicture->openMaxBuffer->texture_id); ++ pDvdVideoPicture->iFlags, buffer->omx_buffer->nFlags, (int)buffer->omx_buffer->pMarkData, pDvdVideoPicture->openMaxBuffer, pDvdVideoPicture->openMaxBuffer->omx_buffer, pDvdVideoPicture->openMaxBuffer->egl_image, pDvdVideoPicture->openMaxBuffer->texture_id); + #endif + assert(!(buffer->omx_buffer->nFlags & (OMX_BUFFERFLAG_DECODEONLY | OMX_BUFFERFLAG_DROPPED))); + } +@@ -956,6 +970,12 @@ bool COpenMaxVideo::GetPicture(DVDVideoPicture* pDvdVideoPicture) + CLog::Log(LOGERROR, "%s::%s - called but m_omx_output_ready is empty", CLASSNAME, __func__); + return false; + } ++ ++ if (pDvdVideoPicture->pts != DVD_NOPTS_VALUE) ++ m_decoderPts = pDvdVideoPicture->pts; ++ else ++ m_decoderPts = pDvdVideoPicture->dts; // xxx is DVD_NOPTS_VALUE better? ++ + return true; + } + +@@ -970,25 +990,54 @@ bool COpenMaxVideo::ClearPicture(DVDVideoPicture* pDvdVideoPicture) + return true; + } + ++bool COpenMaxVideo::GetCodecStats(double &pts, int &droppedPics) ++{ ++ pts = m_decoderPts; ++ droppedPics = m_droppedPics; ++ m_droppedPics = 0; ++ CLog::Log(LOGDEBUG, "%s::%s - pts:%.0f droppedPics:%d", CLASSNAME, __func__, pts, droppedPics); ++ return true; ++} ++ + // DecoderFillBufferDone -- OpenMax output buffer has been filled + OMX_ERRORTYPE COpenMaxVideo::DecoderFillBufferDone( + OMX_HANDLETYPE hComponent, + OMX_BUFFERHEADERTYPE* pBuffer) + { + COpenMaxVideoBuffer *buffer = (COpenMaxVideoBuffer*)pBuffer->pAppPrivate; ++ bool skipDeinterlaceFields = m_skipDeinterlaceFields || g_windowManager.HasDialogOnScreen(); + + #if defined(OMX_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - %p (%p,%p) buffer_size(%u), pts:%.3f flags:%x", +- CLASSNAME, __func__, buffer, pBuffer, buffer->omx_buffer, pBuffer->nFilledLen, (double)FromOMXTime(buffer->omx_buffer->nTimeStamp)*1e-6, buffer->omx_buffer->nFlags); ++ CLog::Log(LOGDEBUG, "%s::%s - %p (%p,%p) buffer_size(%u), pts:%.3f flags:%x frame:%d win:%x", ++ CLASSNAME, __func__, buffer, pBuffer, buffer->omx_buffer, pBuffer->nFilledLen, (double)FromOMXTime(buffer->omx_buffer->nTimeStamp)*1e-6, buffer->omx_buffer->nFlags, (int)buffer->omx_buffer->pMarkData, skipDeinterlaceFields); + #endif + + assert(!(buffer->omx_buffer->nFlags & (OMX_BUFFERFLAG_DECODEONLY | OMX_BUFFERFLAG_DROPPED))); +- // queue output omx buffer to ready list. +- pthread_mutex_lock(&m_omx_output_mutex); +- buffer->m_aspect_ratio = m_aspect_ratio; +- m_omx_output_ready.push(buffer); +- pthread_mutex_unlock(&m_omx_output_mutex); + ++ ++ // flags have OMX_BUFFERFLAG_FIRST_FIELD set if this is a direct result of a submitted frame, ++ // clear for second field of deinterlaced frame. They are zero when frame is returned due to a flush. ++#ifdef DTS_QUEUE ++ if ((!m_deinterlace || (buffer->omx_buffer->nFlags & OMX_BUFFERFLAG_FIRST_FIELD)) && buffer->omx_buffer->nFlags) ++ { ++ pthread_mutex_lock(&m_omx_output_mutex); ++ assert(!m_dts_queue.empty()); ++ buffer->dts = m_dts_queue.front(); ++ m_dts_queue.pop(); ++ pthread_mutex_unlock(&m_omx_output_mutex); ++ } ++#endif ++ if (m_drop_state || (m_deinterlace && skipDeinterlaceFields && !(buffer->omx_buffer->nFlags & OMX_BUFFERFLAG_FIRST_FIELD))) ++ { ++ ReturnOpenMaxBuffer(buffer); ++ } ++ else ++ { ++ buffer->m_aspect_ratio = m_aspect_ratio; ++ pthread_mutex_lock(&m_omx_output_mutex); ++ m_omx_output_ready.push(buffer); ++ pthread_mutex_unlock(&m_omx_output_mutex); ++ } + return OMX_ErrorNone; + } + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.h +index f234f6d..adf53b5 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.h +@@ -57,6 +57,7 @@ class COpenMaxVideoBuffer + int height; + float m_aspect_ratio; + int index; ++ double dts; + + // used for egl based rendering if active + EGLImageKHR egl_image; +@@ -87,6 +88,7 @@ class COpenMaxVideo + virtual unsigned GetAllowedReferences() { return 2; } + virtual void SetDropState(bool bDrop); + virtual const char* GetName(void) { return (const char*)m_pFormatName; } ++ virtual bool GetCodecStats(double &pts, int &droppedPics); + + // OpenMax decoder callback routines. + OMX_ERRORTYPE DecoderFillBufferDone(OMX_HANDLETYPE hComponent, OMX_BUFFERHEADERTYPE* pBuffer); +@@ -142,10 +144,11 @@ class COpenMaxVideo + + bool m_deinterlace; + EDEINTERLACEMODE m_deinterlace_request; +- bool m_deinterlace_second_field; +- + bool m_startframe; +- ++ unsigned int m_decode_frame_number; ++ double m_decoderPts; ++ unsigned int m_droppedPics; ++ bool m_skipDeinterlaceFields; + bool PortSettingsChanged(); + bool SendDecoderConfig(uint8_t *extradata, int extrasize); + bool NaluFormatStartCodes(enum AVCodecID codec, uint8_t *extradata, int extrasize); +-- +1.9.3 + + +From 82751192a8757cfa8800278cbe871b0c48bff8ac Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 11 Apr 2014 16:12:27 +0100 +Subject: [PATCH 82/83] [omxplayer] Add ability to log more timestamp info in + extra debug settings + +--- + language/English/strings.po | 5 ++++ + xbmc/commons/ilog.h | 1 + + xbmc/cores/omxplayer/OMXPlayer.cpp | 52 ++++++++++++++++----------------- + xbmc/cores/omxplayer/OMXPlayerAudio.cpp | 8 ++--- + xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 9 +++--- + xbmc/settings/AdvancedSettings.cpp | 3 ++ + 6 files changed, 44 insertions(+), 34 deletions(-) + +diff --git a/language/English/strings.po b/language/English/strings.po +index fb26ead..98b9e7e 100755 +--- a/language/English/strings.po ++++ b/language/English/strings.po +@@ -2871,6 +2871,11 @@ msgctxt "#679" + msgid "Verbose logging for CEC library" + msgstr "" + ++#: xbmc/settings/AdvancedSettings.cpp ++msgctxt "#697" ++msgid "Verbose logging for OMXPLAYER" ++msgstr "" ++ + #empty strings from id 680 to 699 + + msgctxt "#700" +diff --git a/xbmc/commons/ilog.h b/xbmc/commons/ilog.h +index 4bf5d83..3fb7cc3 100644 +--- a/xbmc/commons/ilog.h ++++ b/xbmc/commons/ilog.h +@@ -53,6 +53,7 @@ + #define LOGAIRTUNES (1 << (LOGMASKBIT + 8)) + #define LOGUPNP (1 << (LOGMASKBIT + 9)) + #define LOGCEC (1 << (LOGMASKBIT + 10)) ++#define LOGOMXPLAYER (1 << (LOGMASKBIT+11)) + + #ifdef __GNUC__ + #define ATTRIB_LOG_FORMAT __attribute__((format(printf,3,4))) +diff --git a/xbmc/cores/omxplayer/OMXPlayer.cpp b/xbmc/cores/omxplayer/OMXPlayer.cpp +index 92dd5c5..afa6290 100644 +--- a/xbmc/cores/omxplayer/OMXPlayer.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayer.cpp +@@ -1554,27 +1554,28 @@ void COMXPlayer::Process() + m_video_fifo = (int)(100.0*(m_omxPlayerVideo.GetDecoderBufferSize()-m_omxPlayerVideo.GetDecoderFreeSpace())/m_omxPlayerVideo.GetDecoderBufferSize()); + m_audio_fifo = (int)(100.0*audio_fifo/m_omxPlayerAudio.GetCacheTotal()); + +- #ifdef _DEBUG +- static unsigned count; +- if ((count++ & 7) == 0) ++ if (g_advancedSettings.CanLogComponent(LOGOMXPLAYER)) + { +- char response[80]; +- if (m_omxPlayerVideo.GetDecoderBufferSize() && m_omxPlayerAudio.GetCacheTotal()) +- vc_gencmd(response, sizeof response, "render_bar 4 video_fifo %d %d %d %d", +- m_video_fifo, +- (int)(100.0*video_fifo/m_omxPlayerAudio.GetCacheTotal()), +- 0, 100); +- if (m_omxPlayerAudio.GetCacheTotal()) +- vc_gencmd(response, sizeof response, "render_bar 5 audio_fifo %d %d %d %d", +- m_audio_fifo, +- (int)(100.0*m_omxPlayerAudio.GetDelay()/m_omxPlayerAudio.GetCacheTotal()), +- 0, 100); +- vc_gencmd(response, sizeof response, "render_bar 6 video_queue %d %d %d %d", +- m_omxPlayerVideo.GetLevel(), 0, 0, 100); +- vc_gencmd(response, sizeof response, "render_bar 7 audio_queue %d %d %d %d", +- m_omxPlayerAudio.GetLevel(), 0, 0, 100); ++ static unsigned count; ++ if ((count++ & 7) == 0) ++ { ++ char response[80]; ++ if (m_omxPlayerVideo.GetDecoderBufferSize() && m_omxPlayerAudio.GetCacheTotal()) ++ vc_gencmd(response, sizeof response, "render_bar 4 video_fifo %d %d %d %d", ++ m_video_fifo, ++ (int)(100.0*video_fifo/m_omxPlayerAudio.GetCacheTotal()), ++ 0, 100); ++ if (m_omxPlayerAudio.GetCacheTotal()) ++ vc_gencmd(response, sizeof response, "render_bar 5 audio_fifo %d %d %d %d", ++ m_audio_fifo, ++ (int)(100.0*m_omxPlayerAudio.GetDelay()/m_omxPlayerAudio.GetCacheTotal()), ++ 0, 100); ++ vc_gencmd(response, sizeof response, "render_bar 6 video_queue %d %d %d %d", ++ m_omxPlayerVideo.GetLevel(), 0, 0, 100); ++ vc_gencmd(response, sizeof response, "render_bar 7 audio_queue %d %d %d %d", ++ m_omxPlayerAudio.GetLevel(), 0, 0, 100); ++ } + } +- #endif + if (audio_pts != DVD_NOPTS_VALUE) + { + audio_fifo_low = m_HasAudio && audio_fifo < threshold; +@@ -1590,13 +1591,12 @@ void COMXPlayer::Process() + if (!m_HasVideo && m_HasAudio) + video_fifo_high = true; + +- #ifdef _DEBUG +- CLog::Log(LOGDEBUG, "%s - M:%.6f-%.6f (A:%.6f V:%.6f) PEF:%d%d%d S:%.2f A:%.2f V:%.2f/T:%.2f (A:%d%d V:%d%d) A:%d%% V:%d%% (%.2f,%.2f)", __FUNCTION__, +- m_stamp*1e-6, m_av_clock.OMXClockAdjustment()*1e-6, audio_pts*1e-6, video_pts*1e-6, m_av_clock.OMXIsPaused(), bOmxSentEOFs, not_accepts_data, m_playSpeed * (1.0f/DVD_PLAYSPEED_NORMAL), +- audio_pts == DVD_NOPTS_VALUE ? 0.0:audio_fifo, video_pts == DVD_NOPTS_VALUE ? 0.0:video_fifo, m_threshold, +- audio_fifo_low, audio_fifo_high, video_fifo_low, video_fifo_high, +- m_omxPlayerAudio.GetLevel(), m_omxPlayerVideo.GetLevel(), m_omxPlayerAudio.GetDelay(), (float)m_omxPlayerAudio.GetCacheTotal()); +- #endif ++ if (g_advancedSettings.CanLogComponent(LOGOMXPLAYER)) ++ CLog::Log(LOGDEBUG, "%s - M:%.6f-%.6f (A:%.6f V:%.6f) PEF:%d%d%d S:%.2f A:%.2f V:%.2f/T:%.2f (A:%d%d V:%d%d) A:%d%% V:%d%% (%.2f,%.2f)", __FUNCTION__, ++ m_stamp*1e-6, m_av_clock.OMXClockAdjustment()*1e-6, audio_pts*1e-6, video_pts*1e-6, m_av_clock.OMXIsPaused(), bOmxSentEOFs, not_accepts_data, m_playSpeed * (1.0f/DVD_PLAYSPEED_NORMAL), ++ audio_pts == DVD_NOPTS_VALUE ? 0.0:audio_fifo, video_pts == DVD_NOPTS_VALUE ? 0.0:video_fifo, m_threshold, ++ audio_fifo_low, audio_fifo_high, video_fifo_low, video_fifo_high, ++ m_omxPlayerAudio.GetLevel(), m_omxPlayerVideo.GetLevel(), m_omxPlayerAudio.GetDelay(), (float)m_omxPlayerAudio.GetCacheTotal()); + + if (TP(m_playSpeed)) + { +diff --git a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp +index 4435d22..0e49088 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp +@@ -367,10 +367,10 @@ void OMXPlayerAudio::Process() + DemuxPacket* pPacket = ((CDVDMsgDemuxerPacket*)pMsg)->GetPacket(); + bool bPacketDrop = ((CDVDMsgDemuxerPacket*)pMsg)->GetPacketDrop(); + +- #ifdef _DEBUG +- CLog::Log(LOGINFO, "Audio: dts:%.0f pts:%.0f size:%d (s:%d f:%d d:%d l:%d) s:%d %d/%d late:%d,%d", pPacket->dts, pPacket->pts, +- (int)pPacket->iSize, m_started, m_flush, bPacketDrop, m_stalled, m_speed, 0, 0, (int)m_omxAudio.GetAudioRenderingLatency(), (int)m_hints_current.samplerate); +- #endif ++ if (g_advancedSettings.CanLogComponent(LOGOMXPLAYER)) ++ CLog::Log(LOGINFO, "Audio: dts:%.0f pts:%.0f size:%d (s:%d f:%d d:%d l:%d) s:%d %d/%d late:%d,%d", pPacket->dts, pPacket->pts, ++ (int)pPacket->iSize, m_started, m_flush, bPacketDrop, m_stalled, m_speed, 0, 0, (int)m_omxAudio.GetAudioRenderingLatency(), (int)m_hints_current.samplerate); ++ + if(Decode(pPacket, m_speed > DVD_PLAYSPEED_NORMAL || m_speed < 0 || bPacketDrop)) + { + // we are not running until something is cached in output device +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +index eaa1e34..fa6a4c5 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +@@ -42,6 +42,7 @@ + #include "DVDOverlayRenderer.h" + #include "settings/DisplaySettings.h" + #include "settings/Settings.h" ++#include "settings/AdvancedSettings.h" + #include "settings/MediaSettings.h" + #include "cores/VideoRenderers/RenderFormats.h" + #include "cores/VideoRenderers/RenderFlags.h" +@@ -454,10 +455,10 @@ void OMXPlayerVideo::Process() + DemuxPacket* pPacket = ((CDVDMsgDemuxerPacket*)pMsg)->GetPacket(); + bool bPacketDrop = ((CDVDMsgDemuxerPacket*)pMsg)->GetPacketDrop(); + +- #ifdef _DEBUG +- CLog::Log(LOGINFO, "Video: dts:%.0f pts:%.0f size:%d (s:%d f:%d d:%d l:%d) s:%d %d/%d late:%d\n", pPacket->dts, pPacket->pts, +- (int)pPacket->iSize, m_started, m_flush, bPacketDrop, m_stalled, m_speed, 0, 0, 0); +- #endif ++ if (g_advancedSettings.CanLogComponent(LOGOMXPLAYER)) ++ CLog::Log(LOGINFO, "Video: dts:%.0f pts:%.0f size:%d (s:%d f:%d d:%d l:%d) s:%d %d/%d late:%d\n", pPacket->dts, pPacket->pts, ++ (int)pPacket->iSize, m_started, m_flush, bPacketDrop, m_stalled, m_speed, 0, 0, 0); ++ + if (m_messageQueue.GetDataSize() == 0 + || m_speed < 0) + { +diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp +index 6835504..fde4499 100644 +--- a/xbmc/settings/AdvancedSettings.cpp ++++ b/xbmc/settings/AdvancedSettings.cpp +@@ -1394,6 +1394,9 @@ void CAdvancedSettings::SettingOptionsLoggingComponentsFiller(const CSetting *se + #ifdef HAVE_LIBCEC + list.push_back(std::make_pair(g_localizeStrings.Get(679), LOGCEC)); + #endif ++#ifdef TARGET_RASPBERRY_PI ++ list.push_back(std::make_pair(g_localizeStrings.Get(697), LOGOMXPLAYER)); ++#endif + } + + void CAdvancedSettings::setExtraLogLevel(const std::vector &components) +-- +1.9.3 + + +From 89495b080b49765c2f9fa730db95b3b7eab088a6 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 7 Apr 2014 23:13:55 +0100 +Subject: [PATCH 83/83] [omxplayer] Add ability to dump out audio/video data + for later debugging + +--- + language/English/strings.po | 10 ++++++++ + xbmc/commons/ilog.h | 2 ++ + xbmc/cores/omxplayer/OMXAudio.cpp | 49 ++++++++++++++++++++++++++++++++++++++ + xbmc/cores/omxplayer/OMXVideo.cpp | 47 ++++++++++++++++++++++++++++++++++++ + xbmc/settings/AdvancedSettings.cpp | 4 ++++ + 5 files changed, 112 insertions(+) + +diff --git a/language/English/strings.po b/language/English/strings.po +index 98b9e7e..9f0475e 100755 +--- a/language/English/strings.po ++++ b/language/English/strings.po +@@ -2876,6 +2876,16 @@ msgctxt "#697" + msgid "Verbose logging for OMXPLAYER" + msgstr "" + ++#: xbmc/settings/AdvancedSettings.cpp ++msgctxt "#698" ++msgid "Dump video frames to debug file" ++msgstr "" ++ ++#: xbmc/settings/AdvancedSettings.cpp ++msgctxt "#699" ++msgid "Dump audio frames to debug file" ++msgstr "" ++ + #empty strings from id 680 to 699 + + msgctxt "#700" +diff --git a/xbmc/commons/ilog.h b/xbmc/commons/ilog.h +index 3fb7cc3..4d722a0 100644 +--- a/xbmc/commons/ilog.h ++++ b/xbmc/commons/ilog.h +@@ -54,6 +54,8 @@ + #define LOGUPNP (1 << (LOGMASKBIT + 9)) + #define LOGCEC (1 << (LOGMASKBIT + 10)) + #define LOGOMXPLAYER (1 << (LOGMASKBIT+11)) ++#define LOGDUMPVIDEO (1 << (LOGMASKBIT+12)) ++#define LOGDUMPAUDIO (1 << (LOGMASKBIT+13)) + + #ifdef __GNUC__ + #define ATTRIB_LOG_FORMAT __attribute__((format(printf,3,4))) +diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp +index c277af3..0f83053 100644 +--- a/xbmc/cores/omxplayer/OMXAudio.cpp ++++ b/xbmc/cores/omxplayer/OMXAudio.cpp +@@ -60,6 +60,49 @@ static const uint16_t AC3FSCod [] = {48000, 44100, 32000, 0}; + + static const uint16_t DTSFSCod [] = {0, 8000, 16000, 32000, 0, 0, 11025, 22050, 44100, 0, 0, 12000, 24000, 48000, 0, 0}; + ++//#define DEBUG_PLAYBACK ++static void dump_omx_buffer(OMX_BUFFERHEADERTYPE *omx_buffer) ++{ ++ if (!(g_advancedSettings.CanLogComponent(LOGDUMPAUDIO))) ++ return; ++ static FILE *fp; ++ if (!omx_buffer) ++ { ++ if (fp) ++ { ++ fclose(fp); ++ fp = NULL; ++ } ++ return; ++ } ++ if (!fp) ++ { ++ char filename[1024]; ++ strcpy(filename, g_advancedSettings.m_logFolder.c_str()); ++ strcat(filename, "audio.dat"); ++#ifdef DEBUG_PLAYBACK ++ fp = fopen(filename, "rb"); ++#else ++ fp = fopen(filename, "wb"); ++#endif ++ } ++ if (fp) ++ { ++#ifdef DEBUG_PLAYBACK ++ OMX_BUFFERHEADERTYPE omx = {0}; ++ int s = fread(&omx, sizeof omx, 1, fp); ++ omx_buffer->nFilledLen = omx.nFilledLen; ++ omx_buffer->nFlags = omx.nFlags; ++ omx_buffer->nTimeStamp = omx.nTimeStamp; ++ if (s==1) ++ fread(omx_buffer->pBuffer, omx_buffer->nFilledLen, 1, fp); ++#else ++ if (fwrite(omx_buffer, sizeof *omx_buffer, 1, fp) == 1) ++ fwrite(omx_buffer->pBuffer, omx_buffer->nFilledLen, 1, fp); ++#endif ++ } ++} ++ + ////////////////////////////////////////////////////////////////////// + // Construction/Destruction + ////////////////////////////////////////////////////////////////////// +@@ -862,6 +905,7 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo + memcpy((unsigned char *)omx_buffer->pBuffer, &m_wave_header, omx_buffer->nFilledLen); + omx_buffer->nFlags = OMX_BUFFERFLAG_CODECCONFIG | OMX_BUFFERFLAG_ENDOFFRAME; + ++ dump_omx_buffer(omx_buffer); + omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); + if (omx_err != OMX_ErrorNone) + { +@@ -894,6 +938,7 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo + memcpy((unsigned char *)omx_buffer->pBuffer, m_extradata, omx_buffer->nFilledLen); + omx_buffer->nFlags = OMX_BUFFERFLAG_CODECCONFIG | OMX_BUFFERFLAG_ENDOFFRAME; + ++ dump_omx_buffer(omx_buffer); + omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); + if (omx_err != OMX_ErrorNone) + { +@@ -930,6 +975,8 @@ bool COMXAudio::Deinitialize() + { + CSingleLock lock (m_critSection); + ++ dump_omx_buffer(NULL); ++ + if ( m_omx_tunnel_clock_analog.IsInitialized() ) + m_omx_tunnel_clock_analog.Deestablish(); + if ( m_omx_tunnel_clock_hdmi.IsInitialized() ) +@@ -1222,6 +1269,7 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt + int nRetry = 0; + while(true) + { ++ dump_omx_buffer(omx_buffer); + omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); + if (omx_err == OMX_ErrorNone) + { +@@ -1490,6 +1538,7 @@ void COMXAudio::SubmitEOS() + + omx_buffer->nFlags = OMX_BUFFERFLAG_ENDOFFRAME | OMX_BUFFERFLAG_EOS | OMX_BUFFERFLAG_TIME_UNKNOWN; + ++ dump_omx_buffer(omx_buffer); + omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); + if (omx_err != OMX_ErrorNone) + { +diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp +index 820ea44..6639804 100644 +--- a/xbmc/cores/omxplayer/OMXVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXVideo.cpp +@@ -63,6 +63,49 @@ + + #define MAX_TEXT_LENGTH 1024 + ++//#define DEBUG_PLAYBACK ++static void dump_omx_buffer(OMX_BUFFERHEADERTYPE *omx_buffer) ++{ ++ if (!(g_advancedSettings.CanLogComponent(LOGDUMPVIDEO))) ++ return; ++ static FILE *fp; ++ if (!omx_buffer) ++ { ++ if (fp) ++ { ++ fclose(fp); ++ fp = NULL; ++ } ++ return; ++ } ++ if (!fp) ++ { ++ char filename[1024]; ++ strcpy(filename, g_advancedSettings.m_logFolder.c_str()); ++ strcat(filename, "video.dat"); ++#ifdef DEBUG_PLAYBACK ++ fp = fopen(filename, "rb"); ++#else ++ fp = fopen(filename, "wb"); ++#endif ++ } ++ if (fp) ++ { ++#ifdef DEBUG_PLAYBACK ++ OMX_BUFFERHEADERTYPE omx = {0}; ++ int s = fread(&omx, sizeof omx, 1, fp); ++ omx_buffer->nFilledLen = omx.nFilledLen; ++ omx_buffer->nFlags = omx.nFlags; ++ omx_buffer->nTimeStamp = omx.nTimeStamp; ++ if (s==1) ++ fread(omx_buffer->pBuffer, omx_buffer->nFilledLen, 1, fp); ++#else ++ if (fwrite(omx_buffer, sizeof *omx_buffer, 1, fp) == 1) ++ fwrite(omx_buffer->pBuffer, omx_buffer->nFilledLen, 1, fp); ++#endif ++ } ++} ++ + COMXVideo::COMXVideo() : m_video_codec_name("") + { + m_is_open = false; +@@ -118,6 +161,7 @@ bool COMXVideo::SendDecoderConfig() + memcpy((unsigned char *)omx_buffer->pBuffer, m_extradata, omx_buffer->nFilledLen); + omx_buffer->nFlags = OMX_BUFFERFLAG_CODECCONFIG | OMX_BUFFERFLAG_ENDOFFRAME; + ++ dump_omx_buffer(omx_buffer); + omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); + if (omx_err != OMX_ErrorNone) + { +@@ -687,6 +731,7 @@ bool COMXVideo::Open(CDVDStreamInfo &hints, OMXClock *clock, EDEINTERLACEMODE de + void COMXVideo::Close() + { + CSingleLock lock (m_critSection); ++ dump_omx_buffer(NULL); + m_omx_tunnel_clock.Deestablish(); + m_omx_tunnel_decoder.Deestablish(); + if(m_deinterlace) +@@ -781,6 +826,7 @@ int COMXVideo::Decode(uint8_t *pData, int iSize, double pts) + int nRetry = 0; + while(true) + { ++ dump_omx_buffer(omx_buffer); + omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); + if (omx_err == OMX_ErrorNone) + { +@@ -910,6 +956,7 @@ void COMXVideo::SubmitEOS() + + omx_buffer->nFlags = OMX_BUFFERFLAG_ENDOFFRAME | OMX_BUFFERFLAG_EOS | OMX_BUFFERFLAG_TIME_UNKNOWN; + ++ dump_omx_buffer(omx_buffer); + omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); + if (omx_err != OMX_ErrorNone) + { +diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp +index fde4499..06ef2ed 100644 +--- a/xbmc/settings/AdvancedSettings.cpp ++++ b/xbmc/settings/AdvancedSettings.cpp +@@ -1397,6 +1397,10 @@ void CAdvancedSettings::SettingOptionsLoggingComponentsFiller(const CSetting *se + #ifdef TARGET_RASPBERRY_PI + list.push_back(std::make_pair(g_localizeStrings.Get(697), LOGOMXPLAYER)); + #endif ++#ifdef TARGET_RASPBERRY_PI ++ list.push_back(std::make_pair(g_localizeStrings.Get(698), LOGDUMPVIDEO)); ++ list.push_back(std::make_pair(g_localizeStrings.Get(699), LOGDUMPAUDIO)); ++#endif + } + + void CAdvancedSettings::setExtraLogLevel(const std::vector &components) +-- +1.9.3