From 3a65faeeeeb85df50b45d3e5ab5f2553aefaa939 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sun, 7 Sep 2014 18:00:15 +0200 Subject: [PATCH] xbmc: update FM support patch Signed-off-by: Stephan Raue --- .../patches/xbmc-995.01-fernetmenta.patch | 539 +++++++++++++++--- 1 file changed, 471 insertions(+), 68 deletions(-) diff --git a/packages/mediacenter/xbmc/patches/xbmc-995.01-fernetmenta.patch b/packages/mediacenter/xbmc/patches/xbmc-995.01-fernetmenta.patch index 8d038e9d1f..3f239156fd 100644 --- a/packages/mediacenter/xbmc/patches/xbmc-995.01-fernetmenta.patch +++ b/packages/mediacenter/xbmc/patches/xbmc-995.01-fernetmenta.patch @@ -1,7 +1,7 @@ -From d5b6f63eb2de0cee7e52ebe7a3a10b7209db2fa4 Mon Sep 17 00:00:00 2001 +From 013a4ac075824491e8387b62a00e10c30af26421 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:34:39 +0200 -Subject: [PATCH 01/23] videoplayer: adapt lateness detection and dropping to +Subject: [PATCH 01/27] videoplayer: adapt lateness detection and dropping to buffering --- @@ -289,7 +289,7 @@ index 1f564bb..48564d1 100644 + int m_codecControlFlags; }; diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index efc30b6..8b407a5 100644 +index 3ad22e8..c43af4d 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -38,6 +38,7 @@ @@ -308,7 +308,7 @@ index efc30b6..8b407a5 100644 m_iDroppedFrames = 0; m_fFrameRate = 25; m_bCalcFrameRate = false; -@@ -297,7 +297,6 @@ void CDVDPlayerVideo::OnStartup() +@@ -299,7 +299,6 @@ void CDVDPlayerVideo::OnStartup() m_crop.x1 = m_crop.x2 = 0.0f; m_crop.y1 = m_crop.y2 = 0.0f; @@ -316,7 +316,7 @@ index efc30b6..8b407a5 100644 m_FlipTimeStamp = m_pClock->GetAbsoluteClock(); m_FlipTimePts = 0.0; } -@@ -319,8 +318,10 @@ void CDVDPlayerVideo::Process() +@@ -321,8 +320,10 @@ void CDVDPlayerVideo::Process() int iDropped = 0; //frames dropped in a row bool bRequestDrop = false; @@ -327,7 +327,7 @@ index efc30b6..8b407a5 100644 while (!m_bStop) { -@@ -432,6 +433,7 @@ void CDVDPlayerVideo::Process() +@@ -434,6 +435,7 @@ void CDVDPlayerVideo::Process() picture.iFlags &= ~DVP_FLAG_ALLOCATED; m_packets.clear(); m_started = false; @@ -335,7 +335,7 @@ index efc30b6..8b407a5 100644 } else if (pMsg->IsType(CDVDMsg::GENERAL_FLUSH)) // private message sent by (CDVDPlayerVideo::Flush()) { -@@ -444,6 +446,7 @@ void CDVDPlayerVideo::Process() +@@ -446,6 +448,7 @@ void CDVDPlayerVideo::Process() //we need to recalculate the framerate //TODO: this needs to be set on a streamchange instead ResetFrameRateCalc(); @@ -343,7 +343,7 @@ index efc30b6..8b407a5 100644 m_stalled = true; m_started = false; -@@ -463,6 +466,7 @@ void CDVDPlayerVideo::Process() +@@ -465,6 +468,7 @@ void CDVDPlayerVideo::Process() m_iNrOfPicturesNotToSkip = 0; if (m_pVideoCodec) m_pVideoCodec->SetSpeed(m_speed); @@ -351,7 +351,7 @@ index efc30b6..8b407a5 100644 } else if (pMsg->IsType(CDVDMsg::PLAYER_STARTED)) { -@@ -508,6 +512,28 @@ void CDVDPlayerVideo::Process() +@@ -510,6 +514,28 @@ void CDVDPlayerVideo::Process() m_iNrOfPicturesNotToSkip = 1; } @@ -380,7 +380,7 @@ index efc30b6..8b407a5 100644 if (m_messageQueue.GetDataSize() == 0 || m_speed < 0) { -@@ -560,15 +586,7 @@ void CDVDPlayerVideo::Process() +@@ -562,15 +588,7 @@ void CDVDPlayerVideo::Process() } m_videoStats.AddSampleBytes(pPacket->iSize); @@ -397,7 +397,7 @@ index efc30b6..8b407a5 100644 // reset the request, the following while loop may break before // setting the flag to a new value bRequestDrop = false; -@@ -1170,45 +1188,17 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) +@@ -1172,45 +1190,17 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) , "CDVDPlayerVideo::OutputPicture"); } @@ -447,7 +447,7 @@ index efc30b6..8b407a5 100644 // set fieldsync if picture is interlaced EFIELDSYNC mDisplayField = FS_NONE; -@@ -1241,7 +1231,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) +@@ -1243,7 +1233,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) if (index < 0) return EOS_DROPPED; @@ -456,7 +456,7 @@ index efc30b6..8b407a5 100644 return result; #else -@@ -1541,3 +1531,124 @@ void CDVDPlayerVideo::CalcFrameRate() +@@ -1545,3 +1535,124 @@ void CDVDPlayerVideo::CalcFrameRate() m_iFrameRateCount = 0; } } @@ -643,10 +643,10 @@ index dcd0ffd..1f0e661 100644 }; -From 965cd1e39178caa9b80ed53cdadee9753aa8b33a Mon Sep 17 00:00:00 2001 +From ad54054429044403a44416be8b74c106b64d758f Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 2 Sep 2012 16:05:21 +0200 -Subject: [PATCH 02/23] video player: present correct pts to user for a/v sync +Subject: [PATCH 02/27] video player: present correct pts to user for a/v sync (after buffering in renderer) --- @@ -655,10 +655,10 @@ Subject: [PATCH 02/23] video player: present correct pts to user for a/v sync 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 8b407a5..ac8f511 100644 +index c43af4d..3bfa7f1 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1451,6 +1451,22 @@ void CDVDPlayerVideo::ResetFrameRateCalc() +@@ -1453,6 +1453,22 @@ void CDVDPlayerVideo::ResetFrameRateCalc() g_advancedSettings.m_videoFpsDetect == 0; } @@ -695,10 +695,10 @@ index 1f0e661..a38a9c3 100644 double GetOutputDelay(); /* returns the expected delay, from that a packet is put in queue */ int GetDecoderFreeSpace() { return 0; } -From 31631e66766dcd661cb378600906915aa842ec03 Mon Sep 17 00:00:00 2001 +From 9f5a0351e50f63e03fca12592e94cd6c635ef036 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sat, 1 Jun 2013 11:21:19 +0200 -Subject: [PATCH 03/23] renderer: bump buffers to 5 +Subject: [PATCH 03/27] renderer: bump buffers to 5 --- xbmc/cores/VideoRenderers/BaseRenderer.h | 2 +- @@ -718,10 +718,10 @@ index fb41ccf..f5e5677 100644 class CSetting; -From 6a15681781711a7a93f14393ca10823fee765f7b Mon Sep 17 00:00:00 2001 +From 49b8b7b8d5e017bc0d04f9f7f892601709825f1c Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:41:31 +0200 -Subject: [PATCH 04/23] videoplayer: update frametime, it might change due to +Subject: [PATCH 04/27] videoplayer: update frametime, it might change due to fps detection --- @@ -729,10 +729,10 @@ Subject: [PATCH 04/23] 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 ac8f511..97402d4 100644 +index 3bfa7f1..a41ed47 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -706,6 +706,8 @@ void CDVDPlayerVideo::Process() +@@ -708,6 +708,8 @@ void CDVDPlayerVideo::Process() int iResult = OutputPicture(&picture, pts); @@ -742,10 +742,34 @@ index ac8f511..97402d4 100644 { m_codecname = m_pVideoCodec->GetName(); -From 91fc350c6512ae7f30eb74eb188748d37ed867d2 Mon Sep 17 00:00:00 2001 +From dfbc63e5a0844d477700caf931bc9a22776372d3 Mon Sep 17 00:00:00 2001 +From: xbmc +Date: Mon, 28 May 2012 10:43:06 +0200 +Subject: [PATCH 05/27] videoplayer: give streams with invalid fps a chance for + fps detection + +--- + xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +index a41ed47..05f5d44 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +@@ -1497,7 +1497,7 @@ void CDVDPlayerVideo::CalcFrameRate() + frameduration = m_pullupCorrection.GetMinFrameDuration(); + + if ((frameduration==DVD_NOPTS_VALUE) || +- ((g_advancedSettings.m_videoFpsDetect == 1) && ((m_pullupCorrection.GetPatternLength() > 1) && !m_pullupCorrection.VFRDetection()))) ++ ((g_advancedSettings.m_videoFpsDetect == 1) && ((m_pullupCorrection.GetPatternLength() > 1) && !m_pullupCorrection.VFRDetection() && !m_bFpsInvalid))) + { + //reset the stored framerates if no good framerate was detected + m_fStableFrameRate = 0.0; + +From 2af8349533d62b616252c0aa28800f07e0b48d43 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:49:05 +0200 -Subject: [PATCH 06/23] dvdplayer: allow rewinding at end of stream, do a seek +Subject: [PATCH 06/27] dvdplayer: allow rewinding at end of stream, do a seek after rewind --- @@ -779,10 +803,10 @@ index 8f41c76..b99c8a2 100644 // audioplayer, stops outputing audio to audiorendere, but still tries to // sleep an correct amount for each packet -From 2a5816ea42fb3929d0ea63f9f34b2cb10b110f66 Mon Sep 17 00:00:00 2001 +From 8a1d664dffffab4b41cf9025565185127ef7e590 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 20 Aug 2012 16:06:39 +0200 -Subject: [PATCH 07/23] dvdplayer: observe pts counter overflow +Subject: [PATCH 07/27] dvdplayer: observe pts counter overflow --- .../cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 197 ++++++++++++++++++++- @@ -1062,10 +1086,10 @@ index 08eb3df..dd89584 100644 }; -From 7e5d755f7aa94c7bd934d2ac3c2ff753710ec2a8 Mon Sep 17 00:00:00 2001 +From 1f6d472559959ac3193ad33042bb3f01fbadf248 Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 2 Oct 2012 13:02:10 +0200 -Subject: [PATCH 08/23] dvdplayer: avoid short screen flicker caused by +Subject: [PATCH 08/27] dvdplayer: avoid short screen flicker caused by unnecessary reconfigure of renderer --- @@ -1073,10 +1097,10 @@ Subject: [PATCH 08/23] 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 df4ff5d..04bd13a 100644 +index 05f5d44..5d84cd0 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1052,13 +1052,16 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) +@@ -1054,13 +1054,16 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) #ifdef HAS_VIDEO_PLAYBACK double config_framerate = m_bFpsInvalid ? 0.0 : m_fFrameRate; @@ -1095,10 +1119,10 @@ index df4ff5d..04bd13a 100644 || ( m_output.extended_format != pPicture->extended_format ) || ( m_output.color_matrix != pPicture->color_matrix && pPicture->color_matrix != 0 ) // don't reconfigure on unspecified -From cb503ce774f25d71a5e924b22a6803fe7b461847 Mon Sep 17 00:00:00 2001 +From dbde9c6c1a6e2b946cc14783d7e5f9b536c52424 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 11 Oct 2012 12:05:50 +0200 -Subject: [PATCH 09/23] vdpau: advanced settings for auto deinterlacing +Subject: [PATCH 09/27] vdpau: advanced settings for auto deinterlacing --- xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 8 ++++---- @@ -1161,10 +1185,10 @@ index 7e50a63..980138e 100644 bool m_videoVDPAUdeintSkipChromaHD; bool m_musicUseTimeSeeking; -From 9f7eb73d804a83c57054c3dd3a3bdf2ddba36cb3 Mon Sep 17 00:00:00 2001 +From e1a347c8a8f4e310d0cbc3b3a234dca6f1f52cb1 Mon Sep 17 00:00:00 2001 From: xbmc Date: Fri, 2 Nov 2012 13:20:03 +0100 -Subject: [PATCH 10/23] player: fix rewind +Subject: [PATCH 10/27] player: fix rewind --- xbmc/cores/dvdplayer/DVDMessage.h | 5 ++++- @@ -1342,10 +1366,10 @@ index 951382c..3af2fdd 100644 int m_errorCount; diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 04bd13a..ae1b2f3 100644 +index 5d84cd0..bab0972 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1466,7 +1466,7 @@ double CDVDPlayerVideo::GetCurrentPts() +@@ -1468,7 +1468,7 @@ double CDVDPlayerVideo::GetCurrentPts() if( m_stalled ) iRenderPts = DVD_NOPTS_VALUE; @@ -1354,7 +1378,7 @@ index 04bd13a..ae1b2f3 100644 iRenderPts = iRenderPts - max(0.0, iSleepTime); return iRenderPts; -@@ -1565,6 +1565,8 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts) +@@ -1569,6 +1569,8 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts) int iDroppedPics = -1; int iBufferLevel; @@ -1376,10 +1400,10 @@ index a38a9c3..4e1b3d6 100644 unsigned int m_dropRequests; }; -From 95ff1ed4832ae09b1eafb182c12742fe7741f1bf Mon Sep 17 00:00:00 2001 +From a4753ee613f87f97e29a990989060c71095c3f61 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 28 Mar 2013 20:50:59 +0100 -Subject: [PATCH 11/23] fix incorrect display of fps when dr kicks in +Subject: [PATCH 11/27] fix incorrect display of fps when dr kicks in --- xbmc/Application.cpp | 3 ++- @@ -1403,10 +1427,10 @@ index 94ee013..851a380 100644 g_renderManager.UpdateResolution(); -From 204eef3c7ca95febe392583ab2df38bfc1840c27 Mon Sep 17 00:00:00 2001 +From 145757456b51b69f7eacb6e90d6e3604ef431b84 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Thu, 25 Jul 2013 17:18:13 +0200 -Subject: [PATCH 12/23] ActiveAE: slightly reduce buffer size +Subject: [PATCH 12/27] ActiveAE: slightly reduce buffer size --- xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 4 ++-- @@ -1428,10 +1452,10 @@ index fe5e893..c98c73b 100644 void CEngineStats::Reset(unsigned int sampleRate) -From 4dc9dd1d74a519c354c8d51968548cc20ba48802 Mon Sep 17 00:00:00 2001 +From 24618104a4d34f9fa69a6898434dfe68fc08a3dc Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sun, 4 Aug 2013 10:11:16 +0200 -Subject: [PATCH 13/23] Revert "vdpau: comment some features that will be added +Subject: [PATCH 13/27] Revert "vdpau: comment some features that will be added later" This reverts commit e00b4f65864d623ab4d2e9e5c06db138e661f1cf. @@ -1484,10 +1508,10 @@ index 1845198..2bfea1a 100644 m_mixersteps = 1; } -From 13b60086afda3e91eb18bc4e23c56e048dea2515 Mon Sep 17 00:00:00 2001 +From a446749b9d633d2a270328f679a1c634a1ab7f73 Mon Sep 17 00:00:00 2001 From: Marcel Groothuis Date: Thu, 5 Dec 2013 22:02:50 +0100 -Subject: [PATCH 14/23] ffmpeg demuxer: faster channel change for PVR addons +Subject: [PATCH 14/27] ffmpeg demuxer: faster channel change for PVR addons without internal demuxing (such as MediaPortal, ArgusTV, MythTV, NextPVR) Credits: FernetMenta, Davilla, Popcornmix, Whaupt @@ -1844,10 +1868,10 @@ index ca689d0..f383563 100644 else return NULL; -From 3c727e578016db5222c640757ce033de121aa2c2 Mon Sep 17 00:00:00 2001 +From 266bf6dc835b64fbc1fccba6662c8b80990643ff Mon Sep 17 00:00:00 2001 From: Wolfgang Haupt Date: Thu, 5 Dec 2013 22:11:57 +0100 -Subject: [PATCH 15/23] DVDFactoryDemuxer: skip streaminfo for udp tcp and +Subject: [PATCH 15/27] DVDFactoryDemuxer: skip streaminfo for udp tcp and pvr-channels --- @@ -1968,10 +1992,10 @@ index 667f6d3..0094709 100644 static void AddSlashAtEnd(std::string& strFolder); static bool HasSlashAtEnd(const std::string& strFile, bool checkURL = false); -From 47f8d33eccd8acc0190123f2fa1d1d37569d8180 Mon Sep 17 00:00:00 2001 +From e3e82f4d2c6aa0c8a3e21ba6c537c675bfec1a1b Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Fri, 18 Jul 2014 10:39:07 +0200 -Subject: [PATCH 16/23] fast channel switch, make sure extradata is decoded +Subject: [PATCH 16/27] fast channel switch, make sure extradata is decoded --- xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 3 ++- @@ -1992,10 +2016,10 @@ index c01bc11..d38bfab 100644 // We are looking for an IDR frame -From d3869585ba5f748b54fb13688a93059c7727690c Mon Sep 17 00:00:00 2001 +From 394e940568426f749efcf1ae314f56fa6ba4cd6d Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Wed, 23 Jul 2014 15:07:37 +0200 -Subject: [PATCH 17/23] ffmpeg demuxer: allow a stream change if pat/pmt was +Subject: [PATCH 17/27] ffmpeg demuxer: allow a stream change if pat/pmt was not seen on open --- @@ -2055,10 +2079,10 @@ index d38bfab..2332b1b 100644 { for (unsigned int i = 0; i < m_pFormatContext->programs[m_program]->nb_stream_indexes; i++) -From 5c9a0b8e36242aed98688a1d5cb108051b70dc34 Mon Sep 17 00:00:00 2001 +From 68fea83410e44637f549b31dd3e74fb0b623d504 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Tue, 28 Jan 2014 10:05:26 +0100 -Subject: [PATCH 18/23] xbmc pr 3080 +Subject: [PATCH 18/27] xbmc pr 3080 --- xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 8 ++++++++ @@ -2084,10 +2108,10 @@ index 2481b66..40816e3 100644 * Setting it correctly would allow CorePNG decoding. */ avpkt.flags = AV_PKT_FLAG_KEY; -From 971c068bdcb84109fc9d195871ba6fd143499d02 Mon Sep 17 00:00:00 2001 +From cccc5d41dcd33307651570d866aac825268eb965 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Tue, 11 Feb 2014 18:15:06 +0100 -Subject: [PATCH 19/23] ActiveAE: add some debug logging +Subject: [PATCH 19/27] ActiveAE: add some debug logging --- xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp | 6 ++++++ @@ -2112,10 +2136,10 @@ index ec10397..3b67fc0 100644 return copied; } -From 96c48947b6db20d247b167e6485ea18cf6728b7d Mon Sep 17 00:00:00 2001 +From 146df22fa3a5a2876abe50fc34f563d56232e25d Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sat, 26 Jul 2014 09:54:06 +0200 -Subject: [PATCH 20/23] ffmpeg: adapt depreciated attribute +Subject: [PATCH 20/27] ffmpeg: adapt depreciated attribute max_analyze_duration --- @@ -2136,10 +2160,10 @@ index 2332b1b..edaa006 100644 isMpegts = true; } -From 6d420596aa44b48c066204561f4fda0b63bba635 Mon Sep 17 00:00:00 2001 +From b65042d8b51ca245ea6f5182d1d892dfc1bec4a8 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sat, 23 Aug 2014 11:42:31 +0200 -Subject: [PATCH 21/23] dvdplayer: rename codec ctrl flags +Subject: [PATCH 21/27] dvdplayer: rename codec ctrl flags --- xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 14 ++++++++------ @@ -2235,10 +2259,10 @@ index 2bfea1a..165f103 100644 m_mixersteps = 1; } diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index ae1b2f3..0d5d477 100644 +index bab0972..20aef4e 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -524,9 +524,9 @@ void CDVDPlayerVideo::Process() +@@ -526,9 +526,9 @@ void CDVDPlayerVideo::Process() } int codecControl = 0; if (iDropDirective & EOS_BUFFER_LEVEL) @@ -2251,10 +2275,10 @@ index ae1b2f3..0d5d477 100644 if (iDropDirective & EOS_DROPPED) { -From 729d2cd7c2fed02d62a502ea264da94fdde9f36d Mon Sep 17 00:00:00 2001 +From 30691569978e210b609bfc616bc639c343de74f8 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Fri, 13 Jun 2014 14:37:16 +0200 -Subject: [PATCH 22/23] VAAPI: implement codec control flags +Subject: [PATCH 22/27] VAAPI: implement codec control flags --- .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 21 ++++++++++++++++++--- @@ -2358,20 +2382,20 @@ index 40fbcd8..70eda1a 100644 VAProcFilterParameterBufferDeinterlacing *filterParams; VABufferID pipelineBuf; -From c718f9f083a3f5b1af9623639d038753fcba83af Mon Sep 17 00:00:00 2001 +From b38c6dfec5f0a2a7a5c0f8164998468260ad0ff7 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Thu, 4 Sep 2014 09:25:48 +0200 -Subject: [PATCH 23/23] consider rounding errors in dropping control +Subject: [PATCH 23/27] consider rounding errors in dropping control --- xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 0d5d477..12f73eb 100644 +index 20aef4e..2a10cfd 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1604,7 +1604,7 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts) +@@ -1608,7 +1608,7 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts) m_droppingStats.m_dropRequests = 0; CLog::Log(LOGDEBUG,"CDVDPlayerVideo::CalcDropRequirement - dropped pictures, Sleeptime: %f, Bufferlevel: %d, Gain: %f", iSleepTime, iBufferLevel, iGain); } @@ -2380,3 +2404,382 @@ index 0d5d477..12f73eb 100644 { CDroppingStats::CGain gain; gain.gain = iGain; + +From da4403a911093bb2fa20614523e4c9a7a6c41615 Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Fri, 5 Sep 2014 15:40:24 +0200 +Subject: [PATCH 24/27] vaapi: optimize render pipeline + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp | 58 ++++++++++++++++++++++---- + xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h | 11 ++++- + 2 files changed, 58 insertions(+), 11 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp +index 70eda1a..3fba209 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp +@@ -641,7 +641,8 @@ int CDecoder::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic, int flags) + if (surf == VA_INVALID_SURFACE) + { + uint16_t decoded, processed, render; +- va->m_bufferStats.Get(decoded, processed, render); ++ bool vpp; ++ va->m_bufferStats.Get(decoded, processed, render, vpp); + CLog::Log(LOGERROR, "VAAPI::FFGetBuffer - no surface available - dec: %d, render: %d", + decoded, render); + return -1; +@@ -714,6 +715,8 @@ int CDecoder::Decode(AVCodecContext* avctx, AVFrame* pFrame) + + int retval = 0; + uint16_t decoded, processed, render; ++ int vapipe; ++ bool vpp; + Message *msg; + while (m_vaapiOutput.m_controlPort.ReceiveInMessage(&msg)) + { +@@ -725,13 +728,14 @@ int CDecoder::Decode(AVCodecContext* avctx, AVFrame* pFrame) + msg->Release(); + } + +- m_bufferStats.Get(decoded, processed, render); ++ m_bufferStats.Get(decoded, processed, render, vpp); + + bool hasfree = m_videoSurfaces.HasFree(); + while (!retval) + { + // first fill the buffers to keep vaapi busy +- if (decoded < 3 && processed < 3 && m_videoSurfaces.HasFree()) ++ vapipe = vpp ? decoded + processed : decoded; ++ if (vapipe < 4 && m_videoSurfaces.HasFree()) + { + retval |= VC_BUFFER; + } +@@ -748,7 +752,7 @@ int CDecoder::Decode(AVCodecContext* avctx, AVFrame* pFrame) + m_presentPicture = *(CVaapiRenderPicture**)msg->data; + m_presentPicture->vaapi = this; + m_bufferStats.DecRender(); +- m_bufferStats.Get(decoded, processed, render); ++ m_bufferStats.Get(decoded, processed, render, vpp); + retval |= VC_PICTURE; + msg->Release(); + break; +@@ -759,7 +763,7 @@ int CDecoder::Decode(AVCodecContext* avctx, AVFrame* pFrame) + { + if (msg->signal == COutputControlProtocol::STATS) + { +- m_bufferStats.Get(decoded, processed, render); ++ m_bufferStats.Get(decoded, processed, render, vpp); + } + else + { +@@ -769,7 +773,8 @@ int CDecoder::Decode(AVCodecContext* avctx, AVFrame* pFrame) + msg->Release(); + } + +- if (decoded < 3 && processed < 3 && m_videoSurfaces.HasFree()) ++ vapipe = vpp ? decoded + processed : decoded; ++ if (vapipe < 4 && m_videoSurfaces.HasFree()) + { + retval |= VC_BUFFER; + } +@@ -1365,8 +1370,7 @@ void COutput::StateMachine(int signal, Protocol *port, Message *msg) + switch (signal) + { + case COutputControlProtocol::TIMEOUT: +- if (!m_bufferPool.decodedPics.empty() && +- m_bufferPool.processedPics.size() < 4) ++ if (PreferPP()) + { + m_currentPicture = m_bufferPool.decodedPics.front(); + m_bufferPool.decodedPics.pop_front(); +@@ -1645,7 +1649,21 @@ void COutput::Flush() + bool COutput::HasWork() + { + if ((!m_bufferPool.freeRenderPics.empty() && !m_bufferPool.processedPics.empty()) || +- !m_bufferPool.decodedPics.empty()) ++ (!m_bufferPool.decodedPics.empty() && m_bufferPool.processedPics.size() < 4)) ++ return true; ++ ++ return false; ++} ++ ++bool COutput::PreferPP() ++{ ++ if (!m_pp) ++ return true; ++ ++ if (!m_bufferPool.decodedPics.empty() && !m_pp->DoesSync() && m_bufferPool.processedPics.size() < 4) ++ return true; ++ ++ if (m_bufferPool.freeRenderPics.empty() || m_bufferPool.processedPics.empty()) + return true; + + return false; +@@ -1693,9 +1711,15 @@ void COutput::InitCycle() + { + if (method == VS_INTERLACEMETHOD_DEINTERLACE || + method == VS_INTERLACEMETHOD_RENDER_BOB) ++ { + m_pp = new CFFmpegPostproc(); ++ m_config.stats->SetVpp(false); ++ } + else ++ { + m_pp = new CVppPostproc(); ++ m_config.stats->SetVpp(true); ++ } + if (m_pp->PreInit(m_config)) + { + m_pp->Init(method); +@@ -1720,6 +1744,7 @@ void COutput::InitCycle() + } + if (!m_pp) + { ++ m_config.stats->SetVpp(false); + if (!CSettings::Get().GetBool("videoplayer.prefervaapirender")) + m_pp = new CFFmpegPostproc(); + else +@@ -2282,6 +2307,11 @@ bool CSkipPostproc::Compatible(EINTERLACEMETHOD method) + return false; + } + ++bool CSkipPostproc::DoesSync() ++{ ++ return false; ++} ++ + //----------------------------------------------------------------------------- + // VPP Postprocessing + //----------------------------------------------------------------------------- +@@ -2723,6 +2753,11 @@ bool CVppPostproc::Compatible(EINTERLACEMETHOD method) + return false; + } + ++bool CVppPostproc::DoesSync() ++{ ++ return false; ++} ++ + bool CVppPostproc::CheckSuccess(VAStatus status) + { + if (status != VA_STATUS_SUCCESS) +@@ -3069,6 +3104,11 @@ bool CFFmpegPostproc::Compatible(EINTERLACEMETHOD method) + return false; + } + ++bool CFFmpegPostproc::DoesSync() ++{ ++ return true; ++} ++ + bool CFFmpegPostproc::CheckSuccess(VAStatus status) + { + if (status != VA_STATUS_SUCCESS) +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h +index 53608e0..3cc05c2 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h +@@ -71,6 +71,7 @@ class CVaapiBufferStats + int codecFlags; + bool canSkipDeint; + int processCmd; ++ bool isVpp; + + void IncDecoded() { CSingleLock l(m_sec); decodedPics++;} + void DecDecoded() { CSingleLock l(m_sec); decodedPics--;} +@@ -78,14 +79,15 @@ class CVaapiBufferStats + void DecProcessed() { CSingleLock l(m_sec); processedPics--;} + void IncRender() { CSingleLock l(m_sec); renderPics++;} + void DecRender() { CSingleLock l(m_sec); renderPics--;} +- void Reset() { CSingleLock l(m_sec); decodedPics=0; processedPics=0;renderPics=0;latency=0;} +- void Get(uint16_t &decoded, uint16_t &processed, uint16_t &render) {CSingleLock l(m_sec); decoded = decodedPics, processed=processedPics, render=renderPics;} ++ void Reset() { CSingleLock l(m_sec); decodedPics=0; processedPics=0;renderPics=0;latency=0;isVpp=false;} ++ void Get(uint16_t &decoded, uint16_t &processed, uint16_t &render, bool &vpp) {CSingleLock l(m_sec); decoded = decodedPics, processed=processedPics, render=renderPics; vpp=isVpp;} + void SetParams(uint64_t time, int flags) { CSingleLock l(m_sec); latency = time; codecFlags = flags; } + void GetParams(uint64_t &lat, int &flags) { CSingleLock l(m_sec); lat = latency; flags = codecFlags; } + void SetCmd(int cmd) { CSingleLock l(m_sec); processCmd = cmd; } + void GetCmd(int &cmd) { CSingleLock l(m_sec); cmd = processCmd; processCmd = 0; } + void SetCanSkipDeint(bool canSkip) { CSingleLock l(m_sec); canSkipDeint = canSkip; } + bool CanSkipDeint() { CSingleLock l(m_sec); if (canSkipDeint) return true; else return false;} ++ void SetVpp(bool vpp) {CSingleLock l(m_sec); isVpp = vpp;} + private: + CCriticalSection m_sec; + }; +@@ -268,6 +270,7 @@ class COutput : private CThread + void Process(); + void StateMachine(int signal, Protocol *port, Message *msg); + bool HasWork(); ++ bool PreferPP(); + void InitCycle(); + CVaapiRenderPicture* ProcessPicture(CVaapiProcessedPicture &pic); + void QueueReturnPicture(CVaapiRenderPicture *pic); +@@ -450,6 +453,7 @@ class CPostproc + virtual void ClearRef(VASurfaceID surf) = 0; + virtual void Flush() = 0; + virtual bool Compatible(EINTERLACEMETHOD method) = 0; ++ virtual bool DoesSync() = 0; + protected: + CVaapiConfig m_config; + int m_step; +@@ -468,6 +472,7 @@ class CSkipPostproc : public CPostproc + void ClearRef(VASurfaceID surf); + void Flush(); + bool Compatible(EINTERLACEMETHOD method); ++ bool DoesSync(); + protected: + CVaapiDecodedPicture m_pic; + }; +@@ -487,6 +492,7 @@ class CVppPostproc : public CPostproc + void ClearRef(VASurfaceID surf); + void Flush(); + bool Compatible(EINTERLACEMETHOD method); ++ bool DoesSync(); + protected: + bool CheckSuccess(VAStatus status); + void Dispose(); +@@ -517,6 +523,7 @@ class CFFmpegPostproc : public CPostproc + void ClearRef(VASurfaceID surf); + void Flush(); + bool Compatible(EINTERLACEMETHOD method); ++ bool DoesSync(); + protected: + bool CheckSuccess(VAStatus status); + void Close(); + +From d8e25988a5a86af34a99e38c45347b7eda7569b3 Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Sat, 6 Sep 2014 10:23:28 +0200 +Subject: [PATCH 25/27] vaapi: cleanup left overs + +--- + xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 19 +------------------ + 1 file changed, 1 insertion(+), 18 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +index 767e15a..417577d 100644 +--- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp ++++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +@@ -2530,25 +2530,8 @@ bool CLinuxRendererGL::CreateVAAPITexture(int index) + plane.pixpertex_x = 1; + plane.pixpertex_y = 1; + +- if(m_renderMethod & RENDER_POT) +- { +- plane.texwidth = NP2(plane.texwidth); +- plane.texheight = NP2(plane.texheight); +- } +- +- glEnable(m_textureTarget); +- glGenTextures(1, &plane.id); +- VerifyGLState(); ++ plane.id = 1; + +- glBindTexture(m_textureTarget, plane.id); +- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); +- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); +- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); +- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); +- glPixelStorei(GL_UNPACK_ALIGNMENT, 4); +- glTexImage2D(m_textureTarget, 0, GL_RGBA, plane.texwidth, plane.texheight, 0, GL_BGRA, GL_UNSIGNED_BYTE, NULL); +- glBindTexture(m_textureTarget, 0); +- glDisable(m_textureTarget); + #endif + return true; + } + +From 8cdb49af35d2c08a4528955ce34b378bd205892f Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Sat, 6 Sep 2014 10:24:58 +0200 +Subject: [PATCH 26/27] vaapi: set error if no video surfaces are available + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp +index 3fba209..9611bf2 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp +@@ -645,6 +645,7 @@ int CDecoder::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic, int flags) + va->m_bufferStats.Get(decoded, processed, render, vpp); + CLog::Log(LOGERROR, "VAAPI::FFGetBuffer - no surface available - dec: %d, render: %d", + decoded, render); ++ va->m_DisplayState = VAAPI_ERROR; + return -1; + } + + +From 4a33e3c86e2c38a57ff7b8f7671983c251dfdc44 Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Sat, 6 Sep 2014 10:25:52 +0200 +Subject: [PATCH 27/27] vaapi: use display connection of vaapi for xsync + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp | 11 +++++++---- + xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h | 2 ++ + 2 files changed, 9 insertions(+), 4 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp +index 9611bf2..624d6a4 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp +@@ -241,6 +241,11 @@ VADisplay CVAAPIContext::GetDisplay() + return m_display; + } + ++Display *CVAAPIContext::GetX11Display() ++{ ++ return m_X11dpy; ++} ++ + bool CVAAPIContext::IsValidDecoder(CDecoder *decoder) + { + std::vector::iterator it; +@@ -932,6 +937,7 @@ bool CDecoder::ConfigVAAPI() + memset(&m_hwContext, 0, sizeof(vaapi_context)); + + m_vaapiConfig.dpy = m_vaapiConfig.context->GetDisplay(); ++ m_vaapiConfig.x11dsp = m_vaapiConfig.context->GetX11Display(); + m_vaapiConfig.attrib = m_vaapiConfig.context->GetAttrib(m_vaapiConfig.profile); + if ((m_vaapiConfig.attrib.value & VA_RT_FORMAT_YUV420) == 0) + { +@@ -1815,7 +1821,7 @@ CVaapiRenderPicture* COutput::ProcessPicture(CVaapiProcessedPicture &pic) + { + return NULL; + } +- XSync(m_Display, false); ++ XSync(m_config.x11dsp, false); + glEnable(m_textureTarget); + glBindTexture(m_textureTarget, retPic->texture); + glXBindTexImageEXT(m_Display, retPic->glPixmap, GLX_FRONT_LEFT_EXT, NULL); +@@ -2058,9 +2064,6 @@ bool COutput::EnsureBufferPool() + } + + glGenTextures(1, &pic->texture); +- glBindTexture(m_textureTarget, pic->texture); +- glXBindTexImageEXT(m_Display, pic->glPixmap, GLX_FRONT_LEFT_EXT, NULL); +- glBindTexture(m_textureTarget, 0); + + pic->avFrame = av_frame_alloc(); + pic->valid = false; +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h +index 3cc05c2..d937eea 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h +@@ -123,6 +123,7 @@ struct CVaapiConfig + VADisplay dpy; + VAProfile profile; + VAConfigAttrib attrib; ++ Display *x11dsp; + }; + + /** +@@ -346,6 +347,7 @@ class CVAAPIContext + static bool EnsureContext(CVAAPIContext **ctx, CDecoder *decoder); + void Release(CDecoder *decoder); + VADisplay GetDisplay(); ++ Display* GetX11Display(); + bool SupportsProfile(VAProfile profile); + VAConfigAttrib GetAttrib(VAProfile profile); + VAConfigID CreateConfig(VAProfile profile, VAConfigAttrib attrib);