diff --git a/packages/mediacenter/xbmc-theme-Confluence/meta b/packages/mediacenter/xbmc-theme-Confluence/meta index e34729ab63..2cdbe8faec 100644 --- a/packages/mediacenter/xbmc-theme-Confluence/meta +++ b/packages/mediacenter/xbmc-theme-Confluence/meta @@ -21,7 +21,7 @@ PKG_NAME="xbmc-theme-Confluence" PKG_VERSION="12.2-5ba69b6" if [ "$XBMC" = "master" ]; then - PKG_VERSION="13.alpha-df91888" + PKG_VERSION="13.alpha-0efa87e" elif [ "$XBMC" = "xbmc-aml" ]; then PKG_VERSION="aml-frodo-d9119f2" fi diff --git a/packages/mediacenter/xbmc/package.mk b/packages/mediacenter/xbmc/package.mk index f9398a22f2..1d91a91467 100644 --- a/packages/mediacenter/xbmc/package.mk +++ b/packages/mediacenter/xbmc/package.mk @@ -21,7 +21,7 @@ PKG_NAME="xbmc" PKG_VERSION="12.2-5ba69b6" if [ "$XBMC" = "master" ]; then - PKG_VERSION="13.alpha-df91888" + PKG_VERSION="13.alpha-0efa87e" elif [ "$XBMC" = "xbmc-aml" ]; then PKG_VERSION="aml-frodo-d9119f2" fi diff --git a/packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-321-texturepacker-hostflags-and-rework.patch b/packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-321-texturepacker-hostflags-and-rework.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-321-texturepacker-hostflags-and-rework.patch rename to packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-321-texturepacker-hostflags-and-rework.patch diff --git a/packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-408-enable_PYTHONOPTIMIZE_with_external_Python-0.1.patch b/packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-408-enable_PYTHONOPTIMIZE_with_external_Python-0.1.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-408-enable_PYTHONOPTIMIZE_with_external_Python-0.1.patch rename to packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-408-enable_PYTHONOPTIMIZE_with_external_Python-0.1.patch diff --git a/packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-453-add_openelec.tv_RSS_news-0.1.patch b/packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-453-add_openelec.tv_RSS_news-0.1.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-453-add_openelec.tv_RSS_news-0.1.patch rename to packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-453-add_openelec.tv_RSS_news-0.1.patch diff --git a/packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-602-add_as.xml_busy_dialog_delay_control.patch b/packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-602-add_as.xml_busy_dialog_delay_control.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-602-add_as.xml_busy_dialog_delay_control.patch rename to packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-602-add_as.xml_busy_dialog_delay_control.patch diff --git a/packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-990.15-depends-mark_our_wrapped_functions_as_used.patch b/packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-990.15-depends-mark_our_wrapped_functions_as_used.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-990.15-depends-mark_our_wrapped_functions_as_used.patch rename to packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-990.15-depends-mark_our_wrapped_functions_as_used.patch diff --git a/packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-995.01-xvba_support-8fdcc86.patch b/packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-995.01-xvba_support-e70c101.patch similarity index 86% rename from packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-995.01-xvba_support-8fdcc86.patch rename to packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-995.01-xvba_support-e70c101.patch index 24c5392f3c..ba73315ef1 100644 --- a/packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-995.01-xvba_support-8fdcc86.patch +++ b/packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-995.01-xvba_support-e70c101.patch @@ -1,911 +1,1483 @@ -From 6eaedd0e1d1b3bb716ea7458b9782a704bf54f1e Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Thu, 30 May 2013 10:56:06 +0200 -Subject: [PATCH 001/110] renderer: use fence for determination when a buffer - is ready for reuse +From eb767f12f803f34a841f490e58bd11629c2e7f84 Mon Sep 17 00:00:00 2001 +From: unknown +Date: Sun, 11 Aug 2013 18:10:05 +0200 +Subject: [PATCH 001/111] AE: add planar formats to end of enum, some other + code relies on the order --- - xbmc/cores/VideoRenderers/BaseRenderer.h | 1 + - xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 32 +++++++++++++++++++++++++++ - xbmc/cores/VideoRenderers/LinuxRendererGL.h | 2 ++ - xbmc/cores/VideoRenderers/RenderManager.cpp | 7 +++++- - 4 files changed, 41 insertions(+), 1 deletion(-) + xbmc/cores/AudioEngine/AEAudioFormat.h | 22 +++++++------ + xbmc/cores/AudioEngine/Utils/AEUtil.cpp | 57 +++++++++++++++++---------------- + 2 files changed, 42 insertions(+), 37 deletions(-) -diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.h b/xbmc/cores/VideoRenderers/BaseRenderer.h -index a61d3cf..6acf2f3 100644 ---- a/xbmc/cores/VideoRenderers/BaseRenderer.h -+++ b/xbmc/cores/VideoRenderers/BaseRenderer.h -@@ -92,6 +92,7 @@ class CBaseRenderer - virtual unsigned int GetMaxBufferSize() { return 0; } - virtual void SetBufferSize(int numBuffers) { } - virtual void ReleaseBuffer(int idx) { } -+ virtual bool IsProcessed(int idx) { return true; } +diff --git a/xbmc/cores/AudioEngine/AEAudioFormat.h b/xbmc/cores/AudioEngine/AEAudioFormat.h +index 64be36f..5664e6e 100644 +--- a/xbmc/cores/AudioEngine/AEAudioFormat.h ++++ b/xbmc/cores/AudioEngine/AEAudioFormat.h +@@ -31,33 +31,26 @@ enum AEDataFormat + AE_FMT_INVALID = -1, - virtual bool Supports(ERENDERFEATURE feature) { return false; } + AE_FMT_U8, +- AE_FMT_U8P, + AE_FMT_S8, -diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index d52dead..962680a 100644 ---- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -+++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -128,6 +128,7 @@ - memset(&image , 0, sizeof(image)); - memset(&pbo , 0, sizeof(pbo)); - flipindex = 0; -+ fence = None; - #ifdef HAVE_LIBVDPAU - vdpau = NULL; - #endif -@@ -138,6 +139,8 @@ - - CLinuxRendererGL::YUVBUFFER::~YUVBUFFER() - { -+ if(fence) -+ glDeleteSync(fence); - #ifdef HAVE_LIBVA - delete &vaapi; - #endif -@@ -1228,6 +1231,15 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) - RenderSoftware(renderBuffer, m_currentField); - VerifyGLState(); - } -+ -+ // set fence in order to determine when buffer is ready for reuse -+ // this is the case when the gl has finished processing -+ if(m_buffers[renderBuffer].fence) -+ { -+ glDeleteSync(m_buffers[renderBuffer].fence); -+ m_buffers[renderBuffer].fence = None; -+ } -+ m_buffers[renderBuffer].fence = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); - } - - void CLinuxRendererGL::RenderSinglePass(int index, int field) -@@ -3426,6 +3438,26 @@ unsigned int CLinuxRendererGL::GetProcessorSize() - return 0; - } - -+bool CLinuxRendererGL::IsProcessed(int idx) -+{ -+ YUVBUFFER &buf = m_buffers[idx]; -+ if(buf.fence) -+ { -+ GLint state; -+ GLsizei length; -+ glGetSynciv(buf.fence, GL_SYNC_STATUS, 1, &length, &state); -+ if(state == GL_SIGNALED) -+ { -+ glDeleteSync(buf.fence); -+ buf.fence = None; -+ return true; -+ } -+ else -+ return false; -+ } -+ return true; -+} -+ - #ifdef HAVE_LIBVDPAU - void CLinuxRendererGL::AddProcessor(CVDPAU* vdpau, int index) - { -diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.h b/xbmc/cores/VideoRenderers/LinuxRendererGL.h -index b986d93..a90a532 100644 ---- a/xbmc/cores/VideoRenderers/LinuxRendererGL.h -+++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.h -@@ -141,6 +141,7 @@ class CLinuxRendererGL : public CBaseRenderer - virtual void SetBufferSize(int numBuffers) { m_NumYV12Buffers = numBuffers; } - virtual unsigned int GetMaxBufferSize() { return NUM_BUFFERS; } - virtual unsigned int GetProcessorSize(); -+ virtual bool IsProcessed(int idx); - - #ifdef HAVE_LIBVDPAU - virtual void AddProcessor(CVDPAU* vdpau, int index); -@@ -278,6 +279,7 @@ class CLinuxRendererGL : public CBaseRenderer - YV12Image image; - unsigned flipindex; /* used to decide if this has been uploaded */ - GLuint pbo[MAX_PLANES]; -+ GLsync fence; - - #ifdef HAVE_LIBVDPAU - CVDPAU* vdpau; -diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 0d32715..6a8afff 100644 ---- a/xbmc/cores/VideoRenderers/RenderManager.cpp -+++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -374,11 +374,16 @@ void CXBMCRenderManager::FrameMove() - /* release all previous */ - for(std::deque::iterator it = m_discard.begin(); it != m_discard.end(); ) - { -- // TODO check for fence -+ if (!m_pRenderer->IsProcessed(*it)) -+ { -+ ++it; -+ continue; -+ } - m_pRenderer->ReleaseBuffer(*it); - m_overlays.Release(*it); - m_free.push_back(*it); - it = m_discard.erase(it); -+ m_presentevent.notifyAll(); - } - } - } --- -1.8.1.6 - - -From 4e82aa374e215ba627741f7a0a9ea8da770b2672 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Mon, 28 May 2012 10:34:39 +0200 -Subject: [PATCH 002/110] 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 ++++ - .../DVDCodecs/Video/DVDVideoCodecFFmpeg.h | 7 + - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 194 +++++++++++++++++---- - xbmc/cores/dvdplayer/DVDPlayerVideo.h | 23 +++ - 7 files changed, 260 insertions(+), 38 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 6a8afff..deac94b 100644 ---- a/xbmc/cores/VideoRenderers/RenderManager.cpp -+++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -299,6 +299,8 @@ bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsi - m_bIsStarted = true; - m_bReconfigured = true; - m_presentstep = PRESENT_IDLE; -+ m_presentpts = DVD_NOPTS_VALUE; -+ m_sleeptime = 1.0; - m_presentevent.notifyAll(); - - m_firstFlipPage = false; // tempfix -@@ -645,7 +647,7 @@ void CXBMCRenderManager::SetViewMode(int iViewMode) - m_pRenderer->SetViewMode(iViewMode); - } - --void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0LL*/, int source /*= -1*/, EFIELDSYNC sync /*= FS_NONE*/) -+void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0LL*/, double pts /* = 0 */, int source /*= -1*/, EFIELDSYNC sync /*= FS_NONE*/) - { - { CSharedLock lock(m_sharedSection); - -@@ -713,6 +715,7 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L - m.timestamp = timestamp; - m.presentfield = sync; - m.presentmethod = presentmethod; -+ m.pts = pts; - requeue(m_queued, m_free); - - /* signal to any waiters to check state */ -@@ -1076,6 +1079,8 @@ void CXBMCRenderManager::PrepareNextRender() - m_discard.push_back(m_presentsource); - m_presentsource = idx; - m_queued.pop_front(); -+ m_sleeptime = m_Queue[idx].timestamp - clocktime; -+ m_presentpts = m_Queue[idx].pts; - m_presentevent.notifyAll(); - } - } -@@ -1092,3 +1097,12 @@ void CXBMCRenderManager::DiscardBuffer() - m_presentstep = PRESENT_IDLE; - m_presentevent.notifyAll(); - } -+ -+bool CXBMCRenderManager::GetStats(double &sleeptime, double &pts, int &bufferLevel) -+{ -+ CSingleLock lock(m_presentlock); -+ sleeptime = m_sleeptime; -+ pts = m_presentpts; -+ bufferLevel = m_queued.size() + m_discard.size(); -+ return true; -+} -diff --git a/xbmc/cores/VideoRenderers/RenderManager.h b/xbmc/cores/VideoRenderers/RenderManager.h -index 00fe4c3..52380c1 100644 ---- a/xbmc/cores/VideoRenderers/RenderManager.h -+++ b/xbmc/cores/VideoRenderers/RenderManager.h -@@ -97,10 +97,11 @@ class CXBMCRenderManager - * - * @param bStop reference to stop flag of calling thread - * @param timestamp of frame delivered with AddVideoPicture -+ * @param pts used for lateness detection - * @param source depreciated - * @param sync signals frame, top, or bottom field - */ -- void FlipPage(volatile bool& bStop, double timestamp = 0.0, int source = -1, EFIELDSYNC sync = FS_NONE); -+ void FlipPage(volatile bool& bStop, double timestamp = 0.0, double pts = 0.0, int source = -1, EFIELDSYNC sync = FS_NONE); - unsigned int PreInit(); - void UnInit(); - bool Flush(); -@@ -175,6 +176,12 @@ class CXBMCRenderManager - int WaitForBuffer(volatile bool& bStop, int timeout = 100); - - /** -+ * Can be called by player for lateness detection. This is done best by -+ * looking at the end of the queue. -+ */ -+ bool GetStats(double &sleeptime, double &pts, int &bufferLevel); -+ -+ /** - * Video player call this on flush in oder to discard any queued frames - */ - void DiscardBuffer(); -@@ -221,6 +228,7 @@ class CXBMCRenderManager - - struct SPresent - { -+ double pts; - double timestamp; - EFIELDSYNC presentfield; - EPRESENTMETHOD presentmethod; -@@ -232,6 +240,8 @@ class CXBMCRenderManager - - ERenderFormat m_format; - -+ double m_sleeptime; -+ double m_presentpts; - double m_presentcorr; - 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 8fc76b7..7f6d536 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -@@ -117,6 +117,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 -+ - // DVP_FLAG 0x00000100 - 0x00000f00 is in use by libmpeg2! - - #define DVP_QSCALE_UNKNOWN 0 -@@ -134,6 +138,9 @@ struct DVDVideoUserData - #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: -@@ -251,10 +258,16 @@ class CDVDVideoCodec - return 0; - } + AE_FMT_S16BE, + AE_FMT_S16LE, + AE_FMT_S16NE, +- AE_FMT_S16NEP, + AE_FMT_S32BE, + AE_FMT_S32LE, + AE_FMT_S32NE, +- AE_FMT_S32NEP, - - /** - * Number of references to old pictures that are allowed to - * be retained when calling decode on the next demux packet - */ - virtual unsigned GetAllowedReferences() { return 0; } ++ + AE_FMT_S24BE4, + AE_FMT_S24LE4, + AE_FMT_S24NE4, /* S24 in 4 bytes */ +- AE_FMT_S24NE4P, + + AE_FMT_S24BE3, + AE_FMT_S24LE3, + AE_FMT_S24NE3, /* S24 in 3 bytes */ +- AE_FMT_S24NE3P, + + AE_FMT_DOUBLE, +- AE_FMT_DOUBLEP, + AE_FMT_FLOAT, +- AE_FMT_FLOATP, + + /* Bitstream formats */ + AE_FMT_AAC, +@@ -68,11 +61,20 @@ enum AEDataFormat + AE_FMT_DTSHD, + AE_FMT_LPCM, + ++ /* planar formats */ ++ AE_FMT_U8P, ++ AE_FMT_S16NEP, ++ AE_FMT_S32NEP, ++ AE_FMT_S24NE4P, ++ AE_FMT_S24NE3P, ++ AE_FMT_DOUBLEP, ++ AE_FMT_FLOATP, + -+ virtual bool GetPts(double &pts, int &skippedDeint, int &interlaced) -+ { -+ return false; -+ } -+ -+ virtual void SetCodecControl(int flags) {} + AE_FMT_MAX }; -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index 12bad27..530dc9d 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -@@ -167,6 +167,7 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx - m_iLastKeyframe = 0; - m_dts = DVD_NOPTS_VALUE; - m_started = false; -+ m_decoderPts = DVD_NOPTS_VALUE; - } - CDVDVideoCodecFFmpeg::~CDVDVideoCodecFFmpeg() -@@ -353,6 +354,14 @@ void CDVDVideoCodecFFmpeg::SetDropState(bool bDrop) - { - if( m_pCodecContext ) +-#define AE_IS_RAW(x) ((x) >= AE_FMT_AAC && (x) < AE_FMT_MAX) +-#define AE_IS_RAW_HD(x) ((x) >= AE_FMT_EAC3 && (x) < AE_FMT_MAX) ++#define AE_IS_RAW(x) ((x) >= AE_FMT_AAC && (x) < AE_FMT_U8P) ++#define AE_IS_RAW_HD(x) ((x) >= AE_FMT_EAC3 && (x) < AE_FMT_U8P) + + /** + * The audio format structure that fully defines a stream's audio information +diff --git a/xbmc/cores/AudioEngine/Utils/AEUtil.cpp b/xbmc/cores/AudioEngine/Utils/AEUtil.cpp +index 3a5c78f..1ff44f8 100644 +--- a/xbmc/cores/AudioEngine/Utils/AEUtil.cpp ++++ b/xbmc/cores/AudioEngine/Utils/AEUtil.cpp +@@ -82,42 +82,43 @@ const unsigned int CAEUtil::DataFormatToBits(const enum AEDataFormat dataFormat) + static const unsigned int formats[AE_FMT_MAX] = { -+ if (bDrop && m_pHardware && m_pHardware->CanSkipDeint()) -+ { -+ m_requestSkipDeint = true; -+ bDrop = false; -+ } -+ else -+ m_requestSkipDeint = false; -+ - // i don't know exactly how high this should be set - // couldn't find any good docs on it. think it varies - // from codec to codec on what it does -@@ -554,6 +563,7 @@ int CDVDVideoCodecFFmpeg::Decode(uint8_t* pData, int iSize, double dts, double p - void CDVDVideoCodecFFmpeg::Reset() - { - m_started = false; -+ m_decoderPts = DVD_NOPTS_VALUE; - m_iLastKeyframe = m_pCodecContext->has_b_frames; - m_dllAvCodec.avcodec_flush_buffers(m_pCodecContext); + 8, /* U8 */ +- 8, /* U8P */ + 8, /* S8 */ -@@ -667,6 +677,22 @@ bool CDVDVideoCodecFFmpeg::GetPictureCommon(DVDVideoPicture* pDvdVideoPicture) - else - pDvdVideoPicture->pts = DVD_NOPTS_VALUE; + 16, /* S16BE */ + 16, /* S16LE */ + 16, /* S16NE */ +- 16, /* S16NEP */ +- ++ + 32, /* S32BE */ + 32, /* S32LE */ + 32, /* S32NE */ +- 32, /* S32NEP */ +- ++ + 32, /* S24BE */ + 32, /* S24LE */ + 32, /* S24NE */ +- 32, /* S24NEP */ +- ++ + 24, /* S24BE3 */ + 24, /* S24LE3 */ + 24, /* S24NE3 */ +- 24, /* S24NE3P*/ +- ++ + sizeof(double) << 3, /* DOUBLE */ +- sizeof(double) << 3, /* DOUBLEP */ + sizeof(float ) << 3, /* FLOAT */ +- sizeof(float ) << 3, /* FLOATP */ +- ++ + 16, /* AAC */ + 16, /* AC3 */ + 16, /* DTS */ + 16, /* EAC3 */ + 16, /* TRUEHD */ + 16, /* DTS-HD */ +- 32 /* LPCM */ +- }; ++ 32, /* LPCM */ ++ ++ 8, /* U8P */ ++ 16, /* S16NEP */ ++ 32, /* S32NEP */ ++ 32, /* S24NEP */ ++ 24, /* S24NE3P*/ ++ sizeof(double) << 3, /* DOUBLEP */ ++ sizeof(float ) << 3 /* FLOATP */ ++ }; -+ if (pDvdVideoPicture->pts != DVD_NOPTS_VALUE) -+ m_decoderPts = pDvdVideoPicture->pts; -+ else -+ m_decoderPts = m_dts; -+ -+ if (m_requestSkipDeint) -+ { -+ pDvdVideoPicture->iFlags |= DVP_FLAG_DROPDEINT; -+ m_skippedDeint = 1; -+ } -+ else -+ m_skippedDeint = 0; -+ -+ m_requestSkipDeint = false; -+ pDvdVideoPicture->iFlags |= m_codecControlFlags; -+ - if(!m_started) - pDvdVideoPicture->iFlags |= DVP_FLAG_DROPPED; - -@@ -931,3 +957,8 @@ unsigned CDVDVideoCodecFFmpeg::GetAllowedReferences() - else - return 0; + return formats[dataFormat]; } +@@ -130,34 +131,27 @@ const char* CAEUtil::DataFormatToStr(const enum AEDataFormat dataFormat) + static const char *formats[AE_FMT_MAX] = + { + "AE_FMT_U8", +- "AE_FMT_U8P", + "AE_FMT_S8", + + "AE_FMT_S16BE", + "AE_FMT_S16LE", + "AE_FMT_S16NE", +- "AE_FMT_S16NEP", +- ++ + "AE_FMT_S32BE", + "AE_FMT_S32LE", + "AE_FMT_S32NE", +- "AE_FMT_S32NEP", +- ++ + "AE_FMT_S24BE4", + "AE_FMT_S24LE4", + "AE_FMT_S24NE4", /* S24 in 4 bytes */ +- "AE_FMT_S24NE4P", +- ++ + "AE_FMT_S24BE3", + "AE_FMT_S24LE3", + "AE_FMT_S24NE3", /* S24 in 3 bytes */ +- "AE_FMT_S24NE3P", +- ++ + "AE_FMT_DOUBLE", +- "AE_FMT_DOUBLEP", + "AE_FMT_FLOAT", +- "AE_FMT_FLOATP", +- ++ + /* for passthrough streams and the like */ + "AE_FMT_AAC", + "AE_FMT_AC3", +@@ -165,7 +159,16 @@ const char* CAEUtil::DataFormatToStr(const enum AEDataFormat dataFormat) + "AE_FMT_EAC3", + "AE_FMT_TRUEHD", + "AE_FMT_DTSHD", +- "AE_FMT_LPCM" ++ "AE_FMT_LPCM", + -+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 c509339..a511806 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h -@@ -46,6 +46,7 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec - virtual int Check (AVCodecContext* avctx) = 0; - virtual void Reset () {} - virtual unsigned GetAllowedReferences() { return 0; } -+ virtual bool CanSkipDeint() {return false; } - virtual const std::string Name() = 0; - virtual CCriticalSection* Section() { return NULL; } ++ /* planar formats */ ++ "AE_FMT_U8P", ++ "AE_FMT_S16NEP", ++ "AE_FMT_S32NEP", ++ "AE_FMT_S24NE4P", ++ "AE_FMT_S24NE3P", ++ "AE_FMT_DOUBLEP", ++ "AE_FMT_FLOATP" }; -@@ -63,6 +64,8 @@ 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 void SetCodecControl(int flags); - bool IsHardwareAllowed() { return !m_bSoftware; } - IHardwareDecoder * GetHardware() { return m_pHardware; }; -@@ -128,4 +131,8 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec - double m_dts; - bool m_started; - std::vector m_formats; -+ double m_decoderPts, m_decoderInterval; -+ int m_skippedDeint; -+ bool m_requestSkipDeint; -+ int m_codecControlFlags; - }; -diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 51caa05..3284332 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -323,8 +323,10 @@ void CDVDPlayerVideo::Process() + return formats[dataFormat]; +-- +1.8.1.6 + + +From a2ab55a82288080ef0fbb92f9cf5a7d4c34c8ff9 Mon Sep 17 00:00:00 2001 +From: fritsch +Date: Sun, 11 Aug 2013 19:35:57 +0200 +Subject: [PATCH 002/111] AudioEngine: Add AE_IS_PLANAR(x) macro + +--- + xbmc/cores/AudioEngine/AEAudioFormat.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/xbmc/cores/AudioEngine/AEAudioFormat.h b/xbmc/cores/AudioEngine/AEAudioFormat.h +index 5664e6e..5774132 100644 +--- a/xbmc/cores/AudioEngine/AEAudioFormat.h ++++ b/xbmc/cores/AudioEngine/AEAudioFormat.h +@@ -75,6 +75,7 @@ enum AEDataFormat - int iDropped = 0; //frames dropped in a row - bool bRequestDrop = false; -+ int iDropDirective; + #define AE_IS_RAW(x) ((x) >= AE_FMT_AAC && (x) < AE_FMT_U8P) + #define AE_IS_RAW_HD(x) ((x) >= AE_FMT_EAC3 && (x) < AE_FMT_U8P) ++#define AE_IS_PLANAR(x) ((x) >= AE_FMT_U8P && (x) <= AE_FMT_FLOATP) - m_videoStats.Start(); -+ m_droppingStats.Reset(); - - while (!m_bStop) + /** + * The audio format structure that fully defines a stream's audio information +-- +1.8.1.6 + + +From 6fe6e6009ffb0ccafc270a5cacf8b3bc0c7a7ff7 Mon Sep 17 00:00:00 2001 +From: unknown +Date: Mon, 12 Aug 2013 09:08:34 +0200 +Subject: [PATCH 003/111] AE: WASAPI - fix AddPackets for the case of provided + frames are less than buffer size + +--- + xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp +index ef43428..8a7001b 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp +@@ -466,7 +466,7 @@ unsigned int CAESinkWASAPI::AddPackets(uint8_t *data, unsigned int frames, bool { -@@ -434,6 +436,7 @@ void CDVDPlayerVideo::Process() - picture.iFlags &= ~DVP_FLAG_ALLOCATED; - m_packets.clear(); - m_started = false; -+ m_droppingStats.Reset(); - } - else if (pMsg->IsType(CDVDMsg::GENERAL_FLUSH)) // private message sent by (CDVDPlayerVideo::Flush()) - { -@@ -446,6 +449,7 @@ void CDVDPlayerVideo::Process() - //we need to recalculate the framerate - //TODO: this needs to be set on a streamchange instead - ResetFrameRateCalc(); -+ m_droppingStats.Reset(); + memcpy(m_pBuffer+m_bufferPtr*m_format.m_frameSize, data, FramesToCopy*m_format.m_frameSize); + m_bufferPtr += FramesToCopy; +- if (frames != m_format.m_frames) ++ if (m_bufferPtr != m_format.m_frames) + return frames; + } - m_stalled = true; - m_started = false; -@@ -463,8 +467,10 @@ void CDVDPlayerVideo::Process() - m_speed = static_cast(pMsg)->m_value; - if(m_speed == DVD_PLAYSPEED_PAUSE) - m_iNrOfPicturesNotToSkip = 0; -+ - if (m_pVideoCodec) - m_pVideoCodec->SetSpeed(m_speed); -+ m_droppingStats.Reset(); - } - else if (pMsg->IsType(CDVDMsg::PLAYER_STARTED)) - { -@@ -510,6 +516,28 @@ void CDVDPlayerVideo::Process() - m_iNrOfPicturesNotToSkip = 1; - } - -+ bRequestDrop = false; -+ iDropDirective = CalcDropRequirement(pts); -+ if (iDropDirective & EOS_VERYLATE) -+ { -+ if (m_bAllowDrop) -+ { -+ m_pullupCorrection.Flush(); -+ bRequestDrop = true; -+ } -+ } -+ int codecControl = 0; -+ if (iDropDirective & EOS_BUFFER_LEVEL) -+ codecControl |= DVP_FLAG_DRAIN; -+ if (m_speed > DVD_PLAYSPEED_NORMAL) -+ codecControl |= DVP_FLAG_NO_POSTPROC; -+ m_pVideoCodec->SetCodecControl(codecControl); -+ if (iDropDirective & EOS_DROPPED) -+ { -+ m_iDroppedFrames++; -+ iDropped++; -+ } -+ - if (m_messageQueue.GetDataSize() == 0 - || m_speed < 0) - { -@@ -562,15 +590,8 @@ void CDVDPlayerVideo::Process() - } - - m_videoStats.AddSampleBytes(pPacket->iSize); -- // assume decoder dropped a picture if it didn't give us any -- // picture from a demux packet, this should be reasonable -- // for libavformat as a demuxer as it normally packetizes -- // pictures when they come from demuxer -- if(bRequestDrop && !bPacketDrop && (iDecoderState & VC_BUFFER) && !(iDecoderState & VC_PICTURE)) -- { -- m_iDroppedFrames++; -- iDropped++; -- } -+ -+ bRequestDrop = false; - - // loop while no error - while (!m_bStop) -@@ -1178,33 +1199,12 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) - m_FlipTimeStamp += max(0.0, iSleepTime); - m_FlipTimeStamp += iFrameDuration; - -- if (iSleepTime <= 0 && m_speed) -- m_iLateFrames++; -- else -- m_iLateFrames = 0; -- -- // ask decoder to drop frames next round, as we are very late -- if(m_iLateFrames > 10) -+ if ((pPicture->iFlags & DVP_FLAG_DROPPED)) +-- +1.8.1.6 + + +From beb6b84b7694a5ed50b981eab59405bf5f6ec4c0 Mon Sep 17 00:00:00 2001 +From: unknown +Date: Mon, 12 Aug 2013 09:40:38 +0200 +Subject: [PATCH 004/111] ActiveAE: engage transcode for stereo if upmix is + selected + +--- + xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +index bc861ae..4326729 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +@@ -1172,7 +1172,7 @@ void CActiveAE::ApplySettingsToFormat(AEAudioFormat &format, AudioSettings &sett + settings.ac3passthrough && + (!settings.multichannellpcm || (m_settings.mode != AUDIO_HDMI)) && + !m_streams.empty() && +- format.m_channelLayout.Count() > 2) ++ (format.m_channelLayout.Count() > 2 || settings.stereoupmix)) { -- if (!(pPicture->iFlags & DVP_FLAG_NOSKIP)) -- { -- //if we're calculating the framerate, -- //don't drop frames until we've calculated a stable framerate -- if (m_bAllowDrop || m_speed != DVD_PLAYSPEED_NORMAL) -- { -- result |= EOS_VERYLATE; -- m_pullupCorrection.Flush(); //dropped frames mess up the pattern, so just flush it -- } -- m_iDroppedRequest++; -- } -- } -- else + format.m_dataFormat = AE_FMT_AC3; + format.m_sampleRate = 48000; +-- +1.8.1.6 + + +From 18f24beff89d8c872962967698cd21dce715373d Mon Sep 17 00:00:00 2001 +From: unknown +Date: Mon, 12 Aug 2013 14:59:38 +0200 +Subject: [PATCH 005/111] ActiveAE: flush engine on flush stream if only one + stream is active + +--- + .../AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 27 ++++++++++++++++++++++ + .../AudioEngine/Engines/ActiveAE/ActiveAESink.cpp | 5 ++++ + .../AudioEngine/Engines/ActiveAE/ActiveAESink.h | 1 + + 3 files changed, 33 insertions(+) + +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +index 4326729..30af6e8 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +@@ -1077,6 +1077,33 @@ void CActiveAE::SFlushStream(CActiveAEStream *stream) + stream->m_streamPort->Purge(); + stream->m_bufferedTime = 0.0; + stream->m_paused = true; ++ ++ // flsuh the engine if we only have a single stream ++ if (m_streams.size() == 1) ++ { ++ m_sinkBuffers->Flush(); ++ m_vizBuffers->Flush(); ++ ++ // send message to sink ++ Message *reply; ++ if (m_sink.m_controlPort.SendOutMessageSync(CSinkControlProtocol::FLUSH, ++ &reply, 2000)) ++ { ++ bool success = reply->signal == CSinkControlProtocol::ACC ? true : false; ++ if (!success) ++ { ++ CLog::Log(LOGERROR, "ActiveAE::%s - returned error on flush", __FUNCTION__); ++ m_extError = true; ++ } ++ reply->Release(); ++ } ++ else ++ { ++ CLog::Log(LOGERROR, "ActiveAE::%s - failed to flush", __FUNCTION__); ++ m_extError = true; ++ } ++ m_stats.Reset(m_sinkFormat.m_sampleRate); ++ } + } + + void CActiveAE::ClearDiscardedBuffers() +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp +index 82854c2..4785c76 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp +@@ -167,6 +167,11 @@ void CActiveAESink::StateMachine(int signal, Protocol *port, Message *msg) + msg->Reply(CSinkControlProtocol::ACC); + return; + ++ case CSinkControlProtocol::FLUSH: ++ ReturnBuffers(); ++ msg->Reply(CSinkControlProtocol::ACC); ++ return; ++ + default: + break; + } +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.h +index 559179c..e241b03 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.h ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.h +@@ -50,6 +50,7 @@ class CSinkControlProtocol : public Protocol + UNCONFIGURE, + SILENCEMODE, + VOLUME, ++ FLUSH, + TIMEOUT, + }; + enum InSignal +-- +1.8.1.6 + + +From 25616c11a7f18e7d159d149f98df94c35692e203 Mon Sep 17 00:00:00 2001 +From: unknown +Date: Mon, 12 Aug 2013 15:01:09 +0200 +Subject: [PATCH 006/111] ActiveAE: check for error during playback + +--- + xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +index 30af6e8..5f068a1 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +@@ -649,6 +649,12 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) + switch (signal) + { + case CActiveAEControlProtocol::TIMEOUT: ++ if (m_extError) ++ { ++ m_state = AE_TOP_ERROR; ++ m_extTimeout = 100; ++ return; ++ } + if (RunStages()) + { + m_extTimeout = 0; +-- +1.8.1.6 + + +From 49e6399b73ad242133f8f75e48d8830eef00d788 Mon Sep 17 00:00:00 2001 +From: unknown +Date: Mon, 12 Aug 2013 15:32:50 +0200 +Subject: [PATCH 007/111] dvdplayer: flush audio on close stream in case of + nowait + +--- + xbmc/cores/dvdplayer/DVDPlayerAudio.cpp | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp +index 3c1e553..583a7f8 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp +@@ -231,6 +231,11 @@ void CDVDPlayerAudio::CloseStream(bool bWaitForBuffers) + m_dvdAudio.Drain(); + m_bStop = true; + } ++ else ++ { ++ m_dvdAudio.Flush(); ++ } ++ + m_dvdAudio.Destroy(); + + // uninit queue +-- +1.8.1.6 + + +From 049909912598dcca3dc5e4113bf1da9c7dc856fd Mon Sep 17 00:00:00 2001 +From: unknown +Date: Mon, 12 Aug 2013 15:33:49 +0200 +Subject: [PATCH 008/111] ActiveAE: faster flushing of stream + +--- + .../AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 22 ++++++++++++---------- + xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h | 2 +- + .../Engines/ActiveAE/ActiveAEStream.cpp | 10 +--------- + 3 files changed, 14 insertions(+), 20 deletions(-) + +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +index 5f068a1..3ae6d9c 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +@@ -424,6 +424,11 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) + m_state = AE_TOP_CONFIGURED_PLAY; + m_extTimeout = 0; + return; ++ case CActiveAEControlProtocol::FLUSHSTREAM: ++ stream = *(CActiveAEStream**)msg->data; ++ SFlushStream(stream); ++ msg->Reply(CActiveAEControlProtocol::ACC); ++ return; + case CActiveAEControlProtocol::STREAMAMP: + MsgStreamParameter *par; + par = (MsgStreamParameter*)msg->data; +@@ -541,11 +546,6 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) + m_state = AE_TOP_CONFIGURED_PLAY; + msg->Reply(CActiveAEDataProtocol::ACC); + return; +- case CActiveAEDataProtocol::FLUSHSTREAM: +- stream = *(CActiveAEStream**)msg->data; +- SFlushStream(stream); +- msg->Reply(CActiveAEDataProtocol::ACC); +- return; + default: + break; + } +@@ -1084,11 +1084,13 @@ void CActiveAE::SFlushStream(CActiveAEStream *stream) + stream->m_bufferedTime = 0.0; + stream->m_paused = true; + +- // flsuh the engine if we only have a single stream ++ // flush the engine if we only have a single stream + if (m_streams.size() == 1) + { +- m_sinkBuffers->Flush(); +- m_vizBuffers->Flush(); ++ if (m_sinkBuffers) ++ m_sinkBuffers->Flush(); ++ if (m_vizBuffers) ++ m_vizBuffers->Flush(); + + // send message to sink + Message *reply; +@@ -2263,11 +2265,11 @@ IAEStream *CActiveAE::FreeStream(IAEStream *stream) + void CActiveAE::FlushStream(CActiveAEStream *stream) + { + Message *reply; +- if (m_dataPort.SendOutMessageSync(CActiveAEDataProtocol::FLUSHSTREAM, ++ if (m_controlPort.SendOutMessageSync(CActiveAEControlProtocol::FLUSHSTREAM, + &reply,1000, + &stream, sizeof(CActiveAEStream*))) + { +- bool success = reply->signal == CActiveAEDataProtocol::ACC ? true : false; ++ bool success = reply->signal == CActiveAEControlProtocol::ACC ? true : false; + reply->Release(); + if (!success) + { +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h +index 90c7f14..e5a3e9d 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h +@@ -73,6 +73,7 @@ class CActiveAEControlProtocol : public Protocol + VOLUME, + PAUSESTREAM, + RESUMESTREAM, ++ FLUSHSTREAM, + STREAMRGAIN, + STREAMVOLUME, + STREAMAMP, +@@ -106,7 +107,6 @@ class CActiveAEDataProtocol : public Protocol + FREESTREAM, + STREAMSAMPLE, + DRAINSTREAM, +- FLUSHSTREAM, + }; + enum InSignal + { +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp +index 3ef5d1f..ab2b10a 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp +@@ -247,15 +247,7 @@ bool CActiveAEStream::IsDrained() + + void CActiveAEStream::Flush() + { +- if (m_currentBuffer) - { -- m_iDroppedRequest = 0; +- MsgStreamSample msgData; +- m_currentBuffer->pkt->nb_samples = 0; +- msgData.buffer = m_currentBuffer; +- msgData.stream = this; +- m_streamPort->SendOutMessage(CActiveAEDataProtocol::STREAMSAMPLE, &msgData, sizeof(MsgStreamSample)); +- m_currentBuffer = NULL; - } -- -- if( (pPicture->iFlags & DVP_FLAG_DROPPED) ) -+ m_droppingStats.AddOutputDropGain(pts, 1/m_fFrameRate); -+ CLog::Log(LOGDEBUG,"%s - dropped in output", __FUNCTION__); - return result | EOS_DROPPED; ++ m_currentBuffer = NULL; + AE.FlushStream(this); + ResetFreeBuffers(); + } +-- +1.8.1.6 + + +From 2d51194c3ca1c4a62be4ca48d8edd85c7922c9b3 Mon Sep 17 00:00:00 2001 +From: unknown +Date: Tue, 13 Aug 2013 10:55:39 +0200 +Subject: [PATCH 009/111] AE: WASAPI - fix GetDelay + +--- + xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp | 15 ++++++++++++++- + xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.h | 1 + + 2 files changed, 15 insertions(+), 1 deletion(-) + +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp +index 8a7001b..a49e86d 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp +@@ -418,7 +418,19 @@ double CAESinkWASAPI::GetDelay() + if (!m_initialized) + return 0.0; + +- return m_sinkLatency; ++ double time_played = 0.0; ++ if (m_running) ++ { ++ unsigned int now = XbmcThreads::SystemClockMillis(); ++ time_played = (double)(now-m_lastWriteToBuffer) / 1000; ++ } ++ ++ double delay = m_sinkLatency - time_played + (double)m_bufferPtr / (double)m_format.m_sampleRate; ++ ++ if (delay < 0) ++ delay = 0.0; ++ ++ return delay; + } + + double CAESinkWASAPI::GetCacheTime() +@@ -579,6 +591,7 @@ unsigned int CAESinkWASAPI::AddPackets(uint8_t *data, unsigned int frames, bool + #endif + return INT_MAX; + } ++ m_lastWriteToBuffer = XbmcThreads::SystemClockMillis(); + + if (FramesToCopy != frames) + { +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.h b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.h +index d9619c4..8b29f50 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.h ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.h +@@ -79,6 +79,7 @@ class CAESinkWASAPI : public IAESink + unsigned int m_uiBufferLen; /* wasapi endpoint buffer size, in frames */ + double m_avgTimeWaiting; /* time between next buffer of data from SoftAE and driver call for data */ + double m_sinkLatency; /* time in seconds of total duration of the two WASAPI buffers */ ++ unsigned int m_lastWriteToBuffer; + + uint8_t *m_pBuffer; + int m_bufferPtr; +-- +1.8.1.6 + + +From c04bd2950634488381ed17897fd20347b517a889 Mon Sep 17 00:00:00 2001 +From: unknown +Date: Tue, 13 Aug 2013 13:19:48 +0200 +Subject: [PATCH 010/111] ActiveAE: do not pause stream when flushing it + +--- + xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +index 3ae6d9c..9b3ff00 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +@@ -428,6 +428,8 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) + stream = *(CActiveAEStream**)msg->data; + SFlushStream(stream); + msg->Reply(CActiveAEControlProtocol::ACC); ++ m_state = AE_TOP_CONFIGURED_PLAY; ++ m_extTimeout = 0; + return; + case CActiveAEControlProtocol::STREAMAMP: + MsgStreamParameter *par; +@@ -1082,7 +1084,7 @@ void CActiveAE::SFlushStream(CActiveAEStream *stream) + stream->m_resampleBuffers->Flush(); + stream->m_streamPort->Purge(); + stream->m_bufferedTime = 0.0; +- stream->m_paused = true; ++ stream->m_paused = false; + + // flush the engine if we only have a single stream + if (m_streams.size() == 1) +-- +1.8.1.6 + + +From 6188a2c1d3b5613eaba8338fba32b6e1f9544c68 Mon Sep 17 00:00:00 2001 +From: unknown +Date: Wed, 14 Aug 2013 08:11:05 +0200 +Subject: [PATCH 011/111] AE: adapt limiter to planar formats + +--- + xbmc/cores/AudioEngine/Utils/AELimiter.cpp | 9 ++++++--- + xbmc/cores/AudioEngine/Utils/AELimiter.h | 2 +- + 2 files changed, 7 insertions(+), 4 deletions(-) + +diff --git a/xbmc/cores/AudioEngine/Utils/AELimiter.cpp b/xbmc/cores/AudioEngine/Utils/AELimiter.cpp +index 77af320..5ea0884 100644 +--- a/xbmc/cores/AudioEngine/Utils/AELimiter.cpp ++++ b/xbmc/cores/AudioEngine/Utils/AELimiter.cpp +@@ -34,12 +34,15 @@ + m_increase = 0.0f; + } + +-float CAELimiter::Run(float* frame, int channels) ++float CAELimiter::Run(float* frame, int channels, int stride /*= 1*/) + { +- float* end = frame + channels; ++ float* end = frame + channels*stride; + float highest = 0.0f; + while (frame != end) +- highest = std::max(highest, fabsf(*(frame++))); ++ { ++ highest = std::max(highest, fabsf(*(frame))); ++ frame += stride; + } - // set fieldsync if picture is interlaced - EFIELDSYNC mDisplayField = FS_NONE; -@@ -1237,7 +1237,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) - if (index < 0) - return EOS_DROPPED; + float sample = highest * m_amplify; + if (sample * m_attenuation > 1.0f) +diff --git a/xbmc/cores/AudioEngine/Utils/AELimiter.h b/xbmc/cores/AudioEngine/Utils/AELimiter.h +index ef46d0c..9507e71 100644 +--- a/xbmc/cores/AudioEngine/Utils/AELimiter.h ++++ b/xbmc/cores/AudioEngine/Utils/AELimiter.h +@@ -48,5 +48,5 @@ class CAELimiter + m_samplerate = (float)samplerate; + } -- g_renderManager.FlipPage(CThread::m_bStop, (iCurrentClock + iSleepTime) / DVD_TIME_BASE, -1, mDisplayField); -+ g_renderManager.FlipPage(CThread::m_bStop, (iCurrentClock + iSleepTime) / DVD_TIME_BASE, pts, -1, mDisplayField); +- float Run(float* frame, int channels); ++ float Run(float* frame, int channels, int stride = 1); + }; +-- +1.8.1.6 + + +From 8b77985e390eeb90a17ef4198b0177d03a910406 Mon Sep 17 00:00:00 2001 +From: unknown +Date: Wed, 14 Aug 2013 08:11:42 +0200 +Subject: [PATCH 012/111] ActiveAE: fix volume amplification + +--- + .../AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 36 +++++++++------------- + xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h | 1 - + 2 files changed, 15 insertions(+), 22 deletions(-) + +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +index 9b3ff00..db331dc 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +@@ -972,6 +972,9 @@ void CActiveAE::Configure(AEAudioFormat *desiredFmt) + } + if (m_mode == MODE_TRANSCODE || m_streams.size() > 1) + (*it)->m_resampleBuffers->m_fillPackets = true; ++ ++ // amplification ++ (*it)->m_limiter.SetSamplerate(outputFormat.m_sampleRate); + } - return result; - #else -@@ -1537,3 +1537,127 @@ void CDVDPlayerVideo::CalcFrameRate() - m_iFrameRateCount = 0; + // buffers for viz +@@ -1165,19 +1168,6 @@ void CActiveAE::DiscardSound(CActiveAESound *sound) } } -+ -+int CDVDPlayerVideo::CalcDropRequirement(double pts) -+{ -+ int result = 0; -+ double iSleepTime; -+ double iDecoderPts, iRenderPts; -+ double iInterval; -+ int interlaced; -+ double iGain; -+ double iLateness; -+ bool bNewFrame; -+ int iSkippedDeint = 0; -+ int iBufferLevel; -+ -+ // get decoder stats -+ if (!m_pVideoCodec->GetPts(iDecoderPts, iSkippedDeint, interlaced)) -+ iDecoderPts = pts; -+ if (iDecoderPts == DVD_NOPTS_VALUE) -+ iDecoderPts = pts; -+ -+ // get render stats -+ g_renderManager.GetStats(iSleepTime, iRenderPts, iBufferLevel); -+ -+ if (iBufferLevel < 0) -+ result |= EOS_BUFFER_LEVEL; -+ else if (iBufferLevel < 2) -+ { -+ result |= EOS_BUFFER_LEVEL; -+ CLog::Log(LOGDEBUG,"CDVDPlayerVideo::CalcDropRequirement - hurry: %d", iBufferLevel); -+ } -+ -+ bNewFrame = iDecoderPts != m_droppingStats.m_lastDecoderPts; -+ -+ if (interlaced) -+ iInterval = 2/m_fFrameRate*(double)DVD_TIME_BASE; -+ else -+ iInterval = 1/m_fFrameRate*(double)DVD_TIME_BASE; -+ -+ if (m_droppingStats.m_lastDecoderPts > 0 -+ && bNewFrame -+ && m_bAllowDrop -+ && m_droppingStats.m_dropRequests > 0) -+ { -+ iGain = (iDecoderPts - m_droppingStats.m_lastDecoderPts - iInterval)/(double)DVD_TIME_BASE; -+ if (iSkippedDeint) -+ { -+ CDroppingStats::CGain gain; -+ gain.gain = 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); -+ } -+ else if (iGain > 1/m_fFrameRate) -+ { -+ CDroppingStats::CGain gain; -+ gain.gain = iGain; -+ gain.pts = iDecoderPts; -+ m_droppingStats.m_gain.push_back(gain); -+ m_droppingStats.m_totalGain += iGain; -+ result |= EOS_DROPPED; -+ m_droppingStats.m_dropRequests = 0; -+ CLog::Log(LOGDEBUG,"CDVDPlayerVideo::CalcDropRequirement - dropped in decoder, Sleeptime: %f, Bufferlevel: %d, Gain: %f", iSleepTime, iBufferLevel, iGain); -+ } -+ } -+ m_droppingStats.m_lastDecoderPts = iDecoderPts; -+ -+ // subtract gains -+ while (!m_droppingStats.m_gain.empty() && -+ iRenderPts >= m_droppingStats.m_gain.front().pts) -+ { -+ m_droppingStats.m_totalGain -= m_droppingStats.m_gain.front().gain; -+ m_droppingStats.m_gain.pop_front(); -+ } -+ -+ // calculate lateness -+ iLateness = iSleepTime + m_droppingStats.m_totalGain; -+ if (iLateness < 0 && m_speed) -+ { -+ if (bNewFrame) -+ m_droppingStats.m_lateFrames++; -+ -+ // if lateness is smaller than frametime, we observe this state -+ // for 10 cycles -+ if (m_droppingStats.m_lateFrames > 10 || iLateness < -2/m_fFrameRate) -+ { -+ // is frame allowed to skip -+ if (m_iNrOfPicturesNotToSkip <= 0) -+ { -+ result |= EOS_VERYLATE; -+ if (bNewFrame) -+ m_droppingStats.m_dropRequests++; -+ } -+ } -+ } -+ else -+ { -+ m_droppingStats.m_dropRequests = 0; -+ m_droppingStats.m_lateFrames = 0; -+ } -+ m_droppingStats.m_lastRenderPts = iRenderPts; -+ return result; -+} -+ -+void CDroppingStats::Reset() -+{ -+ m_gain.clear(); -+ m_totalGain = 0; -+ m_lastDecoderPts = 0; -+ m_lastRenderPts = 0; -+ m_lateFrames = 0; -+ m_dropRequests = 0; -+} -+ -+void CDroppingStats::AddOutputDropGain(double pts, double frametime) -+{ -+ CDroppingStats::CGain gain; -+ gain.gain = frametime; -+ gain.pts = pts; -+ m_gain.push_back(gain); -+ m_totalGain += frametime; -+} -diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.h b/xbmc/cores/dvdplayer/DVDPlayerVideo.h -index f8ad541..186e271 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerVideo.h -+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.h -@@ -36,6 +36,25 @@ - #define VIDEO_PICTURE_QUEUE_SIZE 1 - -+class CDroppingStats -+{ -+public: -+ void Reset(); -+ void AddOutputDropGain(double pts, double frametime); -+ struct CGain -+ { -+ double gain; -+ double pts; -+ }; -+ std::deque m_gain; -+ double m_totalGain; -+ double m_lastDecoderPts; -+ double m_lastRenderPts; -+ unsigned int m_lateFrames; -+ unsigned int m_dropRequests; -+}; -+ -+ - class CDVDPlayerVideo : public CThread +-float CActiveAE::CalcStreamAmplification(CActiveAEStream *stream, CSampleBuffer *buf) +-{ +- float amp = 1.0f; +- int nb_floats = buf->pkt->nb_samples * buf->pkt->config.channels / buf->pkt->planes; +- float tamp; +- for(int i=0; ipkt->planes; i++) +- { +- tamp = stream->m_limiter.Run((float*)buf->pkt->data[i], nb_floats); +- amp = std::min(amp, tamp); +- } +- return amp; +-} +- + void CActiveAE::ChangeResampleQuality() { - public: -@@ -104,6 +123,7 @@ class CDVDPlayerVideo : public CThread - #define EOS_ABORT 1 - #define EOS_DROPPED 2 - #define EOS_VERYLATE 4 -+#define EOS_BUFFER_LEVEL 8 + std::list::iterator it; +@@ -1488,12 +1478,10 @@ bool CActiveAE::RunStages() + out = (*it)->m_resampleBuffers->m_outputSamples.front(); + (*it)->m_resampleBuffers->m_outputSamples.pop_front(); - void AutoCrop(DVDVideoPicture* pPicture); - void AutoCrop(DVDVideoPicture *pPicture, RECT &crop); -@@ -129,6 +149,7 @@ class CDVDPlayerVideo : public CThread +- // volume for stream +- float amp = (*it)->m_rgain * CalcStreamAmplification((*it), out); +- + int nb_floats = out->pkt->nb_samples * out->pkt->config.channels / out->pkt->planes; + int nb_loops = 1; + float fadingStep = 0.0f; ++ int stride = 1; - void ResetFrameRateCalc(); - void CalcFrameRate(); -+ int CalcDropRequirement(double pts); - - double m_fFrameRate; //framerate of the video currently playing - bool m_bCalcFrameRate; //if we should calculate the framerate from the timestamps -@@ -182,5 +203,7 @@ class CDVDPlayerVideo : public CThread - CPullupCorrection m_pullupCorrection; - - std::list m_packets; + // fading + if ((*it)->m_fadingSamples == -1) +@@ -1508,6 +1496,7 @@ bool CActiveAE::RunStages() + float delta = (*it)->m_fadingTarget - (*it)->m_fadingBase; + int samples = m_internalFormat.m_sampleRate * (float)(*it)->m_fadingTime / 1000.0f; + fadingStep = delta / samples; ++ stride = out->pkt->planes > 1 ? out->pkt->linesize : 1; + } + for(int i=0; im_streamFading = false; + } + } +- float volume = (*it)->m_volume * amp; + -+ CDroppingStats m_droppingStats; - }; ++ // volume for stream ++ float volume = (*it)->m_volume * (*it)->m_rgain * ++ (*it)->m_limiter.Run((float*)out->pkt->data[0]+i*nb_floats, out->pkt->config.channels, stride); + for(int j=0; jpkt->planes; j++) + { +@@ -1543,12 +1535,10 @@ bool CActiveAE::RunStages() + mix = (*it)->m_resampleBuffers->m_outputSamples.front(); + (*it)->m_resampleBuffers->m_outputSamples.pop_front(); + +- // volume for stream +- float amp = (*it)->m_volume * (*it)->m_rgain * CalcStreamAmplification((*it), mix); +- + int nb_floats = mix->pkt->nb_samples * mix->pkt->config.channels / mix->pkt->planes; + int nb_loops = 1; + float fadingStep = 0.0f; ++ int stride = 1; + + // fading + if ((*it)->m_fadingSamples == -1) +@@ -1563,6 +1553,7 @@ bool CActiveAE::RunStages() + float delta = (*it)->m_fadingTarget - (*it)->m_fadingBase; + int samples = m_internalFormat.m_sampleRate * (float)(*it)->m_fadingTime / 1000.0f; + fadingStep = delta / samples; ++ stride = out->pkt->planes > 1 ? out->pkt->linesize : 1; + } + for(int i=0; im_streamFading = false; + } + } +- float volume = (*it)->m_volume * amp; ++ ++ // volume for stream ++ float volume = (*it)->m_volume * (*it)->m_rgain * ++ (*it)->m_limiter.Run((float*)out->pkt->data[0]+i*nb_floats, out->pkt->config.channels, stride); + + for(int j=0; jpkt->planes && jpkt->planes; j++) + { +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h +index e5a3e9d..9b4c243 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h +@@ -258,7 +258,6 @@ class CActiveAE : public IAE, private CThread + void ClearDiscardedBuffers(); + void SStopSound(CActiveAESound *sound); + void DiscardSound(CActiveAESound *sound); +- float CalcStreamAmplification(CActiveAEStream *stream, CSampleBuffer *buf); + void ChangeResampleQuality(); + + bool RunStages(); -- 1.8.1.6 -From 33ea71cda1fc4767c047865112f2e2a245bcdb50 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sun, 2 Sep 2012 16:05:21 +0200 -Subject: [PATCH 003/110] video player: present correct pts to user for a/v - sync (after buffering in renderer) +From 2f9784b5419e70e3c19271a071ffc17c968922b1 Mon Sep 17 00:00:00 2001 +From: fritsch +Date: Wed, 14 Aug 2013 08:22:03 +0200 +Subject: [PATCH 013/111] AESinkOSS: Implement Drain() --- - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 25 +++++++++++++++++++++++++ - xbmc/cores/dvdplayer/DVDPlayerVideo.h | 2 +- - 2 files changed, 26 insertions(+), 1 deletion(-) + xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) -diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 3284332..4970675 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1457,6 +1457,22 @@ void CDVDPlayerVideo::ResetFrameRateCalc() - g_advancedSettings.m_videoFpsDetect == 0; +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp +index 7986c60..6612dc2 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp +@@ -435,7 +435,10 @@ void CAESinkOSS::Drain() + if (m_fd == -1) + return; + +- // ??? ++ if(ioctl(m_fd, SNDCTL_DSP_SYNC, NULL) == -1) ++ { ++ CLog::Log(LOGERROR, "CAESinkOSS::Drain - Draining the Sink failed"); ++ } } -+double CDVDPlayerVideo::GetCurrentPts() -+{ -+ double iSleepTime, iRenderPts; -+ int iBufferLevel; -+ -+ // get render stats -+ g_renderManager.GetStats(iSleepTime, iRenderPts, iBufferLevel); -+ -+ if( m_stalled ) -+ iRenderPts = DVD_NOPTS_VALUE; -+ else -+ iRenderPts = iRenderPts - max(0.0, iSleepTime); -+ -+ return iRenderPts; -+} -+ - #define MAXFRAMERATEDIFF 0.01 - #define MAXFRAMESERR 1000 - -@@ -1575,6 +1591,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 -+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.h -@@ -100,7 +100,7 @@ class CDVDPlayerVideo : public CThread - - bool InitializedOutputDevice(); - -- double GetCurrentPts() { return m_iCurrentPts; } -+ double GetCurrentPts(); - int GetPullupCorrection() { return m_pullupCorrection.GetPatternLength(); } - - double GetOutputDelay(); /* returns the expected delay, from that a packet is put in queue */ + void CAESinkOSS::EnumerateDevicesEx(AEDeviceInfoList &list, bool force) -- 1.8.1.6 -From 10a7f371c9c49afcbdbc302380c406bdbb126308 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sat, 16 Feb 2013 18:25:53 +0100 -Subject: [PATCH 004/110] videoplayer: some rework and documentation +From 908abe4c4b5a9470168b0f8b71dfe042243349eb Mon Sep 17 00:00:00 2001 +From: unknown +Date: Wed, 14 Aug 2013 09:14:36 +0200 +Subject: [PATCH 014/111] ActiveAE: make sure GetDalay returns no negative + values --- - .../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 29 ++++++++++++++++++++-- - .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 11 ++++++++ - .../DVDCodecs/Video/DVDVideoCodecFFmpeg.h | 2 +- - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 2 +- - 4 files changed, 40 insertions(+), 4 deletions(-) + xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 3 +++ + 1 file changed, 3 insertions(+) -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -index 7f6d536..2ccae41 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -@@ -139,7 +139,6 @@ struct DVDVideoUserData - #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 +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +index db331dc..2a3e49c 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +@@ -83,6 +83,9 @@ float CEngineStats::GetDelay() + float delay = m_sinkDelay - (double)(now-m_sinkUpdate) / 1000; + delay += (float)m_bufferedSamples / m_sinkSampleRate; - class CDVDVideoCodec ++ if (delay < 0) ++ delay = 0.0; ++ + return delay; + } + +-- +1.8.1.6 + + +From f77b9d7d24aba628e9a2a13045ec7d1712c493c3 Mon Sep 17 00:00:00 2001 +From: fritsch +Date: Wed, 14 Aug 2013 09:16:25 +0200 +Subject: [PATCH 015/111] AESinkOSS: Make sink usable in blocking mode + +--- + xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp | 22 +++++++++++++++------- + xbmc/cores/AudioEngine/Sinks/AESinkOSS.h | 1 + + 2 files changed, 16 insertions(+), 7 deletions(-) + +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp +index 6612dc2..60df54d 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp +@@ -66,6 +66,7 @@ + CAESinkOSS::CAESinkOSS() { -@@ -264,10 +263,36 @@ class CDVDVideoCodec - */ - virtual unsigned GetAllowedReferences() { return 0; } + m_fd = 0; ++ m_blockingNeedsUpdate = true; + } -- 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) - { + CAESinkOSS::~CAESinkOSS() +@@ -321,13 +322,6 @@ bool CAESinkOSS::Initialize(AEAudioFormat &format, std::string &device) 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 530dc9d..e5748df 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -@@ -958,6 +958,17 @@ unsigned CDVDVideoCodecFFmpeg::GetAllowedReferences() - return 0; +- if (fcntl(m_fd, F_SETFL, fcntl(m_fd, F_GETFL, 0) | O_NONBLOCK) == -1) +- { +- close(m_fd); +- CLog::Log(LOGERROR, "CAESinkOSS::Initialize - Failed to set non blocking writes"); +- return false; +- } +- + format.m_sampleRate = oss_sr; + format.m_frameSize = (CAEUtil::DataFormatToBits(format.m_dataFormat) >> 3) * format.m_channelLayout.Count(); + format.m_frames = bi.fragsize / format.m_frameSize; +@@ -344,6 +338,8 @@ void CAESinkOSS::Deinitialize() + + if (m_fd != -1) + close(m_fd); ++ ++ m_blockingNeedsUpdate = true; } -+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; -+} + inline CAEChannelInfo CAESinkOSS::GetChannelLayout(AEAudioFormat format) +@@ -417,6 +413,18 @@ unsigned int CAESinkOSS::AddPackets(uint8_t *data, unsigned int frames, bool has + return INT_MAX; + } + ++ if(m_blockingNeedsUpdate) ++ { ++ if(!blocking) ++ { ++ if (fcntl(m_fd, F_SETFL, fcntl(m_fd, F_GETFL, 0) | O_NONBLOCK) == -1) ++ { ++ CLog::Log(LOGERROR, "CAESinkOSS::Initialize - Failed to set non blocking writes"); ++ } ++ } ++ m_blockingNeedsUpdate = false; ++ } + - 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 a511806..0436108 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h -@@ -64,7 +64,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 4970675..2e76ff5 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1568,7 +1568,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; + int wrote = write(m_fd, data, size); + if (wrote < 0) + { +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkOSS.h b/xbmc/cores/AudioEngine/Sinks/AESinkOSS.h +index 1131dc7..2f9a1ee 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkOSS.h ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkOSS.h +@@ -46,6 +46,7 @@ class CAESinkOSS : public IAESink + static void EnumerateDevicesEx(AEDeviceInfoList &list, bool force = false); + private: + int m_fd; ++ bool m_blockingNeedsUpdate; + std::string m_device; + AEAudioFormat m_initFormat; + AEAudioFormat m_format; -- 1.8.1.6 -From 5dd41a12cb592e81866245da375541f97d77b861 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sat, 7 Apr 2012 09:19:00 +0200 -Subject: [PATCH 005/110] vdpau: redesign +From ff9570ce226025fd8c2b40d27893d90c692406a7 Mon Sep 17 00:00:00 2001 +From: fritsch +Date: Wed, 14 Aug 2013 15:19:45 +0200 +Subject: [PATCH 016/111] AESinkOSS: Set required format for passthrough --- - language/English/strings.po | 14 +- + xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp +index 60df54d..d9524f7 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp +@@ -150,7 +150,10 @@ bool CAESinkOSS::Initialize(AEAudioFormat &format, std::string &device) + else if ((format.m_dataFormat == AE_FMT_U8 ) && (format_mask & AFMT_U8 )) + oss_fmt = AFMT_U8; + else if ((AE_IS_RAW(format.m_dataFormat) ) && (format_mask & AFMT_AC3 )) ++ { + oss_fmt = AFMT_AC3; ++ format.m_dataFormat = AE_FMT_S16NE; ++ } + else if (AE_IS_RAW(format.m_dataFormat)) + { + close(m_fd); +-- +1.8.1.6 + + +From 7454c2ef78b76825b99d5c99d7cee9d253b4bdcc Mon Sep 17 00:00:00 2001 +From: fritsch +Date: Wed, 14 Aug 2013 16:46:42 +0200 +Subject: [PATCH 017/111] AESinkOSS: Missed one reuse of format.m_dataFormat in + 4c536e960dfa5610bd62968feff1eebaada17c6d + +--- + xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp +index d9524f7..1f88326 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkOSS.cpp +@@ -262,7 +262,7 @@ bool CAESinkOSS::Initialize(AEAudioFormat &format, std::string &device) + + #if defined(TARGET_FREEBSD) + /* fix hdmi 8 channels order */ +- if (!AE_IS_RAW(format.m_dataFormat) && 8 == oss_ch) ++ if ((oss_fmt != AFMT_AC3) && 8 == oss_ch) + { + unsigned long long order = 0x0000000087346521ULL; + +-- +1.8.1.6 + + +From b762c57174277e73ae0e562b3a679810b1761d79 Mon Sep 17 00:00:00 2001 +From: fritsch +Date: Thu, 15 Aug 2013 16:06:49 +0200 +Subject: [PATCH 018/111] ActiveAE: Fix refcounting with viz + +--- + .../AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 25 +++++++++++++--------- + 1 file changed, 15 insertions(+), 10 deletions(-) + +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +index 2a3e49c..43fc085 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +@@ -1596,6 +1596,7 @@ bool CActiveAE::RunStages() + } + + // process output buffer, gui sounds, encode, viz ++ CSampleBuffer *viz = NULL; + if (out) + { + // mix gui sounds +@@ -1603,21 +1604,17 @@ bool CActiveAE::RunStages() + if (!m_sinkHasVolume) + Deamplify(*(out->pkt)); + +- // encode ++ // encode and backup out buffer for viz ++ viz = out; + if (m_mode == MODE_TRANSCODE && m_encoder) + { + CSampleBuffer *buf = m_encoderBuffers->GetFreeBuffer(); + m_encoder->Encode(out->pkt->data[0], out->pkt->planes*out->pkt->linesize, + buf->pkt->data[0], buf->pkt->planes*buf->pkt->linesize); + buf->pkt->nb_samples = buf->pkt->max_nb_samples; +- out->Return(); + out = buf; + } + +- // update stats +- m_stats.AddSamples(out->pkt->nb_samples, m_streams); +- m_sinkBuffers->m_inputSamples.push_back(out); +- + busy = true; + } + +@@ -1632,13 +1629,13 @@ bool CActiveAE::RunStages() + m_vizInitialized = true; + } + +- // if viz has no free buffer, it won't return current buffer "out" ++ // if viz has no free buffer, it won't return current buffer "viz" + if (!m_vizBuffers->m_freeSamples.empty()) + { +- if (out) ++ if (viz) + { +- out->Acquire(); +- m_vizBuffers->m_inputSamples.push_back(out); ++ viz->Acquire(); ++ m_vizBuffers->m_inputSamples.push_back(viz); + } + } + else +@@ -1669,6 +1666,14 @@ bool CActiveAE::RunStages() + else if (m_vizBuffers) + m_vizBuffers->Flush(); + } ++ // update stats ++ if(out) ++ { ++ m_stats.AddSamples(out->pkt->nb_samples, m_streams); ++ m_sinkBuffers->m_inputSamples.push_back(out); ++ if(viz && (viz != out)) ++ viz->Return(); ++ } + } + // pass through + else +-- +1.8.1.6 + + +From e2242bc9bb34f5b9b1ad6570d448bbb8cbc98162 Mon Sep 17 00:00:00 2001 +From: wsoltys +Date: Thu, 15 Aug 2013 19:41:12 +0200 +Subject: [PATCH 019/111] [WASAPI] fixed: return the right channel layout + +--- + xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp +index a49e86d..e4022e3 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp +@@ -1150,6 +1150,7 @@ bool CAESinkWASAPI::InitializeExclusive(AEAudioFormat &format) + initialize: + + AEChannelsFromSpeakerMask(wfxex.dwChannelMask); ++ format.m_channelLayout = m_channelLayout; + + /* When the stream is raw, the values in the format structure are set to the link */ + /* parameters, so store the encoded stream values here for the IsCompatible function */ +-- +1.8.1.6 + + +From 1f7c7f5848cbd6b63c4bf8b33fae9d09545263ee Mon Sep 17 00:00:00 2001 +From: wsoltys +Date: Thu, 15 Aug 2013 20:00:22 +0200 +Subject: [PATCH 020/111] [WASAPI] fixed: use the more accurate GetDelay() for + Drain(). + +--- + xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp | 7 ++----- + xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.h | 1 - + 2 files changed, 2 insertions(+), 6 deletions(-) + +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp +index e4022e3..dbfc071 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp +@@ -193,8 +193,7 @@ CStdStringA localWideToUtf(LPCWSTR wstr) + m_avgTimeWaiting(50), + m_sinkLatency(0.0), + m_pBuffer(NULL), +- m_bufferPtr(0), +- m_hnsRequestedDuration(0) ++ m_bufferPtr(0) + { + m_channelLayout.Reset(); + } +@@ -1196,8 +1195,6 @@ bool CAESinkWASAPI::InitializeExclusive(AEAudioFormat &format) + hr = m_pAudioClient->Initialize(AUDCLNT_SHAREMODE_EXCLUSIVE, AUDCLNT_STREAMFLAGS_EVENTCALLBACK | AUDCLNT_STREAMFLAGS_NOPERSIST, + audioSinkBufferDurationMsec, audioSinkBufferDurationMsec, &wfxex.Format, NULL); + +- m_hnsRequestedDuration = audioSinkBufferDurationMsec; +- + if (hr == AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED) + { + /* WASAPI requires aligned buffer */ +@@ -1333,7 +1330,7 @@ void CAESinkWASAPI::Drain() + if(!m_pAudioClient) + return; + +- Sleep( (DWORD)(m_hnsRequestedDuration / 10000)); ++ Sleep( (DWORD)(GetDelay()*50) ); + + if (m_running) + { +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.h b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.h +index 8b29f50..144bad3 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.h ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.h +@@ -83,5 +83,4 @@ class CAESinkWASAPI : public IAESink + + uint8_t *m_pBuffer; + int m_bufferPtr; +- REFERENCE_TIME m_hnsRequestedDuration; + }; +-- +1.8.1.6 + + +From ac99b47888fdd232351ff48482eae66aa3473ce9 Mon Sep 17 00:00:00 2001 +From: wsoltys +Date: Fri, 16 Aug 2013 23:35:39 +0200 +Subject: [PATCH 021/111] [WASAPI] fixed: wrong multiplicator (thanks + Voyager1). + +--- + xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp +index dbfc071..2aa7362 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp +@@ -1330,7 +1330,7 @@ void CAESinkWASAPI::Drain() + if(!m_pAudioClient) + return; + +- Sleep( (DWORD)(GetDelay()*50) ); ++ Sleep( (DWORD)(GetDelay()*500) ); + + if (m_running) + { +-- +1.8.1.6 + + +From 729154f830f60aabd3bc85ebacacda444b52b27b Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Sun, 18 Aug 2013 22:32:12 +0200 +Subject: [PATCH 022/111] ActiveAE: check for valid ac3 sampling rates, fixes + no sound for flac 96khz when transcoding + +--- + xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +index 43fc085..78f9eee 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +@@ -893,6 +893,14 @@ void CActiveAE::Configure(AEAudioFormat *desiredFmt) + CLog::Log(LOGINFO, "CActiveAE::Configure - Forcing samplerate to %d", inputFormat.m_sampleRate); + } + ++ // check for valid sampling rates ++ if (inputFormat.m_sampleRate != 48000 || ++ inputFormat.m_sampleRate != 41000 || ++ inputFormat.m_sampleRate != 32000) ++ { ++ outputFormat.m_sampleRate = 48000; ++ } ++ + // setup encoder + if (!m_encoder) + { +-- +1.8.1.6 + + +From e3655dd63f7a324c92acac376a5f8cd8b25426a9 Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Fri, 2 Aug 2013 18:55:56 +0200 +Subject: [PATCH 023/111] linuxrenderer: do not render if upload texture fails + +--- + xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 39 ++++++++++++++++----------- + xbmc/cores/VideoRenderers/LinuxRendererGL.h | 16 +++++------ + 2 files changed, 31 insertions(+), 24 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +index 56b54cf..2f3ed4a 100644 +--- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp ++++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +@@ -515,14 +515,14 @@ void CLinuxRendererGL::LoadPlane( YUVPLANE& plane, int type, unsigned flipindex + plane.flipindex = flipindex; + } + +-void CLinuxRendererGL::UploadYV12Texture(int source) ++bool CLinuxRendererGL::UploadYV12Texture(int source) + { + YUVBUFFER& buf = m_buffers[source]; + YV12Image* im = &buf.image; + YUVFIELDS& fields = buf.fields; + + if (!(im->flags&IMAGE_FLAG_READY)) +- return; ++ return false; + bool deinterlacing; + if (m_currentField == FIELD_FULL) + deinterlacing = false; +@@ -587,6 +587,7 @@ void CLinuxRendererGL::UploadYV12Texture(int source) + CalculateTextureSourceRects(source, 3); + + glDisable(m_textureTarget); ++ return true; + } + + void CLinuxRendererGL::Reset() +@@ -1183,7 +1184,8 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) + m_currentField = FIELD_FULL; + + // call texture load function +- (this->*m_textureUpload)(renderBuffer); ++ if (!(this->*m_textureUpload)(renderBuffer)) ++ return; + + if (m_renderMethod & RENDER_GLSL) + { +@@ -2026,14 +2028,14 @@ bool CLinuxRendererGL::CreateYV12Texture(int index) + //******************************************************************************************************** + // NV12 Texture loading, creation and deletion + //******************************************************************************************************** +-void CLinuxRendererGL::UploadNV12Texture(int source) ++bool CLinuxRendererGL::UploadNV12Texture(int source) + { + YUVBUFFER& buf = m_buffers[source]; + YV12Image* im = &buf.image; + YUVFIELDS& fields = buf.fields; + + if (!(im->flags & IMAGE_FLAG_READY)) +- return; ++ return false; + bool deinterlacing; + if (m_currentField == FIELD_FULL) + deinterlacing = false; +@@ -2086,6 +2088,7 @@ void CLinuxRendererGL::UploadNV12Texture(int source) + CalculateTextureSourceRects(source, 3); + + glDisable(m_textureTarget); ++ return true; + } + + bool CLinuxRendererGL::CreateNV12Texture(int index) +@@ -2338,11 +2341,12 @@ bool CLinuxRendererGL::CreateVDPAUTexture(int index) + return true; + } + +-void CLinuxRendererGL::UploadVDPAUTexture(int index) ++bool CLinuxRendererGL::UploadVDPAUTexture(int index) + { + #ifdef HAVE_LIBVDPAU + glPixelStorei(GL_UNPACK_ALIGNMENT,1); //what's this for? + #endif ++ return true; + } + + +@@ -2406,7 +2410,7 @@ bool CLinuxRendererGL::CreateVAAPITexture(int index) + return true; + } + +-void CLinuxRendererGL::UploadVAAPITexture(int index) ++bool CLinuxRendererGL::UploadVAAPITexture(int index) + { + #ifdef HAVE_LIBVA + YUVPLANE &plane = m_buffers[index].fields[0][0]; +@@ -2414,7 +2418,7 @@ void CLinuxRendererGL::UploadVAAPITexture(int index) + VAStatus status; + + if(!va.surface) +- return; ++ return false; + + if(va.display && va.surface->m_display != va.display) + { +@@ -2426,7 +2430,7 @@ void CLinuxRendererGL::UploadVAAPITexture(int index) + CSingleLock lock(*va.display); + + if(va.display->lost()) +- return; ++ return false; + + if(!va.surfglx) + { +@@ -2439,7 +2443,7 @@ void CLinuxRendererGL::UploadVAAPITexture(int index) + if(status != VA_STATUS_SUCCESS) + { + CLog::Log(LOGERROR, "CLinuxRendererGL::UploadVAAPITexture - failed to create vaapi glx surface (%d)", status); +- return; ++ return false; + } + va.surfglx = VAAPI::CSurfaceGLPtr(new VAAPI::CSurfaceGL(surface, va.display)); + } +@@ -2487,12 +2491,13 @@ void CLinuxRendererGL::UploadVAAPITexture(int index) + CLog::Log(LOGERROR, "CLinuxRendererGL::UploadVAAPITexture - failed to copy surface to glx %d - %s", status, vaErrorStr(status)); + + #endif ++ return true; + } + + //******************************************************************************************************** + // CoreVideoRef Texture creation, deletion, copying + clearing + //******************************************************************************************************** +-void CLinuxRendererGL::UploadCVRefTexture(int index) ++bool CLinuxRendererGL::UploadCVRefTexture(int index) + { + #ifdef TARGET_DARWIN + CVBufferRef cvBufferRef = m_buffers[index].cvBufferRef; +@@ -2554,6 +2559,7 @@ void CLinuxRendererGL::UploadCVRefTexture(int index) + glDisable(m_textureTarget); + + #endif ++ return true; + } + + void CLinuxRendererGL::DeleteCVRefTexture(int index) +@@ -2615,14 +2621,14 @@ bool CLinuxRendererGL::CreateCVRefTexture(int index) + return true; + } + +-void CLinuxRendererGL::UploadYUV422PackedTexture(int source) ++bool CLinuxRendererGL::UploadYUV422PackedTexture(int source) + { + YUVBUFFER& buf = m_buffers[source]; + YV12Image* im = &buf.image; + YUVFIELDS& fields = buf.fields; + + if (!(im->flags & IMAGE_FLAG_READY)) +- return; ++ return false; + + bool deinterlacing; + if (m_currentField == FIELD_FULL) +@@ -2659,7 +2665,7 @@ void CLinuxRendererGL::UploadYUV422PackedTexture(int source) + CalculateTextureSourceRects(source, 3); + + glDisable(m_textureTarget); +- ++ return true; + } + + void CLinuxRendererGL::DeleteYUV422PackedTexture(int index) +@@ -3045,14 +3051,14 @@ void CLinuxRendererGL::SetupRGBBuffer() + m_rgbBuffer = new BYTE[m_rgbBufferSize]; + } + +-void CLinuxRendererGL::UploadRGBTexture(int source) ++bool CLinuxRendererGL::UploadRGBTexture(int source) + { + YUVBUFFER& buf = m_buffers[source]; + YV12Image* im = &buf.image; + YUVFIELDS& fields = buf.fields; + + if (!(im->flags&IMAGE_FLAG_READY)) +- return; ++ return false; + + bool deinterlacing; + if (m_currentField == FIELD_FULL) +@@ -3155,6 +3161,7 @@ void CLinuxRendererGL::UploadRGBTexture(int source) + CalculateTextureSourceRects(source, 3); + + glDisable(m_textureTarget); ++ return true; + } + + void CLinuxRendererGL::SetTextureFilter(GLenum method) +diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.h b/xbmc/cores/VideoRenderers/LinuxRendererGL.h +index b986d93..b5c4dec 100644 +--- a/xbmc/cores/VideoRenderers/LinuxRendererGL.h ++++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.h +@@ -178,35 +178,35 @@ class CLinuxRendererGL : public CBaseRenderer + void UpdateVideoFilter(); + + // textures +- void (CLinuxRendererGL::*m_textureUpload)(int index); ++ bool (CLinuxRendererGL::*m_textureUpload)(int index); + void (CLinuxRendererGL::*m_textureDelete)(int index); + bool (CLinuxRendererGL::*m_textureCreate)(int index); + +- void UploadYV12Texture(int index); ++ bool UploadYV12Texture(int index); + void DeleteYV12Texture(int index); + bool CreateYV12Texture(int index); + +- void UploadNV12Texture(int index); ++ bool UploadNV12Texture(int index); + void DeleteNV12Texture(int index); + bool CreateNV12Texture(int index); + +- void UploadVDPAUTexture(int index); ++ bool UploadVDPAUTexture(int index); + void DeleteVDPAUTexture(int index); + bool CreateVDPAUTexture(int index); + +- void UploadVAAPITexture(int index); ++ bool UploadVAAPITexture(int index); + void DeleteVAAPITexture(int index); + bool CreateVAAPITexture(int index); + +- void UploadCVRefTexture(int index); ++ bool UploadCVRefTexture(int index); + void DeleteCVRefTexture(int index); + bool CreateCVRefTexture(int index); + +- void UploadYUV422PackedTexture(int index); ++ bool UploadYUV422PackedTexture(int index); + void DeleteYUV422PackedTexture(int index); + bool CreateYUV422PackedTexture(int index); + +- void UploadRGBTexture(int index); ++ bool UploadRGBTexture(int index); + void ToRGBFrame(YV12Image* im, unsigned flipIndexPlane, unsigned flipIndexBuf); + void ToRGBFields(YV12Image* im, unsigned flipIndexPlaneTop, unsigned flipIndexPlaneBot, unsigned flipIndexBuf); + void SetupRGBBuffer(); +-- +1.8.1.6 + + +From 50714278e46ea4565c68eadc40c94f7544b63d6f Mon Sep 17 00:00:00 2001 +From: xbmc +Date: Sat, 7 Apr 2012 09:19:00 +0200 +Subject: [PATCH 024/111] vdpau: redesign + +--- + language/English/strings.po | 21 +- system/settings/settings.xml | 10 + system/shaders/yuv2rgb_basic.glsl | 12 + - xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 225 +- - xbmc/cores/VideoRenderers/LinuxRendererGL.h | 13 +- + xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 218 +- + xbmc/cores/VideoRenderers/LinuxRendererGL.h | 12 +- xbmc/cores/VideoRenderers/RenderFormats.h | 1 + xbmc/cores/VideoRenderers/RenderManager.cpp | 3 +- xbmc/cores/VideoRenderers/RenderManager.h | 2 +- @@ -913,20 +1485,20 @@ Subject: [PATCH 005/110] vdpau: redesign .../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 4 +- .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 6 +- .../DVDCodecs/Video/DVDVideoCodecFFmpeg.h | 1 - - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 3843 ++++++++++++++------ - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h | 675 +++- + xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 3917 +++++++++++++++----- + xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h | 681 +++- xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 1 + xbmc/settings/AdvancedSettings.cpp | 8 +- xbmc/settings/AdvancedSettings.h | 4 +- xbmc/video/dialogs/GUIDialogVideoSettings.cpp | 2 +- xbmc/windowing/X11/WinSystemX11.h | 1 + - 19 files changed, 3597 insertions(+), 1230 deletions(-) + 19 files changed, 3670 insertions(+), 1236 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index ec3ee5f..a6b0297 100644 +index 0042682..4a10f5d 100644 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -5775,7 +5775,17 @@ msgctxt "#13436" +@@ -5784,7 +5784,17 @@ msgctxt "#13436" msgid "Allow hardware acceleration (libstagefright)" msgstr "" @@ -945,7 +1517,7 @@ index ec3ee5f..a6b0297 100644 #: system/settings/settings.xml msgctxt "#13500" -@@ -6850,7 +6860,7 @@ msgid "Software Blend" +@@ -6867,7 +6877,7 @@ msgid "Software Blend" msgstr "" msgctxt "#16325" @@ -954,15 +1526,29 @@ index ec3ee5f..a6b0297 100644 msgstr "" #empty strings from id 16326 to 16399 +@@ -14179,7 +14189,12 @@ msgctxt "#36420" + msgid "No info available yet." + msgstr "" + +-#empty strings from id 36421 to 36499 ++#: system/settings/settings.xml ++msgctxt "#36421" ++msgid "Bypassing VDPAU mixer saves resources on low power systems but slightly reduces picture quality" ++msgstr "" ++ ++#empty strings from id 36422 to 36499 + #end reservation + + #: system/settings/settings.xml diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index d1e5eff..56d637d 100644 +index 2bad9bb..04c521d 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -375,6 +375,16 @@ 2 true -+ ++ + HAVE_LIBVDPAU + 2 + true @@ -973,13 +1559,13 @@ index d1e5eff..56d637d 100644 + + - HAVE_LIBVA + HAVE_LIBVA 2 diff --git a/system/shaders/yuv2rgb_basic.glsl b/system/shaders/yuv2rgb_basic.glsl -index c8c8a2e..0799a4b 100644 +index 2ce65a1..92b9be7 100644 --- a/system/shaders/yuv2rgb_basic.glsl +++ b/system/shaders/yuv2rgb_basic.glsl -@@ -70,6 +70,18 @@ void main() +@@ -69,6 +69,18 @@ void main() rgb.a = gl_Color.a; gl_FragColor = rgb; @@ -999,10 +1585,10 @@ index c8c8a2e..0799a4b 100644 #if(XBMC_texture_rectangle) diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index 962680a..388d778 100644 +index 2f3ed4a..42b47e5 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -702,6 +702,18 @@ void CLinuxRendererGL::RenderUpdate(bool clear, DWORD flags, DWORD alpha) +@@ -698,6 +698,18 @@ void CLinuxRendererGL::RenderUpdate(bool clear, DWORD flags, DWORD alpha) glDisable(GL_POLYGON_STIPPLE); } @@ -1021,7 +1607,7 @@ index 962680a..388d778 100644 else Render(flags, index); -@@ -782,11 +794,6 @@ void CLinuxRendererGL::FlipPage(int source) +@@ -778,11 +790,6 @@ void CLinuxRendererGL::FlipPage(int source) m_buffers[m_iYV12RenderBuffer].flipindex = ++m_flipindex; @@ -1033,7 +1619,7 @@ index 962680a..388d778 100644 return; } -@@ -1113,6 +1120,12 @@ void CLinuxRendererGL::LoadShaders(int field) +@@ -1109,6 +1116,12 @@ void CLinuxRendererGL::LoadShaders(int field) m_textureCreate = &CLinuxRendererGL::CreateVDPAUTexture; m_textureDelete = &CLinuxRendererGL::DeleteVDPAUTexture; } @@ -1046,18 +1632,7 @@ index 962680a..388d778 100644 else if (m_format == RENDER_FMT_VAAPI) { m_textureUpload = &CLinuxRendererGL::UploadVAAPITexture; -@@ -1188,7 +1201,10 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) - m_currentField = FIELD_FULL; - - // call texture load function -+ m_skipRender = false; - (this->*m_textureUpload)(renderBuffer); -+ if (m_skipRender) -+ return; - - if (m_renderMethod & RENDER_GLSL) - { -@@ -1563,17 +1579,12 @@ void CLinuxRendererGL::RenderFromFBO() +@@ -1551,17 +1564,12 @@ void CLinuxRendererGL::RenderFromFBO() void CLinuxRendererGL::RenderVDPAU(int index, int field) { #ifdef HAVE_LIBVDPAU @@ -1066,7 +1641,7 @@ index 962680a..388d778 100644 - - if (!vdpau) - return; -+ YUVPLANE &plane = m_buffers[index].fields[0][1]; ++ YUVPLANE &plane = m_buffers[index].fields[FIELD_FULL][0]; glEnable(m_textureTarget); glActiveTextureARB(GL_TEXTURE0); @@ -1077,7 +1652,7 @@ index 962680a..388d778 100644 // make sure we know the correct texture size GetPlaneTextureSize(plane); -@@ -1635,8 +1646,6 @@ void CLinuxRendererGL::RenderVDPAU(int index, int field) +@@ -1623,8 +1631,6 @@ void CLinuxRendererGL::RenderVDPAU(int index, int field) if (m_pVideoFilterShader) m_pVideoFilterShader->Disable(); @@ -1086,23 +1661,40 @@ index 962680a..388d778 100644 glBindTexture (m_textureTarget, 0); glDisable(m_textureTarget); #endif -@@ -2317,12 +2326,14 @@ void CLinuxRendererGL::DeleteVDPAUTexture(int index) +@@ -2305,12 +2311,10 @@ void CLinuxRendererGL::DeleteNV12Texture(int index) + void CLinuxRendererGL::DeleteVDPAUTexture(int index) { #ifdef HAVE_LIBVDPAU - YUVPLANE &plane = m_buffers[index].fields[0][0]; -+ YUVFIELDS &fields = m_buffers[index].fields; +- YUVPLANE &plane = m_buffers[index].fields[0][0]; ++ YUVPLANE &plane = m_buffers[index].fields[FIELD_FULL][0]; SAFE_RELEASE(m_buffers[index].vdpau); - if(plane.id && glIsTexture(plane.id)) - glDeleteTextures(1, &plane.id); +- if(plane.id && glIsTexture(plane.id)) +- glDeleteTextures(1, &plane.id); plane.id = 0; -+ fields[0][1].id = 0; #endif } +@@ -2320,7 +2324,7 @@ bool CLinuxRendererGL::CreateVDPAUTexture(int index) + #ifdef HAVE_LIBVDPAU + YV12Image &im = m_buffers[index].image; + YUVFIELDS &fields = m_buffers[index].fields; +- YUVPLANE &plane = fields[0][0]; ++ YUVPLANE &plane = fields[FIELD_FULL][0]; -@@ -2355,10 +2366,172 @@ bool CLinuxRendererGL::CreateVDPAUTexture(int index) - void CLinuxRendererGL::UploadVDPAUTexture(int index) + DeleteVDPAUTexture(index); + +@@ -2335,7 +2339,7 @@ bool CLinuxRendererGL::CreateVDPAUTexture(int index) + plane.pixpertex_x = 1; + plane.pixpertex_y = 1; + +- glGenTextures(1, &plane.id); ++ plane.id = 1; + + #endif + return true; +@@ -2344,11 +2348,163 @@ bool CLinuxRendererGL::CreateVDPAUTexture(int index) + bool CLinuxRendererGL::UploadVDPAUTexture(int index) { #ifdef HAVE_LIBVDPAU - glPixelStorei(GL_UNPACK_ALIGNMENT,1); //what's this for? @@ -1111,19 +1703,15 @@ index 962680a..388d778 100644 + unsigned int flipindex = m_buffers[index].flipindex; + YV12Image &im = m_buffers[index].image; + YUVFIELDS &fields = m_buffers[index].fields; -+ YUVPLANE &plane = fields[0][1]; ++ YUVPLANE &plane = fields[FIELD_FULL][0]; + + if (!vdpau || !vdpau->valid) + { -+ m_skipRender = true; -+ return; ++ return false; + } + + plane.id = vdpau->texture[0]; + -+ plane.pixpertex_x = 1; -+ plane.pixpertex_y = 1; -+ + plane.rect = m_sourceRect; + plane.width = im.width; + plane.height = im.height; @@ -1145,20 +1733,18 @@ index 962680a..388d778 100644 + plane.rect.x2 /= plane.texwidth; + } + -+#endif -+} -+ + #endif + return true; + } + +void CLinuxRendererGL::DeleteVDPAUTexture420(int index) +{ +#ifdef HAVE_LIBVDPAU -+ YUVPLANE &plane = m_buffers[index].fields[0][0]; + YUVFIELDS &fields = m_buffers[index].fields; + + SAFE_RELEASE(m_buffers[index].vdpau); + -+ if(plane.id && glIsTexture(plane.id)) -+ glDeleteTextures(1, &plane.id); -+ plane.id = 0; ++ fields[0][0].id = 0; + fields[1][0].id = 0; + fields[1][1].id = 0; + fields[2][0].id = 0; @@ -1187,20 +1773,18 @@ index 962680a..388d778 100644 + im.plane[1] = NULL; + im.plane[2] = NULL; + -+ for(int p = 0;p<3;p++) ++ for(int p=0; p<3; p++) + { + pbo[p] = None; + } + -+ glEnable(m_textureTarget); -+ glGenTextures(1, &plane.id); -+ glDisable(m_textureTarget); ++ plane.id = 1; + - #endif ++#endif + return true; - } - -+void CLinuxRendererGL::UploadVDPAUTexture420(int index) ++} ++ ++bool CLinuxRendererGL::UploadVDPAUTexture420(int index) +{ +#ifdef HAVE_LIBVDPAU + VDPAU::CVdpauRenderPicture *vdpau = m_buffers[index].vdpau; @@ -1208,25 +1792,22 @@ index 962680a..388d778 100644 + + unsigned int flipindex = m_buffers[index].flipindex; + YUVFIELDS &fields = m_buffers[index].fields; -+ YUVPLANE &plane = fields[0][0]; + + if (!vdpau || !vdpau->valid) + { -+ m_skipRender = true; -+ return; ++ return false; + } + + im.height = vdpau->texHeight; + im.width = vdpau->texWidth; + + // YUV -+ for (int f = FIELD_FULL; f<=FIELD_BOT ; f++) ++ for (int f = FIELD_TOP; f<=FIELD_BOT ; f++) + { -+ int fieldshift = (f==FIELD_FULL) ? 0 : 1; + YUVPLANES &planes = fields[f]; + + planes[0].texwidth = im.width; -+ planes[0].texheight = im.height >> fieldshift; ++ planes[0].texheight = im.height >> 1; + + planes[1].texwidth = planes[0].texwidth >> im.cshift_x; + planes[1].texheight = planes[0].texheight >> im.cshift_y; @@ -1248,13 +1829,15 @@ index 962680a..388d778 100644 + // set textures + fields[1][0].id = vdpau->texture[0]; + fields[1][1].id = vdpau->texture[2]; ++ fields[1][2].id = vdpau->texture[2]; + fields[2][0].id = vdpau->texture[1]; + fields[2][1].id = vdpau->texture[3]; ++ fields[2][2].id = vdpau->texture[3]; + + glEnable(m_textureTarget); -+ for (int f = 1; f < 3; f++) ++ for (int f = FIELD_TOP; f <= FIELD_BOT; f++) + { -+ for (int p=0;p<2;p++) ++ for (int p=0; p<2; p++) + { + glBindTexture(m_textureTarget,fields[f][p].id); + glTexParameteri(m_textureTarget, GL_TEXTURE_MIN_FILTER, GL_LINEAR); @@ -1265,17 +1848,17 @@ index 962680a..388d778 100644 + glBindTexture(m_textureTarget,0); + VerifyGLState(); + } -+ fields[f][2].id = fields[f][1].id; + } + CalculateTextureSourceRects(index, 3); + glDisable(m_textureTarget); + +#endif ++ return true; +} void CLinuxRendererGL::DeleteVAAPITexture(int index) { -@@ -3281,12 +3454,13 @@ bool CLinuxRendererGL::Supports(EINTERLACEMETHOD method) +@@ -3274,12 +3430,13 @@ bool CLinuxRendererGL::Supports(EINTERLACEMETHOD method) if(method == VS_INTERLACEMETHOD_AUTO) return true; @@ -1293,7 +1876,7 @@ index 962680a..388d778 100644 #endif return false; } -@@ -3379,14 +3553,7 @@ EINTERLACEMETHOD CLinuxRendererGL::AutoInterlaceMethod() +@@ -3372,14 +3529,7 @@ EINTERLACEMETHOD CLinuxRendererGL::AutoInterlaceMethod() return VS_INTERLACEMETHOD_NONE; if(m_renderMethod & RENDER_VDPAU) @@ -1308,7 +1891,7 @@ index 962680a..388d778 100644 if(Supports(VS_INTERLACEMETHOD_RENDER_BOB)) return VS_INTERLACEMETHOD_RENDER_BOB; -@@ -3431,6 +3598,7 @@ void CLinuxRendererGL::UnBindPbo(YUVBUFFER& buff) +@@ -3424,6 +3574,7 @@ void CLinuxRendererGL::UnBindPbo(YUVBUFFER& buff) unsigned int CLinuxRendererGL::GetProcessorSize() { if(m_format == RENDER_FMT_VDPAU @@ -1316,7 +1899,7 @@ index 962680a..388d778 100644 || m_format == RENDER_FMT_VAAPI || m_format == RENDER_FMT_CVBREF) return 1; -@@ -3459,11 +3627,12 @@ bool CLinuxRendererGL::IsProcessed(int idx) +@@ -3432,11 +3583,12 @@ unsigned int CLinuxRendererGL::GetProcessorSize() } #ifdef HAVE_LIBVDPAU @@ -1332,7 +1915,7 @@ index 962680a..388d778 100644 #endif diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.h b/xbmc/cores/VideoRenderers/LinuxRendererGL.h -index a90a532..fdda2ed 100644 +index b5c4dec..8daf72c 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.h +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.h @@ -39,12 +39,11 @@ @@ -1349,8 +1932,8 @@ index a90a532..fdda2ed 100644 #undef ALIGN #define ALIGN(value, alignment) (((value)+((alignment)-1))&~((alignment)-1)) -@@ -144,7 +143,7 @@ class CLinuxRendererGL : public CBaseRenderer - virtual bool IsProcessed(int idx); +@@ -143,7 +142,7 @@ class CLinuxRendererGL : public CBaseRenderer + virtual unsigned int GetProcessorSize(); #ifdef HAVE_LIBVDPAU - virtual void AddProcessor(CVDPAU* vdpau, int index); @@ -1358,18 +1941,18 @@ index a90a532..fdda2ed 100644 #endif #ifdef HAVE_LIBVA virtual void AddProcessor(VAAPI::CHolder& holder, int index); -@@ -195,6 +194,10 @@ class CLinuxRendererGL : public CBaseRenderer +@@ -194,6 +193,10 @@ class CLinuxRendererGL : public CBaseRenderer void DeleteVDPAUTexture(int index); bool CreateVDPAUTexture(int index); -+ void UploadVDPAUTexture420(int index); ++ bool UploadVDPAUTexture420(int index); + void DeleteVDPAUTexture420(int index); + bool CreateVDPAUTexture420(int index); + - void UploadVAAPITexture(int index); + bool UploadVAAPITexture(int index); void DeleteVAAPITexture(int index); bool CreateVAAPITexture(int index); -@@ -221,6 +224,7 @@ class CLinuxRendererGL : public CBaseRenderer +@@ -220,6 +223,7 @@ class CLinuxRendererGL : public CBaseRenderer void RenderSinglePass(int renderBuffer, int field); // single pass glsl renderer void RenderSoftware(int renderBuffer, int field); // single pass s/w yuv2rgb renderer void RenderVDPAU(int renderBuffer, int field); // render using vdpau hardware @@ -1377,8 +1960,8 @@ index a90a532..fdda2ed 100644 void RenderVAAPI(int renderBuffer, int field); // render using vdpau hardware struct -@@ -282,7 +286,7 @@ class CLinuxRendererGL : public CBaseRenderer - GLsync fence; +@@ -280,7 +284,7 @@ class CLinuxRendererGL : public CBaseRenderer + GLuint pbo[MAX_PLANES]; #ifdef HAVE_LIBVDPAU - CVDPAU* vdpau; @@ -1386,14 +1969,6 @@ index a90a532..fdda2ed 100644 #endif #ifdef HAVE_LIBVA VAAPI::CHolder& vaapi; -@@ -327,6 +331,7 @@ class CLinuxRendererGL : public CBaseRenderer - bool m_nonLinStretch; - bool m_nonLinStretchGui; - float m_pixelRatio; -+ bool m_skipRender; - }; - - diff --git a/xbmc/cores/VideoRenderers/RenderFormats.h b/xbmc/cores/VideoRenderers/RenderFormats.h index 29d45e0..3b09194 100644 --- a/xbmc/cores/VideoRenderers/RenderFormats.h @@ -1407,10 +1982,10 @@ index 29d45e0..3b09194 100644 RENDER_FMT_UYVY422, RENDER_FMT_YUYV422, diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index deac94b..a1c2fc7 100644 +index 0d32715..fbc2aae 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -925,7 +925,8 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) +@@ -917,7 +917,8 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) CDVDCodecUtils::CopyDXVA2Picture(&image, &pic); } #ifdef HAVE_LIBVDPAU @@ -1421,7 +1996,7 @@ index deac94b..a1c2fc7 100644 #endif #ifdef HAVE_LIBOPENMAX diff --git a/xbmc/cores/VideoRenderers/RenderManager.h b/xbmc/cores/VideoRenderers/RenderManager.h -index 52380c1..befd851 100644 +index 00fe4c3..28596cf 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.h +++ b/xbmc/cores/VideoRenderers/RenderManager.h @@ -35,7 +35,7 @@ @@ -1447,7 +2022,7 @@ index ad1940c..48302ff 100644 CLog::Log(LOGERROR, "GL: BaseYUV2RGBGLSLShader - unsupported format %d", m_format); diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -index 2ccae41..0dd29c3 100644 +index a16ac4b..87edaa5 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h @@ -34,7 +34,7 @@ @@ -1469,7 +2044,7 @@ index 2ccae41..0dd29c3 100644 struct { VAAPI::CHolder* vaapi; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index e5748df..aa2d1e4 100644 +index b09ac29..143675a 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -75,11 +75,11 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx @@ -1488,7 +2063,7 @@ index e5748df..aa2d1e4 100644 ctx->SetHardware(vdp); return *cur; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h -index 0436108..c0ce198 100644 +index c509339..2287031 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h @@ -29,7 +29,6 @@ @@ -1500,7 +2075,7 @@ index 0436108..c0ce198 100644 class CDVDVideoCodecFFmpeg : public CDVDVideoCodec diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 5ca0803..4844469 100644 +index f830f61..1e4b0b7 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp @@ -33,11 +33,16 @@ @@ -1521,31 +2096,23 @@ index 5ca0803..4844469 100644 {"MPEG1", VDP_DECODER_PROFILE_MPEG1}, {"MPEG2_SIMPLE", VDP_DECODER_PROFILE_MPEG2_SIMPLE}, {"MPEG2_MAIN", VDP_DECODER_PROFILE_MPEG2_MAIN}, -@@ -51,14 +56,16 @@ +@@ -51,14 +56,7 @@ {"MPEG4_PART2_ASP", VDP_DECODER_PROFILE_MPEG4_PART2_ASP}, #endif }; -const size_t decoder_profile_count = sizeof(decoder_profiles)/sizeof(CVDPAU::Desc); -+const size_t decoder_profile_count = sizeof(decoder_profiles)/sizeof(CDecoder::Desc); - +- -static float studioCSC[3][4] = -{ - { 1.0f, 0.0f, 1.57480000f,-0.78740000f}, - { 1.0f,-0.18737736f,-0.46813736f, 0.32775736f}, - { 1.0f, 1.85556000f, 0.0f,-0.92780000f} -}; -+//static float studioCSC[3][4] = -+//{ -+// { 1.0f, 0.0f, 1.57480000f,-0.78740000f}, -+// { 1.0f,-0.18737736f,-0.46813736f, 0.32775736f}, -+// { 1.0f, 1.85556000f, 0.0f,-0.92780000f} -+//}; -+static float studioCSCKCoeffs601[3] = {0.299, 0.587, 0.114}; //BT601 {Kr, Kg, Kb} -+static float studioCSCKCoeffs709[3] = {0.2126, 0.7152, 0.0722}; //BT709 {Kr, Kg, Kb} ++const size_t decoder_profile_count = sizeof(decoder_profiles)/sizeof(CDecoder::Desc); static struct SInterlaceMapping { -@@ -69,114 +76,30 @@ +@@ -69,114 +67,34 @@ , {VS_INTERLACEMETHOD_VDPAU_TEMPORAL_HALF , VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL} , {VS_INTERLACEMETHOD_VDPAU_TEMPORAL_SPATIAL , VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL_SPATIAL} , {VS_INTERLACEMETHOD_VDPAU_TEMPORAL_SPATIAL_HALF, VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL_SPATIAL} @@ -1554,19 +2121,17 @@ index 5ca0803..4844469 100644 , {VS_INTERLACEMETHOD_NONE , (VdpVideoMixerFeature)-1} }; ++static float studioCSCKCoeffs601[3] = {0.299, 0.587, 0.114}; //BT601 {Kr, Kg, Kb} ++static float studioCSCKCoeffs709[3] = {0.2126, 0.7152, 0.0722}; //BT709 {Kr, Kg, Kb} ++ //since libvdpau 0.4, vdp_device_create_x11() installs a callback on the Display*, //if we unload libvdpau with dlclose(), we segfault on XCloseDisplay, //so we just keep a static handle to libvdpau around -void* CVDPAU::dl_handle; +void* CDecoder::dl_handle; -+ -+//----------------------------------------------------------------------------- -+// CVDPAU -+//----------------------------------------------------------------------------- -CVDPAU::CVDPAU() -+CDecoder::CDecoder() : m_vdpauOutput(&m_inMsgEvent) - { +-{ - glXBindTexImageEXT = NULL; - glXReleaseTexImageEXT = NULL; - vdp_device = VDP_INVALID_HANDLE; @@ -1576,9 +2141,9 @@ index 5ca0803..4844469 100644 - m_DisplayState = VDPAU_OPEN; - m_mixerfield = VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME; - m_mixerstep = 0; -+ m_vdpauConfig.vdpDevice = VDP_INVALID_HANDLE; -+ m_vdpauConfig.videoSurfaces = &m_videoSurfaces; -+ m_vdpauConfig.videoSurfaceSec = &m_videoSurfaceSec; ++//----------------------------------------------------------------------------- ++// CVDPAU ++//----------------------------------------------------------------------------- - m_glPixmap = 0; - m_Pixmap = 0; @@ -1586,9 +2151,11 @@ index 5ca0803..4844469 100644 - glXBindTexImageEXT = (PFNGLXBINDTEXIMAGEEXTPROC)glXGetProcAddress((GLubyte *) "glXBindTexImageEXT"); - if (!glXReleaseTexImageEXT) - glXReleaseTexImageEXT = (PFNGLXRELEASETEXIMAGEEXTPROC)glXGetProcAddress((GLubyte *) "glXReleaseTexImageEXT"); -+ m_vdpauConfigured = false; -+ m_DisplayState = VDPAU_OPEN; -+} ++CDecoder::CDecoder() : m_vdpauOutput(&m_inMsgEvent) ++{ ++ m_vdpauConfig.vdpDevice = VDP_INVALID_HANDLE; ++ m_vdpauConfig.videoSurfaces = &m_videoSurfaces; ++ m_vdpauConfig.videoSurfaceSec = &m_videoSurfaceSec; - totalAvailableOutputSurfaces = 0; - outputSurface = presentSurface = VDP_INVALID_HANDLE; @@ -1666,15 +2233,17 @@ index 5ca0803..4844469 100644 - vdp_video_mixer_query_feature_support = NULL; - vdp_video_mixer_destroy = NULL; - vdp_video_mixer_render = NULL; -- m_hwContext.bitstream_buffers_allocated = 0; --} -- ++ m_vdpauConfigured = false; + m_hwContext.bitstream_buffers_allocated = 0; ++ m_DisplayState = VDPAU_OPEN; + } + -bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int surfaces) +bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int surfaces) { if(avctx->coded_width == 0 || avctx->coded_height == 0) -@@ -184,6 +107,8 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su +@@ -184,6 +102,8 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su CLog::Log(LOGWARNING,"(VDPAU) no width/height available, can't init"); return false; } @@ -1683,7 +2252,7 @@ index 5ca0803..4844469 100644 if ((avctx->codec_id == AV_CODEC_ID_MPEG4) && !g_advancedSettings.m_videoAllowMpeg4VDPAU) return false; -@@ -198,8 +123,6 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su +@@ -198,8 +118,6 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su error = "dlerror() returned NULL"; CLog::Log(LOGNOTICE,"(VDPAU) Unable to get handle to libvdpau: %s", error); @@ -1692,7 +2261,7 @@ index 5ca0803..4844469 100644 return false; } } -@@ -208,8 +131,9 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su +@@ -208,8 +126,9 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su return false; InitVDPAUProcs(); @@ -1703,7 +2272,7 @@ index 5ca0803..4844469 100644 { SpewHardwareAvailable(); -@@ -227,28 +151,26 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su +@@ -227,28 +146,26 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su /* attempt to create a decoder with this width/height, some sizes are not supported by hw */ VdpStatus vdp_st; @@ -1739,7 +2308,7 @@ index 5ca0803..4844469 100644 avctx->slice_flags=SLICE_FLAG_CODED_ORDER|SLICE_FLAG_ALLOW_FIELD; avctx->hwaccel_context = &m_hwContext; avctx->thread_count = 1; -@@ -259,17 +181,20 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su +@@ -259,17 +176,22 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su return false; } @@ -1754,6 +2323,8 @@ index 5ca0803..4844469 100644 { CLog::Log(LOGNOTICE, " (VDPAU) %s", __FUNCTION__); ++ g_Windowing.Unregister(this); ++ + CSingleLock lock(m_DecoderSection); + FiniVDPAUOutput(); @@ -1762,16 +2333,11 @@ index 5ca0803..4844469 100644 while (!m_videoSurfaces.empty()) { -@@ -287,191 +212,120 @@ void CVDPAU::Close() +@@ -286,192 +208,114 @@ void CVDPAU::Close() + m_dllAvUtil.av_freep(&m_hwContext.bitstream_buffers); } - g_Windowing.Unregister(this); -+ -+ if (m_hwContext.bitstream_buffers_allocated) -+ { -+ m_dllAvUtil.av_freep(&m_hwContext.bitstream_buffers); -+ } -+ +- g_Windowing.Unregister(this); m_dllAvUtil.Unload(); } @@ -1854,7 +2420,7 @@ index 5ca0803..4844469 100644 + } } - XFree(fbConfigs); -+ IHardwareDecoder::Release(); ++ return IHardwareDecoder::Release(); +} - return true; @@ -2017,7 +2583,7 @@ index 5ca0803..4844469 100644 state = m_DisplayState; } -@@ -485,16 +339,13 @@ int CVDPAU::Check(AVCodecContext* avctx) +@@ -485,16 +329,13 @@ int CVDPAU::Check(AVCodecContext* avctx) } else { @@ -2036,7 +2602,7 @@ index 5ca0803..4844469 100644 FiniVDPAUOutput(); FiniVDPAUProcs(); -@@ -509,7 +360,7 @@ int CVDPAU::Check(AVCodecContext* avctx) +@@ -509,7 +350,7 @@ int CVDPAU::Check(AVCodecContext* avctx) return 0; } @@ -2045,7 +2611,7 @@ index 5ca0803..4844469 100644 { if (format == AV_PIX_FMT_VDPAU) return true; -@@ -517,90 +368,28 @@ bool CVDPAU::IsVDPAUFormat(PixelFormat format) +@@ -517,90 +358,28 @@ bool CVDPAU::IsVDPAUFormat(PixelFormat format) return false; } @@ -2147,7 +2713,7 @@ index 5ca0803..4844469 100644 for(SInterlaceMapping* p = g_interlace_mapping; p->method != VS_INTERLACEMETHOD_NONE; p++) { if(p->method == method) -@@ -609,162 +398,12 @@ bool CVDPAU::Supports(EINTERLACEMETHOD method) +@@ -609,162 +388,12 @@ bool CVDPAU::Supports(EINTERLACEMETHOD method) return false; } @@ -2313,7 +2879,7 @@ index 5ca0803..4844469 100644 { char* error; -@@ -774,151 +413,115 @@ void CVDPAU::InitVDPAUProcs() +@@ -774,151 +403,115 @@ void CVDPAU::InitVDPAUProcs() if (error) { CLog::Log(LOGERROR,"(VDPAU) - %s in %s",error,__FUNCTION__); @@ -2510,11 +3076,11 @@ index 5ca0803..4844469 100644 return; - decoder = VDP_INVALID_HANDLE; + m_vdpauConfig.vdpDecoder = VDP_INVALID_HANDLE; -+ -+ CSingleLock lock(m_videoSurfaceSec); -+ CLog::Log(LOGDEBUG, "CVDPAU::FiniVDPAUOutput destroying %d video surfaces", (int)m_videoSurfaces.size()); - for (unsigned int i = 0; i < m_videoSurfaces.size(); ++i) ++ CSingleLock lock(m_videoSurfaceSec); ++ CLog::Log(LOGDEBUG, "CVDPAU::FiniVDPAUOutput destroying %d video surfaces", (int)m_videoSurfaces.size()); ++ + for(unsigned int i = 0; i < m_videoSurfaces.size(); ++i) { vdpau_render_state *render = m_videoSurfaces[i]; @@ -2525,7 +3091,7 @@ index 5ca0803..4844469 100644 render->surface = VDP_INVALID_HANDLE; } if (CheckStatus(vdp_st, __LINE__)) -@@ -926,10 +529,9 @@ void CVDPAU::FiniVDPAUOutput() +@@ -926,10 +519,9 @@ void CVDPAU::FiniVDPAUOutput() } } @@ -2539,7 +3105,7 @@ index 5ca0803..4844469 100644 { switch (codec) { -@@ -941,7 +543,7 @@ void CVDPAU::ReadFormatOf( AVCodecID codec +@@ -941,7 +533,7 @@ void CVDPAU::ReadFormatOf( AVCodecID codec vdp_decoder_profile = VDP_DECODER_PROFILE_MPEG2_MAIN; vdp_chroma_type = VDP_CHROMA_TYPE_420; break; @@ -2548,7 +3114,7 @@ index 5ca0803..4844469 100644 vdp_decoder_profile = VDP_DECODER_PROFILE_H264_HIGH; vdp_chroma_type = VDP_CHROMA_TYPE_420; break; -@@ -953,12 +555,10 @@ void CVDPAU::ReadFormatOf( AVCodecID codec +@@ -953,12 +545,10 @@ void CVDPAU::ReadFormatOf( AVCodecID codec vdp_decoder_profile = VDP_DECODER_PROFILE_VC1_ADVANCED; vdp_chroma_type = VDP_CHROMA_TYPE_420; break; @@ -2561,7 +3127,7 @@ index 5ca0803..4844469 100644 default: vdp_decoder_profile = 0; vdp_chroma_type = 0; -@@ -966,170 +566,78 @@ void CVDPAU::ReadFormatOf( AVCodecID codec +@@ -966,170 +556,78 @@ void CVDPAU::ReadFormatOf( AVCodecID codec } } @@ -2780,7 +3346,7 @@ index 5ca0803..4844469 100644 { VdpStatus rv; CLog::Log(LOGNOTICE,"VDPAU Decoder capabilities:"); -@@ -1139,7 +647,7 @@ void CVDPAU::SpewHardwareAvailable() //Copyright (c) 2008 Wladimir J. van der L +@@ -1139,7 +637,7 @@ void CVDPAU::SpewHardwareAvailable() //Copyright (c) 2008 Wladimir J. van der L { VdpBool is_supported = false; uint32_t max_level, max_macroblocks, max_width, max_height; @@ -2789,7 +3355,7 @@ index 5ca0803..4844469 100644 &is_supported, &max_level, &max_macroblocks, &max_width, &max_height); if(rv == VDP_STATUS_OK && is_supported) { -@@ -1148,13 +656,13 @@ void CVDPAU::SpewHardwareAvailable() //Copyright (c) 2008 Wladimir J. van der L +@@ -1148,13 +646,13 @@ void CVDPAU::SpewHardwareAvailable() //Copyright (c) 2008 Wladimir J. van der L } } CLog::Log(LOGNOTICE,"------------------------------------"); @@ -2806,7 +3372,7 @@ index 5ca0803..4844469 100644 } \ } while(false) -@@ -1178,7 +686,7 @@ void CVDPAU::SpewHardwareAvailable() //Copyright (c) 2008 Wladimir J. van der L +@@ -1178,7 +676,7 @@ void CVDPAU::SpewHardwareAvailable() //Copyright (c) 2008 Wladimir J. van der L } @@ -2815,7 +3381,7 @@ index 5ca0803..4844469 100644 { // find render state in queue bool found(false); -@@ -1205,34 +713,33 @@ bool CVDPAU::IsSurfaceValid(vdpau_render_state *render) +@@ -1205,34 +703,33 @@ bool CVDPAU::IsSurfaceValid(vdpau_render_state *render) return true; } @@ -2865,7 +3431,7 @@ index 5ca0803..4844469 100644 } } -@@ -1241,21 +748,22 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) +@@ -1241,21 +738,22 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) { // create a new surface VdpDecoderProfile profile; @@ -2891,7 +3457,7 @@ index 5ca0803..4844469 100644 avctx->coded_width, avctx->coded_height, &render->surface); -@@ -1277,18 +785,6 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) +@@ -1274,18 +772,6 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) pic->linesize[0] = pic->linesize[1] = pic->linesize[2] = 0; @@ -2910,7 +3476,7 @@ index 5ca0803..4844469 100644 pic->type= FF_BUFFER_TYPE_USER; render->state |= FF_VDPAU_STATE_USED_FOR_REFERENCE; -@@ -1296,15 +792,16 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) +@@ -1293,15 +779,16 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) return 0; } @@ -2930,7 +3496,7 @@ index 5ca0803..4844469 100644 render=(vdpau_render_state*)pic->data[0]; if(!render) -@@ -1313,6 +810,8 @@ void CVDPAU::FFReleaseBuffer(AVCodecContext *avctx, AVFrame *pic) +@@ -1310,6 +797,8 @@ void CVDPAU::FFReleaseBuffer(AVCodecContext *avctx, AVFrame *pic) return; } @@ -2939,7 +3505,7 @@ index 5ca0803..4844469 100644 for(i=0; i<4; i++) pic->data[i]= NULL; -@@ -1326,29 +825,26 @@ void CVDPAU::FFReleaseBuffer(AVCodecContext *avctx, AVFrame *pic) +@@ -1323,29 +812,26 @@ void CVDPAU::FFReleaseBuffer(AVCodecContext *avctx, AVFrame *pic) render->state &= ~FF_VDPAU_STATE_USED_FOR_REFERENCE; } @@ -2978,7 +3544,7 @@ index 5ca0803..4844469 100644 if(src->linesize[0] || src->linesize[1] || src->linesize[2] || offset[0] || offset[1] || offset[2]) -@@ -1378,67 +874,50 @@ void CVDPAU::FFDrawSlice(struct AVCodecContext *s, +@@ -1375,67 +861,50 @@ void CVDPAU::FFDrawSlice(struct AVCodecContext *s, if(s->codec_id == AV_CODEC_ID_H264) max_refs = vdp->m_hwContext.info.h264.num_ref_frames; @@ -2994,7 +3560,7 @@ index 5ca0803..4844469 100644 } - vdp_st = vdp->vdp_decoder_render(vdp->decoder, -+ uint64_t startTime = CurrentHostCounter(); ++// uint64_t startTime = CurrentHostCounter(); + uint16_t decoded, processed, rend; + vdp->m_bufferStats.Get(decoded, processed, rend); + vdp_st = vdp->m_vdpauConfig.vdpProcs.vdp_decoder_render(vdp->m_vdpauConfig.vdpDecoder, @@ -3003,9 +3569,9 @@ index 5ca0803..4844469 100644 vdp->m_hwContext.bitstream_buffers_used, vdp->m_hwContext.bitstream_buffers); vdp->CheckStatus(vdp_st, __LINE__); -+ uint64_t diff = CurrentHostCounter() - startTime; -+ if (diff*1000/CurrentHostFrequency() > 30) -+ CLog::Log(LOGWARNING,"CVDPAU::DrawSlice - VdpDecoderRender long decoding: %d ms, dec: %d, proc: %d, rend: %d", (int)((diff*1000)/CurrentHostFrequency()), decoded, processed, rend); ++// uint64_t diff = CurrentHostCounter() - startTime; ++// if (diff*1000/CurrentHostFrequency() > 30) ++// CLog::Log(LOGWARNING,"CVDPAU::DrawSlice - VdpDecoderRender long decoding: %d ms, dec: %d, proc: %d, rend: %d", (int)((diff*1000)/CurrentHostFrequency()), decoded, processed, rend); + } @@ -3065,7 +3631,7 @@ index 5ca0803..4844469 100644 // ffmpeg vc-1 decoder does not flush, make sure the data buffer is still valid if (!IsSurfaceValid(render)) -@@ -1447,258 +926,166 @@ int CVDPAU::Decode(AVCodecContext *avctx, AVFrame *pFrame) +@@ -1444,258 +913,166 @@ int CVDPAU::Decode(AVCodecContext *avctx, AVFrame *pFrame) return VC_BUFFER; } @@ -3434,7 +4000,7 @@ index 5ca0803..4844469 100644 if(m_DisplayState == VDPAU_OPEN) { -@@ -1716,4 +1103,2424 @@ bool CVDPAU::CheckStatus(VdpStatus vdp_st, int line) +@@ -1713,4 +1090,2508 @@ bool CVDPAU::CheckStatus(VdpStatus vdp_st, int line) return false; } @@ -3444,7 +4010,7 @@ index 5ca0803..4844469 100644 + +CVdpauRenderPicture* CVdpauRenderPicture::Acquire() +{ -+ CSingleLock lock(*renderPicSection); ++ CSingleLock lock(renderPicSection); + + if (refCount == 0) + vdpau->Acquire(); @@ -3455,7 +4021,7 @@ index 5ca0803..4844469 100644 + +long CVdpauRenderPicture::Release() +{ -+ CSingleLock lock(*renderPicSection); ++ CSingleLock lock(renderPicSection); + + refCount--; + if (refCount > 0) @@ -3470,7 +4036,7 @@ index 5ca0803..4844469 100644 + +void CVdpauRenderPicture::ReturnUnused() +{ -+ { CSingleLock lock(*renderPicSection); ++ { CSingleLock lock(renderPicSection); + if (refCount > 0) + return; + } @@ -3508,6 +4074,11 @@ index 5ca0803..4844469 100644 + m_dataPort.Purge(); +} + ++bool CMixer::IsActive() ++{ ++ return IsRunning(); ++} ++ +void CMixer::OnStartup() +{ + CLog::Log(LOGNOTICE, "CMixer::OnStartup: Output Thread created"); @@ -3764,8 +4335,8 @@ index 5ca0803..4844469 100644 + +void CMixer::Process() +{ -+ Message *msg; -+ Protocol *port; ++ Message *msg = NULL; ++ Protocol *port = NULL; + bool gotMsg; + + m_state = M_TOP_UNCONFIGURED; @@ -3870,7 +4441,6 @@ index 5ca0803..4844469 100644 + +void CMixer::InitCSCMatrix(int Width) +{ -+ VdpStatus vdp_st; + m_Procamp.struct_version = VDP_PROCAMP_VERSION; + m_Procamp.brightness = 0.0; + m_Procamp.contrast = 1.0; @@ -3968,7 +4538,6 @@ index 5ca0803..4844469 100644 + DisableHQScaling(); +} + -+ +bool CMixer::GenerateStudioCSCMatrix(VdpColorStandard colorStandard, VdpCSCMatrix &studioCSCMatrix) +{ + // instead use studioCSCKCoeffs601[3], studioCSCKCoeffs709[3] to generate float[3][4] matrix (float studioCSC[3][4]) @@ -4068,6 +4637,7 @@ index 5ca0803..4844469 100644 + void const * pm_CSCMatix[] = { &m_CSCMatrix }; + vdp_st = m_config.vdpProcs.vdp_video_mixer_set_attribute_values(m_videoMixer, ARSIZE(attributes), attributes, pm_CSCMatix); + } ++ + CheckStatus(vdp_st, __LINE__); +} + @@ -4711,6 +5281,31 @@ index 5ca0803..4844469 100644 +} + +//----------------------------------------------------------------------------- ++// Buffer Pool ++//----------------------------------------------------------------------------- ++ ++VdpauBufferPool::VdpauBufferPool() ++{ ++ CVdpauRenderPicture *pic; ++ for (unsigned int i = 0; i < NUM_RENDER_PICS; i++) ++ { ++ pic = new CVdpauRenderPicture(renderPicSec); ++ allRenderPics.push_back(pic); ++ } ++} ++ ++VdpauBufferPool::~VdpauBufferPool() ++{ ++ CVdpauRenderPicture *pic; ++ for (unsigned int i = 0; i < NUM_RENDER_PICS; i++) ++ { ++ pic = allRenderPics[i]; ++ delete pic; ++ } ++ allRenderPics.clear(); ++} ++ ++//----------------------------------------------------------------------------- +// Output +//----------------------------------------------------------------------------- +COutput::COutput(CEvent *inMsgEvent) : @@ -4721,16 +5316,9 @@ index 5ca0803..4844469 100644 +{ + m_inMsgEvent = inMsgEvent; + -+ CVdpauRenderPicture pic; -+ pic.renderPicSection = &m_bufferPool.renderPicSec; -+ pic.refCount = 0; -+ for (unsigned int i = 0; i < NUM_RENDER_PICS; i++) -+ { -+ m_bufferPool.allRenderPics.push_back(pic); -+ } + for (unsigned int i = 0; i < m_bufferPool.allRenderPics.size(); ++i) + { -+ m_bufferPool.freeRenderPics.push_back(&m_bufferPool.allRenderPics[i]); ++ m_bufferPool.freeRenderPics.push_back(i); + } +} + @@ -4745,7 +5333,6 @@ index 5ca0803..4844469 100644 + + m_bufferPool.freeRenderPics.clear(); + m_bufferPool.usedRenderPics.clear(); -+ m_bufferPool.allRenderPics.clear(); +} + +void COutput::Dispose() @@ -4883,6 +5470,7 @@ index 5ca0803..4844469 100644 + return; + case COutputControlProtocol::PRECLEANUP: + Flush(); ++ PreCleanup(); + msg->Reply(COutputControlProtocol::ACC); + return; + default: @@ -4937,9 +5525,6 @@ index 5ca0803..4844469 100644 + switch (signal) + { + case COutputControlProtocol::TIMEOUT: -+// uint16_t decoded, processed, render; -+// m_config.stats->Get(decoded, processed, render); -+// CLog::Log(LOGDEBUG, "CVDPAU::COutput - timeout idle: decoded: %d, proc: %d, render: %d", decoded, processed, render); + return; + default: + break; @@ -4986,8 +5571,8 @@ index 5ca0803..4844469 100644 + +void COutput::Process() +{ -+ Message *msg; -+ Protocol *port; ++ Message *msg = NULL; ++ Protocol *port = NULL; + bool gotMsg; + + m_state = O_TOP_UNCONFIGURED; @@ -5089,15 +5674,18 @@ index 5ca0803..4844469 100644 + +void COutput::Flush() +{ -+ Message *reply; -+ if (m_mixer.m_controlPort.SendOutMessageSync(CMixerControlProtocol::FLUSH, ++ if (m_mixer.IsActive()) ++ { ++ Message *reply; ++ if (m_mixer.m_controlPort.SendOutMessageSync(CMixerControlProtocol::FLUSH, + &reply, + 2000)) -+ { -+ reply->Release(); ++ { ++ reply->Release(); ++ } ++ else ++ CLog::Log(LOGERROR, "Coutput::%s - failed to flush mixer", __FUNCTION__); + } -+ else -+ CLog::Log(LOGERROR, "Coutput::%s - failed to flush mixer", __FUNCTION__); + + Message *msg; + while (m_mixer.m_dataPort.ReceiveInMessage(&msg)) @@ -5144,13 +5732,14 @@ index 5ca0803..4844469 100644 + } + + // reset used render flag which was cleared on mixer flush -+ std::deque::iterator it; ++ std::deque::iterator it; + for (it = m_bufferPool.usedRenderPics.begin(); it != m_bufferPool.usedRenderPics.end(); ++it) + { -+ if ((*it)->DVDPic.format == RENDER_FMT_VDPAU_420) ++ CVdpauRenderPicture *pic = m_bufferPool.allRenderPics[*it]; ++ if (pic->DVDPic.format == RENDER_FMT_VDPAU_420) + { + std::map::iterator it2; -+ it2 = m_bufferPool.glVideoSurfaceMap.find((*it)->sourceIdx); ++ it2 = m_bufferPool.glVideoSurfaceMap.find(pic->sourceIdx); + if (it2 == m_bufferPool.glVideoSurfaceMap.end()) + { + CLog::Log(LOGDEBUG, "COutput::Flush - gl surface not found"); @@ -5183,7 +5772,7 @@ index 5ca0803..4844469 100644 + +CVdpauRenderPicture* COutput::ProcessMixerPicture() +{ -+ CVdpauRenderPicture *retPic = 0; ++ CVdpauRenderPicture *retPic = NULL; + + if (m_config.usePixmaps) + { @@ -5197,8 +5786,7 @@ index 5ca0803..4844469 100644 + pixmap->surface = pic.outputSurface; + pixmap->DVDPic = pic.DVDPic; + pixmap->id = i; -+ m_bufferPool.notVisiblePixmaps.push_back(pixmap); -+ VdpStatus vdp_st; ++ m_bufferPool.notVisiblePixmaps.push_back(i); + m_config.vdpProcs.vdp_presentation_queue_display(pixmap->vdp_flip_queue, + pixmap->surface,0,0,0); + } @@ -5207,15 +5795,17 @@ index 5ca0803..4844469 100644 + VdpStatus vdp_st; + VdpTime time; + VdpPresentationQueueStatus status; -+ VdpauBufferPool::Pixmaps *pixmap = m_bufferPool.notVisiblePixmaps.front(); ++ int idx = m_bufferPool.notVisiblePixmaps.front(); ++ VdpauBufferPool::Pixmaps *pixmap = &m_bufferPool.pixmaps[idx]; + vdp_st = m_config.vdpProcs.vdp_presentation_queue_query_surface_status( + pixmap->vdp_flip_queue, pixmap->surface, &status, &time); + + if (vdp_st == VDP_STATUS_OK && status == VDP_PRESENTATION_QUEUE_STATUS_VISIBLE) + { -+ retPic = m_bufferPool.freeRenderPics.front(); ++ int idx = m_bufferPool.freeRenderPics.front(); ++ retPic = m_bufferPool.allRenderPics[idx]; + m_bufferPool.freeRenderPics.pop_front(); -+ m_bufferPool.usedRenderPics.push_back(retPic); ++ m_bufferPool.usedRenderPics.push_back(idx); + retPic->sourceIdx = pixmap->id; + retPic->DVDPic = pixmap->DVDPic; + retPic->valid = true; @@ -5228,9 +5818,10 @@ index 5ca0803..4844469 100644 + } // pixmap + else if (!m_bufferPool.processedPics.empty() && !m_bufferPool.freeRenderPics.empty()) + { -+ retPic = m_bufferPool.freeRenderPics.front(); ++ int idx = m_bufferPool.freeRenderPics.front(); ++ retPic = m_bufferPool.allRenderPics[idx]; + m_bufferPool.freeRenderPics.pop_front(); -+ m_bufferPool.usedRenderPics.push_back(retPic); ++ m_bufferPool.usedRenderPics.push_back(idx); + CVdpauProcessedPicture procPic = m_bufferPool.processedPics.front(); + m_bufferPool.processedPics.pop(); + @@ -5266,15 +5857,22 @@ index 5ca0803..4844469 100644 + +void COutput::ProcessReturnPicture(CVdpauRenderPicture *pic) +{ -+ std::deque::iterator it; -+ it = std::find(m_bufferPool.usedRenderPics.begin(), m_bufferPool.usedRenderPics.end(), pic); ++ std::deque::iterator it; ++ for (it = m_bufferPool.usedRenderPics.begin(); it != m_bufferPool.usedRenderPics.end(); ++it) ++ { ++ if (m_bufferPool.allRenderPics[*it] == pic) ++ { ++ break; ++ } ++ } ++ + if (it == m_bufferPool.usedRenderPics.end()) + { + CLog::Log(LOGWARNING, "COutput::ProcessReturnPicture - pic not found"); + return; + } ++ m_bufferPool.freeRenderPics.push_back(*it); + m_bufferPool.usedRenderPics.erase(it); -+ m_bufferPool.freeRenderPics.push_back(pic); + if (!pic->valid) + { + CLog::Log(LOGDEBUG, "COutput::%s - return of invalid render pic", __FUNCTION__); @@ -5356,7 +5954,7 @@ index 5ca0803..4844469 100644 + { + // create pixmpas + VdpauBufferPool::Pixmaps pixmap; -+ int numPixmaps = NUM_RENDER_PICS; ++ unsigned int numPixmaps = NUM_RENDER_PICS; + for (unsigned int i = 0; i < numPixmaps; i++) + { + pixmap.pixmap = None; @@ -5432,10 +6030,63 @@ index 5ca0803..4844469 100644 + // invalidate all used render pictures + for (unsigned int i = 0; i < m_bufferPool.usedRenderPics.size(); ++i) + { -+ m_bufferPool.usedRenderPics[i]->valid = false; ++ m_bufferPool.allRenderPics[m_bufferPool.usedRenderPics[i]]->valid = false; + } +} + ++void COutput::PreCleanup() ++{ ++ ++ VdpStatus vdp_st; ++ ++ m_mixer.Dispose(); ++ ++ CSingleLock lock(m_bufferPool.renderPicSec); ++ for (unsigned int i = 0; i < m_bufferPool.outputSurfaces.size(); ++i) ++ { ++ if (m_bufferPool.outputSurfaces[i] == VDP_INVALID_HANDLE) ++ continue; ++ ++ // check if output surface is in use ++ bool used = false; ++ std::deque::iterator it; ++ CVdpauRenderPicture *pic; ++ for (it = m_bufferPool.usedRenderPics.begin(); it != m_bufferPool.usedRenderPics.end(); ++it) ++ { ++ pic = m_bufferPool.allRenderPics[*it]; ++ if ((pic->sourceIdx == m_bufferPool.outputSurfaces[i]) && pic->valid) ++ { ++ used = true; ++ break; ++ } ++ } ++ if (used) ++ continue; ++ ++#ifdef GL_NV_vdpau_interop ++ // unmap surface ++ std::map::iterator it_map; ++ it_map = m_bufferPool.glOutputSurfaceMap.find(m_bufferPool.outputSurfaces[i]); ++ if (it_map == m_bufferPool.glOutputSurfaceMap.end()) ++ { ++ CLog::Log(LOGERROR, "%s - could not find gl surface", __FUNCTION__); ++ continue; ++ } ++ glVDPAUUnregisterSurfaceNV(it_map->second.glVdpauSurface); ++ glDeleteTextures(1, it_map->second.texture); ++ m_bufferPool.glOutputSurfaceMap.erase(it_map); ++#endif ++ ++ vdp_st = m_config.vdpProcs.vdp_output_surface_destroy(m_bufferPool.outputSurfaces[i]); ++ CheckStatus(vdp_st, __LINE__); ++ ++ m_bufferPool.outputSurfaces[i] = VDP_INVALID_HANDLE; ++ ++ CLog::Log(LOGDEBUG, "VDPAU::PreCleanup - released output surface"); ++ } ++ ++} ++ +void COutput::InitMixer() +{ + for (unsigned int i = 0; i < m_bufferPool.outputSurfaces.size(); ++i) @@ -5611,7 +6262,7 @@ index 5ca0803..4844469 100644 + if (m_config.videoSurfaces->size() != m_bufferPool.glVideoSurfaceMap.size()) + { + CSingleLock lock(*m_config.videoSurfaceSec); -+ for (int i = 0; i < m_config.videoSurfaces->size(); i++) ++ for (unsigned int i = 0; i < m_config.videoSurfaces->size(); i++) + { + if ((*m_config.videoSurfaces)[i]->surface == VDP_INVALID_HANDLE) + continue; @@ -5659,7 +6310,7 @@ index 5ca0803..4844469 100644 + if (m_bufferPool.glOutputSurfaceMap.size() != m_bufferPool.numOutputSurfaces) + { + VdpauBufferPool::GLVideoSurface glSurface; -+ for (int i=m_bufferPool.glOutputSurfaceMap.size(); i allRenderPics; + unsigned short numOutputSurfaces; + std::vector pixmaps; + std::vector outputSurfaces; -+ std::deque notVisiblePixmaps; -+ std::vector allRenderPics; ++ std::deque notVisiblePixmaps; + std::map glVideoSurfaceMap; + std::map glOutputSurfaceMap; + std::queue processedPics; -+ std::deque usedRenderPics; -+ std::deque freeRenderPics; ++ std::deque usedRenderPics; ++ std::deque freeRenderPics; + CCriticalSection renderPicSec; +}; + @@ -6439,6 +7094,7 @@ index e760f28..1c21535 100644 + bool DestroyGlxContext(); + bool EnsureBufferPool(); + void ReleaseBufferPool(); ++ void PreCleanup(); + void InitMixer(); + bool GLInit(); + void GLMapSurfaces(); @@ -6575,7 +7231,7 @@ index e760f28..1c21535 100644 // OnLostDevice triggers transition from all states to LOST // internal errors trigger transition from OPEN to RESET -@@ -254,9 +581,25 @@ class CVDPAU +@@ -254,9 +587,25 @@ class CVDPAU , VDPAU_LOST , VDPAU_ERROR } m_DisplayState; @@ -6606,10 +7262,10 @@ index e760f28..1c21535 100644 + +} diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 2e76ff5..8ed34f9 100644 +index bcfd27c..d35751c 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1010,6 +1010,7 @@ static std::string GetRenderFormatName(ERenderFormat format) +@@ -992,6 +992,7 @@ static std::string GetRenderFormatName(ERenderFormat format) case RENDER_FMT_UYVY422: return "UYVY"; case RENDER_FMT_YUYV422: return "YUY2"; case RENDER_FMT_VDPAU: return "VDPAU"; @@ -6618,7 +7274,7 @@ index 2e76ff5..8ed34f9 100644 case RENDER_FMT_VAAPI: return "VAAPI"; case RENDER_FMT_OMXEGL: return "OMXEGL"; diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index 3ec25c1..6541f65 100644 +index 5feaf8a..f611bb6 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp @@ -161,7 +161,7 @@ void CAdvancedSettings::Initialize() @@ -6639,7 +7295,7 @@ index 3ec25c1..6541f65 100644 m_DXVACheckCompatibility = false; m_DXVACheckCompatibilityPresent = false; m_DXVAForceProcessorRenderer = true; -@@ -590,7 +592,7 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) +@@ -594,7 +596,7 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) XMLUtils::GetString(pElement,"cleandatetime", m_videoCleanDateTimeRegExp); XMLUtils::GetString(pElement,"ppffmpegdeinterlacing",m_videoPPFFmpegDeint); XMLUtils::GetString(pElement,"ppffmpegpostprocessing",m_videoPPFFmpegPostProc); @@ -6648,7 +7304,7 @@ index 3ec25c1..6541f65 100644 XMLUtils::GetFloat(pElement, "nonlinearstretchratio", m_videoNonLinStretchRatio, 0.01f, 1.0f); XMLUtils::GetBoolean(pElement,"enablehighqualityhwscalers", m_videoEnableHighQualityHwScalers); XMLUtils::GetFloat(pElement,"autoscalemaxfps",m_videoAutoScaleMaxFps, 0.0f, 1000.0f); -@@ -599,6 +601,8 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) +@@ -603,6 +605,8 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) XMLUtils::GetBoolean(pElement,"allowmpeg4vaapi",m_videoAllowMpeg4VAAPI); XMLUtils::GetBoolean(pElement, "disablebackgrounddeinterlace", m_videoDisableBackgroundDeinterlace); XMLUtils::GetInt(pElement, "useocclusionquery", m_videoCaptureUseOcclusionQuery, -1, 1); @@ -6658,7 +7314,7 @@ index 3ec25c1..6541f65 100644 TiXmlElement* pStagefrightElem = pElement->FirstChildElement("stagefright"); if (pStagefrightElem) diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h -index 224268a..310db76 100644 +index 72716ee..df5b028 100644 --- a/xbmc/settings/AdvancedSettings.h +++ b/xbmc/settings/AdvancedSettings.h @@ -158,6 +158,8 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler @@ -6708,10 +7364,10 @@ index a0f7bba..b6b6ec4 100644 1.8.1.6 -From 64a3764653d8021becc1ba27cb1b9900ab581ff5 Mon Sep 17 00:00:00 2001 +From 3c0d159b590e6489fac9a47955b18cbad1826484 Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 12 Dec 2012 09:52:17 +0100 -Subject: [PATCH 006/110] vdpau: make interop gl default and remove setting, +Subject: [PATCH 025/111] vdpau: make interop gl default and remove setting, rename and intvert interop yuv --- @@ -6720,10 +7376,10 @@ Subject: [PATCH 006/110] vdpau: make interop gl default and remove setting, 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index a6b0297..fae2505 100644 +index 4a10f5d..0e900ad 100644 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -5777,15 +5777,10 @@ msgstr "" +@@ -5786,15 +5786,10 @@ msgstr "" #: system/settings/settings.xml msgctxt "#13437" @@ -6742,10 +7398,10 @@ index a6b0297..fae2505 100644 #: system/settings/settings.xml msgctxt "#13500" diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 4844469..fc95760 100644 +index 1e4b0b7..c3af67a 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -384,12 +384,15 @@ bool CDecoder::Supports(EINTERLACEMETHOD method) +@@ -374,12 +374,15 @@ bool CDecoder::Supports(EINTERLACEMETHOD method) || method == VS_INTERLACEMETHOD_AUTO) return true; @@ -6762,7 +7418,7 @@ index 4844469..fc95760 100644 for(SInterlaceMapping* p = g_interlace_mapping; p->method != VS_INTERLACEMETHOD_NONE; p++) { if(p->method == method) -@@ -1869,7 +1872,7 @@ void CMixer::SetDeinterlacing() +@@ -1860,7 +1863,7 @@ void CMixer::SetDeinterlacing() SetDeintSkipChroma(); @@ -6771,7 +7427,7 @@ index 4844469..fc95760 100644 } void CMixer::SetDeintSkipChroma() -@@ -2061,7 +2064,7 @@ void CMixer::Init() +@@ -2052,7 +2055,7 @@ void CMixer::Init() m_vdpError = false; m_config.upscale = g_advancedSettings.m_videoVDPAUScaling; @@ -6780,7 +7436,7 @@ index 4844469..fc95760 100644 CreateVdpauMixer(); } -@@ -2171,11 +2174,12 @@ void CMixer::InitCycle() +@@ -2162,11 +2165,12 @@ void CMixer::InitCycle() DVP_FLAG_INTERLACED); m_config.useInteropYuv = false; } @@ -6794,7 +7450,7 @@ index 4844469..fc95760 100644 } else { -@@ -3207,7 +3211,7 @@ bool COutput::GLInit() +@@ -3279,7 +3283,7 @@ bool COutput::GLInit() glVDPAUGetSurfaceivNV = NULL; #endif @@ -6803,7 +7459,7 @@ index 4844469..fc95760 100644 #ifdef GL_NV_vdpau_interop if (glewIsSupported("GL_NV_vdpau_interop")) -@@ -3239,8 +3243,7 @@ bool COutput::GLInit() +@@ -3311,8 +3315,7 @@ bool COutput::GLInit() #endif { m_config.usePixmaps = true; @@ -6817,165 +7473,10 @@ index 4844469..fc95760 100644 1.8.1.6 -From 9288e2009b64f9ceebda4c27a98a412c07ee8cbf Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Wed, 12 Dec 2012 18:34:47 +0100 -Subject: [PATCH 007/110] vdpau: drop studio level conversion - ---- - xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 4 +- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 94 ++------------------------ - 2 files changed, 6 insertions(+), 92 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index 388d778..2de63b8 100644 ---- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -+++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -3370,7 +3370,7 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) - { - if(feature == RENDERFEATURE_BRIGHTNESS) - { -- if ((m_renderMethod & RENDER_VDPAU) && !CSettings::Get().GetBool("videoscreen.limitedrange")) -+ if (m_renderMethod & RENDER_VDPAU) - return true; - - if (m_renderMethod & RENDER_VAAPI) -@@ -3383,7 +3383,7 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) - - if(feature == RENDERFEATURE_CONTRAST) - { -- if ((m_renderMethod & RENDER_VDPAU) && !CSettings::Get().GetBool("videoscreen.limitedrange")) -+ if (m_renderMethod & RENDER_VDPAU) - return true; - - if (m_renderMethod & RENDER_VAAPI) -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index fc95760..07af62a 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -58,15 +58,6 @@ - }; - const size_t decoder_profile_count = sizeof(decoder_profiles)/sizeof(CDecoder::Desc); - --//static float studioCSC[3][4] = --//{ --// { 1.0f, 0.0f, 1.57480000f,-0.78740000f}, --// { 1.0f,-0.18737736f,-0.46813736f, 0.32775736f}, --// { 1.0f, 1.85556000f, 0.0f,-0.92780000f} --//}; --static float studioCSCKCoeffs601[3] = {0.299, 0.587, 0.114}; //BT601 {Kr, Kg, Kb} --static float studioCSCKCoeffs709[3] = {0.2126, 0.7152, 0.0722}; //BT709 {Kr, Kg, Kb} -- - static struct SInterlaceMapping - { - const EINTERLACEMETHOD method; -@@ -1636,74 +1627,6 @@ void CMixer::PostProcOff() - DisableHQScaling(); - } - -- --bool CMixer::GenerateStudioCSCMatrix(VdpColorStandard colorStandard, VdpCSCMatrix &studioCSCMatrix) --{ -- // instead use studioCSCKCoeffs601[3], studioCSCKCoeffs709[3] to generate float[3][4] matrix (float studioCSC[3][4]) -- // m00 = mRY = red: luma factor (contrast factor) (1.0) -- // m10 = mGY = green: luma factor (contrast factor) (1.0) -- // m20 = mBY = blue: luma factor (contrast factor) (1.0) -- // -- // m01 = mRB = red: blue color diff coeff (0.0) -- // m11 = mGB = green: blue color diff coeff (-2Kb(1-Kb)/(Kg)) -- // m21 = mBB = blue: blue color diff coeff ((1-Kb)/0.5) -- // -- // m02 = mRR = red: red color diff coeff ((1-Kr)/0.5) -- // m12 = mGR = green: red color diff coeff (-2Kr(1-Kr)/(Kg)) -- // m22 = mBR = blue: red color diff coeff (0.0) -- // -- // m03 = mRC = red: colour zero offset (brightness factor) (-(1-Kr)/0.5 * (128/255)) -- // m13 = mGC = green: colour zero offset (brightness factor) ((256/255) * (Kb(1-Kb) + Kr(1-Kr)) / Kg) -- // m23 = mBC = blue: colour zero offset (brightness factor) (-(1-Kb)/0.5 * (128/255)) -- -- // columns -- int Y = 0; -- int Cb = 1; -- int Cr = 2; -- int C = 3; -- // rows -- int R = 0; -- int G = 1; -- int B = 2; -- // colour standard coefficients for red, geen, blue -- double Kr, Kg, Kb; -- // colour diff zero position (use standard 8-bit coding precision) -- double CDZ = 128; //256*0.5 -- // range excursion (use standard 8-bit coding precision) -- double EXC = 255; //256-1 -- -- if (colorStandard == VDP_COLOR_STANDARD_ITUR_BT_601) -- { -- Kr = studioCSCKCoeffs601[0]; -- Kg = studioCSCKCoeffs601[1]; -- Kb = studioCSCKCoeffs601[2]; -- } -- else // assume VDP_COLOR_STANDARD_ITUR_BT_709 -- { -- Kr = studioCSCKCoeffs709[0]; -- Kg = studioCSCKCoeffs709[1]; -- Kb = studioCSCKCoeffs709[2]; -- } -- // we keep luma unscaled to retain the levels present in source so that 16-235 luma is converted to RGB 16-235 -- studioCSCMatrix[R][Y] = 1.0; -- studioCSCMatrix[G][Y] = 1.0; -- studioCSCMatrix[B][Y] = 1.0; -- -- studioCSCMatrix[R][Cb] = 0.0; -- studioCSCMatrix[G][Cb] = (double)-2 * Kb * (1 - Kb) / Kg; -- studioCSCMatrix[B][Cb] = (double)(1 - Kb) / 0.5; -- -- studioCSCMatrix[R][Cr] = (double)(1 - Kr) / 0.5; -- studioCSCMatrix[G][Cr] = (double)-2 * Kr * (1 - Kr) / Kg; -- studioCSCMatrix[B][Cr] = 0.0; -- -- studioCSCMatrix[R][C] = (double)-1 * studioCSCMatrix[R][Cr] * CDZ/EXC; -- studioCSCMatrix[G][C] = (double)-1 * (studioCSCMatrix[G][Cb] + studioCSCMatrix[G][Cr]) * CDZ/EXC; -- studioCSCMatrix[B][C] = (double)-1 * studioCSCMatrix[B][Cb] * CDZ/EXC; -- -- return true; --} -- - void CMixer::SetColor() - { - VdpStatus vdp_st; -@@ -1723,19 +1646,10 @@ void CMixer::SetColor() - //vdp_st = vdp_generate_csc_matrix(&m_Procamp, VDP_COLOR_STANDARD_ITUR_BT_601, &m_CSCMatrix); - - VdpVideoMixerAttribute attributes[] = { VDP_VIDEO_MIXER_ATTRIBUTE_CSC_MATRIX }; -- if (CSettings::Get().GetBool("videoscreen.limitedrange")) -- { -- float studioCSC[3][4]; -- GenerateStudioCSCMatrix(colorStandard, studioCSC); -- void const * pm_CSCMatix[] = { &studioCSC }; -- vdp_st = m_config.vdpProcs.vdp_video_mixer_set_attribute_values(m_videoMixer, ARSIZE(attributes), attributes, pm_CSCMatix); -- } -- else -- { -- vdp_st = m_config.vdpProcs.vdp_generate_csc_matrix(&m_Procamp, colorStandard, &m_CSCMatrix); -- void const * pm_CSCMatix[] = { &m_CSCMatrix }; -- vdp_st = m_config.vdpProcs.vdp_video_mixer_set_attribute_values(m_videoMixer, ARSIZE(attributes), attributes, pm_CSCMatix); -- } -+ vdp_st = m_config.vdpProcs.vdp_generate_csc_matrix(&m_Procamp, colorStandard, &m_CSCMatrix); -+ void const * pm_CSCMatix[] = { &m_CSCMatrix }; -+ vdp_st = m_config.vdpProcs.vdp_video_mixer_set_attribute_values(m_videoMixer, ARSIZE(attributes), attributes, pm_CSCMatix); -+ - CheckStatus(vdp_st, __LINE__); - } - --- -1.8.1.6 - - -From 471ec30394381baccd0d7c6fe24efc834a1e9d25 Mon Sep 17 00:00:00 2001 +From 81a040e60363479ee026aa33d19da1ea4b235425 Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 12 Dec 2012 20:28:49 +0100 -Subject: [PATCH 008/110] vdpau: observe ffmpeg tags for color space +Subject: [PATCH 026/111] vdpau: observe ffmpeg tags for color space --- xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 38 ++++++++++++++++++-------- @@ -6983,10 +7484,10 @@ Subject: [PATCH 008/110] vdpau: observe ffmpeg tags for color space 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 07af62a..7ecc2cf 100644 +index c3af67a..2d8b8e2 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -929,6 +929,7 @@ int CDecoder::Decode(AVCodecContext *avctx, AVFrame *pFrame) +@@ -925,6 +925,7 @@ int CDecoder::Decode(AVCodecContext *avctx, AVFrame *pFrame) memset(&pic.DVDPic, 0, sizeof(pic.DVDPic)); ((CDVDVideoCodecFFmpeg*)avctx->opaque)->GetPictureCommon(&pic.DVDPic); pic.render = render; @@ -7020,7 +7521,7 @@ index 07af62a..7ecc2cf 100644 } if (m_NoiseReduction != CMediaSettings::Get().GetCurrentVideoSettings().m_NoiseReduction) { -@@ -1637,13 +1636,27 @@ void CMixer::SetColor() +@@ -1704,13 +1703,27 @@ void CMixer::SetColor() m_Procamp.contrast = (float)((CMediaSettings::Get().GetCurrentVideoSettings().m_Contrast)+50) / 100; VdpColorStandard colorStandard; @@ -7054,8 +7555,8 @@ index 07af62a..7ecc2cf 100644 + } VdpVideoMixerAttribute attributes[] = { VDP_VIDEO_MIXER_ATTRIBUTE_CSC_MATRIX }; - vdp_st = m_config.vdpProcs.vdp_generate_csc_matrix(&m_Procamp, colorStandard, &m_CSCMatrix); -@@ -1974,6 +1987,7 @@ void CMixer::Init() + if (CSettings::Get().GetBool("videoscreen.limitedrange")) +@@ -2051,6 +2064,7 @@ void CMixer::Init() m_Sharpness = 0.0; m_DeintMode = 0; m_Deint = 0; @@ -7064,10 +7565,10 @@ index 07af62a..7ecc2cf 100644 m_vdpError = false; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h -index 1c21535..674571b 100644 +index aae4173..8845a16 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h -@@ -334,6 +334,7 @@ class CMixer : private CThread +@@ -337,6 +337,7 @@ class CMixer : private CThread int m_DeintMode; int m_Deint; int m_Upscale; @@ -7079,20 +7580,20 @@ index 1c21535..674571b 100644 1.8.1.6 -From 0d627c2dfe93bc9cbde2f0c45b209b24ae3afcf6 Mon Sep 17 00:00:00 2001 +From 550eb77b91beb31fcb70a480451da977755e1d8d Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 27 Jan 2013 12:10:19 +0100 -Subject: [PATCH 009/110] vdpau: switch off de-interlacing on ff +Subject: [PATCH 027/111] vdpau: switch off de-interlacing on ff --- xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 7ecc2cf..3cc02ee 100644 +index 2d8b8e2..7a9dfc9 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -2065,8 +2065,9 @@ void CMixer::InitCycle() +@@ -2142,8 +2142,9 @@ void CMixer::InitCycle() EINTERLACEMETHOD method = GetDeinterlacingMethod(); bool interlaced = m_mixerInput[1].DVDPic.iFlags & DVP_FLAG_INTERLACED; @@ -7108,200 +7609,10 @@ index 7ecc2cf..3cc02ee 100644 1.8.1.6 -From 9bd37f8dce8f15c2b7db6d998b7637645345f432 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sat, 2 Feb 2013 13:17:09 +0100 -Subject: [PATCH 010/110] vdpau: fix mp4 part2 decoding, activate by default - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 3 +-- - xbmc/settings/AdvancedSettings.cpp | 2 +- - 2 files changed, 2 insertions(+), 3 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 3cc02ee..d90df12 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -131,10 +131,9 @@ bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int - VdpDecoderProfile profile = 0; - if(avctx->codec_id == AV_CODEC_ID_H264) - profile = VDP_DECODER_PROFILE_H264_HIGH; --#ifdef VDP_DECODER_PROFILE_MPEG4_PART2_ASP - else if(avctx->codec_id == AV_CODEC_ID_MPEG4) - profile = VDP_DECODER_PROFILE_MPEG4_PART2_ASP; --#endif -+ - if(profile) - { - if (!CDVDCodecUtils::IsVP3CompatibleWidth(avctx->coded_width)) -diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index 6541f65..8287651 100644 ---- a/xbmc/settings/AdvancedSettings.cpp -+++ b/xbmc/settings/AdvancedSettings.cpp -@@ -165,7 +165,7 @@ void CAdvancedSettings::Initialize() - m_videoNonLinStretchRatio = 0.5f; - m_videoEnableHighQualityHwScalers = false; - m_videoAutoScaleMaxFps = 30.0f; -- m_videoAllowMpeg4VDPAU = false; -+ m_videoAllowMpeg4VDPAU = true; - m_videoAllowMpeg4VAAPI = false; - m_videoDisableBackgroundDeinterlace = false; - m_videoCaptureUseOcclusionQuery = -1; //-1 is auto detect --- -1.8.1.6 - - -From 084d9ac176408dd4240edb14b144f67a884eda5e Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sat, 2 Mar 2013 15:19:19 +0100 -Subject: [PATCH 011/110] vdpau: re-add limited range conversion - ---- - xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 4 +- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 86 +++++++++++++++++++++++++- - 2 files changed, 85 insertions(+), 5 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index 2de63b8..388d778 100644 ---- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -+++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -3370,7 +3370,7 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) - { - if(feature == RENDERFEATURE_BRIGHTNESS) - { -- if (m_renderMethod & RENDER_VDPAU) -+ if ((m_renderMethod & RENDER_VDPAU) && !CSettings::Get().GetBool("videoscreen.limitedrange")) - return true; - - if (m_renderMethod & RENDER_VAAPI) -@@ -3383,7 +3383,7 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) - - if(feature == RENDERFEATURE_CONTRAST) - { -- if (m_renderMethod & RENDER_VDPAU) -+ if ((m_renderMethod & RENDER_VDPAU) && !CSettings::Get().GetBool("videoscreen.limitedrange")) - return true; - - if (m_renderMethod & RENDER_VAAPI) -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index d90df12..62cd72e 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -71,6 +71,9 @@ - , {VS_INTERLACEMETHOD_NONE , (VdpVideoMixerFeature)-1} - }; - -+static float studioCSCKCoeffs601[3] = {0.299, 0.587, 0.114}; //BT601 {Kr, Kg, Kb} -+static float studioCSCKCoeffs709[3] = {0.2126, 0.7152, 0.0722}; //BT709 {Kr, Kg, Kb} -+ - //since libvdpau 0.4, vdp_device_create_x11() installs a callback on the Display*, - //if we unload libvdpau with dlclose(), we segfault on XCloseDisplay, - //so we just keep a static handle to libvdpau around -@@ -1625,6 +1628,73 @@ void CMixer::PostProcOff() - DisableHQScaling(); - } - -+bool CMixer::GenerateStudioCSCMatrix(VdpColorStandard colorStandard, VdpCSCMatrix &studioCSCMatrix) -+{ -+ // instead use studioCSCKCoeffs601[3], studioCSCKCoeffs709[3] to generate float[3][4] matrix (float studioCSC[3][4]) -+ // m00 = mRY = red: luma factor (contrast factor) (1.0) -+ // m10 = mGY = green: luma factor (contrast factor) (1.0) -+ // m20 = mBY = blue: luma factor (contrast factor) (1.0) -+ // -+ // m01 = mRB = red: blue color diff coeff (0.0) -+ // m11 = mGB = green: blue color diff coeff (-2Kb(1-Kb)/(Kg)) -+ // m21 = mBB = blue: blue color diff coeff ((1-Kb)/0.5) -+ // -+ // m02 = mRR = red: red color diff coeff ((1-Kr)/0.5) -+ // m12 = mGR = green: red color diff coeff (-2Kr(1-Kr)/(Kg)) -+ // m22 = mBR = blue: red color diff coeff (0.0) -+ // -+ // m03 = mRC = red: colour zero offset (brightness factor) (-(1-Kr)/0.5 * (128/255)) -+ // m13 = mGC = green: colour zero offset (brightness factor) ((256/255) * (Kb(1-Kb) + Kr(1-Kr)) / Kg) -+ // m23 = mBC = blue: colour zero offset (brightness factor) (-(1-Kb)/0.5 * (128/255)) -+ -+ // columns -+ int Y = 0; -+ int Cb = 1; -+ int Cr = 2; -+ int C = 3; -+ // rows -+ int R = 0; -+ int G = 1; -+ int B = 2; -+ // colour standard coefficients for red, geen, blue -+ double Kr, Kg, Kb; -+ // colour diff zero position (use standard 8-bit coding precision) -+ double CDZ = 128; //256*0.5 -+ // range excursion (use standard 8-bit coding precision) -+ double EXC = 255; //256-1 -+ -+ if (colorStandard == VDP_COLOR_STANDARD_ITUR_BT_601) -+ { -+ Kr = studioCSCKCoeffs601[0]; -+ Kg = studioCSCKCoeffs601[1]; -+ Kb = studioCSCKCoeffs601[2]; -+ } -+ else // assume VDP_COLOR_STANDARD_ITUR_BT_709 -+ { -+ Kr = studioCSCKCoeffs709[0]; -+ Kg = studioCSCKCoeffs709[1]; -+ Kb = studioCSCKCoeffs709[2]; -+ } -+ // we keep luma unscaled to retain the levels present in source so that 16-235 luma is converted to RGB 16-235 -+ studioCSCMatrix[R][Y] = 1.0; -+ studioCSCMatrix[G][Y] = 1.0; -+ studioCSCMatrix[B][Y] = 1.0; -+ -+ studioCSCMatrix[R][Cb] = 0.0; -+ studioCSCMatrix[G][Cb] = (double)-2 * Kb * (1 - Kb) / Kg; -+ studioCSCMatrix[B][Cb] = (double)(1 - Kb) / 0.5; -+ -+ studioCSCMatrix[R][Cr] = (double)(1 - Kr) / 0.5; -+ studioCSCMatrix[G][Cr] = (double)-2 * Kr * (1 - Kr) / Kg; -+ studioCSCMatrix[B][Cr] = 0.0; -+ -+ studioCSCMatrix[R][C] = (double)-1 * studioCSCMatrix[R][Cr] * CDZ/EXC; -+ studioCSCMatrix[G][C] = (double)-1 * (studioCSCMatrix[G][Cb] + studioCSCMatrix[G][Cr]) * CDZ/EXC; -+ studioCSCMatrix[B][C] = (double)-1 * studioCSCMatrix[B][Cb] * CDZ/EXC; -+ -+ return true; -+} -+ - void CMixer::SetColor() - { - VdpStatus vdp_st; -@@ -1658,9 +1728,19 @@ void CMixer::SetColor() - } - - VdpVideoMixerAttribute attributes[] = { VDP_VIDEO_MIXER_ATTRIBUTE_CSC_MATRIX }; -- vdp_st = m_config.vdpProcs.vdp_generate_csc_matrix(&m_Procamp, colorStandard, &m_CSCMatrix); -- void const * pm_CSCMatix[] = { &m_CSCMatrix }; -- vdp_st = m_config.vdpProcs.vdp_video_mixer_set_attribute_values(m_videoMixer, ARSIZE(attributes), attributes, pm_CSCMatix); -+ if (CSettings::Get().GetBool("videoscreen.limitedrange")) -+ { -+ float studioCSC[3][4]; -+ GenerateStudioCSCMatrix(colorStandard, studioCSC); -+ void const * pm_CSCMatix[] = { &studioCSC }; -+ vdp_st = m_config.vdpProcs.vdp_video_mixer_set_attribute_values(m_videoMixer, ARSIZE(attributes), attributes, pm_CSCMatix); -+ } -+ else -+ { -+ vdp_st = m_config.vdpProcs.vdp_generate_csc_matrix(&m_Procamp, colorStandard, &m_CSCMatrix); -+ void const * pm_CSCMatix[] = { &m_CSCMatrix }; -+ vdp_st = m_config.vdpProcs.vdp_video_mixer_set_attribute_values(m_videoMixer, ARSIZE(attributes), attributes, pm_CSCMatix); -+ } - - CheckStatus(vdp_st, __LINE__); - } --- -1.8.1.6 - - -From 4b7e68462033d60522677cb8abd3472ffe0734f0 Mon Sep 17 00:00:00 2001 +From 760abbbfdd0f77c63adb22d4ea3cf2950cf4ce2c Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 25 Sep 2012 12:14:15 +0200 -Subject: [PATCH 012/110] linuxrenderer: drop method RenderMultiPass +Subject: [PATCH 028/111] linuxrenderer: drop method RenderMultiPass --- xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 9 ++------- @@ -7309,10 +7620,10 @@ Subject: [PATCH 012/110] linuxrenderer: drop method RenderMultiPass 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index 388d778..e8ae9df 100644 +index 42b47e5..daadcd6 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -1218,7 +1218,8 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) +@@ -1212,7 +1212,8 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) break; case RQ_MULTIPASS: @@ -7322,7 +7633,7 @@ index 388d778..e8ae9df 100644 VerifyGLState(); break; } -@@ -1350,12 +1351,6 @@ void CLinuxRendererGL::RenderSinglePass(int index, int field) +@@ -1335,12 +1336,6 @@ void CLinuxRendererGL::RenderSinglePass(int index, int field) VerifyGLState(); } @@ -7336,10 +7647,10 @@ index 388d778..e8ae9df 100644 { YUVPLANES &planes = m_buffers[index].fields[field]; diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.h b/xbmc/cores/VideoRenderers/LinuxRendererGL.h -index fdda2ed..1a3a6cf 100644 +index 8daf72c..b086bae 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.h +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.h -@@ -218,7 +218,6 @@ class CLinuxRendererGL : public CBaseRenderer +@@ -217,7 +217,6 @@ class CLinuxRendererGL : public CBaseRenderer void CalculateTextureSourceRects(int source, int num_planes); // renderers @@ -7351,21 +7662,21 @@ index fdda2ed..1a3a6cf 100644 1.8.1.6 -From b92169b126e26347156b617be5c7c7ac7a9ed191 Mon Sep 17 00:00:00 2001 +From 81ca23124841b2f9c0be794f71449f6d7ed60e7a Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 25 Sep 2012 13:20:47 +0200 -Subject: [PATCH 013/110] linuxrenderer: implement progressive weave for vdpau +Subject: [PATCH 029/111] linuxrenderer: implement progressive weave for vdpau --- - xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 55 +++++++++++++++++++-------- + xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 56 +++++++++++++++++++-------- xbmc/cores/VideoRenderers/LinuxRendererGL.h | 4 +- - 2 files changed, 41 insertions(+), 18 deletions(-) + 2 files changed, 42 insertions(+), 18 deletions(-) diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index e8ae9df..6807df7 100644 +index daadcd6..1dbb670 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -702,18 +702,6 @@ void CLinuxRendererGL::RenderUpdate(bool clear, DWORD flags, DWORD alpha) +@@ -698,18 +698,6 @@ void CLinuxRendererGL::RenderUpdate(bool clear, DWORD flags, DWORD alpha) glDisable(GL_POLYGON_STIPPLE); } @@ -7384,7 +7695,7 @@ index e8ae9df..6807df7 100644 else Render(flags, index); -@@ -1213,13 +1201,21 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) +@@ -1207,13 +1195,21 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) { case RQ_LOW: case RQ_SINGLEPASS: @@ -7409,7 +7720,7 @@ index e8ae9df..6807df7 100644 VerifyGLState(); break; } -@@ -1351,7 +1347,7 @@ void CLinuxRendererGL::RenderSinglePass(int index, int field) +@@ -1336,7 +1332,7 @@ void CLinuxRendererGL::RenderSinglePass(int index, int field) VerifyGLState(); } @@ -7418,7 +7729,7 @@ index e8ae9df..6807df7 100644 { YUVPLANES &planes = m_buffers[index].fields[field]; -@@ -1453,6 +1449,8 @@ void CLinuxRendererGL::RenderToFBO(int index, int field) +@@ -1438,6 +1434,8 @@ void CLinuxRendererGL::RenderToFBO(int index, int field) } m_fbo.width *= planes[0].pixpertex_x; m_fbo.height *= planes[0].pixpertex_y; @@ -7427,15 +7738,16 @@ index e8ae9df..6807df7 100644 // 1st Pass to video frame size glBegin(GL_QUADS); -@@ -1571,6 +1569,31 @@ void CLinuxRendererGL::RenderFromFBO() +@@ -1556,6 +1554,32 @@ void CLinuxRendererGL::RenderFromFBO() VerifyGLState(); } +void CLinuxRendererGL::RenderProgressiveWeave(int index, int field) +{ -+ bool scaleUp = (int)m_sourceHeight < g_graphicsContext.GetHeight() || (int)m_sourceWidth < g_graphicsContext.GetWidth(); ++ bool scale = (int)m_sourceHeight != m_destRect.Height() || ++ (int)m_sourceWidth != m_destRect.Width(); + -+ if (m_fbo.fbo.IsSupported() && (scaleUp || m_renderQuality == RQ_MULTIPASS)) ++ if (m_fbo.fbo.IsSupported() && (scale || m_renderQuality == RQ_MULTIPASS)) + { + glEnable(GL_POLYGON_STIPPLE); + glPolygonStipple(stipple_weave); @@ -7460,10 +7772,10 @@ index e8ae9df..6807df7 100644 { #ifdef HAVE_LIBVDPAU diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.h b/xbmc/cores/VideoRenderers/LinuxRendererGL.h -index 1a3a6cf..258a598 100644 +index b086bae..966733e 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.h +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.h -@@ -218,12 +218,12 @@ class CLinuxRendererGL : public CBaseRenderer +@@ -217,12 +217,12 @@ class CLinuxRendererGL : public CBaseRenderer void CalculateTextureSourceRects(int source, int num_planes); // renderers @@ -7482,250 +7794,10 @@ index 1a3a6cf..258a598 100644 1.8.1.6 -From 43a1ea8a43bc950f3f60bdeb02adf0d2a117273f Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Thu, 28 Mar 2013 10:38:37 +0100 -Subject: [PATCH 014/110] VDPAU: silence compiler warnings - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 19 ++++++++----------- - 1 file changed, 8 insertions(+), 11 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 62cd72e..a0ccd9f 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -252,7 +252,7 @@ long CDecoder::Release() - } - } - } -- IHardwareDecoder::Release(); -+ return IHardwareDecoder::Release(); - } - - long CDecoder::ReleasePicReference() -@@ -1426,8 +1426,8 @@ void CMixer::StateMachine(int signal, Protocol *port, Message *msg) - - void CMixer::Process() - { -- Message *msg; -- Protocol *port; -+ Message *msg = NULL; -+ Protocol *port = NULL; - bool gotMsg; - - m_state = M_TOP_UNCONFIGURED; -@@ -1532,7 +1532,6 @@ void CMixer::CreateVdpauMixer() - - void CMixer::InitCSCMatrix(int Width) - { -- VdpStatus vdp_st; - m_Procamp.struct_version = VDP_PROCAMP_VERSION; - m_Procamp.brightness = 0.0; - m_Procamp.contrast = 1.0; -@@ -2663,8 +2662,8 @@ void COutput::StateMachine(int signal, Protocol *port, Message *msg) - - void COutput::Process() - { -- Message *msg; -- Protocol *port; -+ Message *msg = NULL; -+ Protocol *port = NULL; - bool gotMsg; - - m_state = O_TOP_UNCONFIGURED; -@@ -2875,7 +2874,6 @@ CVdpauRenderPicture* COutput::ProcessMixerPicture() - pixmap->DVDPic = pic.DVDPic; - pixmap->id = i; - m_bufferPool.notVisiblePixmaps.push_back(pixmap); -- VdpStatus vdp_st; - m_config.vdpProcs.vdp_presentation_queue_display(pixmap->vdp_flip_queue, - pixmap->surface,0,0,0); - } -@@ -3033,7 +3031,7 @@ bool COutput::EnsureBufferPool() - { - // create pixmpas - VdpauBufferPool::Pixmaps pixmap; -- int numPixmaps = NUM_RENDER_PICS; -+ unsigned int numPixmaps = NUM_RENDER_PICS; - for (unsigned int i = 0; i < numPixmaps; i++) - { - pixmap.pixmap = None; -@@ -3287,7 +3285,7 @@ void COutput::GLMapSurfaces() - if (m_config.videoSurfaces->size() != m_bufferPool.glVideoSurfaceMap.size()) - { - CSingleLock lock(*m_config.videoSurfaceSec); -- for (int i = 0; i < m_config.videoSurfaces->size(); i++) -+ for (unsigned int i = 0; i < m_config.videoSurfaces->size(); i++) - { - if ((*m_config.videoSurfaces)[i]->surface == VDP_INVALID_HANDLE) - continue; -@@ -3335,7 +3333,7 @@ void COutput::GLMapSurfaces() - if (m_bufferPool.glOutputSurfaceMap.size() != m_bufferPool.numOutputSurfaces) - { - VdpauBufferPool::GLVideoSurface glSurface; -- for (int i=m_bufferPool.glOutputSurfaceMap.size(); i -Date: Mon, 25 Feb 2013 08:47:10 +0100 -Subject: [PATCH 015/110] vdpau: release more resources on pre-cleanup - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 72 +++++++++++++++++++++++--- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h | 2 + - 2 files changed, 68 insertions(+), 6 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index a0ccd9f..89ffc6e 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -1170,6 +1170,11 @@ void CMixer::Dispose() - m_dataPort.Purge(); - } - -+bool CMixer::IsActive() -+{ -+ return IsRunning(); -+} -+ - void CMixer::OnStartup() - { - CLog::Log(LOGNOTICE, "CMixer::OnStartup: Output Thread created"); -@@ -2559,6 +2564,7 @@ void COutput::StateMachine(int signal, Protocol *port, Message *msg) - return; - case COutputControlProtocol::PRECLEANUP: - Flush(); -+ PreCleanup(); - msg->Reply(COutputControlProtocol::ACC); - return; - default: -@@ -2765,15 +2771,18 @@ bool COutput::Uninit() - - void COutput::Flush() - { -- Message *reply; -- if (m_mixer.m_controlPort.SendOutMessageSync(CMixerControlProtocol::FLUSH, -+ if (m_mixer.IsActive()) -+ { -+ Message *reply; -+ if (m_mixer.m_controlPort.SendOutMessageSync(CMixerControlProtocol::FLUSH, - &reply, - 2000)) -- { -- reply->Release(); -+ { -+ reply->Release(); -+ } -+ else -+ CLog::Log(LOGERROR, "Coutput::%s - failed to flush mixer", __FUNCTION__); - } -- else -- CLog::Log(LOGERROR, "Coutput::%s - failed to flush mixer", __FUNCTION__); - - Message *msg; - while (m_mixer.m_dataPort.ReceiveInMessage(&msg)) -@@ -3111,6 +3120,57 @@ void COutput::ReleaseBufferPool() - } - } - -+void COutput::PreCleanup() -+{ -+ -+ VdpStatus vdp_st; -+ -+ m_mixer.Dispose(); -+ -+ CSingleLock lock(m_bufferPool.renderPicSec); -+ for (unsigned int i = 0; i < m_bufferPool.outputSurfaces.size(); ++i) -+ { -+ if (m_bufferPool.outputSurfaces[i] == VDP_INVALID_HANDLE) -+ continue; -+ -+ // check if output surface is in use -+ bool used = false; -+ std::deque::iterator it; -+ for (it = m_bufferPool.usedRenderPics.begin(); it != m_bufferPool.usedRenderPics.end(); ++it) -+ { -+ if (((*it)->sourceIdx == m_bufferPool.outputSurfaces[i]) && (*it)->valid) -+ { -+ used = true; -+ break; -+ } -+ } -+ if (used) -+ continue; -+ -+#ifdef GL_NV_vdpau_interop -+ // unmap surface -+ std::map::iterator it_map; -+ it_map = m_bufferPool.glOutputSurfaceMap.find(m_bufferPool.outputSurfaces[i]); -+ if (it_map == m_bufferPool.glOutputSurfaceMap.end()) -+ { -+ CLog::Log(LOGERROR, "%s - could not find gl surface", __FUNCTION__); -+ continue; -+ } -+ glVDPAUUnregisterSurfaceNV(it_map->second.glVdpauSurface); -+ glDeleteTextures(1, it_map->second.texture); -+ m_bufferPool.glOutputSurfaceMap.erase(it_map); -+#endif -+ -+ vdp_st = m_config.vdpProcs.vdp_output_surface_destroy(m_bufferPool.outputSurfaces[i]); -+ CheckStatus(vdp_st, __LINE__); -+ -+ m_bufferPool.outputSurfaces[i] = VDP_INVALID_HANDLE; -+ -+ CLog::Log(LOGDEBUG, "VDPAU::PreCleanup - released output surface"); -+ } -+ -+} -+ - void COutput::InitMixer() - { - for (unsigned int i = 0; i < m_bufferPool.outputSurfaces.size(); ++i) -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h -index 674571b..c0835cf 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h -@@ -286,6 +286,7 @@ class CMixer : private CThread - virtual ~CMixer(); - void Start(); - void Dispose(); -+ bool IsActive(); - CMixerControlProtocol m_controlPort; - CMixerDataProtocol m_dataPort; - protected: -@@ -454,6 +455,7 @@ class COutput : private CThread - bool DestroyGlxContext(); - bool EnsureBufferPool(); - void ReleaseBufferPool(); -+ void PreCleanup(); - void InitMixer(); - bool GLInit(); - void GLMapSurfaces(); --- -1.8.1.6 - - -From dd49526d8216e4544ec56101f62f85a5b92ee2e0 Mon Sep 17 00:00:00 2001 +From d02fb09931eb70af6b1f7ee4ecd18af7420af1e1 Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 6 Mar 2013 07:35:10 +0100 -Subject: [PATCH 016/110] vdpau: set deinterlacing method to auto, if default +Subject: [PATCH 030/111] vdpau: set deinterlacing method to auto, if default method not supported --- @@ -7733,10 +7805,10 @@ Subject: [PATCH 016/110] vdpau: set deinterlacing method to auto, if default 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 89ffc6e..b23f530 100644 +index 7a9dfc9..a2e2ab9 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -2195,13 +2195,15 @@ void CMixer::InitCycle() +@@ -2189,13 +2189,15 @@ void CMixer::InitCycle() } else { @@ -7757,58 +7829,1236 @@ index 89ffc6e..b23f530 100644 1.8.1.6 -From c5785dcbd029102df0e3bcd0e3ef071105ed6954 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sun, 21 Apr 2013 09:19:34 +0200 -Subject: [PATCH 017/110] vdpau: fix deadlock if decoder is closed while - refresh rate changes +From 4d3cf498b807eb38f21e2a4907a5f82ea7f8e21a Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Fri, 14 Jun 2013 09:23:22 +0200 +Subject: [PATCH 031/111] vdpau: calculate timestamp of second field when doing + deinterlacing --- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 9 ++------- - 1 file changed, 2 insertions(+), 7 deletions(-) + xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index b23f530..2fdcf37 100644 +index a2e2ab9..3dd6343 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -183,6 +183,8 @@ void CDecoder::Close() - { - CLog::Log(LOGNOTICE, " (VDPAU) %s", __FUNCTION__); +@@ -2312,7 +2312,9 @@ void CMixer::ProcessPicture() + futu_surfaces[0] = m_mixerInput[1].render->surface; + futu_surfaces[1] = m_mixerInput[1].render->surface; -+ g_Windowing.Unregister(this); -+ - CSingleLock lock(m_DecoderSection); +- m_processPicture.DVDPic.pts = DVD_NOPTS_VALUE; ++ m_processPicture.DVDPic.pts = m_mixerInput[1].DVDPic.pts + ++ (m_mixerInput[0].DVDPic.pts - ++ m_mixerInput[1].DVDPic.pts) / 2; + m_processPicture.DVDPic.dts = DVD_NOPTS_VALUE; + } + m_processPicture.DVDPic.iRepeatPicture = 0.0; +-- +1.8.1.6 + + +From ca6eb6900dca7e7d1ae074847b8f2c33460f844e Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Fri, 2 Aug 2013 13:57:47 +0200 +Subject: [PATCH 032/111] vdpau: comment some features that will be added later + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +index 3dd6343..e73b059 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +@@ -929,7 +929,8 @@ int CDecoder::Decode(AVCodecContext *avctx, AVFrame *pFrame) + m_bufferStats.IncDecoded(); + m_vdpauOutput.m_dataPort.SendOutMessage(COutputDataProtocol::NEWFRAME, &pic, sizeof(pic)); - FiniVDPAUOutput(); -@@ -204,13 +206,6 @@ void CDecoder::Close() - m_dllAvUtil.av_freep(&m_hwContext.bitstream_buffers); +- m_codecControl = pic.DVDPic.iFlags & (DVP_FLAG_DRAIN | DVP_FLAG_NO_POSTPROC); ++ //TODO ++ // m_codecControl = pic.DVDPic.iFlags & (DVP_FLAG_DRAIN | DVP_FLAG_NO_POSTPROC); + } + + int retval = 0; +@@ -984,7 +985,8 @@ int CDecoder::Decode(AVCodecContext *avctx, AVFrame *pFrame) + msg->Release(); + } + +- if ((m_codecControl & DVP_FLAG_DRAIN)) ++ // TODO ++ if (1) //(m_codecControl & DVP_FLAG_DRAIN)) + { + if (decoded + processed + render < 4) + { +@@ -2131,7 +2133,8 @@ void CMixer::InitCycle() + int flags; + m_config.stats->GetParams(latency, flags); + latency = (latency*1000)/CurrentHostFrequency(); +- if (flags & DVP_FLAG_NO_POSTPROC) ++ // TODO ++ if (0) //flags & DVP_FLAG_NO_POSTPROC) + SetPostProcFeatures(false); + else + SetPostProcFeatures(true); +@@ -2142,7 +2145,8 @@ void CMixer::InitCycle() + EINTERLACEMETHOD method = GetDeinterlacingMethod(); + bool interlaced = m_mixerInput[1].DVDPic.iFlags & DVP_FLAG_INTERLACED; + +- if (!(flags & DVP_FLAG_NO_POSTPROC) && ++ // TODO ++ if (//!(flags & DVP_FLAG_NO_POSTPROC) && + (mode == VS_DEINTERLACEMODE_FORCE || + (mode == VS_DEINTERLACEMODE_AUTO && interlaced))) + { +@@ -2164,7 +2168,8 @@ void CMixer::InitCycle() + m_config.stats->SetCanSkipDeint(true); + } + +- if (m_mixerInput[1].DVDPic.iFlags & DVP_FLAG_DROPDEINT) ++ // TODO ++ if (0) //m_mixerInput[1].DVDPic.iFlags & DVP_FLAG_DROPDEINT) + { + m_mixersteps = 1; + } +-- +1.8.1.6 + + +From 035e6b2965408d1bed9decb1c4883d2b6c52d3c3 Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Tue, 6 Aug 2013 10:37:37 +0200 +Subject: [PATCH 033/111] renderer: protect against div by zero + +--- + xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +index 1dbb670..fb065ea 100644 +--- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp ++++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +@@ -445,6 +445,13 @@ void CLinuxRendererGL::CalculateTextureSourceRects(int source, int num_planes) + p.rect.y2 /= 1 << im->cshift_y; + } + ++ // protect against division by zero ++ if (p.texheight == 0 || p.texwidth == 0 || ++ p.pixpertex_x == 0 || p.pixpertex_y == 0) ++ { ++ continue; ++ } ++ + p.height /= p.pixpertex_y; + p.rect.y1 /= p.pixpertex_y; + p.rect.y2 /= p.pixpertex_y; +-- +1.8.1.6 + + +From 1b6c3ea6e6a258598bb3594266b2a50b008f9367 Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Fri, 9 Aug 2013 09:52:46 +0200 +Subject: [PATCH 034/111] vdpau: add fence for detecting when a buffer can be + reused + +--- + xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 11 ++ + xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 155 +++++++++++++++++++++++-- + xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h | 8 +- + 3 files changed, 161 insertions(+), 13 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +index fb065ea..7bfd892 100644 +--- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp ++++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +@@ -1245,6 +1245,17 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) + RenderSoftware(renderBuffer, m_currentField); + VerifyGLState(); + } ++ ++#ifdef HAVE_LIBVDPAU ++ if (m_format == RENDER_FMT_VDPAU || m_format == RENDER_FMT_VDPAU_420) ++ { ++ YUVBUFFER &buf = m_buffers[renderBuffer]; ++ if (buf.vdpau) ++ { ++ buf.vdpau->Sync(); ++ } ++ } ++#endif + } + + void CLinuxRendererGL::RenderSinglePass(int index, int field) +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +index e73b059..7f0fbd0 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +@@ -1135,6 +1135,23 @@ void CVdpauRenderPicture::ReturnUnused() + if (vdpau) + vdpau->ReturnRenderPicture(this); + } ++ ++void CVdpauRenderPicture::Sync() ++{ ++#ifdef GL_ARB_sync ++ CSingleLock lock(renderPicSection); ++ if (usefence) ++ { ++ if(glIsSync(fence)) ++ { ++ glDeleteSync(fence); ++ fence = None; ++ } ++ fence = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); ++ } ++#endif ++} ++ + //----------------------------------------------------------------------------- + // Mixer + //----------------------------------------------------------------------------- +@@ -2516,7 +2533,7 @@ void COutput::StateMachine(int signal, Protocol *port, Message *msg) + case COutputDataProtocol::RETURNPIC: + CVdpauRenderPicture *pic; + pic = *((CVdpauRenderPicture**)msg->data); +- ProcessReturnPicture(pic); ++ QueueReturnPicture(pic); + return; + default: + break; +@@ -2607,7 +2624,7 @@ void COutput::StateMachine(int signal, Protocol *port, Message *msg) + case COutputDataProtocol::RETURNPIC: + CVdpauRenderPicture *pic; + pic = *((CVdpauRenderPicture**)msg->data); +- ProcessReturnPicture(pic); ++ QueueReturnPicture(pic); + m_controlPort.SendInMessage(COutputControlProtocol::STATS); + m_state = O_TOP_CONFIGURED_WORK; + m_extTimeout = 0; +@@ -2639,6 +2656,10 @@ void COutput::StateMachine(int signal, Protocol *port, Message *msg) + switch (signal) + { + case COutputControlProtocol::TIMEOUT: ++ if (ProcessSyncPicture()) ++ m_extTimeout = 10; ++ else ++ m_extTimeout = 100; + return; + default: + break; +@@ -2830,7 +2851,7 @@ void COutput::Flush() + { + CVdpauRenderPicture *pic; + pic = *((CVdpauRenderPicture**)msg->data); +- ProcessReturnPicture(pic); ++ QueueReturnPicture(pic); + } + msg->Release(); + } +@@ -2841,7 +2862,7 @@ void COutput::Flush() + { + CVdpauRenderPicture *pic; + pic = *((CVdpauRenderPicture**)msg->data); +- ProcessReturnPicture(pic); ++ QueueReturnPicture(pic); + } + } + +@@ -2969,7 +2990,7 @@ CVdpauRenderPicture* COutput::ProcessMixerPicture() + return retPic; + } + +-void COutput::ProcessReturnPicture(CVdpauRenderPicture *pic) ++void COutput::QueueReturnPicture(CVdpauRenderPicture *pic) + { + std::deque::iterator it; + for (it = m_bufferPool.usedRenderPics.begin(); it != m_bufferPool.usedRenderPics.end(); ++it) +@@ -2982,17 +3003,84 @@ void COutput::ProcessReturnPicture(CVdpauRenderPicture *pic) + + if (it == m_bufferPool.usedRenderPics.end()) + { +- CLog::Log(LOGWARNING, "COutput::ProcessReturnPicture - pic not found"); ++ CLog::Log(LOGWARNING, "COutput::QueueReturnPicture - pic not found"); + return; + } +- m_bufferPool.freeRenderPics.push_back(*it); +- m_bufferPool.usedRenderPics.erase(it); +- if (!pic->valid) ++ ++ // check if already queued ++ std::deque::iterator it2 = find(m_bufferPool.syncRenderPics.begin(), ++ m_bufferPool.syncRenderPics.end(), ++ *it); ++ if (it2 == m_bufferPool.syncRenderPics.end()) + { +- CLog::Log(LOGDEBUG, "COutput::%s - return of invalid render pic", __FUNCTION__); +- return; ++ m_bufferPool.syncRenderPics.push_back(*it); + } + ++ ProcessSyncPicture(); ++} ++ ++bool COutput::ProcessSyncPicture() ++{ ++ CVdpauRenderPicture *pic; ++ bool busy = false; ++ ++ std::deque::iterator it; ++ for (it = m_bufferPool.syncRenderPics.begin(); it != m_bufferPool.syncRenderPics.end(); ) ++ { ++ pic = m_bufferPool.allRenderPics[*it]; ++ ++#ifdef GL_ARB_sync ++ if (pic->usefence) ++ { ++ if (glIsSync(pic->fence)) ++ { ++ GLint state; ++ GLsizei length; ++ glGetSynciv(pic->fence, GL_SYNC_STATUS, 1, &length, &state); ++ if(state == GL_SIGNALED) ++ { ++ glDeleteSync(pic->fence); ++ pic->fence = None; ++ } ++ else ++ { ++ busy = true; ++ ++it; ++ continue; ++ } ++ } ++ } ++#endif ++ ++ m_bufferPool.freeRenderPics.push_back(*it); ++ ++ std::deque::iterator it2 = find(m_bufferPool.usedRenderPics.begin(), ++ m_bufferPool.usedRenderPics.end(), ++ *it); ++ if (it2 == m_bufferPool.usedRenderPics.end()) ++ { ++ CLog::Log(LOGERROR, "COutput::ProcessSyncPicture - pic not found in queue"); ++ } ++ else ++ { ++ m_bufferPool.usedRenderPics.erase(it2); ++ } ++ it = m_bufferPool.syncRenderPics.erase(it); ++ ++ if (pic->valid) ++ { ++ ProcessReturnPicture(pic); ++ } ++ else ++ { ++ CLog::Log(LOGDEBUG, "COutput::%s - return of invalid render pic", __FUNCTION__); ++ } ++ } ++ return busy; ++} ++ ++void COutput::ProcessReturnPicture(CVdpauRenderPicture *pic) ++{ + if (m_config.usePixmaps) + { + m_bufferPool.pixmaps[pic->sourceIdx].used = false; +@@ -3141,10 +3229,43 @@ void COutput::ReleaseBufferPool() + } + m_bufferPool.outputSurfaces.clear(); + ++ // wait for all fences ++ XbmcThreads::EndTime timeout(1000); ++ for (int i = 0; i < m_bufferPool.allRenderPics.size(); i++) ++ { ++ CVdpauRenderPicture *pic = m_bufferPool.allRenderPics[i]; ++ if (pic->usefence) ++ { ++#ifdef GL_ARB_sync ++ while (glIsSync(pic->fence)) ++ { ++ GLint state; ++ GLsizei length; ++ glGetSynciv(pic->fence, GL_SYNC_STATUS, 1, &length, &state); ++ if(state == GL_SIGNALED || timeout.IsTimePast()) ++ { ++ glDeleteSync(pic->fence); ++ } ++ else ++ { ++ Sleep(5); ++ } ++ } ++ pic->fence = None; ++#endif ++ } ++ } ++ if (timeout.IsTimePast()) ++ { ++ CLog::Log(LOGERROR, "COutput::%s - timeout waiting for fence", __FUNCTION__); ++ } ++ ProcessSyncPicture(); ++ + // invalidate all used render pictures + for (unsigned int i = 0; i < m_bufferPool.usedRenderPics.size(); ++i) + { +- m_bufferPool.allRenderPics[m_bufferPool.usedRenderPics[i]]->valid = false; ++ CVdpauRenderPicture *pic = m_bufferPool.allRenderPics[m_bufferPool.usedRenderPics[i]]; ++ pic->valid = false; + } + } + +@@ -3154,6 +3275,7 @@ void COutput::PreCleanup() + VdpStatus vdp_st; + + m_mixer.Dispose(); ++ ProcessSyncPicture(); + + CSingleLock lock(m_bufferPool.renderPicSec); + for (unsigned int i = 0; i < m_bufferPool.outputSurfaces.size(); ++i) +@@ -3360,6 +3482,15 @@ bool COutput::GLInit() + CLog::Log(LOGNOTICE, "VDPAU::COutput: vdpau gl interop initialized"); + } + #endif ++ ++#ifdef GL_ARB_sync ++ bool hasfence = glewIsSupported("GL_ARB_sync"); ++ for (unsigned int i = 0; i < m_bufferPool.allRenderPics.size(); i++) ++ { ++ m_bufferPool.allRenderPics[i]->usefence = hasfence; ++ } ++#endif ++ + return true; + } + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h +index 8845a16..c555d2d 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h +@@ -224,7 +224,8 @@ class CVdpauRenderPicture + friend class COutput; + public: + CVdpauRenderPicture(CCriticalSection §ion) +- : renderPicSection(section), refCount(0) {} ++ : renderPicSection(section), refCount(0) { fence = None; } ++ void Sync(); + DVDVideoPicture DVDPic; + int texWidth, texHeight; + CRect crop; +@@ -236,6 +237,8 @@ class CVdpauRenderPicture + long Release(); + private: + void ReturnUnused(); ++ bool usefence; ++ GLsync fence; + int refCount; + CCriticalSection &renderPicSection; + }; +@@ -391,6 +394,7 @@ struct VdpauBufferPool + std::queue processedPics; + std::deque usedRenderPics; + std::deque freeRenderPics; ++ std::deque syncRenderPics; + CCriticalSection renderPicSec; + }; + +@@ -450,7 +454,9 @@ class COutput : private CThread + void StateMachine(int signal, Protocol *port, Message *msg); + bool HasWork(); + CVdpauRenderPicture *ProcessMixerPicture(); ++ void QueueReturnPicture(CVdpauRenderPicture *pic); + void ProcessReturnPicture(CVdpauRenderPicture *pic); ++ bool ProcessSyncPicture(); + int FindFreePixmap(); + bool Init(); + bool Uninit(); +-- +1.8.1.6 + + +From 522296f5fccdd7297e30a97dbb9ebe83f05a8236 Mon Sep 17 00:00:00 2001 +From: xbmc +Date: Mon, 28 May 2012 10:34:39 +0200 +Subject: [PATCH 035/111] 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 ++++ + .../DVDCodecs/Video/DVDVideoCodecFFmpeg.h | 7 + + xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 194 +++++++++++++++++---- + xbmc/cores/dvdplayer/DVDPlayerVideo.h | 23 +++ + 7 files changed, 260 insertions(+), 38 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp +index fbc2aae..ae610ca 100644 +--- a/xbmc/cores/VideoRenderers/RenderManager.cpp ++++ b/xbmc/cores/VideoRenderers/RenderManager.cpp +@@ -299,6 +299,8 @@ bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsi + m_bIsStarted = true; + m_bReconfigured = true; + m_presentstep = PRESENT_IDLE; ++ m_presentpts = DVD_NOPTS_VALUE; ++ m_sleeptime = 1.0; + m_presentevent.notifyAll(); + + m_firstFlipPage = false; // tempfix +@@ -640,7 +642,7 @@ void CXBMCRenderManager::SetViewMode(int iViewMode) + m_pRenderer->SetViewMode(iViewMode); + } + +-void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0LL*/, int source /*= -1*/, EFIELDSYNC sync /*= FS_NONE*/) ++void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0LL*/, double pts /* = 0 */, int source /*= -1*/, EFIELDSYNC sync /*= FS_NONE*/) + { + { CSharedLock lock(m_sharedSection); + +@@ -708,6 +710,7 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L + m.timestamp = timestamp; + m.presentfield = sync; + m.presentmethod = presentmethod; ++ m.pts = pts; + requeue(m_queued, m_free); + + /* signal to any waiters to check state */ +@@ -1072,6 +1075,8 @@ void CXBMCRenderManager::PrepareNextRender() + m_discard.push_back(m_presentsource); + m_presentsource = idx; + m_queued.pop_front(); ++ m_sleeptime = m_Queue[idx].timestamp - clocktime; ++ m_presentpts = m_Queue[idx].pts; + m_presentevent.notifyAll(); + } + } +@@ -1088,3 +1093,12 @@ void CXBMCRenderManager::DiscardBuffer() + m_presentstep = PRESENT_IDLE; + m_presentevent.notifyAll(); + } ++ ++bool CXBMCRenderManager::GetStats(double &sleeptime, double &pts, int &bufferLevel) ++{ ++ CSingleLock lock(m_presentlock); ++ sleeptime = m_sleeptime; ++ pts = m_presentpts; ++ bufferLevel = m_queued.size() + m_discard.size(); ++ return true; ++} +diff --git a/xbmc/cores/VideoRenderers/RenderManager.h b/xbmc/cores/VideoRenderers/RenderManager.h +index 28596cf..befd851 100644 +--- a/xbmc/cores/VideoRenderers/RenderManager.h ++++ b/xbmc/cores/VideoRenderers/RenderManager.h +@@ -97,10 +97,11 @@ class CXBMCRenderManager + * + * @param bStop reference to stop flag of calling thread + * @param timestamp of frame delivered with AddVideoPicture ++ * @param pts used for lateness detection + * @param source depreciated + * @param sync signals frame, top, or bottom field + */ +- void FlipPage(volatile bool& bStop, double timestamp = 0.0, int source = -1, EFIELDSYNC sync = FS_NONE); ++ void FlipPage(volatile bool& bStop, double timestamp = 0.0, double pts = 0.0, int source = -1, EFIELDSYNC sync = FS_NONE); + unsigned int PreInit(); + void UnInit(); + bool Flush(); +@@ -175,6 +176,12 @@ class CXBMCRenderManager + int WaitForBuffer(volatile bool& bStop, int timeout = 100); + + /** ++ * Can be called by player for lateness detection. This is done best by ++ * looking at the end of the queue. ++ */ ++ bool GetStats(double &sleeptime, double &pts, int &bufferLevel); ++ ++ /** + * Video player call this on flush in oder to discard any queued frames + */ + void DiscardBuffer(); +@@ -221,6 +228,7 @@ class CXBMCRenderManager + + struct SPresent + { ++ double pts; + double timestamp; + EFIELDSYNC presentfield; + EPRESENTMETHOD presentmethod; +@@ -232,6 +240,8 @@ class CXBMCRenderManager + + ERenderFormat m_format; + ++ double m_sleeptime; ++ double m_presentpts; + double m_presentcorr; + 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 87edaa5..eaac7fd 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h +@@ -117,6 +117,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 ++ + // DVP_FLAG 0x00000100 - 0x00000f00 is in use by libmpeg2! + + #define DVP_QSCALE_UNKNOWN 0 +@@ -134,6 +138,9 @@ struct DVDVideoUserData + #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: +@@ -251,10 +258,16 @@ class CDVDVideoCodec + return 0; } -- g_Windowing.Unregister(this); - -- if (m_hwContext.bitstream_buffers_allocated) + /** + * Number of references to old pictures that are allowed to + * be retained when calling decode on the next demux packet + */ + virtual unsigned GetAllowedReferences() { return 0; } ++ ++ virtual bool GetPts(double &pts, int &skippedDeint, int &interlaced) ++ { ++ return false; ++ } ++ ++ virtual void SetCodecControl(int flags) {} + }; +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +index 143675a..b53c17a 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +@@ -167,6 +167,7 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx + m_iLastKeyframe = 0; + m_dts = DVD_NOPTS_VALUE; + m_started = false; ++ m_decoderPts = DVD_NOPTS_VALUE; + } + + CDVDVideoCodecFFmpeg::~CDVDVideoCodecFFmpeg() +@@ -353,6 +354,14 @@ void CDVDVideoCodecFFmpeg::SetDropState(bool bDrop) + { + if( m_pCodecContext ) + { ++ if (bDrop && m_pHardware && m_pHardware->CanSkipDeint()) ++ { ++ m_requestSkipDeint = true; ++ bDrop = false; ++ } ++ else ++ m_requestSkipDeint = false; ++ + // i don't know exactly how high this should be set + // couldn't find any good docs on it. think it varies + // from codec to codec on what it does +@@ -554,6 +563,7 @@ int CDVDVideoCodecFFmpeg::Decode(uint8_t* pData, int iSize, double dts, double p + void CDVDVideoCodecFFmpeg::Reset() + { + m_started = false; ++ m_decoderPts = DVD_NOPTS_VALUE; + m_iLastKeyframe = m_pCodecContext->has_b_frames; + m_dllAvCodec.avcodec_flush_buffers(m_pCodecContext); + +@@ -663,6 +673,22 @@ bool CDVDVideoCodecFFmpeg::GetPictureCommon(DVDVideoPicture* pDvdVideoPicture) + else + pDvdVideoPicture->pts = DVD_NOPTS_VALUE; + ++ if (pDvdVideoPicture->pts != DVD_NOPTS_VALUE) ++ m_decoderPts = pDvdVideoPicture->pts; ++ else ++ m_decoderPts = m_dts; ++ ++ if (m_requestSkipDeint) ++ { ++ pDvdVideoPicture->iFlags |= DVP_FLAG_DROPDEINT; ++ m_skippedDeint = 1; ++ } ++ else ++ m_skippedDeint = 0; ++ ++ m_requestSkipDeint = false; ++ pDvdVideoPicture->iFlags |= m_codecControlFlags; ++ + if(!m_started) + pDvdVideoPicture->iFlags |= DVP_FLAG_DROPPED; + +@@ -924,3 +950,8 @@ unsigned CDVDVideoCodecFFmpeg::GetAllowedReferences() + else + return 0; + } ++ ++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 2287031..8376f72 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h +@@ -45,6 +45,7 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec + virtual int Check (AVCodecContext* avctx) = 0; + virtual void Reset () {} + virtual unsigned GetAllowedReferences() { return 0; } ++ virtual bool CanSkipDeint() {return false; } + virtual const std::string Name() = 0; + virtual CCriticalSection* Section() { return NULL; } + }; +@@ -62,6 +63,8 @@ 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 void SetCodecControl(int flags); + + bool IsHardwareAllowed() { return !m_bSoftware; } + IHardwareDecoder * GetHardware() { return m_pHardware; }; +@@ -127,4 +130,8 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec + double m_dts; + bool m_started; + std::vector m_formats; ++ double m_decoderPts, m_decoderInterval; ++ int m_skippedDeint; ++ bool m_requestSkipDeint; ++ int m_codecControlFlags; + }; +diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +index d35751c..487ca01 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +@@ -39,6 +39,7 @@ + #include "DVDCodecs/DVDCodecs.h" + #include "DVDCodecs/Overlay/DVDOverlayCodecCC.h" + #include "DVDCodecs/Overlay/DVDOverlaySSA.h" ++#include "guilib/GraphicContext.h" + #include + #include + #include +@@ -323,8 +324,10 @@ void CDVDPlayerVideo::Process() + + int iDropped = 0; //frames dropped in a row + bool bRequestDrop = false; ++ int iDropDirective; + + m_videoStats.Start(); ++ m_droppingStats.Reset(); + + while (!m_bStop) + { +@@ -434,6 +437,7 @@ void CDVDPlayerVideo::Process() + picture.iFlags &= ~DVP_FLAG_ALLOCATED; + m_packets.clear(); + m_started = false; ++ m_droppingStats.Reset(); + } + else if (pMsg->IsType(CDVDMsg::GENERAL_FLUSH)) // private message sent by (CDVDPlayerVideo::Flush()) + { +@@ -446,6 +450,7 @@ void CDVDPlayerVideo::Process() + //we need to recalculate the framerate + //TODO: this needs to be set on a streamchange instead + ResetFrameRateCalc(); ++ m_droppingStats.Reset(); + + m_stalled = true; + m_started = false; +@@ -463,8 +468,10 @@ void CDVDPlayerVideo::Process() + m_speed = static_cast(pMsg)->m_value; + if(m_speed == DVD_PLAYSPEED_PAUSE) + m_iNrOfPicturesNotToSkip = 0; ++ + if (m_pVideoCodec) + m_pVideoCodec->SetSpeed(m_speed); ++ m_droppingStats.Reset(); + } + else if (pMsg->IsType(CDVDMsg::PLAYER_STARTED)) + { +@@ -510,6 +517,28 @@ void CDVDPlayerVideo::Process() + m_iNrOfPicturesNotToSkip = 1; + } + ++ bRequestDrop = false; ++ iDropDirective = CalcDropRequirement(pts); ++ if (iDropDirective & EOS_VERYLATE) ++ { ++ if (m_bAllowDrop) ++ { ++ m_pullupCorrection.Flush(); ++ bRequestDrop = true; ++ } ++ } ++ int codecControl = 0; ++ if (iDropDirective & EOS_BUFFER_LEVEL) ++ codecControl |= DVP_FLAG_DRAIN; ++ if (m_speed > DVD_PLAYSPEED_NORMAL) ++ codecControl |= DVP_FLAG_NO_POSTPROC; ++ m_pVideoCodec->SetCodecControl(codecControl); ++ if (iDropDirective & EOS_DROPPED) ++ { ++ m_iDroppedFrames++; ++ iDropped++; ++ } ++ + if (m_messageQueue.GetDataSize() == 0 + || m_speed < 0) + { +@@ -562,15 +591,7 @@ void CDVDPlayerVideo::Process() + } + + m_videoStats.AddSampleBytes(pPacket->iSize); +- // assume decoder dropped a picture if it didn't give us any +- // picture from a demux packet, this should be reasonable +- // for libavformat as a demuxer as it normally packetizes +- // pictures when they come from demuxer +- if(bRequestDrop && !bPacketDrop && (iDecoderState & VC_BUFFER) && !(iDecoderState & VC_PICTURE)) +- { +- m_iDroppedFrames++; +- iDropped++; +- } ++ + // reset the request, the following while loop may break before + // setting the flag to a new value + bRequestDrop = false; +@@ -1182,33 +1203,12 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) + m_FlipTimeStamp += max(0.0, iSleepTime); + m_FlipTimeStamp += iFrameDuration; + +- if (iSleepTime <= 0 && m_speed) +- m_iLateFrames++; +- else +- m_iLateFrames = 0; +- +- // ask decoder to drop frames next round, as we are very late +- if(m_iLateFrames > 10) ++ if ((pPicture->iFlags & DVP_FLAG_DROPPED)) + { +- if (!(pPicture->iFlags & DVP_FLAG_NOSKIP)) +- { +- //if we're calculating the framerate, +- //don't drop frames until we've calculated a stable framerate +- if (m_bAllowDrop || m_speed != DVD_PLAYSPEED_NORMAL) +- { +- result |= EOS_VERYLATE; +- m_pullupCorrection.Flush(); //dropped frames mess up the pattern, so just flush it +- } +- m_iDroppedRequest++; +- } +- } +- else - { -- m_dllAvUtil.av_freep(&m_hwContext.bitstream_buffers); +- m_iDroppedRequest = 0; - } - - m_dllAvUtil.Unload(); +- if( (pPicture->iFlags & DVP_FLAG_DROPPED) ) ++ m_droppingStats.AddOutputDropGain(pts, 1/m_fFrameRate); ++ CLog::Log(LOGDEBUG,"%s - dropped in output", __FUNCTION__); + return result | EOS_DROPPED; ++ } + + // set fieldsync if picture is interlaced + EFIELDSYNC mDisplayField = FS_NONE; +@@ -1241,7 +1241,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) + if (index < 0) + return EOS_DROPPED; + +- g_renderManager.FlipPage(CThread::m_bStop, (iCurrentClock + iSleepTime) / DVD_TIME_BASE, -1, mDisplayField); ++ g_renderManager.FlipPage(CThread::m_bStop, (iCurrentClock + iSleepTime) / DVD_TIME_BASE, pts, -1, mDisplayField); + + return result; + #else +@@ -1541,3 +1541,127 @@ void CDVDPlayerVideo::CalcFrameRate() + m_iFrameRateCount = 0; + } } ++ ++int CDVDPlayerVideo::CalcDropRequirement(double pts) ++{ ++ int result = 0; ++ double iSleepTime; ++ double iDecoderPts, iRenderPts; ++ double iInterval; ++ int interlaced; ++ double iGain; ++ double iLateness; ++ bool bNewFrame; ++ int iSkippedDeint = 0; ++ int iBufferLevel; ++ ++ // get decoder stats ++ if (!m_pVideoCodec->GetPts(iDecoderPts, iSkippedDeint, interlaced)) ++ iDecoderPts = pts; ++ if (iDecoderPts == DVD_NOPTS_VALUE) ++ iDecoderPts = pts; ++ ++ // get render stats ++ g_renderManager.GetStats(iSleepTime, iRenderPts, iBufferLevel); ++ ++ if (iBufferLevel < 0) ++ result |= EOS_BUFFER_LEVEL; ++ else if (iBufferLevel < 2) ++ { ++ result |= EOS_BUFFER_LEVEL; ++ CLog::Log(LOGDEBUG,"CDVDPlayerVideo::CalcDropRequirement - hurry: %d", iBufferLevel); ++ } ++ ++ bNewFrame = iDecoderPts != m_droppingStats.m_lastDecoderPts; ++ ++ if (interlaced) ++ iInterval = 2/m_fFrameRate*(double)DVD_TIME_BASE; ++ else ++ iInterval = 1/m_fFrameRate*(double)DVD_TIME_BASE; ++ ++ if (m_droppingStats.m_lastDecoderPts > 0 ++ && bNewFrame ++ && m_bAllowDrop ++ && m_droppingStats.m_dropRequests > 0) ++ { ++ iGain = (iDecoderPts - m_droppingStats.m_lastDecoderPts - iInterval)/(double)DVD_TIME_BASE; ++ if (iSkippedDeint) ++ { ++ CDroppingStats::CGain gain; ++ gain.gain = 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); ++ } ++ else if (iGain > 1/m_fFrameRate) ++ { ++ CDroppingStats::CGain gain; ++ gain.gain = iGain; ++ gain.pts = iDecoderPts; ++ m_droppingStats.m_gain.push_back(gain); ++ m_droppingStats.m_totalGain += iGain; ++ result |= EOS_DROPPED; ++ m_droppingStats.m_dropRequests = 0; ++ CLog::Log(LOGDEBUG,"CDVDPlayerVideo::CalcDropRequirement - dropped in decoder, Sleeptime: %f, Bufferlevel: %d, Gain: %f", iSleepTime, iBufferLevel, iGain); ++ } ++ } ++ m_droppingStats.m_lastDecoderPts = iDecoderPts; ++ ++ // subtract gains ++ while (!m_droppingStats.m_gain.empty() && ++ iRenderPts >= m_droppingStats.m_gain.front().pts) ++ { ++ m_droppingStats.m_totalGain -= m_droppingStats.m_gain.front().gain; ++ m_droppingStats.m_gain.pop_front(); ++ } ++ ++ // calculate lateness ++ iLateness = iSleepTime + m_droppingStats.m_totalGain; ++ if (iLateness < 0 && m_speed) ++ { ++ if (bNewFrame) ++ m_droppingStats.m_lateFrames++; ++ ++ // if lateness is smaller than frametime, we observe this state ++ // for 10 cycles ++ if (m_droppingStats.m_lateFrames > 10 || iLateness < -2/m_fFrameRate) ++ { ++ // is frame allowed to skip ++ if (m_iNrOfPicturesNotToSkip <= 0) ++ { ++ result |= EOS_VERYLATE; ++ if (bNewFrame) ++ m_droppingStats.m_dropRequests++; ++ } ++ } ++ } ++ else ++ { ++ m_droppingStats.m_dropRequests = 0; ++ m_droppingStats.m_lateFrames = 0; ++ } ++ m_droppingStats.m_lastRenderPts = iRenderPts; ++ return result; ++} ++ ++void CDroppingStats::Reset() ++{ ++ m_gain.clear(); ++ m_totalGain = 0; ++ m_lastDecoderPts = 0; ++ m_lastRenderPts = 0; ++ m_lateFrames = 0; ++ m_dropRequests = 0; ++} ++ ++void CDroppingStats::AddOutputDropGain(double pts, double frametime) ++{ ++ CDroppingStats::CGain gain; ++ gain.gain = frametime; ++ gain.pts = pts; ++ m_gain.push_back(gain); ++ m_totalGain += frametime; ++} +diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.h b/xbmc/cores/dvdplayer/DVDPlayerVideo.h +index f8ad541..186e271 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerVideo.h ++++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.h +@@ -36,6 +36,25 @@ + + #define VIDEO_PICTURE_QUEUE_SIZE 1 + ++class CDroppingStats ++{ ++public: ++ void Reset(); ++ void AddOutputDropGain(double pts, double frametime); ++ struct CGain ++ { ++ double gain; ++ double pts; ++ }; ++ std::deque m_gain; ++ double m_totalGain; ++ double m_lastDecoderPts; ++ double m_lastRenderPts; ++ unsigned int m_lateFrames; ++ unsigned int m_dropRequests; ++}; ++ ++ + class CDVDPlayerVideo : public CThread + { + public: +@@ -104,6 +123,7 @@ class CDVDPlayerVideo : public CThread + #define EOS_ABORT 1 + #define EOS_DROPPED 2 + #define EOS_VERYLATE 4 ++#define EOS_BUFFER_LEVEL 8 + + void AutoCrop(DVDVideoPicture* pPicture); + void AutoCrop(DVDVideoPicture *pPicture, RECT &crop); +@@ -129,6 +149,7 @@ class CDVDPlayerVideo : public CThread + + void ResetFrameRateCalc(); + void CalcFrameRate(); ++ int CalcDropRequirement(double pts); + + double m_fFrameRate; //framerate of the video currently playing + bool m_bCalcFrameRate; //if we should calculate the framerate from the timestamps +@@ -182,5 +203,7 @@ class CDVDPlayerVideo : public CThread + CPullupCorrection m_pullupCorrection; + + std::list m_packets; ++ ++ CDroppingStats m_droppingStats; + }; -- 1.8.1.6 -From a8f89679a150db3f6d9e11dbe214de888b373546 Mon Sep 17 00:00:00 2001 +From 76318b7f4bc0202f545a39563f1f72dc1eeaf5f4 Mon Sep 17 00:00:00 2001 +From: xbmc +Date: Sun, 2 Sep 2012 16:05:21 +0200 +Subject: [PATCH 036/111] 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.h | 2 +- + 2 files changed, 26 insertions(+), 1 deletion(-) + +diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +index 487ca01..99c8b3c 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +@@ -1461,6 +1461,22 @@ void CDVDPlayerVideo::ResetFrameRateCalc() + g_advancedSettings.m_videoFpsDetect == 0; + } + ++double CDVDPlayerVideo::GetCurrentPts() ++{ ++ double iSleepTime, iRenderPts; ++ int iBufferLevel; ++ ++ // get render stats ++ g_renderManager.GetStats(iSleepTime, iRenderPts, iBufferLevel); ++ ++ if( m_stalled ) ++ iRenderPts = DVD_NOPTS_VALUE; ++ else ++ iRenderPts = iRenderPts - max(0.0, iSleepTime); ++ ++ return iRenderPts; ++} ++ + #define MAXFRAMERATEDIFF 0.01 + #define MAXFRAMESERR 1000 + +@@ -1579,6 +1595,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 ++++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.h +@@ -100,7 +100,7 @@ class CDVDPlayerVideo : public CThread + + bool InitializedOutputDevice(); + +- double GetCurrentPts() { return m_iCurrentPts; } ++ double GetCurrentPts(); + int GetPullupCorrection() { return m_pullupCorrection.GetPatternLength(); } + + double GetOutputDelay(); /* returns the expected delay, from that a packet is put in queue */ +-- +1.8.1.6 + + +From 2c978a3390d2cfcd0b728efcb977485b329b6568 Mon Sep 17 00:00:00 2001 +From: xbmc +Date: Sat, 16 Feb 2013 18:25:53 +0100 +Subject: [PATCH 037/111] videoplayer: some rework and documentation + +--- + .../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 29 ++++++++++++++++++++-- + .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 11 ++++++++ + .../DVDCodecs/Video/DVDVideoCodecFFmpeg.h | 2 +- + xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 2 +- + 4 files changed, 40 insertions(+), 4 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h +index eaac7fd..d358777 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h +@@ -139,7 +139,6 @@ struct DVDVideoUserData + #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 + { +@@ -264,10 +263,36 @@ class CDVDVideoCodec + */ + virtual unsigned GetAllowedReferences() { return 0; } + +- 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 b53c17a..9f1fc03 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +@@ -951,6 +951,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 8376f72..c0ce198 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h +@@ -63,7 +63,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 99c8b3c..be3d511 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +@@ -1572,7 +1572,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.8.1.6 + + +From d2886a5d3e6a639e828eadc44bcf84f3fd09325b Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sat, 1 Jun 2013 11:21:19 +0200 -Subject: [PATCH 018/110] renderer: bump buffers to 5 +Subject: [PATCH 038/111] 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 6acf2f3..f44024c 100644 +index a61d3cf..df5fe0e 100644 --- a/xbmc/cores/VideoRenderers/BaseRenderer.h +++ b/xbmc/cores/VideoRenderers/BaseRenderer.h @@ -29,7 +29,7 @@ @@ -7824,10 +9074,10 @@ index 6acf2f3..f44024c 100644 1.8.1.6 -From 152844f66eeca185da6982d9e7e66a2ae5a502da Mon Sep 17 00:00:00 2001 +From 5d2b6497e63d417e2547ca9e32a7dcc639c9911c Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:41:31 +0200 -Subject: [PATCH 019/110] videoplayer: update frametime, it might change due to +Subject: [PATCH 039/111] videoplayer: update frametime, it might change due to fps detection --- @@ -7835,10 +9085,10 @@ Subject: [PATCH 019/110] 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 8ed34f9..bc049bd 100644 +index be3d511..dbbd11b 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -708,6 +708,8 @@ void CDVDPlayerVideo::Process() +@@ -711,6 +711,8 @@ void CDVDPlayerVideo::Process() int iResult = OutputPicture(&picture, pts); @@ -7851,10 +9101,10 @@ index 8ed34f9..bc049bd 100644 1.8.1.6 -From 4375b9a0c7e7e12f5f7d5d7dfd8319b26c4f1490 Mon Sep 17 00:00:00 2001 +From 7a7479ea9632e37579d09511cdafb936d326b2f0 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:43:06 +0200 -Subject: [PATCH 020/110] videoplayer: give streams with invalid fps a chance +Subject: [PATCH 040/111] videoplayer: give streams with invalid fps a chance for fps detection --- @@ -7862,10 +9112,10 @@ Subject: [PATCH 020/110] videoplayer: give streams with invalid fps a chance 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index bc049bd..21d023e 100644 +index dbbd11b..eb443af 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1500,7 +1500,7 @@ void CDVDPlayerVideo::CalcFrameRate() +@@ -1503,7 +1503,7 @@ void CDVDPlayerVideo::CalcFrameRate() double frameduration = m_pullupCorrection.GetFrameDuration(); if (frameduration == DVD_NOPTS_VALUE || @@ -7878,10 +9128,10 @@ index bc049bd..21d023e 100644 1.8.1.6 -From a217254277fdd441c31713bcdad816d72263da4e Mon Sep 17 00:00:00 2001 +From 9ba3949b7c7d86ae5d16587d36d954b628a0db24 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:49:05 +0200 -Subject: [PATCH 021/110] dvdplayer: allow rewinding at end of stream, do a +Subject: [PATCH 041/111] dvdplayer: allow rewinding at end of stream, do a seek after rewind --- @@ -7889,10 +9139,10 @@ Subject: [PATCH 021/110] dvdplayer: allow rewinding at end of stream, do a 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 27e9ff1..1bd122b 100644 +index d12121f..06c9439 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -1556,7 +1556,7 @@ void CDVDPlayer::HandlePlaySpeed() +@@ -1559,7 +1559,7 @@ void CDVDPlayer::HandlePlaySpeed() } else if (m_CurrentVideo.id >= 0 @@ -7901,7 +9151,7 @@ index 27e9ff1..1bd122b 100644 && m_SpeedState.lastpts != m_dvdPlayerVideo.GetCurrentPts() && m_SpeedState.lasttime != GetTime()) { -@@ -2222,6 +2222,12 @@ void CDVDPlayer::HandleMessages() +@@ -2225,6 +2225,12 @@ void CDVDPlayer::HandleMessages() pvrinputstream->Pause( speed == 0 ); } @@ -7918,10 +9168,10 @@ index 27e9ff1..1bd122b 100644 1.8.1.6 -From 1e02fb0d7f844b722743ea37f2984f5595b38e3a Mon Sep 17 00:00:00 2001 +From cc9082cea16fe56f6ef2a09349784f0070ca14bc Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 15:22:05 +0200 -Subject: [PATCH 022/110] X11: ditch SDL for video and window events +Subject: [PATCH 042/111] X11: ditch SDL for video and window events --- xbmc/Application.cpp | 2 +- @@ -7937,10 +9187,10 @@ Subject: [PATCH 022/110] X11: ditch SDL for video and window events create mode 100644 xbmc/windowing/WinEventsX11.h diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index b4fa73b..55a2685 100644 +index 57aa100..92e467d 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -845,7 +845,7 @@ bool CApplication::CreateGUI() +@@ -855,7 +855,7 @@ bool CApplication::CreateGUI() uint32_t sdlFlags = 0; @@ -9405,10 +10655,10 @@ index b6b6ec4..448a1bb 100644 1.8.1.6 -From 629aa294a77faa2a9165909ee7750039d997396e Mon Sep 17 00:00:00 2001 +From 00e253a6d5ac1702d59f5c1616fbc38972e2f68a Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 15:24:22 +0200 -Subject: [PATCH 023/110] X11: Add xbmc icon +Subject: [PATCH 043/111] X11: Add xbmc icon --- xbmc/windowing/X11/WinSystemX11.cpp | 126 +++++++++++++++++++++++++++++++++++- @@ -9597,10 +10847,10 @@ index 448a1bb..e618268 100644 1.8.1.6 -From aa580c081b65e5697123a70c128c35a32701ec0b Mon Sep 17 00:00:00 2001 +From dff100069b17cc5d595d542da1b0fe69f9ede738 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 20 May 2012 14:11:26 +0200 -Subject: [PATCH 024/110] X11: add SDL joystick until we have a better solution +Subject: [PATCH 044/111] X11: add SDL joystick until we have a better solution --- xbmc/windowing/WinEventsX11.cpp | 26 ++++++++++++++++++++++++++ @@ -9654,10 +10904,10 @@ index 5a8bbb8..5bc1de0 100644 1.8.1.6 -From d7ec27990c479ef980236e7a20a40bb8f7be791a Mon Sep 17 00:00:00 2001 +From e57226830ca3639cde456f782c3eeaeb89042cf0 Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Thu, 5 Jul 2012 12:35:55 +0200 -Subject: [PATCH 025/110] X11: factor out code handling device reset +Subject: [PATCH 045/111] X11: factor out code handling device reset notification --- @@ -9721,10 +10971,10 @@ index e618268..c4d4b76 100644 1.8.1.6 -From 7a15d6da19afaa671225156f8364b289a78ad677 Mon Sep 17 00:00:00 2001 +From c63da366bbbbb77484758d20b4d1008d5b2de2a8 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 15:02:00 +0200 -Subject: [PATCH 026/110] X11: move xrandr events to WinEventsX11 +Subject: [PATCH 046/111] X11: move xrandr events to WinEventsX11 --- xbmc/windowing/WinEventsX11.cpp | 42 +++++++++++++++++++++++++++++++++++++ @@ -9868,10 +11118,10 @@ index c5938af..9f74dd5 100644 1.8.1.6 -From c3f7dcc65a38d830f80937011e03aa936ab459a8 Mon Sep 17 00:00:00 2001 +From 78313aa1729974e0e3306213ff71b8671b2d4b3b Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 12 Apr 2012 15:43:56 +0200 -Subject: [PATCH 027/110] xrandr: remove method RestoreState +Subject: [PATCH 047/111] xrandr: remove method RestoreState --- xbmc/windowing/X11/WinSystemX11.cpp | 13 +++++++++++-- @@ -9950,10 +11200,10 @@ index 0aec487..00b49dc 100644 1.8.1.6 -From 15e2791c6a56f086182134662fca12e2b6ce7bcc Mon Sep 17 00:00:00 2001 +From d7d3e323aedad05c8f318a4b3dc429175a70873a Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 20 May 2012 13:17:10 +0200 -Subject: [PATCH 028/110] xrandr: observe orientation +Subject: [PATCH 048/111] xrandr: observe orientation --- xbmc/windowing/X11/WinSystemX11.cpp | 89 ++++++++++++++++++++++++++++++------- @@ -10168,10 +11418,10 @@ index 00b49dc..508604d 100644 1.8.1.6 -From 4211de0e0358648ef50f9449c496757081b7671a Mon Sep 17 00:00:00 2001 +From bc51bb36ca7fbe2626f244767cfd58dc5b22c235 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 11:54:15 +0200 -Subject: [PATCH 029/110] xrandr: allow getting info for multiple screen's +Subject: [PATCH 049/111] xrandr: allow getting info for multiple screen's Refactored by: Joakim Plate --- @@ -10346,10 +11596,10 @@ index 508604d..d37838a 100644 1.8.1.6 -From 752269938c1f15620b39d7473236252eaf8a9ebf Mon Sep 17 00:00:00 2001 +From 11a6b3ebd99e492bcac8072e2daf114fea33d2c1 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 11:44:00 +0200 -Subject: [PATCH 030/110] X11: fix multi-head setups +Subject: [PATCH 050/111] X11: fix multi-head setups --- language/English/strings.po | 4 +- @@ -10364,7 +11614,7 @@ Subject: [PATCH 030/110] X11: fix multi-head setups 9 files changed, 229 insertions(+), 116 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index fae2505..ce56914 100644 +index 0e900ad..90fb3fd 100644 --- a/language/English/strings.po +++ b/language/English/strings.po @@ -999,7 +999,9 @@ msgctxt "#245" @@ -10379,10 +11629,10 @@ index fae2505..ce56914 100644 msgctxt "#247" msgid "Scripts" diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 56d637d..f99ba9c 100644 +index 04c521d..a0a1a5b 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml -@@ -1863,6 +1863,15 @@ +@@ -1870,6 +1870,15 @@
@@ -10398,7 +11648,7 @@ index 56d637d..f99ba9c 100644 0 0 -@@ -1884,6 +1893,7 @@ +@@ -1891,6 +1900,7 @@ -1 @@ -10406,7 +11656,7 @@ index 56d637d..f99ba9c 100644 -@@ -1901,6 +1911,7 @@ +@@ -1908,6 +1918,7 @@ -1 @@ -10533,10 +11783,10 @@ index cc4002b..d80f1dc 100644 protected: CDisplaySettings(); diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp -index c1d6443..1de1ac6 100644 +index 486a26c..dfa3774 100644 --- a/xbmc/settings/Settings.cpp +++ b/xbmc/settings/Settings.cpp -@@ -381,6 +381,7 @@ void CSettings::Uninitialize() +@@ -380,6 +380,7 @@ void CSettings::Uninitialize() m_settingsManager->UnregisterSettingOptionsFiller("screens"); m_settingsManager->UnregisterSettingOptionsFiller("stereoscopicmodes"); m_settingsManager->UnregisterSettingOptionsFiller("preferedstereoscopicviewmodes"); @@ -10544,7 +11794,7 @@ index c1d6443..1de1ac6 100644 m_settingsManager->UnregisterSettingOptionsFiller("shutdownstates"); m_settingsManager->UnregisterSettingOptionsFiller("startupwindows"); m_settingsManager->UnregisterSettingOptionsFiller("streamlanguages"); -@@ -688,6 +689,7 @@ void CSettings::InitializeOptionFillers() +@@ -687,6 +688,7 @@ void CSettings::InitializeOptionFillers() m_settingsManager->RegisterSettingOptionsFiller("screens", CDisplaySettings::SettingOptionsScreensFiller); m_settingsManager->RegisterSettingOptionsFiller("stereoscopicmodes", CDisplaySettings::SettingOptionsStereoscopicModesFiller); m_settingsManager->RegisterSettingOptionsFiller("preferedstereoscopicviewmodes", CDisplaySettings::SettingOptionsPreferredStereoscopicViewModesFiller); @@ -10552,7 +11802,7 @@ index c1d6443..1de1ac6 100644 m_settingsManager->RegisterSettingOptionsFiller("shutdownstates", CPowerManager::SettingOptionsShutdownStatesFiller); m_settingsManager->RegisterSettingOptionsFiller("startupwindows", ADDON::CSkinInfo::SettingOptionsStartupWindowsFiller); m_settingsManager->RegisterSettingOptionsFiller("streamlanguages", CLangInfo::SettingOptionsStreamLanguagesFiller); -@@ -715,6 +717,9 @@ void CSettings::InitializeConditions() +@@ -714,6 +716,9 @@ void CSettings::InitializeConditions() #ifdef HAS_GL m_settingsManager->AddCondition("has_gl"); #endif @@ -10562,7 +11812,7 @@ index c1d6443..1de1ac6 100644 #ifdef HAS_GLES m_settingsManager->AddCondition("has_gles"); #endif -@@ -857,6 +862,7 @@ void CSettings::InitializeISettingCallbacks() +@@ -856,6 +861,7 @@ void CSettings::InitializeISettingCallbacks() settingSet.insert("videoscreen.screen"); settingSet.insert("videoscreen.resolution"); settingSet.insert("videoscreen.screenmode"); @@ -11118,10 +12368,10 @@ index 0727bb9..b1eb278 100644 1.8.1.6 -From 9626121cde1743a8d2ef2d51cf92592523ab8b7b Mon Sep 17 00:00:00 2001 +From 79782dac98b48a16bc5f6c7eb1c1a98bba798a56 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 11:36:32 +0200 -Subject: [PATCH 031/110] X11: remove all DefaultScreen and RootWindow macros +Subject: [PATCH 051/111] X11: remove all DefaultScreen and RootWindow macros --- xbmc/windowing/X11/WinSystemX11.cpp | 6 +++--- @@ -11189,10 +12439,10 @@ index 095012f..60a6878 100644 1.8.1.6 -From 5d281408e8eb37184e44c1f6aebf3dea09c9b952 Mon Sep 17 00:00:00 2001 +From a54ab5a3cfb1203bf5923bbedc62eb7f17bcd973 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 11:45:22 +0200 -Subject: [PATCH 032/110] X11: remove all DefaultScreen and RootWindow macros +Subject: [PATCH 052/111] X11: remove all DefaultScreen and RootWindow macros (VideoRefClock) Note this is on a separate display connection. @@ -11264,10 +12514,10 @@ index 5bf3656..0b9e7b3 100644 1.8.1.6 -From 583087348aa3e019f13df994090cadc7dd1bfbf3 Mon Sep 17 00:00:00 2001 +From 695958ee7db334a3e28b54ed210be4e6944a4311 Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 20 Jun 2012 17:37:11 +0200 -Subject: [PATCH 033/110] X11: recreate gl context after output has changed +Subject: [PATCH 053/111] X11: recreate gl context after output has changed --- xbmc/windowing/X11/WinSystemX11.cpp | 24 ++++++++++++++---------- @@ -11418,10 +12668,10 @@ index 60a6878..d6ba80a 100644 1.8.1.6 -From fe9ee4c66e08f11d514b94d61b0fc0585626796e Mon Sep 17 00:00:00 2001 +From dd3b14222b04dbf9fd6021ff87334decc7c63d30 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 12:06:25 +0200 -Subject: [PATCH 034/110] X11: hook video reference clock in windowing +Subject: [PATCH 054/111] X11: hook video reference clock in windowing --- xbmc/video/VideoReferenceClock.cpp | 71 +++++++++++++++++++++++++++----------- @@ -11626,10 +12876,10 @@ index dd65a1b..afd71fc 100644 1.8.1.6 -From 7cd90575e2e7ba0cba25f8882828a03eedd3fa9a Mon Sep 17 00:00:00 2001 +From bc4b5f595c21c8037c584a24de4361d37c7c0cf4 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 21 Jun 2012 17:26:51 +0200 -Subject: [PATCH 035/110] X11: fix video calibrations +Subject: [PATCH 055/111] X11: fix video calibrations --- xbmc/windowing/WinSystem.h | 1 + @@ -11638,7 +12888,7 @@ Subject: [PATCH 035/110] X11: fix video calibrations 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/xbmc/windowing/WinSystem.h b/xbmc/windowing/WinSystem.h -index fc467f1..608b1e1 100644 +index 00a2d24..c0db210 100644 --- a/xbmc/windowing/WinSystem.h +++ b/xbmc/windowing/WinSystem.h @@ -103,6 +103,7 @@ class CWinSystemBase @@ -11721,10 +12971,10 @@ index 05aa60e..95672d1 100644 1.8.1.6 -From 53d7b5b81553e08dd98c6bd8b7fa47b2407e3eb6 Mon Sep 17 00:00:00 2001 +From a61e1e7b866ae6799725a3cee7055947fd2b7b02 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 12:00:26 +0200 -Subject: [PATCH 036/110] X11: deactivate screen saver on startup +Subject: [PATCH 056/111] X11: deactivate screen saver on startup --- xbmc/windowing/X11/WinSystemX11.cpp | 29 +++++++++++++++++++++++++++++ @@ -11794,10 +13044,10 @@ index 95672d1..51ac314 100644 1.8.1.6 -From b5864a4dc3b1c84fddb4d9f2bbaf51fc365c51af Mon Sep 17 00:00:00 2001 +From 7b5eeda44e844f39d026abc306fb530dc74410db Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 12:10:09 +0200 -Subject: [PATCH 037/110] X11: change method of going full-screen +Subject: [PATCH 057/111] X11: change method of going full-screen --- xbmc/windowing/X11/WinSystemX11.cpp | 9 ++++++++- @@ -11841,10 +13091,10 @@ index 14a4307..66b91fd 100644 1.8.1.6 -From c815c5039786c0edfb5a008346f6400be5e8ec29 Mon Sep 17 00:00:00 2001 +From c9966a2bc75891d7f2962424946957cd3840a46f Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 28 Jun 2012 19:12:39 +0200 -Subject: [PATCH 038/110] X11: reset key repeat and key modifier on focus lost +Subject: [PATCH 058/111] X11: reset key repeat and key modifier on focus lost and gain --- @@ -11876,10 +13126,10 @@ index c58067b..c9f8a20 100644 1.8.1.6 -From 18d3da75416f79bb9482c79d00a8449105690bea Mon Sep 17 00:00:00 2001 +From 0f1c51b14d98a525cddfe80122e15837fd4739ae Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Thu, 5 Jul 2012 14:18:46 +0200 -Subject: [PATCH 039/110] X11: replace custom utf8 to unicode with charset +Subject: [PATCH 059/111] X11: replace custom utf8 to unicode with charset convertor (squash to x11 events) --- @@ -12096,10 +13346,10 @@ index 6100933..72955ad 100644 1.8.1.6 -From 7de91f91cb2686e468206bd646d303ce65fe8b98 Mon Sep 17 00:00:00 2001 +From 02972d370ad7e5cd498690bf26d176d34c0bc70e Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Thu, 5 Jul 2012 14:23:54 +0200 -Subject: [PATCH 040/110] X11: fixed invalid usage of sizeof() (squash into x11 +Subject: [PATCH 060/111] X11: fixed invalid usage of sizeof() (squash into x11 changes) --- @@ -12163,10 +13413,10 @@ index 72955ad..102a076 100644 1.8.1.6 -From 81b0fe7a671d9c366eae577e4be00f52d3d9c435 Mon Sep 17 00:00:00 2001 +From 262f4b16ae84bce0348da566c3760d111e908acc Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 9 Jun 2012 18:23:53 +0200 -Subject: [PATCH 041/110] add missing keys to xbmc keytable +Subject: [PATCH 061/111] add missing keys to xbmc keytable --- xbmc/input/XBMC_keytable.cpp | 2 ++ @@ -12189,10 +13439,10 @@ index b430f55..246164b 100644 1.8.1.6 -From a610a6c24039fb885956894fbcfd19b3b35df3db Mon Sep 17 00:00:00 2001 +From d63ae68338fc4da0e774e016698f7fb62a04d9a0 Mon Sep 17 00:00:00 2001 From: xbmc Date: Fri, 16 Mar 2012 15:57:51 +0100 -Subject: [PATCH 042/110] videorefclock: temp deactivate of nv settings +Subject: [PATCH 062/111] videorefclock: temp deactivate of nv settings --- xbmc/video/VideoReferenceClock.cpp | 2 +- @@ -12215,10 +13465,10 @@ index 3bd8133..59f924c 100644 1.8.1.6 -From 1492ea88c9b9659d8e0345fd8d18580cb9ceb259 Mon Sep 17 00:00:00 2001 +From 1b502562a8a1e00a0be4d6ccb0f39be9c2c77511 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 20 Aug 2012 09:09:09 +0200 -Subject: [PATCH 043/110] videorefclock: ask graphics context for refresh rate +Subject: [PATCH 063/111] videorefclock: ask graphics context for refresh rate --- xbmc/video/VideoReferenceClock.cpp | 3 ++- @@ -12249,10 +13499,10 @@ index 59f924c..2f8bc69 100644 1.8.1.6 -From df1cfeff10a2e8e766925da2f60bf06f635da404 Mon Sep 17 00:00:00 2001 +From eb42185640059d34fd1fc3e77f65e1743f760d5f Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 9 Jul 2012 14:00:18 +0200 -Subject: [PATCH 044/110] X11: fix icon texture after +Subject: [PATCH 064/111] X11: fix icon texture after cc5ed3c2474084ebc0373a3046410e6f766e03f4 --- @@ -12360,10 +13610,10 @@ index 66b91fd..b00eddc 100644 1.8.1.6 -From 33a8571e84fb01fd33a6cb3ae72b6feaf23d6776 Mon Sep 17 00:00:00 2001 +From c4b8d1cd002ca52a18a1f871157ccd598f62475c Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 10 Jul 2012 11:14:12 +0200 -Subject: [PATCH 045/110] X11: check for window manager +Subject: [PATCH 065/111] X11: check for window manager --- xbmc/windowing/X11/WinSystemX11.cpp | 74 ++++++++++++++++++++++++++++++++++++- @@ -12484,10 +13734,10 @@ index 51ac314..ce3c289 100644 1.8.1.6 -From 12c401980ef933b8f8c1cba6b7eee11118ca48d3 Mon Sep 17 00:00:00 2001 +From a9dc1666ab76cc5fc46fa07e8b2d8a6278530128 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 12 Jul 2012 11:11:47 +0200 -Subject: [PATCH 046/110] X11: dont set window on xrandr if no mode available +Subject: [PATCH 066/111] X11: dont set window on xrandr if no mode available --- xbmc/windowing/X11/WinSystemX11.cpp | 11 ++++++----- @@ -12524,10 +13774,10 @@ index 05279ad..9697cbb 100644 1.8.1.6 -From ca53c5cdd2b3b9067f750cd47f1789e00f1436c6 Mon Sep 17 00:00:00 2001 +From 657ef9713d20db3fed7787bc1b933c40d2528b0c Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 26 Jul 2012 09:34:28 +0200 -Subject: [PATCH 047/110] X11: fix crash after a resolution change on startup +Subject: [PATCH 067/111] X11: fix crash after a resolution change on startup --- xbmc/windowing/X11/WinSystemX11.cpp | 3 ++- @@ -12551,10 +13801,10 @@ index 9697cbb..868071c 100644 1.8.1.6 -From a2a2730899584fdfe5c8eb9888076941cb9502e8 Mon Sep 17 00:00:00 2001 +From 33480af67d2e02f415a8bc967573b22b894d5fad Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 15 Sep 2012 18:27:29 +0200 -Subject: [PATCH 048/110] X11: lock graphics context in NotifyXRREvent +Subject: [PATCH 068/111] X11: lock graphics context in NotifyXRREvent --- xbmc/windowing/X11/WinSystemX11.cpp | 2 ++ @@ -12577,25 +13827,27 @@ index 868071c..9ff947c 100644 1.8.1.6 -From 8b0a7d7533a3b77e5673b31f5b0493aeb0718b0a Mon Sep 17 00:00:00 2001 +From 5f9c99545002127cd03b8e66b2fbacb05c80aac1 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sat, 8 Oct 2011 16:45:13 +0200 -Subject: [PATCH 049/110] ffmpeg: add xvba hwaccel +Subject: [PATCH 069/111] ffmpeg: add xvba hwaccel, co-author @fritsch --- lib/ffmpeg/configure | 11 ++ lib/ffmpeg/libavcodec/Makefile | 6 ++ lib/ffmpeg/libavcodec/allcodecs.c | 4 + - lib/ffmpeg/libavcodec/h264.c | 3 + - lib/ffmpeg/libavcodec/xvba.c | 66 ++++++++++++ - lib/ffmpeg/libavcodec/xvba.h | 71 +++++++++++++ - lib/ffmpeg/libavcodec/xvba_h264.c | 192 ++++++++++++++++++++++++++++++++++ - lib/ffmpeg/libavcodec/xvba_internal.h | 24 +++++ + lib/ffmpeg/libavcodec/h263dec.c | 3 + + lib/ffmpeg/libavcodec/h264.c | 6 ++ + lib/ffmpeg/libavcodec/vc1dec.c | 3 + + lib/ffmpeg/libavcodec/xvba.c | 77 ++++++++++++++ + lib/ffmpeg/libavcodec/xvba.h | 72 +++++++++++++ + lib/ffmpeg/libavcodec/xvba_h264.c | 194 ++++++++++++++++++++++++++++++++++ + lib/ffmpeg/libavcodec/xvba_internal.h | 25 +++++ lib/ffmpeg/libavcodec/xvba_mpeg2.c | 52 +++++++++ - lib/ffmpeg/libavcodec/xvba_vc1.c | 190 +++++++++++++++++++++++++++++++++ + lib/ffmpeg/libavcodec/xvba_vc1.c | 193 +++++++++++++++++++++++++++++++++ lib/ffmpeg/libavutil/pixdesc.c | 6 ++ lib/ffmpeg/libavutil/pixfmt.h | 1 + - 12 files changed, 626 insertions(+) + 14 files changed, 653 insertions(+) create mode 100644 lib/ffmpeg/libavcodec/xvba.c create mode 100644 lib/ffmpeg/libavcodec/xvba.h create mode 100644 lib/ffmpeg/libavcodec/xvba_h264.c @@ -12751,8 +14003,22 @@ index 584446f..7a8f61c 100644 /* video codecs */ REGISTER_ENCODER(A64MULTI, a64multi); +diff --git a/lib/ffmpeg/libavcodec/h263dec.c b/lib/ffmpeg/libavcodec/h263dec.c +index e231b08..6fcd2a0 100644 +--- a/lib/ffmpeg/libavcodec/h263dec.c ++++ b/lib/ffmpeg/libavcodec/h263dec.c +@@ -769,6 +769,9 @@ int ff_h263_decode_frame(AVCodecContext *avctx, + #if CONFIG_VDPAU + AV_PIX_FMT_VDPAU, + #endif ++#if CONFIG_XVBA ++ AV_PIX_FMT_XVBA_VLD, ++#endif + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_NONE + }; diff --git a/lib/ffmpeg/libavcodec/h264.c b/lib/ffmpeg/libavcodec/h264.c -index 85f2372..02d0a26 100644 +index 85f2372..4f09c67 100644 --- a/lib/ffmpeg/libavcodec/h264.c +++ b/lib/ffmpeg/libavcodec/h264.c @@ -81,6 +81,9 @@ @@ -12761,16 +14027,40 @@ index 85f2372..02d0a26 100644 #endif +#if CONFIG_H264_XVBA_HWACCEL + AV_PIX_FMT_XVBA_VLD, ++#endif + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_NONE + }; +@@ -98,6 +101,9 @@ + #if CONFIG_H264_VDPAU_HWACCEL + AV_PIX_FMT_VDPAU, + #endif ++#if CONFIG_H264_XVBA_HWACCEL ++ AV_PIX_FMT_XVBA_VLD, ++#endif + AV_PIX_FMT_YUVJ420P, + AV_PIX_FMT_NONE + }; +diff --git a/lib/ffmpeg/libavcodec/vc1dec.c b/lib/ffmpeg/libavcodec/vc1dec.c +index 2130c74..4d611f9 100644 +--- a/lib/ffmpeg/libavcodec/vc1dec.c ++++ b/lib/ffmpeg/libavcodec/vc1dec.c +@@ -5807,6 +5807,9 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, + #if CONFIG_VDPAU + AV_PIX_FMT_VDPAU, + #endif ++#if CONFIG_XVBA ++ AV_PIX_FMT_XVBA_VLD, +#endif AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }; diff --git a/lib/ffmpeg/libavcodec/xvba.c b/lib/ffmpeg/libavcodec/xvba.c new file mode 100644 -index 0000000..be29e5d +index 0000000..c6ff2fe --- /dev/null +++ b/lib/ffmpeg/libavcodec/xvba.c -@@ -0,0 +1,66 @@ +@@ -0,0 +1,77 @@ +/* + * HW decode acceleration for MPEG-2, H.264 and VC-1 + * @@ -12804,6 +14094,7 @@ index 0000000..be29e5d +#include "xvba.h" +#include "xvba_internal.h" +#include "avcodec.h" ++#include "mpegvideo.h" + +int ff_xvba_translate_profile(int profile) { + @@ -12823,6 +14114,16 @@ index 0000000..be29e5d + return -1; +} + ++// See page 25 of the documentation ++int ff_xvba_translate_picture_structure(int picture_structure) { ++ if(picture_structure == PICT_BOTTOM_FIELD) ++ return 0; ++ else if (picture_structure == PICT_TOP_FIELD) ++ return 1; ++ else //PICT_FRAME by default ++ return 3; ++} ++ +void ff_xvba_add_slice_data(struct xvba_render_state *render, const uint8_t *buffer, uint32_t size) { + + render->buffers = av_fast_realloc( @@ -12839,10 +14140,10 @@ index 0000000..be29e5d + diff --git a/lib/ffmpeg/libavcodec/xvba.h b/lib/ffmpeg/libavcodec/xvba.h new file mode 100644 -index 0000000..9f9ff0c +index 0000000..e590faf --- /dev/null +++ b/lib/ffmpeg/libavcodec/xvba.h -@@ -0,0 +1,71 @@ +@@ -0,0 +1,72 @@ +/* + * HW decode acceleration for MPEG-2, H.264 and VC-1 + * @@ -12911,15 +14212,16 @@ index 0000000..9f9ff0c + unsigned int num_slices; + struct xvba_bitstream_buffers *buffers; + uint32_t buffers_alllocated; ++ int psf; +}; + +#endif /* AVCODEC_XVBA_H */ diff --git a/lib/ffmpeg/libavcodec/xvba_h264.c b/lib/ffmpeg/libavcodec/xvba_h264.c new file mode 100644 -index 0000000..ae45f3a +index 0000000..20ba2f2 --- /dev/null +++ b/lib/ffmpeg/libavcodec/xvba_h264.c -@@ -0,0 +1,192 @@ +@@ -0,0 +1,194 @@ +/* + * H.264 HW decode acceleration through XVBA + * @@ -13009,7 +14311,9 @@ index 0000000..ae45f3a + pic_descriptor->level = avctx->level; + pic_descriptor->width_in_mb = h->mb_width; + pic_descriptor->height_in_mb = h->mb_height; -+ pic_descriptor->picture_structure = h->picture_structure; ++ ++ pic_descriptor->picture_structure = ff_xvba_translate_picture_structure(h->picture_structure); ++ + pic_descriptor->chroma_format = h->chroma_format_idc ? h->chroma_format_idc : 1; + pic_descriptor->avc_intra_flag = (h->slice_type == AV_PICTURE_TYPE_I) ? 1 : 0; + pic_descriptor->avc_reference = (h->cur_pic_ptr->f.reference & 3) ? 1 : 0; @@ -13082,7 +14386,7 @@ index 0000000..ae45f3a + h->got_first_iframe = 1; + } + -+ ff_draw_horiz_band(h->avctx, &h->dsp, h->cur_pic_ptr, NULL, 0, h->avctx->height, h->picture_structure, h->first_field, 0, 0, 0, 0); ++ ff_h264_draw_horiz_band(h, 0, h->avctx->height); + + return 0; +} @@ -13114,10 +14418,10 @@ index 0000000..ae45f3a +}; diff --git a/lib/ffmpeg/libavcodec/xvba_internal.h b/lib/ffmpeg/libavcodec/xvba_internal.h new file mode 100644 -index 0000000..9653f85 +index 0000000..18faa3e --- /dev/null +++ b/lib/ffmpeg/libavcodec/xvba_internal.h -@@ -0,0 +1,24 @@ +@@ -0,0 +1,25 @@ +/* + * HW decode acceleration for MPEG-2, H.264 and VC-1 + * @@ -13141,6 +14445,7 @@ index 0000000..9653f85 + */ + +int ff_xvba_translate_profile(int profile); ++int ff_xvba_translate_picture_structure(int picture_structure); +void ff_xvba_add_slice_data(struct xvba_render_state *render, const uint8_t *buffer, uint32_t size); diff --git a/lib/ffmpeg/libavcodec/xvba_mpeg2.c b/lib/ffmpeg/libavcodec/xvba_mpeg2.c new file mode 100644 @@ -13202,10 +14507,10 @@ index 0000000..0fc7d78 +}; diff --git a/lib/ffmpeg/libavcodec/xvba_vc1.c b/lib/ffmpeg/libavcodec/xvba_vc1.c new file mode 100644 -index 0000000..bf3d9c2 +index 0000000..e7a85a7 --- /dev/null +++ b/lib/ffmpeg/libavcodec/xvba_vc1.c -@@ -0,0 +1,190 @@ +@@ -0,0 +1,193 @@ +/* + * VC-1 HW decode acceleration through XVBA + * @@ -13286,7 +14591,9 @@ index 0000000..bf3d9c2 + pic_descriptor->width_in_mb = s->mb_width; + pic_descriptor->height_in_mb = s->mb_height; + } -+ pic_descriptor->picture_structure = s->picture_structure; ++ ++ pic_descriptor->picture_structure = ff_xvba_translate_picture_structure(s->picture_structure); ++ + // xvba-video set this to 1 only 4:2:0 supported + // doc says: if not set, choose 1 - we try this + pic_descriptor->chroma_format = 1; @@ -13307,7 +14614,7 @@ index 0000000..bf3d9c2 + pic_descriptor->sps_info.vc1.psf = v->psf; + // what about if it is a frame (page 31) + // looked at xvba-driver -+ pic_descriptor->sps_info.vc1.second_field = !s->first_field; ++ pic_descriptor->sps_info.vc1.second_field = v->interlace && v->second_field && (v->fcm == ILACE_FIELD); + pic_descriptor->sps_info.vc1.xvba_vc1_sps_reserved = 0; + + // VC-1 explicit parameters see page 30 of sdk @@ -13349,8 +14656,9 @@ index 0000000..bf3d9c2 + pic_descriptor->future_surface = last->surface; + break; + } ++ render->psf = v->psf; + -+ ff_draw_horiz_band(s->avctx, &s->dsp, s->current_picture_ptr, s->last_picture_ptr, 0, s->avctx->height, s->picture_structure, s->first_field, (s->unrestricted_mv && !s->intra_only), s->low_delay, s->v_edge_pos, s->h_edge_pos); ++ ff_mpeg_draw_horiz_band(s, 0, s->avctx->height); + + return 0; +} @@ -13429,36 +14737,38 @@ index 1c00ac4..6437e29 100644 1.8.1.6 -From 6e42c0d587b54da3ea6af2afab48f8b5d50457c8 Mon Sep 17 00:00:00 2001 +From 598d3e850b950f2f47352047e2ff70f5e51525cb Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 12 Apr 2012 12:09:31 +0200 -Subject: [PATCH 050/110] xvba: add decoder +Subject: [PATCH 070/111] xvba: add decoder, co-author @fritsch --- configure.in | 47 + language/English/strings.po | 13 +- system/settings/settings.xml | 5 + - xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 218 +- + xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 217 +- xbmc/cores/VideoRenderers/LinuxRendererGL.h | 15 +- xbmc/cores/VideoRenderers/RenderFormats.h | 1 + xbmc/cores/VideoRenderers/RenderManager.cpp | 8 +- + xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp | 5 + .../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 4 + .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 16 + xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in | 4 + - xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp | 2367 ++++++++++++++++++++ + xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp | 2375 ++++++++++++++++++++ xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.h | 383 ++++ xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 1 + + xbmc/settings/Settings.cpp | 3 + xbmc/settings/VideoSettings.h | 2 + xbmc/video/dialogs/GUIDialogVideoSettings.cpp | 1 + - 15 files changed, 3076 insertions(+), 9 deletions(-) + 17 files changed, 3091 insertions(+), 9 deletions(-) create mode 100644 xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp create mode 100644 xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.h diff --git a/configure.in b/configure.in -index d63d13d..e145d43 100644 +index 66e679f..558126f 100644 --- a/configure.in +++ b/configure.in -@@ -143,6 +143,8 @@ vaapi_not_found="== Could not find libva. VAAPI support disabled. ==" +@@ -144,6 +144,8 @@ vaapi_not_found="== Could not find libva. VAAPI support disabled. ==" vaapi_disabled="== VAAPI support manually disabled. ==" crystalhd_not_found="== Could not find libcrystalhd. CrystalHD support disabled. ==" crystalhd_disabled="== CrystalHD support manually disabled. ==" @@ -13467,7 +14777,7 @@ index d63d13d..e145d43 100644 vtbdecoder_enabled="== VTBDecoder support enabled. ==" vtbdecoder_disabled="== VTBDecoder support manually disabled. ==" openmax_disabled="== OpenMax support manually disabled. ==" -@@ -262,6 +264,12 @@ AC_ARG_ENABLE([crystalhd], +@@ -263,6 +265,12 @@ AC_ARG_ENABLE([crystalhd], [enable CrystalHD decoding (default is auto)])], [use_crystalhd=$enableval], [use_crystalhd=auto]) @@ -13480,7 +14790,7 @@ index d63d13d..e145d43 100644 AC_ARG_ENABLE([vtbdecoder], [AS_HELP_STRING([--enable-vtbdecoder], -@@ -1780,6 +1788,37 @@ else +@@ -1776,6 +1784,37 @@ else USE_CRYSTALHD=0 fi @@ -13518,7 +14828,7 @@ index d63d13d..e145d43 100644 # VTBDecoder if test "x$use_vtbdecoder" != "xno"; then if test "$host_vendor" = "apple" ; then -@@ -1982,6 +2021,12 @@ else +@@ -1978,6 +2017,12 @@ else final_message="$final_message\n CrystalHD:\tNo" fi @@ -13531,7 +14841,7 @@ index d63d13d..e145d43 100644 if test "x$use_vtbdecoder" != "xno"; then final_message="$final_message\n VTBDecoder:\tYes" else -@@ -2452,6 +2497,7 @@ AC_SUBST(USE_OPENGLES) +@@ -2450,6 +2495,7 @@ AC_SUBST(USE_OPENGLES) AC_SUBST(USE_VDPAU) AC_SUBST(USE_VAAPI) AC_SUBST(USE_CRYSTALHD) @@ -13539,7 +14849,7 @@ index d63d13d..e145d43 100644 AC_SUBST(USE_LIBSMBCLIENT) AC_SUBST(USE_LIBNFS) AC_SUBST(USE_LIBAFPCLIENT) -@@ -2636,6 +2682,7 @@ XB_CONFIG_MODULE([lib/ffmpeg], [ +@@ -2634,6 +2680,7 @@ XB_CONFIG_MODULE([lib/ffmpeg], [ `if test "x$use_vdpau" != "xno"; then echo --enable-vdpau; else echo --disable-vdpau; fi` \ `if test "x$use_vaapi" != "xno"; then echo --enable-vaapi; else echo --disable-vaapi; fi` \ `if test "$use_optimizations" != "no"; then echo --enable-optimizations; else echo --disable-optimizations; fi` \ @@ -13548,10 +14858,10 @@ index d63d13d..e145d43 100644 --enable-pthreads \ --enable-runtime-cpudetect \ diff --git a/language/English/strings.po b/language/English/strings.po -index ce56914..fc1f5ec4d 100644 +index 90fb3fd..6e87bc7 100644 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -5782,7 +5782,12 @@ msgctxt "#13437" +@@ -5791,7 +5791,12 @@ msgctxt "#13437" msgid "Prefer VDPAU Video Mixer" msgstr "" @@ -13565,7 +14875,7 @@ index ce56914..fc1f5ec4d 100644 #: system/settings/settings.xml msgctxt "#13500" -@@ -6860,7 +6865,11 @@ msgctxt "#16325" +@@ -6877,7 +6882,11 @@ msgctxt "#16325" msgid "VDPAU - Bob" msgstr "" @@ -13579,7 +14889,7 @@ index ce56914..fc1f5ec4d 100644 msgctxt "#16400" msgid "Post-processing" diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index f99ba9c..ac87a69 100644 +index a0a1a5b..a1c7833 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -410,6 +410,11 @@ @@ -13592,10 +14902,10 @@ index f99ba9c..ac87a69 100644 + true + - HAVE_LIBSTAGEFRIGHTDECODER + HAVE_LIBSTAGEFRIGHTDECODER 2 diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index 6807df7..b2beb2e 100644 +index 7bfd892..696c3f1 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp @@ -65,6 +65,9 @@ @@ -13608,7 +14918,7 @@ index 6807df7..b2beb2e 100644 #ifdef TARGET_DARWIN #include "osx/CocoaInterface.h" -@@ -135,6 +138,9 @@ +@@ -134,6 +137,9 @@ #ifdef TARGET_DARWIN_OSX cvBufferRef = NULL; #endif @@ -13618,7 +14928,7 @@ index 6807df7..b2beb2e 100644 } CLinuxRendererGL::YUVBUFFER::~YUVBUFFER() -@@ -621,12 +627,15 @@ void CLinuxRendererGL::Flush() +@@ -624,12 +630,15 @@ void CLinuxRendererGL::Flush() void CLinuxRendererGL::ReleaseBuffer(int idx) { @@ -13635,7 +14945,7 @@ index 6807df7..b2beb2e 100644 #ifdef HAVE_LIBVA buf.vaapi.surface.reset(); #endif -@@ -892,7 +901,7 @@ void CLinuxRendererGL::UpdateVideoFilter() +@@ -895,7 +904,7 @@ void CLinuxRendererGL::UpdateVideoFilter() case VS_SCALINGMETHOD_LINEAR: SetTextureFilter(m_scalingMethod == VS_SCALINGMETHOD_NEAREST ? GL_NEAREST : GL_LINEAR); m_renderQuality = RQ_SINGLEPASS; @@ -13644,7 +14954,7 @@ index 6807df7..b2beb2e 100644 { m_pVideoFilterShader = new StretchFilterShader(); if (!m_pVideoFilterShader->CompileAndLink()) -@@ -978,6 +987,11 @@ void CLinuxRendererGL::LoadShaders(int field) +@@ -981,6 +990,11 @@ void CLinuxRendererGL::LoadShaders(int field) CLog::Log(LOGNOTICE, "GL: Using CVBREF render method"); m_renderMethod = RENDER_CVREF; } @@ -13656,7 +14966,7 @@ index 6807df7..b2beb2e 100644 else { int requestedMethod = CSettings::Get().GetInt("videoplayer.rendermethod"); -@@ -1126,6 +1140,12 @@ void CLinuxRendererGL::LoadShaders(int field) +@@ -1129,6 +1143,12 @@ void CLinuxRendererGL::LoadShaders(int field) m_textureCreate = &CLinuxRendererGL::CreateCVRefTexture; m_textureDelete = &CLinuxRendererGL::DeleteCVRefTexture; } @@ -13669,7 +14979,7 @@ index 6807df7..b2beb2e 100644 else { // setup default YV12 texture handlers -@@ -1238,6 +1258,13 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) +@@ -1239,6 +1259,13 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) RenderVAAPI(renderBuffer, m_currentField); } #endif @@ -13683,7 +14993,7 @@ index 6807df7..b2beb2e 100644 else { // RENDER_CVREF uses the same render as the default case -@@ -1762,6 +1789,77 @@ void CLinuxRendererGL::RenderVAAPI(int index, int field) +@@ -1766,6 +1793,77 @@ void CLinuxRendererGL::RenderVAAPI(int index, int field) #endif } @@ -13761,7 +15071,7 @@ index 6807df7..b2beb2e 100644 void CLinuxRendererGL::RenderSoftware(int index, int field) { // used for textues uploaded from rgba or CVPixelBuffers. -@@ -2820,6 +2918,88 @@ bool CLinuxRendererGL::CreateCVRefTexture(int index) +@@ -2814,6 +2912,87 @@ bool CLinuxRendererGL::CreateCVRefTexture(int index) return true; } @@ -13798,7 +15108,7 @@ index 6807df7..b2beb2e 100644 + return true; +} + -+void CLinuxRendererGL::UploadXVBATexture(int index) ++bool CLinuxRendererGL::UploadXVBATexture(int index) +{ +#ifdef HAVE_LIBXVBA + XVBA::CXvbaRenderPicture *xvba = m_buffers[index].xvba; @@ -13809,8 +15119,7 @@ index 6807df7..b2beb2e 100644 + + if (!xvba || !xvba->valid) + { -+ m_skipRender = true; -+ return; ++ return false; + } + + plane.id = xvba->texture; @@ -13843,14 +15152,14 @@ index 6807df7..b2beb2e 100644 + plane.rect.x1 /= plane.texwidth; + plane.rect.x2 /= plane.texwidth; + } -+ +#endif ++ return true; +} + - void CLinuxRendererGL::UploadYUV422PackedTexture(int source) + bool CLinuxRendererGL::UploadYUV422PackedTexture(int source) { YUVBUFFER& buf = m_buffers[source]; -@@ -3394,6 +3574,9 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) +@@ -3389,6 +3568,9 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) if (m_renderMethod & RENDER_VAAPI) return false; @@ -13860,7 +15169,7 @@ index 6807df7..b2beb2e 100644 return (m_renderMethod & RENDER_GLSL) || (m_renderMethod & RENDER_ARB) || ((m_renderMethod & RENDER_SW) && glewIsSupported("GL_ARB_imaging") == GL_TRUE); -@@ -3407,6 +3590,9 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) +@@ -3402,6 +3584,9 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) if (m_renderMethod & RENDER_VAAPI) return false; @@ -13870,7 +15179,7 @@ index 6807df7..b2beb2e 100644 return (m_renderMethod & RENDER_GLSL) || (m_renderMethod & RENDER_ARB) || ((m_renderMethod & RENDER_SW) && glewIsSupported("GL_ARB_imaging") == GL_TRUE); -@@ -3430,7 +3616,8 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) +@@ -3425,7 +3610,8 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) if (feature == RENDERFEATURE_NONLINSTRETCH) { if (((m_renderMethod & RENDER_GLSL) && !(m_renderMethod & RENDER_POT)) || @@ -13880,7 +15189,7 @@ index 6807df7..b2beb2e 100644 return true; } -@@ -3502,6 +3689,16 @@ bool CLinuxRendererGL::Supports(EINTERLACEMETHOD method) +@@ -3497,6 +3683,16 @@ bool CLinuxRendererGL::Supports(EINTERLACEMETHOD method) return false; } @@ -13897,7 +15206,7 @@ index 6807df7..b2beb2e 100644 #ifdef TARGET_DARWIN // YADIF too slow for HD but we have no methods to fall back // to something that works so just turn it off. -@@ -3551,7 +3748,7 @@ bool CLinuxRendererGL::Supports(ESCALINGMETHOD method) +@@ -3546,7 +3742,7 @@ bool CLinuxRendererGL::Supports(ESCALINGMETHOD method) return false; if ((glewIsSupported("GL_EXT_framebuffer_object") && (m_renderMethod & RENDER_GLSL)) || @@ -13906,7 +15215,7 @@ index 6807df7..b2beb2e 100644 { // spline36 and lanczos3 are only allowed through advancedsettings.xml if(method != VS_SCALINGMETHOD_SPLINE36 -@@ -3618,7 +3815,8 @@ unsigned int CLinuxRendererGL::GetProcessorSize() +@@ -3613,7 +3809,8 @@ unsigned int CLinuxRendererGL::GetProcessorSize() if(m_format == RENDER_FMT_VDPAU || m_format == RENDER_FMT_VDPAU_420 || m_format == RENDER_FMT_VAAPI @@ -13916,7 +15225,7 @@ index 6807df7..b2beb2e 100644 return 1; else return 0; -@@ -3674,4 +3872,14 @@ void CLinuxRendererGL::AddProcessor(struct __CVBuffer *cvBufferRef, int index) +@@ -3649,4 +3846,14 @@ void CLinuxRendererGL::AddProcessor(struct __CVBuffer *cvBufferRef, int index) } #endif @@ -13932,7 +15241,7 @@ index 6807df7..b2beb2e 100644 + #endif diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.h b/xbmc/cores/VideoRenderers/LinuxRendererGL.h -index 258a598..6fa1dbc 100644 +index 966733e..0377fcf 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.h +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.h @@ -44,6 +44,8 @@ @@ -13952,7 +15261,7 @@ index 258a598..6fa1dbc 100644 }; enum RenderQuality -@@ -151,7 +154,9 @@ class CLinuxRendererGL : public CBaseRenderer +@@ -150,7 +153,9 @@ class CLinuxRendererGL : public CBaseRenderer #ifdef TARGET_DARWIN virtual void AddProcessor(struct __CVBuffer *cvBufferRef, int index); #endif @@ -13963,18 +15272,18 @@ index 258a598..6fa1dbc 100644 virtual void RenderUpdate(bool clear, DWORD flags = 0, DWORD alpha = 255); // Feature support -@@ -210,6 +215,10 @@ class CLinuxRendererGL : public CBaseRenderer - void DeleteYUV422PackedTexture(int index); - bool CreateYUV422PackedTexture(int index); +@@ -205,6 +210,10 @@ class CLinuxRendererGL : public CBaseRenderer + void DeleteCVRefTexture(int index); + bool CreateCVRefTexture(int index); -+ void UploadXVBATexture(int index); ++ bool UploadXVBATexture(int index); + void DeleteXVBATexture(int index); + bool CreateXVBATexture(int index); + - void UploadRGBTexture(int index); - void ToRGBFrame(YV12Image* im, unsigned flipIndexPlane, unsigned flipIndexBuf); - void ToRGBFields(YV12Image* im, unsigned flipIndexPlaneTop, unsigned flipIndexPlaneBot, unsigned flipIndexBuf); -@@ -225,6 +234,7 @@ class CLinuxRendererGL : public CBaseRenderer + bool UploadYUV422PackedTexture(int index); + void DeleteYUV422PackedTexture(int index); + bool CreateYUV422PackedTexture(int index); +@@ -224,6 +233,7 @@ class CLinuxRendererGL : public CBaseRenderer void RenderVDPAU(int renderBuffer, int field); // render using vdpau hardware void RenderProgressiveWeave(int renderBuffer, int field); // render using vdpau hardware void RenderVAAPI(int renderBuffer, int field); // render using vdpau hardware @@ -13982,7 +15291,7 @@ index 258a598..6fa1dbc 100644 struct { -@@ -293,6 +303,9 @@ class CLinuxRendererGL : public CBaseRenderer +@@ -291,6 +301,9 @@ class CLinuxRendererGL : public CBaseRenderer #ifdef TARGET_DARWIN_OSX struct __CVBuffer *cvBufferRef; #endif @@ -14005,10 +15314,10 @@ index 3b09194..b193c24 100644 #endif diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index a1c2fc7..5056100 100644 +index ae610ca..08d6230 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -941,11 +941,17 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) +@@ -936,11 +936,17 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) else if(pic.format == RENDER_FMT_VAAPI) m_pRenderer->AddProcessor(*pic.vaapi, index); #endif @@ -14027,8 +15336,24 @@ index a1c2fc7..5056100 100644 m_pRenderer->ReleaseImage(index, false); return index; +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp +index 514a5e1..614afdd 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp +@@ -183,6 +183,11 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, unsigne + #elif defined(TARGET_POSIX) && !defined(TARGET_DARWIN) + hwSupport += "VAAPI:no "; + #endif ++#if defined(HAVE_LIBXVBA) && defined(TARGET_LINUX) ++ hwSupport += "XVBA:yes "; ++#elif defined(TARGET_LINUX) ++ hwSupport += "XVBA:no "; ++#endif + + CLog::Log(LOGDEBUG, "CDVDFactoryCodec: compiled in hardware support: %s", hwSupport.c_str()); + #if !defined(HAS_LIBAMCODEC) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -index 0dd29c3..b346d26 100644 +index d358777..35516d7 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h @@ -35,6 +35,7 @@ @@ -14050,7 +15375,7 @@ index 0dd29c3..b346d26 100644 struct { COpenMax *openMax; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index aa2d1e4..cd48f4e 100644 +index 9f1fc03..7e01ef0 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -60,6 +60,9 @@ @@ -14100,10 +15425,10 @@ index 86b0a89..7bc4065 100644 SRCS += DVDVideoCodecAmlogic.cpp diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp new file mode 100644 -index 0000000..43a331f +index 0000000..5845dbf --- /dev/null +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -@@ -0,0 +1,2367 @@ +@@ -0,0 +1,2375 @@ +/* + * Copyright (C) 2005-2011 Team XBMC + * http://www.xbmc.org @@ -14446,10 +15771,12 @@ index 0000000..43a331f + // it seems that xvba does not support anything > 2k + // return false, for files that are larger + // if you are unlucky, this would kill your decoder -+ // we limit to 2048x1536(+8) now - as this was tested working ++ // we limit to 2048x1152 now - as this was reported by ckoenig the UVD OSS ++ // engineer to be the maximum technically possible for all hardware with UVD. ++ // Some chips can do a bit more, but we use the safe default. + int surfaceWidth = (avctx->coded_width+15) & ~15; + int surfaceHeight = (avctx->coded_height+15) & ~15; -+ if(surfaceHeight > 1544 || surfaceWidth > 2048) ++ if(surfaceHeight > 1152 || surfaceWidth > 2048) + { + CLog::Log(LOGERROR, "Surface too large, decoder skipped: surfaceWidth %u, surfaceHeight %u", + surfaceWidth, surfaceHeight); @@ -14493,7 +15820,7 @@ index 0000000..43a331f + } + + int match = -1; -+ if (avctx->codec_id == CODEC_ID_H264) ++ if (avctx->codec_id == AV_CODEC_ID_H264) + { + // search for profile high + for (unsigned int i = 0; i < capOutput->num_of_decodecaps; ++i) @@ -14510,7 +15837,7 @@ index 0000000..43a331f + CLog::Log(LOGNOTICE, "(XVBA::Open) - profile XVBA_H264_HIGH not found"); + } + } -+ else if (avctx->codec_id == CODEC_ID_VC1) ++ else if (avctx->codec_id == AV_CODEC_ID_VC1) + { + // search for profile advanced + for (unsigned int i = 0; i < capOutput->num_of_decodecaps; ++i) @@ -14527,7 +15854,7 @@ index 0000000..43a331f + CLog::Log(LOGNOTICE, "(XVBA::Open) - profile XVBA_VC1_ADVANCED not found"); + } + } -+ else if (avctx->codec_id == CODEC_ID_MPEG2VIDEO) ++ else if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO) + { + // search for profile high + for (unsigned int i = 0; i < capOutput->num_of_decodecaps; ++i) @@ -14544,7 +15871,7 @@ index 0000000..43a331f + CLog::Log(LOGNOTICE, "(XVBA::Open) - profile XVBA_MPEG2_VLD not found"); + } + } -+ else if (avctx->codec_id == CODEC_ID_WMV3) ++ else if (avctx->codec_id == AV_CODEC_ID_WMV3) + { + // search for profile high + for (unsigned int i = 0; i < capOutput->num_of_decodecaps; ++i) @@ -15071,7 +16398,7 @@ index 0000000..43a331f + picInput.buffer_list = list; + list[0] = xvba->m_xvbaBufferPool.picture_descriptor_buffer; + picInput.num_of_buffers_in_list = 1; -+ if (avctx->codec_id == CODEC_ID_H264) ++ if (avctx->codec_id == AV_CODEC_ID_H264) + { + list[1] = xvba->m_xvbaBufferPool.iq_matrix_buffer; + picInput.num_of_buffers_in_list = 2; @@ -15095,17 +16422,20 @@ index 0000000..43a331f + { + int startCodeSize = 0; + uint8_t startCode[] = {0x00,0x00,0x01}; -+ if (avctx->codec_id == CODEC_ID_H264) ++ if (avctx->codec_id == AV_CODEC_ID_H264) + { + startCodeSize = 3; + memcpy((uint8_t*)xvba->m_xvbaBufferPool.data_buffer->bufferXVBA+location, + startCode, 3); + } -+ else if (avctx->codec_id == CODEC_ID_VC1 && ++ else if (avctx->codec_id == AV_CODEC_ID_VC1 && + (memcmp(render->buffers[j].buffer, startCode, 3) != 0)) + { + startCodeSize = 4; + uint8_t sdf = 0x0d; ++ if (render->picture_descriptor->sps_info.vc1.second_field) ++ sdf = 0x0c; ++ + memcpy((uint8_t*)xvba->m_xvbaBufferPool.data_buffer->bufferXVBA+location, + startCode, 3); + memcpy((uint8_t*)xvba->m_xvbaBufferPool.data_buffer->bufferXVBA+location+3, @@ -15284,6 +16614,7 @@ index 0000000..43a331f + + render->state |= FF_XVBA_STATE_USED_FOR_REFERENCE; + render->state &= ~FF_XVBA_STATE_DECODED; ++ render->psf = 0; + pic->reordered_opaque= avctx->reordered_opaque; + + return 0; @@ -15328,6 +16659,8 @@ index 0000000..43a331f + memset(&pic.DVDPic, 0, sizeof(pic.DVDPic)); + ((CDVDVideoCodecFFmpeg*)avctx->opaque)->GetPictureCommon(&pic.DVDPic); + pic.render = render; ++ if (render->psf) ++ pic.DVDPic.iFlags &= ~DVP_FLAG_INTERLACED; + m_bufferStats.IncDecoded(); + m_xvbaOutput.m_dataPort.SendOutMessage(COutputDataProtocol::NEWFRAME, &pic, sizeof(pic)); + @@ -16861,10 +18194,10 @@ index 0000000..3bd0cea + +} diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 21d023e..f35419f 100644 +index eb443af..c2808c3 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1019,6 +1019,7 @@ static std::string GetRenderFormatName(ERenderFormat format) +@@ -1022,6 +1022,7 @@ static std::string GetRenderFormatName(ERenderFormat format) case RENDER_FMT_CVBREF: return "BGRA"; case RENDER_FMT_EGLIMG: return "EGLIMG"; case RENDER_FMT_BYPASS: return "BYPASS"; @@ -16872,6 +18205,20 @@ index 21d023e..f35419f 100644 case RENDER_FMT_NONE: return "NONE"; } return "UNKNOWN"; +diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp +index dfa3774..2557dfe 100644 +--- a/xbmc/settings/Settings.cpp ++++ b/xbmc/settings/Settings.cpp +@@ -757,6 +757,9 @@ void CSettings::InitializeConditions() + #ifdef HAVE_LIBVDPAU + m_settingsManager->AddCondition("have_libvdpau"); + #endif ++#ifdef HAVE_LIBXVBA ++ m_settingsManager->AddCondition("have_libxvba"); ++#endif + #ifdef HAVE_VIDEOTOOLBOXDECODER + m_settingsManager->AddCondition("have_videotoolboxdecoder"); + if (g_sysinfo.HasVideoToolBoxDecoder()) diff --git a/xbmc/settings/VideoSettings.h b/xbmc/settings/VideoSettings.h index 293f363..3db70fb 100644 --- a/xbmc/settings/VideoSettings.h @@ -16901,47 +18248,17 @@ index 8f30248..db58075 100644 1.8.1.6 -From 21b33a37ba677c4b62a15cb02182b44c542b7613 Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Sun, 4 Nov 2012 16:24:10 +0100 -Subject: [PATCH 051/110] xvba: add string for available decoders - we are - important so make sure we are there - ---- - xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp -index ab3696e..329b6f0 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp -@@ -183,6 +183,11 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, unsigne - #elif defined(TARGET_POSIX) && !defined(TARGET_DARWIN) - hwSupport += "VAAPI:no "; - #endif -+#if defined(HAVE_LIBXVBA) && defined(TARGET_LINUX) -+ hwSupport += "XVBA:yes "; -+#elif defined(TARGET_LINUX) -+ hwSupport += "XVBA:no "; -+#endif - - CLog::Log(LOGDEBUG, "CDVDFactoryCodec: compiled in hardware support: %s", hwSupport.c_str()); - #if !defined(HAS_LIBAMCODEC) --- -1.8.1.6 - - -From 6bbda006ed9e8b2503d69908e571391fbff90532 Mon Sep 17 00:00:00 2001 +From c8f44c6aeca2d7b420a576cada451931c1e8ce71 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 16 Jun 2012 12:46:30 +0200 -Subject: [PATCH 052/110] xvba: do not use vaapi if xvba is present +Subject: [PATCH 071/111] xvba: do not use vaapi if xvba is present --- xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp -index 52b356d..6ed0fc5 100644 +index 2d59b09..aa83875 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp @@ -261,6 +261,15 @@ void CDecoder::Close() @@ -16964,47 +18281,47 @@ index 52b356d..6ed0fc5 100644 1.8.1.6 -From c6d9d1aeaa7905066d354d6182df6da8dcee58b6 Mon Sep 17 00:00:00 2001 +From 62a049ada0e780211a53cf5e0a315a0cc5f9f824 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 23 Aug 2012 19:39:49 +0200 -Subject: [PATCH 053/110] ffmpeg: add av_find_default_stream_index to interface +Subject: [PATCH 072/111] ffmpeg: add av_find_default_stream_index to interface --- lib/DllAvFormat.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/DllAvFormat.h b/lib/DllAvFormat.h -index ee41fa8..56605cb 100644 +index 0016c0b..3514856 100644 --- a/lib/DllAvFormat.h +++ b/lib/DllAvFormat.h -@@ -100,6 +100,7 @@ class DllAvFormatInterface - virtual int avformat_write_header (AVFormatContext *s, AVDictionary **options)=0; - virtual int av_write_trailer(AVFormatContext *s)=0; - virtual int av_write_frame (AVFormatContext *s, AVPacket *pkt)=0; +@@ -106,6 +106,7 @@ class DllAvFormatInterface + #if defined(AVFORMAT_HAS_STREAM_GET_R_FRAME_RATE) + virtual AVRational av_stream_get_r_frame_rate(const AVStream *s)=0; + #endif + virtual int av_find_default_stream_index(AVFormatContext *s)=0; }; #if (defined USE_EXTERNAL_FFMPEG) || (defined TARGET_DARWIN) -@@ -157,6 +158,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface - virtual int avformat_write_header (AVFormatContext *s, AVDictionary **options) { return ::avformat_write_header (s, options); } - virtual int av_write_trailer(AVFormatContext *s) { return ::av_write_trailer(s); } - virtual int av_write_frame (AVFormatContext *s, AVPacket *pkt) { return ::av_write_frame(s, pkt); } +@@ -166,6 +167,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + #if defined(AVFORMAT_HAS_STREAM_GET_R_FRAME_RATE) + virtual AVRational av_stream_get_r_frame_rate(const AVStream *s) { return ::av_stream_get_r_frame_rate(s); } + #endif + virtual int av_find_default_stream_index(AVFormatContext *s) { return ::av_find_default_stream_index(s); } // DLL faking. virtual bool ResolveExports() { return true; } -@@ -225,6 +227,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface - DEFINE_METHOD2(int, avformat_write_header , (AVFormatContext *p1, AVDictionary **p2)) - DEFINE_METHOD1(int, av_write_trailer, (AVFormatContext *p1)) - DEFINE_METHOD2(int, av_write_frame , (AVFormatContext *p1, AVPacket *p2)) +@@ -237,6 +239,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + #if defined(AVFORMAT_HAS_STREAM_GET_R_FRAME_RATE) + DEFINE_METHOD1(AVRational, av_stream_get_r_frame_rate, (const AVStream *p1)) + #endif + DEFINE_METHOD1(int, av_find_default_stream_index, (AVFormatContext *p1)) BEGIN_METHOD_RESOLVE() RESOLVE_METHOD_RENAME(av_register_all, av_register_all_dont_call) RESOLVE_METHOD_RENAME(avformat_network_init, avformat_network_init_dont_call) -@@ -261,6 +264,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface - RESOLVE_METHOD(avformat_write_header) - RESOLVE_METHOD(av_write_trailer) - RESOLVE_METHOD(av_write_frame) +@@ -276,6 +279,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + #if defined(AVFORMAT_HAS_STREAM_GET_R_FRAME_RATE) + RESOLVE_METHOD(av_stream_get_r_frame_rate) + #endif + RESOLVE_METHOD(av_find_default_stream_index) END_METHOD_RESOLVE() @@ -17013,393 +18330,10 @@ index ee41fa8..56605cb 100644 1.8.1.6 -From 17456e4ad8737d27ae084dfae0045ed3eb9da577 Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Sat, 13 Apr 2013 11:30:39 +0200 -Subject: [PATCH 054/110] XVBA: revisit draw functions - ---- - lib/ffmpeg/libavcodec/xvba_h264.c | 2 +- - lib/ffmpeg/libavcodec/xvba_vc1.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/lib/ffmpeg/libavcodec/xvba_h264.c b/lib/ffmpeg/libavcodec/xvba_h264.c -index ae45f3a..309d928 100644 ---- a/lib/ffmpeg/libavcodec/xvba_h264.c -+++ b/lib/ffmpeg/libavcodec/xvba_h264.c -@@ -160,7 +160,7 @@ static int end_frame(AVCodecContext *avctx) - h->got_first_iframe = 1; - } - -- ff_draw_horiz_band(h->avctx, &h->dsp, h->cur_pic_ptr, NULL, 0, h->avctx->height, h->picture_structure, h->first_field, 0, 0, 0, 0); -+ ff_h264_draw_horiz_band(h, 0, h->avctx->height); - - return 0; - } -diff --git a/lib/ffmpeg/libavcodec/xvba_vc1.c b/lib/ffmpeg/libavcodec/xvba_vc1.c -index bf3d9c2..ff35a28 100644 ---- a/lib/ffmpeg/libavcodec/xvba_vc1.c -+++ b/lib/ffmpeg/libavcodec/xvba_vc1.c -@@ -142,7 +142,7 @@ static int end_frame(AVCodecContext *avctx) - break; - } - -- ff_draw_horiz_band(s->avctx, &s->dsp, s->current_picture_ptr, s->last_picture_ptr, 0, s->avctx->height, s->picture_structure, s->first_field, (s->unrestricted_mv && !s->intra_only), s->low_delay, s->v_edge_pos, s->h_edge_pos); -+ ff_mpeg_draw_horiz_band(s, 0, s->avctx->height); - - return 0; - } --- -1.8.1.6 - - -From 898c52bb46e3ad80cf64d7db7c60d5b2d338563b Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Sat, 13 Apr 2013 12:06:02 +0200 -Subject: [PATCH 055/110] (ffmpeg): Make XVBA codec available - ---- - lib/ffmpeg/libavcodec/vc1dec.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/lib/ffmpeg/libavcodec/vc1dec.c b/lib/ffmpeg/libavcodec/vc1dec.c -index 2130c74..4d611f9 100644 ---- a/lib/ffmpeg/libavcodec/vc1dec.c -+++ b/lib/ffmpeg/libavcodec/vc1dec.c -@@ -5807,6 +5807,9 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, - #if CONFIG_VDPAU - AV_PIX_FMT_VDPAU, - #endif -+#if CONFIG_XVBA -+ AV_PIX_FMT_XVBA_VLD, -+#endif - AV_PIX_FMT_YUV420P, - AV_PIX_FMT_NONE - }; --- -1.8.1.6 - - -From 3b952bf28abbd43949c303b858be9a27ebf864d2 Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Sat, 13 Apr 2013 16:38:50 +0200 -Subject: [PATCH 056/110] ffmpeg: XVBA-VC1 use v->second_field instead of - !s->first_field to make VC1 interlaced working - ---- - lib/ffmpeg/libavcodec/xvba_vc1.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/ffmpeg/libavcodec/xvba_vc1.c b/lib/ffmpeg/libavcodec/xvba_vc1.c -index ff35a28..04e7983 100644 ---- a/lib/ffmpeg/libavcodec/xvba_vc1.c -+++ b/lib/ffmpeg/libavcodec/xvba_vc1.c -@@ -99,7 +99,7 @@ static int end_frame(AVCodecContext *avctx) - pic_descriptor->sps_info.vc1.psf = v->psf; - // what about if it is a frame (page 31) - // looked at xvba-driver -- pic_descriptor->sps_info.vc1.second_field = !s->first_field; -+ pic_descriptor->sps_info.vc1.second_field = v->second_field; - pic_descriptor->sps_info.vc1.xvba_vc1_sps_reserved = 0; - - // VC-1 explicit parameters see page 30 of sdk --- -1.8.1.6 - - -From 80e05a1fdafc66ab25364cd661f4839df4d16a1a Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Sat, 27 Apr 2013 17:36:15 +0200 -Subject: [PATCH 057/110] XVBA: Only set second_field when we are interlaced - and an interlaced field - ---- - lib/ffmpeg/libavcodec/xvba_vc1.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/ffmpeg/libavcodec/xvba_vc1.c b/lib/ffmpeg/libavcodec/xvba_vc1.c -index 04e7983..eb90c12 100644 ---- a/lib/ffmpeg/libavcodec/xvba_vc1.c -+++ b/lib/ffmpeg/libavcodec/xvba_vc1.c -@@ -99,7 +99,7 @@ static int end_frame(AVCodecContext *avctx) - pic_descriptor->sps_info.vc1.psf = v->psf; - // what about if it is a frame (page 31) - // looked at xvba-driver -- pic_descriptor->sps_info.vc1.second_field = v->second_field; -+ pic_descriptor->sps_info.vc1.second_field = v->interlace && v->second_field && (v->fcm == ILACE_FIELD); - pic_descriptor->sps_info.vc1.xvba_vc1_sps_reserved = 0; - - // VC-1 explicit parameters see page 30 of sdk --- -1.8.1.6 - - -From fdd88b6e39dd8ec7cf5899276dc583b7eb4237fd Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Sat, 27 Apr 2013 22:08:50 +0200 -Subject: [PATCH 058/110] xvba: translate picture_structure to a value xvba - understands - ---- - lib/ffmpeg/libavcodec/xvba.c | 11 +++++++++++ - lib/ffmpeg/libavcodec/xvba_h264.c | 4 +++- - lib/ffmpeg/libavcodec/xvba_internal.h | 1 + - lib/ffmpeg/libavcodec/xvba_vc1.c | 4 +++- - 4 files changed, 18 insertions(+), 2 deletions(-) - -diff --git a/lib/ffmpeg/libavcodec/xvba.c b/lib/ffmpeg/libavcodec/xvba.c -index be29e5d..566922e 100644 ---- a/lib/ffmpeg/libavcodec/xvba.c -+++ b/lib/ffmpeg/libavcodec/xvba.c -@@ -31,6 +31,7 @@ - #include "xvba.h" - #include "xvba_internal.h" - #include "avcodec.h" -+#include "mpegvideo.h" - - int ff_xvba_translate_profile(int profile) { - -@@ -50,6 +51,16 @@ int ff_xvba_translate_profile(int profile) { - return -1; - } - -+// See page 25 of the documentation -+int ff_xvba_translate_picture_structure(int picture_structure) { -+ if(picture_structure == PICT_TOP_FIELD) -+ return 0; -+ else if (picture_structure == PICT_BOTTOM_FIELD) -+ return 1; -+ else //PICT_FRAME by default -+ return 3; -+} -+ - void ff_xvba_add_slice_data(struct xvba_render_state *render, const uint8_t *buffer, uint32_t size) { - - render->buffers = av_fast_realloc( -diff --git a/lib/ffmpeg/libavcodec/xvba_h264.c b/lib/ffmpeg/libavcodec/xvba_h264.c -index 309d928..20ba2f2 100644 ---- a/lib/ffmpeg/libavcodec/xvba_h264.c -+++ b/lib/ffmpeg/libavcodec/xvba_h264.c -@@ -87,7 +87,9 @@ static int end_frame(AVCodecContext *avctx) - pic_descriptor->level = avctx->level; - pic_descriptor->width_in_mb = h->mb_width; - pic_descriptor->height_in_mb = h->mb_height; -- pic_descriptor->picture_structure = h->picture_structure; -+ -+ pic_descriptor->picture_structure = ff_xvba_translate_picture_structure(h->picture_structure); -+ - pic_descriptor->chroma_format = h->chroma_format_idc ? h->chroma_format_idc : 1; - pic_descriptor->avc_intra_flag = (h->slice_type == AV_PICTURE_TYPE_I) ? 1 : 0; - pic_descriptor->avc_reference = (h->cur_pic_ptr->f.reference & 3) ? 1 : 0; -diff --git a/lib/ffmpeg/libavcodec/xvba_internal.h b/lib/ffmpeg/libavcodec/xvba_internal.h -index 9653f85..18faa3e 100644 ---- a/lib/ffmpeg/libavcodec/xvba_internal.h -+++ b/lib/ffmpeg/libavcodec/xvba_internal.h -@@ -21,4 +21,5 @@ - */ - - int ff_xvba_translate_profile(int profile); -+int ff_xvba_translate_picture_structure(int picture_structure); - void ff_xvba_add_slice_data(struct xvba_render_state *render, const uint8_t *buffer, uint32_t size); -diff --git a/lib/ffmpeg/libavcodec/xvba_vc1.c b/lib/ffmpeg/libavcodec/xvba_vc1.c -index eb90c12..c98dba5 100644 ---- a/lib/ffmpeg/libavcodec/xvba_vc1.c -+++ b/lib/ffmpeg/libavcodec/xvba_vc1.c -@@ -78,7 +78,9 @@ static int end_frame(AVCodecContext *avctx) - pic_descriptor->width_in_mb = s->mb_width; - pic_descriptor->height_in_mb = s->mb_height; - } -- pic_descriptor->picture_structure = s->picture_structure; -+ -+ pic_descriptor->picture_structure = ff_xvba_translate_picture_structure(s->picture_structure); -+ - // xvba-video set this to 1 only 4:2:0 supported - // doc says: if not set, choose 1 - we try this - pic_descriptor->chroma_format = 1; --- -1.8.1.6 - - -From 98b0def969e92f7c8075f8401cd2bb107b0e79b1 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Tue, 30 Apr 2013 21:18:55 +0200 -Subject: [PATCH 059/110] ffmpeg xvba: fix vc1 field interlace - ---- - lib/ffmpeg/libavcodec/xvba.c | 4 ++-- - lib/ffmpeg/libavcodec/xvba.h | 1 + - lib/ffmpeg/libavcodec/xvba_vc1.c | 1 + - 3 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/lib/ffmpeg/libavcodec/xvba.c b/lib/ffmpeg/libavcodec/xvba.c -index 566922e..c6ff2fe 100644 ---- a/lib/ffmpeg/libavcodec/xvba.c -+++ b/lib/ffmpeg/libavcodec/xvba.c -@@ -53,9 +53,9 @@ int ff_xvba_translate_profile(int profile) { - - // See page 25 of the documentation - int ff_xvba_translate_picture_structure(int picture_structure) { -- if(picture_structure == PICT_TOP_FIELD) -+ if(picture_structure == PICT_BOTTOM_FIELD) - return 0; -- else if (picture_structure == PICT_BOTTOM_FIELD) -+ else if (picture_structure == PICT_TOP_FIELD) - return 1; - else //PICT_FRAME by default - return 3; -diff --git a/lib/ffmpeg/libavcodec/xvba.h b/lib/ffmpeg/libavcodec/xvba.h -index 9f9ff0c..e590faf 100644 ---- a/lib/ffmpeg/libavcodec/xvba.h -+++ b/lib/ffmpeg/libavcodec/xvba.h -@@ -66,6 +66,7 @@ struct xvba_render_state { - unsigned int num_slices; - struct xvba_bitstream_buffers *buffers; - uint32_t buffers_alllocated; -+ int psf; - }; - - #endif /* AVCODEC_XVBA_H */ -diff --git a/lib/ffmpeg/libavcodec/xvba_vc1.c b/lib/ffmpeg/libavcodec/xvba_vc1.c -index c98dba5..e7a85a7 100644 ---- a/lib/ffmpeg/libavcodec/xvba_vc1.c -+++ b/lib/ffmpeg/libavcodec/xvba_vc1.c -@@ -143,6 +143,7 @@ static int end_frame(AVCodecContext *avctx) - pic_descriptor->future_surface = last->surface; - break; - } -+ render->psf = v->psf; - - ff_mpeg_draw_horiz_band(s, 0, s->avctx->height); - --- -1.8.1.6 - - -From a2d3dec001d3876d74a8838744050648eff45724 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Tue, 30 Apr 2013 21:19:07 +0200 -Subject: [PATCH 060/110] xvba: fix vc1 field interlace - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -index 43a331f..568632f 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -@@ -1000,6 +1000,9 @@ void CDecoder::FFDrawSlice(struct AVCodecContext *avctx, - { - startCodeSize = 4; - uint8_t sdf = 0x0d; -+ if (render->picture_descriptor->sps_info.vc1.second_field) -+ sdf = 0x0c; -+ - memcpy((uint8_t*)xvba->m_xvbaBufferPool.data_buffer->bufferXVBA+location, - startCode, 3); - memcpy((uint8_t*)xvba->m_xvbaBufferPool.data_buffer->bufferXVBA+location+3, --- -1.8.1.6 - - -From 0199079932e05c87a5166d190bd9f414a85eada3 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Tue, 30 Apr 2013 21:40:55 +0200 -Subject: [PATCH 061/110] xvba: vc1 - honor psf - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -index 568632f..1db9363 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -@@ -1181,6 +1181,7 @@ int CDecoder::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) - - render->state |= FF_XVBA_STATE_USED_FOR_REFERENCE; - render->state &= ~FF_XVBA_STATE_DECODED; -+ render->psf = 0; - pic->reordered_opaque= avctx->reordered_opaque; - - return 0; -@@ -1225,6 +1226,8 @@ int CDecoder::Decode(AVCodecContext* avctx, AVFrame* frame) - memset(&pic.DVDPic, 0, sizeof(pic.DVDPic)); - ((CDVDVideoCodecFFmpeg*)avctx->opaque)->GetPictureCommon(&pic.DVDPic); - pic.render = render; -+ if (render->psf) -+ pic.DVDPic.iFlags &= ~DVP_FLAG_INTERLACED; - m_bufferStats.IncDecoded(); - m_xvbaOutput.m_dataPort.SendOutMessage(COutputDataProtocol::NEWFRAME, &pic, sizeof(pic)); - --- -1.8.1.6 - - -From 5903b207c8fd52c5bee549612c0c35d86ebef1eb Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sat, 4 May 2013 10:31:32 +0200 -Subject: [PATCH 062/110] xvba: squash me, settings - ---- - xbmc/settings/Settings.cpp | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp -index 1de1ac6..1174659 100644 ---- a/xbmc/settings/Settings.cpp -+++ b/xbmc/settings/Settings.cpp -@@ -758,6 +758,9 @@ void CSettings::InitializeConditions() - #ifdef HAVE_LIBVDPAU - m_settingsManager->AddCondition("have_libvdpau"); - #endif -+#ifdef HAVE_LIBXVBA -+ m_settingsManager->AddCondition("have_libxvba"); -+#endif - #ifdef HAVE_VIDEOTOOLBOXDECODER - m_settingsManager->AddCondition("have_videotoolboxdecoder"); - if (g_sysinfo.HasVideoToolBoxDecoder()) --- -1.8.1.6 - - -From 03a51a564d6a80f53c67d1204737bb61b3265c2f Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Fri, 24 May 2013 12:02:02 +0200 -Subject: [PATCH 063/110] XVBA: Limit video to 2048x1152 as this is the max all - blocks can handle - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -index 1db9363..54d7aea 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -@@ -340,10 +340,12 @@ bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat fmt, unsigned - // it seems that xvba does not support anything > 2k - // return false, for files that are larger - // if you are unlucky, this would kill your decoder -- // we limit to 2048x1536(+8) now - as this was tested working -+ // we limit to 2048x1152 now - as this was reported by ckoenig the UVD OSS -+ // engineer to be the maximum technically possible for all hardware with UVD. -+ // Some chips can do a bit more, but we use the safe default. - int surfaceWidth = (avctx->coded_width+15) & ~15; - int surfaceHeight = (avctx->coded_height+15) & ~15; -- if(surfaceHeight > 1544 || surfaceWidth > 2048) -+ if(surfaceHeight > 1152 || surfaceWidth > 2048) - { - CLog::Log(LOGERROR, "Surface too large, decoder skipped: surfaceWidth %u, surfaceHeight %u", - surfaceWidth, surfaceHeight); --- -1.8.1.6 - - -From bc55f265667c12b21f24f443f434a9541d8871fc Mon Sep 17 00:00:00 2001 +From 345117b7bb8287000dc771151d1a34f14b465c19 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 20 Aug 2012 16:06:39 +0200 -Subject: [PATCH 064/110] dvdplayer: observe pts counter overflow +Subject: [PATCH 073/111] dvdplayer: observe pts counter overflow --- .../cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 198 ++++++++++++++++++++- @@ -17407,7 +18341,7 @@ Subject: [PATCH 064/110] dvdplayer: observe pts counter overflow 2 files changed, 201 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index 4e7ca89..4a21438 100644 +index 8afeebe..cd02087 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp @@ -18,7 +18,6 @@ @@ -17686,10 +18620,10 @@ index aef5ab1..35abbdf 100644 1.8.1.6 -From 1ef2e98ecd3c9f22c66c7b0abb2def18559fd114 Mon Sep 17 00:00:00 2001 +From c9faeb54dec08b3ff07c8064dcf3310248455005 Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 2 Oct 2012 13:02:10 +0200 -Subject: [PATCH 065/110] dvdplayer: avoid short screen flicker caused by +Subject: [PATCH 074/111] dvdplayer: avoid short screen flicker caused by unnecessary reconfigure of renderer --- @@ -17697,10 +18631,10 @@ Subject: [PATCH 065/110] dvdplayer: avoid short screen flicker caused by 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index f35419f..61aa709 100644 +index c2808c3..5d487f4 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1062,7 +1062,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) +@@ -1065,7 +1065,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) || ( m_output.height != pPicture->iHeight ) || ( m_output.dwidth != pPicture->iDisplayWidth ) || ( m_output.dheight != pPicture->iDisplayHeight ) @@ -17709,7 +18643,7 @@ index f35419f..61aa709 100644 || ( m_output.color_format != (unsigned int)pPicture->format ) || ( m_output.extended_format != pPicture->extended_format ) || ( m_output.color_matrix != pPicture->color_matrix && pPicture->color_matrix != 0 ) // don't reconfigure on unspecified -@@ -1118,7 +1118,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) +@@ -1121,7 +1121,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) m_output.height = pPicture->iHeight; m_output.dwidth = pPicture->iDisplayWidth; m_output.dheight = pPicture->iDisplayHeight; @@ -17722,10 +18656,10 @@ index f35419f..61aa709 100644 1.8.1.6 -From d54a67b705e0cb0febdb7acb7cee45b77975c2a2 Mon Sep 17 00:00:00 2001 +From c38283b4394ce4dcaea0421b29a1491a6c715ccb Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 11 Oct 2012 12:05:50 +0200 -Subject: [PATCH 066/110] vdpau: advanced settings for auto deinterlacing +Subject: [PATCH 075/111] vdpau: advanced settings for auto deinterlacing --- xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 8 ++++---- @@ -17734,10 +18668,10 @@ Subject: [PATCH 066/110] 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 2fdcf37..2805613 100644 +index 7f0fbd0..b6f3b83 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -1800,10 +1800,10 @@ EINTERLACEMETHOD CMixer::GetDeinterlacingMethod(bool log /* = false */) +@@ -1818,10 +1818,10 @@ EINTERLACEMETHOD CMixer::GetDeinterlacingMethod(bool log /* = false */) if (method == VS_INTERLACEMETHOD_AUTO) { int deint = -1; @@ -17753,7 +18687,7 @@ index 2fdcf37..2805613 100644 if (deint != -1) { diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index 8287651..79d4f90 100644 +index f611bb6..bae5466 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp @@ -169,6 +169,8 @@ void CAdvancedSettings::Initialize() @@ -17765,7 +18699,7 @@ index 8287651..79d4f90 100644 m_videoVDPAUtelecine = false; m_videoVDPAUdeintSkipChromaHD = false; m_DXVACheckCompatibility = false; -@@ -601,6 +603,8 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) +@@ -605,6 +607,8 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) XMLUtils::GetBoolean(pElement,"allowmpeg4vaapi",m_videoAllowMpeg4VAAPI); XMLUtils::GetBoolean(pElement, "disablebackgrounddeinterlace", m_videoDisableBackgroundDeinterlace); XMLUtils::GetInt(pElement, "useocclusionquery", m_videoCaptureUseOcclusionQuery, -1, 1); @@ -17775,7 +18709,7 @@ index 8287651..79d4f90 100644 XMLUtils::GetBoolean(pElement,"vdpauHDdeintSkipChroma",m_videoVDPAUdeintSkipChromaHD); diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h -index 310db76..830a241 100644 +index df5b028..82057bf 100644 --- a/xbmc/settings/AdvancedSettings.h +++ b/xbmc/settings/AdvancedSettings.h @@ -158,6 +158,8 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler @@ -17791,10 +18725,10 @@ index 310db76..830a241 100644 1.8.1.6 -From 46d6b77751fa93a9868bba4086250e8841d939db Mon Sep 17 00:00:00 2001 +From 695161587d0744b427548511fe7b0ed631741bf5 Mon Sep 17 00:00:00 2001 From: xbmc Date: Fri, 2 Nov 2012 13:20:03 +0100 -Subject: [PATCH 067/110] player: fix rewind +Subject: [PATCH 076/111] player: fix rewind --- xbmc/cores/dvdplayer/DVDMessage.h | 5 ++++- @@ -17842,10 +18776,10 @@ index 2ea8b8f..e8274f9 100644 class CDVDMsgPlayerSeekChapter : public CDVDMsg diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 1bd122b..99f0042 100644 +index 06c9439..1ca0de2 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -1557,11 +1557,13 @@ void CDVDPlayer::HandlePlaySpeed() +@@ -1560,11 +1560,13 @@ void CDVDPlayer::HandlePlaySpeed() } else if (m_CurrentVideo.id >= 0 && (m_CurrentVideo.inited == true || GetPlaySpeed() < 0) // allow rewind at end of file @@ -17860,7 +18794,7 @@ index 1bd122b..99f0042 100644 // check how much off clock video is when ff/rw:ing // a problem here is that seeking isn't very accurate // and since the clock will be resynced after seek -@@ -1580,7 +1582,7 @@ void CDVDPlayer::HandlePlaySpeed() +@@ -1583,7 +1585,7 @@ void CDVDPlayer::HandlePlaySpeed() { CLog::Log(LOGDEBUG, "CDVDPlayer::Process - Seeking to catch up"); int64_t iTime = (int64_t)DVD_TIME_TO_MSEC(m_clock.GetClock() + m_State.time_offset + 500000.0 * m_playSpeed / DVD_PLAYSPEED_NORMAL); @@ -17869,7 +18803,7 @@ index 1bd122b..99f0042 100644 } } } -@@ -2068,7 +2070,7 @@ void CDVDPlayer::HandleMessages() +@@ -2071,7 +2073,7 @@ void CDVDPlayer::HandleMessages() else m_StateInput.dts = start; @@ -17878,7 +18812,7 @@ index 1bd122b..99f0042 100644 } else CLog::Log(LOGWARNING, "error while seeking"); -@@ -2207,9 +2209,10 @@ void CDVDPlayer::HandleMessages() +@@ -2210,9 +2212,10 @@ void CDVDPlayer::HandleMessages() double offset; offset = CDVDClock::GetAbsoluteClock() - m_State.timestamp; offset *= m_playSpeed / DVD_PLAYSPEED_NORMAL; @@ -17890,7 +18824,7 @@ index 1bd122b..99f0042 100644 m_State.timestamp = CDVDClock::GetAbsoluteClock(); } -@@ -2225,7 +2228,8 @@ void CDVDPlayer::HandleMessages() +@@ -2228,7 +2231,8 @@ void CDVDPlayer::HandleMessages() // do a seek after rewind, clock is not in sync with current pts if (m_playSpeed < 0 && speed >= 0) { @@ -17900,7 +18834,7 @@ index 1bd122b..99f0042 100644 } // if playspeed is different then DVD_PLAYSPEED_NORMAL or DVD_PLAYSPEED_PAUSE -@@ -3177,7 +3181,7 @@ bool CDVDPlayer::CloseTeletextStream(bool bWaitForBuffers) +@@ -3180,7 +3184,7 @@ bool CDVDPlayer::CloseTeletextStream(bool bWaitForBuffers) return true; } @@ -17909,7 +18843,7 @@ index 1bd122b..99f0042 100644 { double startpts; if(accurate) -@@ -3189,19 +3193,23 @@ void CDVDPlayer::FlushBuffers(bool queued, double pts, bool accurate) +@@ -3192,19 +3196,23 @@ void CDVDPlayer::FlushBuffers(bool queued, double pts, bool accurate) if(startpts != DVD_NOPTS_VALUE) startpts -= m_offset_pts; @@ -17937,7 +18871,7 @@ index 1bd122b..99f0042 100644 m_CurrentTeletext.dts = DVD_NOPTS_VALUE; m_CurrentTeletext.startpts = startpts; -@@ -3245,7 +3253,7 @@ void CDVDPlayer::FlushBuffers(bool queued, double pts, bool accurate) +@@ -3248,7 +3256,7 @@ void CDVDPlayer::FlushBuffers(bool queued, double pts, bool accurate) m_CurrentTeletext.started = false; } @@ -17972,10 +18906,10 @@ index 237aba4d..9e54bc8 100644 int m_errorCount; diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 61aa709..e668d29 100644 +index 5d487f4..8ebe591 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1471,7 +1471,7 @@ double CDVDPlayerVideo::GetCurrentPts() +@@ -1474,7 +1474,7 @@ double CDVDPlayerVideo::GetCurrentPts() if( m_stalled ) iRenderPts = DVD_NOPTS_VALUE; @@ -17984,7 +18918,7 @@ index 61aa709..e668d29 100644 iRenderPts = iRenderPts - max(0.0, iSleepTime); return iRenderPts; -@@ -1571,6 +1571,8 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts) +@@ -1574,6 +1574,8 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts) int iSkippedDeint = 0; int iBufferLevel; @@ -18009,10 +18943,10 @@ index 59c7f09..65dea76 100644 1.8.1.6 -From 9dd0b7d5f46e62f4868f414a599bc8c7bbc7a8b8 Mon Sep 17 00:00:00 2001 +From ad0e6973d2a300143c701de14bdbe8b08f26d1a3 Mon Sep 17 00:00:00 2001 From: xbmc Date: Fri, 23 Nov 2012 17:41:12 +0100 -Subject: [PATCH 068/110] xrandr: fix query for multiple screens +Subject: [PATCH 077/111] xrandr: fix query for multiple screens --- xbmc/windowing/X11/XRandR.cpp | 10 ++++++---- @@ -18053,10 +18987,10 @@ index 9e181f2..ce0a02b 100644 1.8.1.6 -From 8e619e069765d3ee80e17c92d5e4f9ef395046ee Mon Sep 17 00:00:00 2001 +From 746c5a49798137e3c4b209b9e9f0ca0b7bd66d9e Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 2 Dec 2012 15:46:55 +0100 -Subject: [PATCH 069/110] X11: add debug log to print out refresh after xrr +Subject: [PATCH 078/111] X11: add debug log to print out refresh after xrr event --- @@ -18084,10 +19018,10 @@ index 9ff947c..a3394e6 100644 1.8.1.6 -From e9039e88331e391396b445120472b15f8e782cb3 Mon Sep 17 00:00:00 2001 +From b7bfc1df08a3713d8b7d97f33d09bd8bfc447616 Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 11 Dec 2012 11:08:13 +0100 -Subject: [PATCH 070/110] X11: dont call XCloseDisplay on shutdown, it crashes +Subject: [PATCH 079/111] X11: dont call XCloseDisplay on shutdown, it crashes when powered doen by cec on ATI --- @@ -18112,10 +19046,10 @@ index a3394e6..b941c14 100644 1.8.1.6 -From 1e2b5a08eac009b3972c62c58a7f9ed92ce827a0 Mon Sep 17 00:00:00 2001 +From 029656493f159d1ff6c300a2e7cad40e05d90c2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Coutant?= Date: Wed, 12 Dec 2012 19:49:47 +0100 -Subject: [PATCH 071/110] x11: support for multiple x screens +Subject: [PATCH 080/111] x11: support for multiple x screens --- xbmc/windowing/X11/XRandR.cpp | 2 +- @@ -18138,10 +19072,10 @@ index ce0a02b..aa27d2b 100644 1.8.1.6 -From 55e7a139566a3d3d00ba6119deffb0f39c4ef911 Mon Sep 17 00:00:00 2001 +From 452fade6666016d2932a6b2eb6ad560bcddfc77f Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 24 Dec 2012 16:02:42 +0100 -Subject: [PATCH 072/110] pvr: increase changes counter of stream on stream +Subject: [PATCH 081/111] pvr: increase changes counter of stream on stream change, cosmetics after dd307930d39d92f145a01a16600cd00e01ec39be --- @@ -18149,7 +19083,7 @@ Subject: [PATCH 072/110] pvr: increase changes counter of stream on stream 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.cpp -index 7e35581..7adfa27 100644 +index 62fbb41..a80c789 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.cpp +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.cpp @@ -339,9 +339,7 @@ void CDVDDemuxPVRClient::RequestStreams() @@ -18175,10 +19109,10 @@ index 7e35581..7adfa27 100644 1.8.1.6 -From 3897839d0a960e56b0fb2428fac1b6b984c8aa33 Mon Sep 17 00:00:00 2001 +From 047d50ff03dc0e13b386edda99d5d185f449037c Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 17 Jan 2013 16:03:22 +0100 -Subject: [PATCH 073/110] X11: add keymapping for XF86XK_Sleep +Subject: [PATCH 082/111] X11: add keymapping for XF86XK_Sleep --- xbmc/windowing/WinEventsX11.cpp | 1 + @@ -18200,20 +19134,20 @@ index 4a5aab4..da5d412 100644 1.8.1.6 -From 05b4672c598d37ff47e07839e3329fcbe2756c14 Mon Sep 17 00:00:00 2001 +From b1a2fc5e223085fb9f465ba1ce73a583579402ec Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 21 Jan 2013 09:00:19 +0100 -Subject: [PATCH 074/110] X11: remove toggle full screen after resume +Subject: [PATCH 083/111] X11: remove toggle full screen after resume --- xbmc/powermanagement/PowerManager.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/xbmc/powermanagement/PowerManager.cpp b/xbmc/powermanagement/PowerManager.cpp -index d658a97..7f12a5d 100644 +index 2033574..c79bbc1 100644 --- a/xbmc/powermanagement/PowerManager.cpp +++ b/xbmc/powermanagement/PowerManager.cpp -@@ -260,11 +260,6 @@ void CPowerManager::OnWake() +@@ -268,11 +268,6 @@ void CPowerManager::OnWake() #if defined(TARGET_WINDOWS) ShowWindow(g_hWnd,SW_RESTORE); SetForegroundWindow(g_hWnd); @@ -18229,10 +19163,10 @@ index d658a97..7f12a5d 100644 1.8.1.6 -From fcab0158f441c5f7ee06bb360a2d56a14ab79b77 Mon Sep 17 00:00:00 2001 +From 21c12b87da8a2eef346b6249b2980d7d316d8ae5 Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 23 Jan 2013 17:03:02 +0100 -Subject: [PATCH 075/110] xrandr: set screen on mode change command +Subject: [PATCH 084/111] xrandr: set screen on mode change command --- xbmc/windowing/X11/XRandR.cpp | 2 +- @@ -18255,10 +19189,10 @@ index aa27d2b..67bf6ca 100644 1.8.1.6 -From 3c978a401c2624ec0391b25cc66633e247255cd5 Mon Sep 17 00:00:00 2001 +From 4385222d8becf806704305ae839f1b70160b33da Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 23 Jan 2013 17:03:39 +0100 -Subject: [PATCH 076/110] X11: recreate glx context when output changes +Subject: [PATCH 085/111] X11: recreate glx context when output changes --- xbmc/windowing/X11/WinSystemX11.cpp | 6 +++--- @@ -18309,10 +19243,10 @@ index ce3c289..311e4cc 100644 1.8.1.6 -From 6cddfccd77d365c81a384512a5cfee3b00f9b15c Mon Sep 17 00:00:00 2001 +From 3e971e46fa6e016c76e807c8d00af449d258f719 Mon Sep 17 00:00:00 2001 From: xbmc Date: Fri, 14 Dec 2012 14:19:15 +0100 -Subject: [PATCH 077/110] pvr: do not show selection dialog for a single menu +Subject: [PATCH 086/111] pvr: do not show selection dialog for a single menu hook --- @@ -18320,7 +19254,7 @@ Subject: [PATCH 077/110] pvr: do not show selection dialog for a single menu 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xbmc/pvr/addons/PVRClients.cpp b/xbmc/pvr/addons/PVRClients.cpp -index c84bd4d..a39584b 100644 +index aab6345..a880778 100644 --- a/xbmc/pvr/addons/PVRClients.cpp +++ b/xbmc/pvr/addons/PVRClients.cpp @@ -729,6 +729,7 @@ void CPVRClients::ProcessMenuHooks(int iClientID, PVR_MENUHOOK_CAT cat, const CF @@ -18350,10 +19284,10 @@ index c84bd4d..a39584b 100644 1.8.1.6 -From 2f7e8b17ab53a312588d4895cae2fa678760e069 Mon Sep 17 00:00:00 2001 +From 933978ae6ca200d2739d36c417fa3459c3ea392f Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 3 Feb 2013 08:17:16 +0100 -Subject: [PATCH 078/110] X11: use default screen parameters if no output +Subject: [PATCH 087/111] X11: use default screen parameters if no output connected --- @@ -18457,10 +19391,10 @@ index c84e793..5215f4d 100644 1.8.1.6 -From f15251c6dabb64a50cec28eb745534be103437db Mon Sep 17 00:00:00 2001 +From 635080d09a9552a4900ffa2fd504946879851af6 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 23 Mar 2013 15:13:32 +0100 -Subject: [PATCH 079/110] X11: create parent window +Subject: [PATCH 088/111] X11: create parent window --- xbmc/windowing/X11/WinSystemX11.cpp | 69 +++++++++++++++++++++++-------------- @@ -18726,10 +19660,10 @@ index 311e4cc..49365a8 100644 1.8.1.6 -From fdbc56ee223bb0ab998470b5ceb897ac82519530 Mon Sep 17 00:00:00 2001 +From cc5af656ee061060547df565c9d7fd62b3153a2d Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 24 Mar 2013 12:30:12 +0100 -Subject: [PATCH 080/110] X11: use system key repeat rate instead of hardcoded +Subject: [PATCH 089/111] X11: use system key repeat rate instead of hardcoded one, taken from 58fd64b194e38b73b5f3132744bab35e994e7441 --- @@ -18931,10 +19865,10 @@ index 102a076..5b1f3fa 100644 1.8.1.6 -From a70c2e4a776c5be440a1b6c65824d4b36402574f Mon Sep 17 00:00:00 2001 +From 5bf17c84b9dd8e2e03b90e2a418ad2a1f018856a Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 24 Mar 2013 16:04:48 +0100 -Subject: [PATCH 081/110] linux: use CLOCK_MONOTONIC_RAW as this is not subject +Subject: [PATCH 090/111] linux: use CLOCK_MONOTONIC_RAW as this is not subject to NTP --- @@ -18972,21 +19906,21 @@ index c06b8c5..4390d2e 100644 1.8.1.6 -From a79350b43a1c60dc162868475da99421863c74bc Mon Sep 17 00:00:00 2001 +From 52392e8e6b9b2359de01f0a6708a121196641622 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 28 Mar 2013 15:18:53 +0100 -Subject: [PATCH 082/110] OMXPlayer: some caching fixes for pvr +Subject: [PATCH 091/111] OMXPlayer: some caching fixes for pvr --- xbmc/cores/omxplayer/OMXPlayer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/omxplayer/OMXPlayer.cpp b/xbmc/cores/omxplayer/OMXPlayer.cpp -index 31b690c..9d24622 100644 +index 1bfbdaf..11dd1cc 100644 --- a/xbmc/cores/omxplayer/OMXPlayer.cpp +++ b/xbmc/cores/omxplayer/OMXPlayer.cpp @@ -2460,7 +2460,8 @@ void COMXPlayer::HandleMessages() - m_messenger.Put(new CDVDMsgPlayerSeek(DVD_TIME_TO_MSEC(m_clock.GetClock()), (speed < 0), true, false, false, true)); + m_messenger.Put(new CDVDMsgPlayerSeek(GetTime(), (speed < 0), true, false, false, true)); m_playSpeed = speed; - m_caching = CACHESTATE_DONE; @@ -18999,20 +19933,20 @@ index 31b690c..9d24622 100644 1.8.1.6 -From c36206ab65b88bee3d9216d09382f523f470635c Mon Sep 17 00:00:00 2001 +From 49bae3f230d681d6890d2ee706ef68ce72f504bf Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 28 Mar 2013 20:50:59 +0100 -Subject: [PATCH 083/110] fix incorrect display of fps when dr kicks in +Subject: [PATCH 092/111] 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 55a2685..c864770 100644 +index 92e467d..525402c 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -2174,10 +2174,11 @@ void CApplication::Render() +@@ -2184,10 +2184,11 @@ void CApplication::Render() if (frameTime < singleFrameTime) Sleep(singleFrameTime - frameTime); } @@ -19029,73 +19963,10 @@ index 55a2685..c864770 100644 1.8.1.6 -From 26f9d7c84392476cd83eb25fae0cd467478d5300 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Mon, 8 Apr 2013 11:18:31 +0200 -Subject: [PATCH 084/110] squash to dropping control - ---- - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index e668d29..3474fe6 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -39,6 +39,7 @@ - #include "DVDCodecs/DVDCodecs.h" - #include "DVDCodecs/Overlay/DVDOverlayCodecCC.h" - #include "DVDCodecs/Overlay/DVDOverlaySSA.h" -+#include "guilib/GraphicContext.h" - #include - #include - #include --- -1.8.1.6 - - -From be88e4fbe0b07c5604e1e8a548b09f55b67f02ae Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Thu, 11 Apr 2013 12:33:46 +0200 -Subject: [PATCH 085/110] pvr: try SwtichChannel when selecting a channel via - EPG - ---- - xbmc/pvr/windows/GUIWindowPVRGuide.cpp | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp -index 8616980..198b074 100644 ---- a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp -+++ b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp -@@ -427,15 +427,16 @@ bool CGUIWindowPVRGuide::PlayEpgItem(CFileItem *item) - return false; - - CLog::Log(LOGDEBUG, "play channel '%s'", channel->ChannelName().c_str()); -- PlayBackRet ret = g_application.PlayFile(CFileItem(*channel)); -- if (ret == PLAYBACK_FAIL) -+ CFileItem channelItem = CFileItem(*channel); -+ bool bReturn = PlayFile(&channelItem); -+ if (!bReturn) - { - CStdString msg; - msg.Format(g_localizeStrings.Get(19035).c_str(), channel->ChannelName().c_str()); // CHANNELNAME could not be played. Check the log for details. - CGUIDialogOK::ShowAndGetInput(19033, 0, msg, 0); - } - -- return ret == PLAYBACK_OK; -+ return bReturn; - } - - bool CGUIWindowPVRGuide::OnContextButtonPlay(CFileItem *item, CONTEXT_BUTTON button) --- -1.8.1.6 - - -From 51814a1e2c8a562395544a5424fb514a3cda8883 Mon Sep 17 00:00:00 2001 +From 25be31f0e6ffc174c415f0a9bdcd9c38f48bdf01 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 13 Apr 2013 08:32:06 +0200 -Subject: [PATCH 086/110] X11: fix mouse coverage +Subject: [PATCH 093/111] X11: fix mouse coverage --- xbmc/windowing/X11/WinSystemX11.cpp | 11 ++++++++--- @@ -19161,10 +20032,10 @@ index 49365a8..924af1d 100644 1.8.1.6 -From 72e48eb8dbcd4e9d6463a5bfaf32bb8eb03aa8c3 Mon Sep 17 00:00:00 2001 +From 7a1d8137b3ed2e7a2ddfe7be1963615b462926b6 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Wed, 8 May 2013 13:14:58 +0200 -Subject: [PATCH 087/110] X11: fix incorrectly used screen num in desktop +Subject: [PATCH 094/111] X11: fix incorrectly used screen num in desktop resolution --- @@ -19199,10 +20070,10 @@ index 186a28e..66955b8 100644 1.8.1.6 -From 5f7c989345a0bc874dab7985e5b1dd7f524b743d Mon Sep 17 00:00:00 2001 +From b13292942c269723de9d5ad1c1a346cd660ae9e1 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Thu, 9 May 2013 12:07:09 +0200 -Subject: [PATCH 088/110] X11: do not overwrite user selected monitor with +Subject: [PATCH 095/111] X11: do not overwrite user selected monitor with fallback --- @@ -19327,10 +20198,10 @@ index 924af1d..2fb9e0f 100644 1.8.1.6 -From 4df886974f2671a5879f43f5154d7204f8b4f11b Mon Sep 17 00:00:00 2001 +From 4e2bee476f5ff41e71c8841e4d37c162e84f309c Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sun, 12 May 2013 10:50:30 +0200 -Subject: [PATCH 089/110] xrandr: add turn on/off to wrapper +Subject: [PATCH 096/111] xrandr: add turn on/off to wrapper --- xbmc/windowing/X11/XRandR.cpp | 78 +++++++++++++++++++++++++++++++++++++++---- @@ -19496,10 +20367,10 @@ index d37838a..059062f 100644 1.8.1.6 -From 48754be0ac3f25931cef14a72090a775536d1443 Mon Sep 17 00:00:00 2001 +From fc2f08443b4e7dbaeb97ecfe3ef86ecf0c0540ac Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sun, 19 May 2013 12:55:35 +0200 -Subject: [PATCH 090/110] xrandr: add GetPreferredMode to wrapper +Subject: [PATCH 097/111] xrandr: add GetPreferredMode to wrapper --- xbmc/windowing/X11/XRandR.cpp | 23 +++++++++++++++++++++++ @@ -19556,10 +20427,10 @@ index 059062f..ab7cc63 100644 1.8.1.6 -From 667eb31e549880a80aaf1ccd983e010ddc833eae Mon Sep 17 00:00:00 2001 +From 31a16ec843d58847c3e1e3418f1a13481555b950 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sat, 11 May 2013 17:12:12 +0200 -Subject: [PATCH 091/110] X11: multi-head improvement - poll for desired output +Subject: [PATCH 098/111] X11: multi-head improvement - poll for desired output if we do not get an xrr event --- @@ -19574,10 +20445,10 @@ Subject: [PATCH 091/110] X11: multi-head improvement - poll for desired output 8 files changed, 105 insertions(+), 12 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index fc1f5ec4d..645d7be 100644 +index 6e87bc7..b9aefe3 100644 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -6242,7 +6242,7 @@ msgctxt "#14071" +@@ -6251,7 +6251,7 @@ msgctxt "#14071" msgid "Allow file renaming and deletion" msgstr "" @@ -19586,7 +20457,7 @@ index fc1f5ec4d..645d7be 100644 msgctxt "#14074" msgid "Set timezone" -@@ -6374,7 +6374,12 @@ msgctxt "#14100" +@@ -6383,7 +6383,12 @@ msgctxt "#14100" msgid "Stop ripping CD" msgstr "" @@ -19601,10 +20472,10 @@ index fc1f5ec4d..645d7be 100644 #: xbmc/dialogs/GUIDialogFavourites.cpp msgctxt "#15015" diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index ac87a69..688964e 100644 +index a1c7833..a737dc2 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml -@@ -1877,6 +1877,11 @@ +@@ -1884,6 +1884,11 @@ @@ -19616,7 +20487,7 @@ index ac87a69..688964e 100644 0 0 -@@ -1928,6 +1933,7 @@ +@@ -1935,6 +1940,7 @@ @@ -19640,7 +20511,7 @@ index 1a85651..46895d2 100644 return true; } diff --git a/xbmc/windowing/WinEventsX11.cpp b/xbmc/windowing/WinEventsX11.cpp -index 9caeabf..879d8f2 100644 +index 9caeabf..6ddaead 100644 --- a/xbmc/windowing/WinEventsX11.cpp +++ b/xbmc/windowing/WinEventsX11.cpp @@ -204,6 +204,7 @@ bool CWinEventsX11::Init(Display *dpy, Window win) @@ -19655,7 +20526,7 @@ index 9caeabf..879d8f2 100644 g_Windowing.NotifyXRREvent(); WinEvents->m_xrrEventPending = false; } -+ else if (!g_application.IsPlaying() && WinEvents && WinEvents->m_xrrPollTimer.IsTimePast()) ++ else if (!g_application.m_pPlayer->IsPlaying() && WinEvents && WinEvents->m_xrrPollTimer.IsTimePast()) + { + g_Windowing.NotifyXRREvent(true); + WinEvents->m_xrrPollTimer.Set(3000); @@ -19840,17 +20711,17 @@ index 4809821..1ad26b2 100644 1.8.1.6 -From b83db2b42b1f940544e4c353439a97d43379cd73 Mon Sep 17 00:00:00 2001 +From b32ea3e1cb503ac97ecdf361a238b74ab436ea4c Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Wed, 15 May 2013 09:14:34 +0200 -Subject: [PATCH 092/110] X11: ignore mouse move event form other windows +Subject: [PATCH 099/111] X11: ignore mouse move event form other windows --- xbmc/windowing/WinEventsX11.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xbmc/windowing/WinEventsX11.cpp b/xbmc/windowing/WinEventsX11.cpp -index 879d8f2..2ec9b6f 100644 +index 6ddaead..e4451fe 100644 --- a/xbmc/windowing/WinEventsX11.cpp +++ b/xbmc/windowing/WinEventsX11.cpp @@ -319,7 +319,7 @@ bool CWinEventsX11::MessagePump() @@ -19875,74 +20746,10 @@ index 879d8f2..2ec9b6f 100644 1.8.1.6 -From f8633b3687ef65d4467e0779854ba2f6b6a853b1 Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Sun, 2 Jun 2013 14:53:45 +0200 -Subject: [PATCH 093/110] vdpau: fix segfault caused by uninitialized member - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 2805613..cdfceb7 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -90,6 +90,7 @@ - m_vdpauConfig.videoSurfaceSec = &m_videoSurfaceSec; - - m_vdpauConfigured = false; -+ m_hwContext.bitstream_buffers_allocated = 0; - m_DisplayState = VDPAU_OPEN; - } - --- -1.8.1.6 - - -From d1884a4dade9ce7e7e6a90a15fdcc13b789f23b0 Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Tue, 11 Jun 2013 16:13:45 +0200 -Subject: [PATCH 094/110] vdpau: sync video mixer - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 15 +++++++++++++++ - 1 file changed, 15 insertions(+) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index cdfceb7..75ac6f0 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -2350,6 +2350,21 @@ void CMixer::ProcessPicture() - NULL); - CheckStatus(vdp_st, __LINE__); - -+ // sync mixer, read blocks until output surface is written -+ { -+ uint32_t data[16]; -+ VdpRect rect; -+ rect.x0 = rect.y0 = 0; -+ rect.x1 = rect.y1 = 1; -+ uint32_t *pdata[] = {data}; -+ uint32_t pitches[] = {4}; -+ -+ vdp_st = m_config.vdpProcs.vdp_output_surface_get_bits_native(m_processPicture.outputSurface, -+ &rect, -+ (void**)pdata, -+ pitches); -+ } -+ - if (m_mixerfield != VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME) - { - // in order to clip top and bottom lines when de-interlacing --- -1.8.1.6 - - -From 01311ab34796feff00c771a3ac357b650ef340e6 Mon Sep 17 00:00:00 2001 +From 31dc0a9d086769a0e920c0ddf926b876f6ed7015 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Tue, 11 Jun 2013 16:20:29 +0200 -Subject: [PATCH 095/110] renderer: allow some lateness within vblank interval +Subject: [PATCH 100/111] renderer: allow some lateness within vblank interval --- xbmc/cores/VideoRenderers/RenderManager.cpp | 12 ++++++++++-- @@ -19950,10 +20757,10 @@ Subject: [PATCH 095/110] renderer: allow some lateness within vblank interval 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 5056100..97fed9a 100644 +index 08d6230..d8eaac9 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -398,6 +398,8 @@ void CXBMCRenderManager::FrameFinish() +@@ -393,6 +393,8 @@ void CXBMCRenderManager::FrameFinish() if(g_graphicsContext.IsFullScreenVideo()) WaitPresentTime(m.timestamp); @@ -19962,7 +20769,7 @@ index 5056100..97fed9a 100644 { CSingleLock lock(m_presentlock); if(m_presentstep == PRESENT_FRAME) -@@ -1050,6 +1052,12 @@ void CXBMCRenderManager::PrepareNextRender() +@@ -1045,6 +1047,12 @@ void CXBMCRenderManager::PrepareNextRender() double clocktime = GetPresentTime(); double frametime = 1.0 / GetMaximumFPS(); @@ -19975,7 +20782,7 @@ index 5056100..97fed9a 100644 /* see if any future queued frames are already due */ std::deque::reverse_iterator curr, prev; -@@ -1058,8 +1066,8 @@ void CXBMCRenderManager::PrepareNextRender() +@@ -1053,8 +1061,8 @@ void CXBMCRenderManager::PrepareNextRender() ++prev; while (prev != m_queued.rend()) { @@ -20002,85 +20809,17 @@ index befd851..27283ec 100644 1.8.1.6 -From caa6819211e3709d0b07a243769efd98713abf7d Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Fri, 14 Jun 2013 09:23:22 +0200 -Subject: [PATCH 096/110] vdpau: calculate timestamp of second field when doing - deinterlacing - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 75ac6f0..67b6cf2 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -2314,7 +2314,9 @@ void CMixer::ProcessPicture() - futu_surfaces[0] = m_mixerInput[1].render->surface; - futu_surfaces[1] = m_mixerInput[1].render->surface; - -- m_processPicture.DVDPic.pts = DVD_NOPTS_VALUE; -+ m_processPicture.DVDPic.pts = m_mixerInput[1].DVDPic.pts + -+ (m_mixerInput[0].DVDPic.pts - -+ m_mixerInput[1].DVDPic.pts) / 2; - m_processPicture.DVDPic.dts = DVD_NOPTS_VALUE; - } - m_processPicture.DVDPic.iRepeatPicture = 0.0; --- -1.8.1.6 - - -From e25ff6fc6ca096549e9a8be0d87b63d4dd9bc45c Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Fri, 14 Jun 2013 10:46:58 +0200 -Subject: [PATCH 097/110] vdpau: comment debug log: long decoding time - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 67b6cf2..55430a6 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -874,7 +874,7 @@ void CDecoder::FFDrawSlice(struct AVCodecContext *s, - return; - } - -- uint64_t startTime = CurrentHostCounter(); -+// uint64_t startTime = CurrentHostCounter(); - uint16_t decoded, processed, rend; - vdp->m_bufferStats.Get(decoded, processed, rend); - vdp_st = vdp->m_vdpauConfig.vdpProcs.vdp_decoder_render(vdp->m_vdpauConfig.vdpDecoder, -@@ -883,9 +883,9 @@ void CDecoder::FFDrawSlice(struct AVCodecContext *s, - vdp->m_hwContext.bitstream_buffers_used, - vdp->m_hwContext.bitstream_buffers); - vdp->CheckStatus(vdp_st, __LINE__); -- uint64_t diff = CurrentHostCounter() - startTime; -- if (diff*1000/CurrentHostFrequency() > 30) -- CLog::Log(LOGWARNING,"CVDPAU::DrawSlice - VdpDecoderRender long decoding: %d ms, dec: %d, proc: %d, rend: %d", (int)((diff*1000)/CurrentHostFrequency()), decoded, processed, rend); -+// uint64_t diff = CurrentHostCounter() - startTime; -+// if (diff*1000/CurrentHostFrequency() > 30) -+// CLog::Log(LOGWARNING,"CVDPAU::DrawSlice - VdpDecoderRender long decoding: %d ms, dec: %d, proc: %d, rend: %d", (int)((diff*1000)/CurrentHostFrequency()), decoded, processed, rend); - - } - --- -1.8.1.6 - - -From 9fe7fd83414c3963a10fe333c439203d6b34873e Mon Sep 17 00:00:00 2001 +From 2cb5380ec3bffaaa968462afbe09484581355889 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 16 Jun 2013 13:22:58 +0200 -Subject: [PATCH 098/110] X11: another fix for mouse coverage +Subject: [PATCH 101/111] X11: another fix for mouse coverage --- xbmc/windowing/WinEventsX11.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xbmc/windowing/WinEventsX11.cpp b/xbmc/windowing/WinEventsX11.cpp -index 2ec9b6f..4ed978c 100644 +index e4451fe..582b9f5 100644 --- a/xbmc/windowing/WinEventsX11.cpp +++ b/xbmc/windowing/WinEventsX11.cpp @@ -506,14 +506,16 @@ bool CWinEventsX11::MessagePump() @@ -20106,159 +20845,10 @@ index 2ec9b6f..4ed978c 100644 1.8.1.6 -From cb8babb62b2adb4ec05722d67a23982516a5c3f0 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sun, 16 Jun 2013 13:23:19 +0200 -Subject: [PATCH 099/110] renderer: delete fence on uninit - ---- - xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index b2beb2e..2613083 100644 ---- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -+++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -1187,7 +1187,12 @@ void CLinuxRendererGL::UnInit() - - // YV12 textures - for (int i = 0; i < NUM_BUFFERS; ++i) -+ { - (this->*m_textureDelete)(i); -+ if (m_buffers[i].fence) -+ glDeleteSync(m_buffers[i].fence); -+ m_buffers[i].fence = None; -+ } - - // cleanup framebuffer object if it was in use - m_fbo.fbo.Cleanup(); --- -1.8.1.6 - - -From adc3b53ae2357465184d38409c9dc5f2d61dc007 Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Sun, 16 Jun 2013 14:28:01 +0200 -Subject: [PATCH 100/110] renderer: limit fence to vdpau - ---- - xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 15 +++++++++------ - 1 file changed, 9 insertions(+), 6 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index 2613083..9337ee6 100644 ---- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -+++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -1277,14 +1277,17 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) - VerifyGLState(); - } - -- // set fence in order to determine when buffer is ready for reuse -- // this is the case when the gl has finished processing -- if(m_buffers[renderBuffer].fence) -+ if (m_format == RENDER_FMT_VDPAU || m_format == RENDER_FMT_VDPAU_420) - { -- glDeleteSync(m_buffers[renderBuffer].fence); -- m_buffers[renderBuffer].fence = None; -+ // set fence in order to determine when buffer is ready for reuse -+ // this is the case when the gl has finished processing -+ if(m_buffers[renderBuffer].fence) -+ { -+ glDeleteSync(m_buffers[renderBuffer].fence); -+ m_buffers[renderBuffer].fence = None; -+ } -+ m_buffers[renderBuffer].fence = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); - } -- m_buffers[renderBuffer].fence = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); - } - - void CLinuxRendererGL::RenderSinglePass(int index, int field) --- -1.8.1.6 - - -From 69b3991f1c8f45295dbd62f42f3af0e153337980 Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Thu, 4 Jul 2013 16:38:26 +0200 -Subject: [PATCH 101/110] XVBA: replace CODEC_IS with AV_CODEC_ID - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -index 54d7aea..5845dbf 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -@@ -389,7 +389,7 @@ bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat fmt, unsigned - } - - int match = -1; -- if (avctx->codec_id == CODEC_ID_H264) -+ if (avctx->codec_id == AV_CODEC_ID_H264) - { - // search for profile high - for (unsigned int i = 0; i < capOutput->num_of_decodecaps; ++i) -@@ -406,7 +406,7 @@ bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat fmt, unsigned - CLog::Log(LOGNOTICE, "(XVBA::Open) - profile XVBA_H264_HIGH not found"); - } - } -- else if (avctx->codec_id == CODEC_ID_VC1) -+ else if (avctx->codec_id == AV_CODEC_ID_VC1) - { - // search for profile advanced - for (unsigned int i = 0; i < capOutput->num_of_decodecaps; ++i) -@@ -423,7 +423,7 @@ bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat fmt, unsigned - CLog::Log(LOGNOTICE, "(XVBA::Open) - profile XVBA_VC1_ADVANCED not found"); - } - } -- else if (avctx->codec_id == CODEC_ID_MPEG2VIDEO) -+ else if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO) - { - // search for profile high - for (unsigned int i = 0; i < capOutput->num_of_decodecaps; ++i) -@@ -440,7 +440,7 @@ bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat fmt, unsigned - CLog::Log(LOGNOTICE, "(XVBA::Open) - profile XVBA_MPEG2_VLD not found"); - } - } -- else if (avctx->codec_id == CODEC_ID_WMV3) -+ else if (avctx->codec_id == AV_CODEC_ID_WMV3) - { - // search for profile high - for (unsigned int i = 0; i < capOutput->num_of_decodecaps; ++i) -@@ -967,7 +967,7 @@ void CDecoder::FFDrawSlice(struct AVCodecContext *avctx, - picInput.buffer_list = list; - list[0] = xvba->m_xvbaBufferPool.picture_descriptor_buffer; - picInput.num_of_buffers_in_list = 1; -- if (avctx->codec_id == CODEC_ID_H264) -+ if (avctx->codec_id == AV_CODEC_ID_H264) - { - list[1] = xvba->m_xvbaBufferPool.iq_matrix_buffer; - picInput.num_of_buffers_in_list = 2; -@@ -991,13 +991,13 @@ void CDecoder::FFDrawSlice(struct AVCodecContext *avctx, - { - int startCodeSize = 0; - uint8_t startCode[] = {0x00,0x00,0x01}; -- if (avctx->codec_id == CODEC_ID_H264) -+ if (avctx->codec_id == AV_CODEC_ID_H264) - { - startCodeSize = 3; - memcpy((uint8_t*)xvba->m_xvbaBufferPool.data_buffer->bufferXVBA+location, - startCode, 3); - } -- else if (avctx->codec_id == CODEC_ID_VC1 && -+ else if (avctx->codec_id == AV_CODEC_ID_VC1 && - (memcmp(render->buffers[j].buffer, startCode, 3) != 0)) - { - startCodeSize = 4; --- -1.8.1.6 - - -From 07d82699f9aff83d4228e1cea4a5da05460f8717 Mon Sep 17 00:00:00 2001 +From 57726ab8ccb995463bbb76a566638aa8fd751751 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Fri, 5 Jul 2013 12:14:00 +0200 -Subject: [PATCH 102/110] X11: set windows class name +Subject: [PATCH 102/111] X11: set windows class name --- xbmc/windowing/X11/WinSystemX11.cpp | 9 ++++++++- @@ -20300,79 +20890,10 @@ index 7e4b637..44e40a3 100644 1.8.1.6 -From 4a6c2229447b4dfbbadaa0fa8005d2278ee52353 Mon Sep 17 00:00:00 2001 -From: Rainer Hochecker -Date: Sat, 13 Jul 2013 20:00:45 +0200 -Subject: [PATCH 103/110] VDPAU: revert sync mixer, does a busy wait - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 31 +++++++++++++------------- - 1 file changed, 16 insertions(+), 15 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 55430a6..aac0646 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -1139,7 +1139,7 @@ void CVdpauRenderPicture::ReturnUnused() - // Mixer - //----------------------------------------------------------------------------- - CMixer::CMixer(CEvent *inMsgEvent) : -- CThread("Vdpau Mixer Thread"), -+ CThread("Vdpau Mixer"), - m_controlPort("ControlPort", inMsgEvent, &m_outMsgEvent), - m_dataPort("DataPort", inMsgEvent, &m_outMsgEvent) - { -@@ -2353,19 +2353,20 @@ void CMixer::ProcessPicture() - CheckStatus(vdp_st, __LINE__); - - // sync mixer, read blocks until output surface is written -- { -- uint32_t data[16]; -- VdpRect rect; -- rect.x0 = rect.y0 = 0; -- rect.x1 = rect.y1 = 1; -- uint32_t *pdata[] = {data}; -- uint32_t pitches[] = {4}; -- -- vdp_st = m_config.vdpProcs.vdp_output_surface_get_bits_native(m_processPicture.outputSurface, -- &rect, -- (void**)pdata, -- pitches); -- } -+ // this does a busy wait :( -+// { -+// uint32_t data[16]; -+// VdpRect rect; -+// rect.x0 = rect.y0 = 0; -+// rect.x1 = rect.y1 = 1; -+// uint32_t *pdata[] = {data}; -+// uint32_t pitches[] = {4}; -+// -+// vdp_st = m_config.vdpProcs.vdp_output_surface_get_bits_native(m_processPicture.outputSurface, -+// &rect, -+// (void**)pdata, -+// pitches); -+// } - - if (m_mixerfield != VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME) - { -@@ -2410,7 +2411,7 @@ bool CMixer::CheckStatus(VdpStatus vdp_st, int line) - // Output - //----------------------------------------------------------------------------- - COutput::COutput(CEvent *inMsgEvent) : -- CThread("Vdpau Output Thread"), -+ CThread("Vdpau Output"), - m_controlPort("OutputControlPort", inMsgEvent, &m_outMsgEvent), - m_dataPort("OutputDataPort", inMsgEvent, &m_outMsgEvent), - m_mixer(&m_outMsgEvent) --- -1.8.1.6 - - -From 810827650de3ad9c682d6c40bb275c8549c093f7 Mon Sep 17 00:00:00 2001 +From 002808de57386d6f7edf2e352d1d86199db3545d Mon Sep 17 00:00:00 2001 From: fritsch Date: Sun, 14 Jul 2013 14:21:52 +0200 -Subject: [PATCH 104/110] ActiveAE: Make ActiveAE default Audio Engine to get +Subject: [PATCH 103/111] ActiveAE: Make ActiveAE default Audio Engine to get it tested via ppa --- @@ -20380,7 +20901,7 @@ Subject: [PATCH 104/110] ActiveAE: Make ActiveAE default Audio Engine to get 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/cores/AudioEngine/AEFactory.cpp b/xbmc/cores/AudioEngine/AEFactory.cpp -index 50a309c..8ce02d7 100644 +index 6a5808c..fc38090 100644 --- a/xbmc/cores/AudioEngine/AEFactory.cpp +++ b/xbmc/cores/AudioEngine/AEFactory.cpp @@ -97,7 +97,7 @@ bool CAEFactory::LoadEngine() @@ -20396,62 +20917,20 @@ index 50a309c..8ce02d7 100644 1.8.1.6 -From 13d61226017eede4aae9e48edcbb6c8fa90dc42a Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Sun, 21 Jul 2013 13:03:45 +0200 -Subject: [PATCH 105/110] ffmpeg: xvba - add missing pix formats for xvba - ---- - lib/ffmpeg/libavcodec/h263dec.c | 3 +++ - lib/ffmpeg/libavcodec/h264.c | 3 +++ - 2 files changed, 6 insertions(+) - -diff --git a/lib/ffmpeg/libavcodec/h263dec.c b/lib/ffmpeg/libavcodec/h263dec.c -index e231b08..6fcd2a0 100644 ---- a/lib/ffmpeg/libavcodec/h263dec.c -+++ b/lib/ffmpeg/libavcodec/h263dec.c -@@ -769,6 +769,9 @@ int ff_h263_decode_frame(AVCodecContext *avctx, - #if CONFIG_VDPAU - AV_PIX_FMT_VDPAU, - #endif -+#if CONFIG_XVBA -+ AV_PIX_FMT_XVBA_VLD, -+#endif - AV_PIX_FMT_YUV420P, - AV_PIX_FMT_NONE - }; -diff --git a/lib/ffmpeg/libavcodec/h264.c b/lib/ffmpeg/libavcodec/h264.c -index 02d0a26..4f09c67 100644 ---- a/lib/ffmpeg/libavcodec/h264.c -+++ b/lib/ffmpeg/libavcodec/h264.c -@@ -101,6 +101,9 @@ - #if CONFIG_H264_VDPAU_HWACCEL - AV_PIX_FMT_VDPAU, - #endif -+#if CONFIG_H264_XVBA_HWACCEL -+ AV_PIX_FMT_XVBA_VLD, -+#endif - AV_PIX_FMT_YUVJ420P, - AV_PIX_FMT_NONE - }; --- -1.8.1.6 - - -From db09e815ec42cca91d13ef48479f05d4abed9c24 Mon Sep 17 00:00:00 2001 +From 6659a6c0436b4f00494612e1d96c8b9d842160a9 Mon Sep 17 00:00:00 2001 From: spiff Date: Tue, 16 Jul 2013 14:34:04 +0200 -Subject: [PATCH 106/110] fixed: typo +Subject: [PATCH 104/111] fixed: typo --- language/English/strings.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/language/English/strings.po b/language/English/strings.po -index 645d7be..7cc5c3b 100644 +index b9aefe3..0c5a8dd 100644 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -6376,7 +6376,7 @@ msgstr "" +@@ -6385,7 +6385,7 @@ msgstr "" #: xbmc/settings/settings.xml msgctxt "#14101" @@ -20464,17 +20943,17 @@ index 645d7be..7cc5c3b 100644 1.8.1.6 -From e0368f17203eda08ea68b6c4665ced323c37852a Mon Sep 17 00:00:00 2001 +From 9b0b4c425a6d1f547565226b3815c3709048b5f9 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Thu, 25 Jul 2013 17:18:13 +0200 -Subject: [PATCH 107/110] ActiveAE: slightly reduce buffer size +Subject: [PATCH 105/111] ActiveAE: slightly reduce buffer size --- xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -index 31aa3c0..fd4d7c5 100644 +index 78f9eee..961adc8 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp @@ -30,8 +30,8 @@ @@ -20490,3 +20969,247 @@ index 31aa3c0..fd4d7c5 100644 { -- 1.8.1.6 + + +From bda6c8230b4740b032553eabd3f4309d57b668c1 Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Sun, 4 Aug 2013 10:11:16 +0200 +Subject: [PATCH 106/111] Revert "vdpau: comment some features that will be + added later" + +This reverts commit e00b4f65864d623ab4d2e9e5c06db138e661f1cf. +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 15 +++++---------- + 1 file changed, 5 insertions(+), 10 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +index b6f3b83..5f62189 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +@@ -929,8 +929,7 @@ int CDecoder::Decode(AVCodecContext *avctx, AVFrame *pFrame) + m_bufferStats.IncDecoded(); + m_vdpauOutput.m_dataPort.SendOutMessage(COutputDataProtocol::NEWFRAME, &pic, sizeof(pic)); + +- //TODO +- // m_codecControl = pic.DVDPic.iFlags & (DVP_FLAG_DRAIN | DVP_FLAG_NO_POSTPROC); ++ m_codecControl = pic.DVDPic.iFlags & (DVP_FLAG_DRAIN | DVP_FLAG_NO_POSTPROC); + } + + int retval = 0; +@@ -985,8 +984,7 @@ int CDecoder::Decode(AVCodecContext *avctx, AVFrame *pFrame) + msg->Release(); + } + +- // TODO +- if (1) //(m_codecControl & DVP_FLAG_DRAIN)) ++ if ((m_codecControl & DVP_FLAG_DRAIN)) + { + if (decoded + processed + render < 4) + { +@@ -2150,8 +2148,7 @@ void CMixer::InitCycle() + int flags; + m_config.stats->GetParams(latency, flags); + latency = (latency*1000)/CurrentHostFrequency(); +- // TODO +- if (0) //flags & DVP_FLAG_NO_POSTPROC) ++ if (flags & DVP_FLAG_NO_POSTPROC) + SetPostProcFeatures(false); + else + SetPostProcFeatures(true); +@@ -2162,8 +2159,7 @@ void CMixer::InitCycle() + EINTERLACEMETHOD method = GetDeinterlacingMethod(); + bool interlaced = m_mixerInput[1].DVDPic.iFlags & DVP_FLAG_INTERLACED; + +- // TODO +- if (//!(flags & DVP_FLAG_NO_POSTPROC) && ++ if (!(flags & DVP_FLAG_NO_POSTPROC) && + (mode == VS_DEINTERLACEMODE_FORCE || + (mode == VS_DEINTERLACEMODE_AUTO && interlaced))) + { +@@ -2185,8 +2181,7 @@ void CMixer::InitCycle() + m_config.stats->SetCanSkipDeint(true); + } + +- // TODO +- if (0) //m_mixerInput[1].DVDPic.iFlags & DVP_FLAG_DROPDEINT) ++ if (m_mixerInput[1].DVDPic.iFlags & DVP_FLAG_DROPDEINT) + { + m_mixersteps = 1; + } +-- +1.8.1.6 + + +From 85c36804624f9fbceae85c5e82e757b066d21cb7 Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Fri, 9 Aug 2013 18:01:40 +0200 +Subject: [PATCH 107/111] X11: fix keysyms + +--- + xbmc/windowing/WinEventsX11.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/windowing/WinEventsX11.cpp b/xbmc/windowing/WinEventsX11.cpp +index 582b9f5..ca31278 100644 +--- a/xbmc/windowing/WinEventsX11.cpp ++++ b/xbmc/windowing/WinEventsX11.cpp +@@ -452,7 +452,7 @@ bool CWinEventsX11::MessagePump() + if (keys.length() > 0) + { + newEvent.key.keysym.scancode = xevent.xkey.keycode; +- xkeysym = XLookupKeysym(&xevent.xkey, 0); ++ XLookupString(&xevent.xkey, NULL, 0, &xkeysym, NULL); + newEvent.key.keysym.sym = LookupXbmcKeySym(xkeysym); + newEvent.key.keysym.unicode = keys[keys.length() - 1]; + newEvent.key.state = xevent.xkey.state; +-- +1.8.1.6 + + +From cc051edca6fd3bf6430a0503aab29d564f2e77af Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Fri, 9 Aug 2013 18:42:36 +0200 +Subject: [PATCH 108/111] X11: fix keysym for non-IM + +--- + xbmc/windowing/WinEventsX11.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/windowing/WinEventsX11.cpp b/xbmc/windowing/WinEventsX11.cpp +index ca31278..db50d3c 100644 +--- a/xbmc/windowing/WinEventsX11.cpp ++++ b/xbmc/windowing/WinEventsX11.cpp +@@ -399,7 +399,7 @@ bool CWinEventsX11::MessagePump() + { + static XComposeStatus state; + char keybuf[32]; +- xkeysym = XLookupKeysym(&xevent.xkey, 0); ++ XLookupString(&xevent.xkey, NULL, 0, &xkeysym, NULL); + newEvent.key.keysym.sym = LookupXbmcKeySym(xkeysym); + newEvent.key.keysym.scancode = xevent.xkey.keycode; + newEvent.key.state = xevent.xkey.state; +-- +1.8.1.6 + + +From 6b45549f6174112896c51108315a68d410579cbe Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Sat, 10 Aug 2013 11:18:16 +0200 +Subject: [PATCH 109/111] add some missing multi media keys + +--- + system/keymaps/keyboard.xml | 3 +++ + xbmc/input/XBMC_keytable.cpp | 4 ++++ + xbmc/input/XBMC_vkeys.h | 3 +++ + 3 files changed, 10 insertions(+) + +diff --git a/system/keymaps/keyboard.xml b/system/keymaps/keyboard.xml +index ae5cf96..ba5510e 100644 +--- a/system/keymaps/keyboard.xml ++++ b/system/keymaps/keyboard.xml +@@ -118,6 +118,9 @@ + SkipPrevious + Stop + Pause ++ FastForward ++ Rewind ++ + + XBMC.ActivateWindow(MyMusic) + ActivateWindow(MyPrograms) +diff --git a/xbmc/input/XBMC_keytable.cpp b/xbmc/input/XBMC_keytable.cpp +index 246164b..9be22c9 100644 +--- a/xbmc/input/XBMC_keytable.cpp ++++ b/xbmc/input/XBMC_keytable.cpp +@@ -181,6 +181,10 @@ + , { XBMCK_LAUNCH_MEDIA_CENTER, 0, 0, XBMCVK_LAUNCH_MEDIA_CENTER, "launch_media_center" } + , { XBMCK_PLAY, 0, 0, XBMCVK_MEDIA_PLAY_PAUSE, "play_pause" } + , { XBMCK_STOP, 0, 0, XBMCVK_MEDIA_STOP, "stop" } ++, { XBMCK_REWIND, 0, 0, XBMCVK_MEDIA_REWIND, "rewind" } ++, { XBMCK_FASTFORWARD, 0, 0, XBMCVK_MEDIA_FASTFORWARD, "fastforward" } ++, { XBMCK_RECORD, 0, 0, XBMCVK_MEDIA_RECORD, "record" } ++ + + // Function keys + , { XBMCK_F1, 0, 0, XBMCVK_F1, "f1"} +diff --git a/xbmc/input/XBMC_vkeys.h b/xbmc/input/XBMC_vkeys.h +index ee6bb69..364b45a 100644 +--- a/xbmc/input/XBMC_vkeys.h ++++ b/xbmc/input/XBMC_vkeys.h +@@ -188,6 +188,9 @@ + XBMCVK_LAUNCH_APP2 = 0xC1, + XBMCVK_LAUNCH_FILE_BROWSER = 0xC2, + XBMCVK_LAUNCH_MEDIA_CENTER = 0xC3, ++ XBMCVK_MEDIA_RECORD = 0xC4, ++ XBMCVK_MEDIA_REWIND = 0xC5, ++ XBMCVK_MEDIA_FASTFORWARD = 0xC6, + + XBMCVK_LCONTROL = 0xD0, + XBMCVK_RCONTROL = 0xD1, +-- +1.8.1.6 + + +From 6b9ecbb8956eb6bdc59eeae79f628bf511be52b8 Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Sat, 10 Aug 2013 15:32:06 +0200 +Subject: [PATCH 110/111] CWinSystemBase: keep RES_DESKTOP untouched at pos 0, + fixes toggle fullscreen + +--- + xbmc/windowing/WinSystem.cpp | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/xbmc/windowing/WinSystem.cpp b/xbmc/windowing/WinSystem.cpp +index b3add75..6294965 100644 +--- a/xbmc/windowing/WinSystem.cpp ++++ b/xbmc/windowing/WinSystem.cpp +@@ -136,7 +136,8 @@ static void AddResolution(vector &resolutions, unsigned int addi + // check if the refresh rate of this resolution is better suited than + // the refresh rate of the resolution with the same width/height/interlaced + // property and if so replace it +- if (bestRefreshrate > 0.0 && refreshrate == bestRefreshrate) ++ // don't touch RES_DESKTOP ++ if (idx != 0 && bestRefreshrate > 0.0 && refreshrate == bestRefreshrate) + resolutions[idx].ResInfo_Index = addindex; + + // no need to add the resolution again +@@ -166,7 +167,8 @@ static bool resSortPredicate(RESOLUTION_WHR i, RESOLUTION_WHR j) + } + + // Can't assume a sort order +- sort(resolutions.begin(), resolutions.end(), resSortPredicate); ++ // don't touch RES_DESKTOP which is index 0 ++ sort(resolutions.begin()+1, resolutions.end(), resSortPredicate); + + return resolutions; + } +-- +1.8.1.6 + + +From e70c101a28981a2e5e238654bdbc05e7ee5132fe Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Sat, 10 Aug 2013 15:53:45 +0200 +Subject: [PATCH 111/111] X11: squash multi + +--- + xbmc/windowing/X11/WinSystemX11.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp +index 44e40a3..a00481e 100644 +--- a/xbmc/windowing/X11/WinSystemX11.cpp ++++ b/xbmc/windowing/X11/WinSystemX11.cpp +@@ -435,7 +435,7 @@ void CWinSystemX11::GetConnectedOutputs(std::vector *outputs) + + bool CWinSystemX11::IsCurrentOutput(CStdString output) + { +- return m_currentOutput.Equals(output); ++ return output.Equals("Default") || m_currentOutput.Equals(output); + } + + bool CWinSystemX11::IsSuitableVisual(XVisualInfo *vInfo) +-- +1.8.1.6 + diff --git a/packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-995.10-disable-alt-tab.patch b/packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-995.10-disable-alt-tab.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-995.10-disable-alt-tab.patch rename to packages/mediacenter/xbmc/patches/13.alpha-0efa87e/xbmc-995.10-disable-alt-tab.patch diff --git a/packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-999.02-rpipower.patch b/packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-999.02-rpipower.patch deleted file mode 100644 index 5153c26caa..0000000000 --- a/packages/mediacenter/xbmc/patches/13.alpha-df91888/xbmc-999.02-rpipower.patch +++ /dev/null @@ -1,113 +0,0 @@ -From 3c27e947a2c52c7b124b1bcf32f554b82b60f690 Mon Sep 17 00:00:00 2001 -From: Stephan Raue -Date: Fri, 2 Aug 2013 01:32:03 +0200 -Subject: [PATCH] Disable Hibernate and Suspend related power options for - Raspberry & Co. without (working) Upower/HAL/CK/Systemd support. Usually this - devices dont support Suspend & Hibernate. - ---- - xbmc/powermanagement/PowerManager.cpp | 21 ++++++++---- - xbmc/powermanagement/linux/FallbackPowerSyscall.h | 39 +++++++++++++++++++++++ - 2 files changed, 53 insertions(+), 7 deletions(-) - create mode 100644 xbmc/powermanagement/linux/FallbackPowerSyscall.h - -diff --git a/xbmc/powermanagement/PowerManager.cpp b/xbmc/powermanagement/PowerManager.cpp -index d658a97..993477e 100644 ---- a/xbmc/powermanagement/PowerManager.cpp -+++ b/xbmc/powermanagement/PowerManager.cpp -@@ -40,14 +40,17 @@ - #include "osx/CocoaPowerSyscall.h" - #elif defined(TARGET_ANDROID) - #include "android/AndroidPowerSyscall.h" --#elif defined(TARGET_POSIX) && defined(HAS_DBUS) -+#elif defined(TARGET_POSIX) -+#include "linux/FallbackPowerSyscall.h" -+#if defined(HAS_DBUS) - #include "linux/ConsoleUPowerSyscall.h" - #include "linux/ConsoleDeviceKitPowerSyscall.h" - #include "linux/LogindUPowerSyscall.h" - #include "linux/UPowerSyscall.h" --#ifdef HAS_HAL -+#if defined(HAS_HAL) - #include "linux/HALPowerSyscall.h" --#endif -+#endif // HAS_HAL -+#endif // HAS_DBUS - #elif defined(TARGET_WINDOWS) - #include "powermanagement/windows/Win32PowerSyscall.h" - extern HWND g_hWnd; -@@ -73,7 +76,8 @@ void CPowerManager::Initialize() - m_instance = new CCocoaPowerSyscall(); - #elif defined(TARGET_ANDROID) - m_instance = new CAndroidPowerSyscall(); --#elif defined(TARGET_POSIX) && defined(HAS_DBUS) -+#elif defined(TARGET_POSIX) -+#if defined(HAS_DBUS) - if (CConsoleUPowerSyscall::HasConsoleKitAndUPower()) - m_instance = new CConsoleUPowerSyscall(); - else if (CConsoleDeviceKitPowerSyscall::HasDeviceConsoleKit()) -@@ -82,10 +86,13 @@ void CPowerManager::Initialize() - m_instance = new CLogindUPowerSyscall(); - else if (CUPowerSyscall::HasUPower()) - m_instance = new CUPowerSyscall(); --#ifdef HAS_HAL -- else -+#if defined(HAS_HAL) -+ else if(1) - m_instance = new CHALPowerSyscall(); --#endif -+#endif // HAS_HAL -+ else -+#endif // HAS_DBUS -+ m_instance = new CFallbackPowerSyscall(); - #elif defined(TARGET_WINDOWS) - m_instance = new CWin32PowerSyscall(); - #endif -diff --git a/xbmc/powermanagement/linux/FallbackPowerSyscall.h b/xbmc/powermanagement/linux/FallbackPowerSyscall.h -new file mode 100644 -index 0000000..a6ed27b ---- /dev/null -+++ b/xbmc/powermanagement/linux/FallbackPowerSyscall.h -@@ -0,0 +1,39 @@ -+/* -+ * Copyright (C) 2005-2013 Team XBMC -+ * http://xbmc.org -+ * -+ * This Program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This Program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with XBMC; see the file COPYING. If not, see -+ * . -+ * -+ */ -+#pragma once -+#include "powermanagement/IPowerSyscall.h" -+#include "system.h" -+#if defined(TARGET_POSIX) -+ -+class CFallbackPowerSyscall : public CPowerSyscallWithoutEvents -+{ -+public: -+ virtual bool Powerdown() {return true; } -+ virtual bool Suspend() {return false; } -+ virtual bool Hibernate() {return false; } -+ virtual bool Reboot() {return true; } -+ -+ virtual bool CanPowerdown() {return true; } -+ virtual bool CanSuspend() {return false; } -+ virtual bool CanHibernate() {return false; } -+ virtual bool CanReboot() {return true; } -+ virtual int BatteryLevel() {return 0; } -+}; -+#endif --- -1.8.1.6 - diff --git a/tools/mkpkg/mkpkg_xbmc-gotham b/tools/mkpkg/mkpkg_xbmc-gotham index ea170e32cc..1bddce318f 100755 --- a/tools/mkpkg/mkpkg_xbmc-gotham +++ b/tools/mkpkg/mkpkg_xbmc-gotham @@ -57,7 +57,6 @@ echo "cleaning sources..." rm -rf $PKG_NAME-$PKG_VERSION/visualisations rm -rf $PKG_NAME-$PKG_VERSION/lib/libSDL-* rm -rf $PKG_NAME-$PKG_VERSION/lib/libcurl-* - rm -rf $PKG_NAME-$PKG_VERSION/project for i in "Changelog" "Fake\ Episode\ Maker" "MingwBuildEnvironment" \ "PackageMaker" "Translator" "XBMCLive" "XprPack" \