diff --git a/packages/mediacenter/xbmc-theme-Confluence/meta b/packages/mediacenter/xbmc-theme-Confluence/meta index d21683de8f..69b9eb3f41 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.0" if [ "$XBMC" = "master" ]; then - PKG_VERSION="83b16d0" + PKG_VERSION="c68abb0" fi PKG_REV="1" PKG_ARCH="any" diff --git a/packages/mediacenter/xbmc/build b/packages/mediacenter/xbmc/build index 0b2b41e2d2..e3944a5c9a 100755 --- a/packages/mediacenter/xbmc/build +++ b/packages/mediacenter/xbmc/build @@ -321,8 +321,8 @@ export gl_cv_func_gettimeofday_clobber=no # setup default skin inside the sources sed -i -e "s|skin.confluence|$SKIN_DIR|g" xbmc/settings/Settings.h -make externals -make xbmc.bin +make -j1 V=1 externals +make -j1 V=1 xbmc.bin if [ "$DISPLAYSERVER" = "xorg-server" ]; then make xbmc-xrandr diff --git a/packages/mediacenter/xbmc/meta b/packages/mediacenter/xbmc/meta index 12636c24d1..7bf55544ac 100644 --- a/packages/mediacenter/xbmc/meta +++ b/packages/mediacenter/xbmc/meta @@ -21,7 +21,7 @@ PKG_NAME="xbmc" PKG_VERSION="12.2.0" if [ "$XBMC" = "master" ]; then - PKG_VERSION="83b16d0" + PKG_VERSION="c68abb0" fi PKG_REV="1" PKG_ARCH="any" @@ -144,8 +144,13 @@ if [ "$AIRPLAY_SUPPORT" = yes ]; then fi if [ "$AIRTUNES_SUPPORT" = yes ]; then - PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS libshairport" - PKG_DEPENDS="$PKG_DEPENDS libshairport" + if [ "$XBMC" = master ]; then + PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS libshairplay" + PKG_DEPENDS="$PKG_DEPENDS libshairplay" + else + PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS libshairport" + PKG_DEPENDS="$PKG_DEPENDS libshairport" + fi fi if [ "$NFS_SUPPORT" = yes ]; then diff --git a/packages/mediacenter/xbmc/patches/83b16d0/xbmc-999.04-Revert-ff_read_frame_flush-to-av_read_frame_flush-for-external-ffmpeg.patch b/packages/mediacenter/xbmc/patches/83b16d0/xbmc-999.04-Revert-ff_read_frame_flush-to-av_read_frame_flush-for-external-ffmpeg.patch deleted file mode 100644 index 5495f3973b..0000000000 --- a/packages/mediacenter/xbmc/patches/83b16d0/xbmc-999.04-Revert-ff_read_frame_flush-to-av_read_frame_flush-for-external-ffmpeg.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 2280026c33ad6334e0b03b0eee1e35e8de4c5921 Mon Sep 17 00:00:00 2001 -From: vicbitter -Date: Fri, 12 Apr 2013 11:06:45 +0100 -Subject: [PATCH] ffmpeg 1.2 - rollback ff_read_frame_flush to - av_read_frame_flush for external ffmpeg - ---- - lib/DllAvFormat.h | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/lib/DllAvFormat.h b/lib/DllAvFormat.h -index 7fc831e..7937421 100644 ---- a/lib/DllAvFormat.h -+++ b/lib/DllAvFormat.h -@@ -43,8 +43,7 @@ extern "C" { - #include - #endif - /* av_read_frame_flush() is defined for us in lib/xbmc-dll-symbols/DllAvFormat.c */ -- // void av_read_frame_flush(AVFormatContext *s); // av_read_frame_flush decrepated -- void ff_read_frame_flush(AVFormatContext *s); // internal replacement -+ void av_read_frame_flush(AVFormatContext *s); - #else - #include "libavformat/avformat.h" - void ff_read_frame_flush(AVFormatContext *s); // internal replacement -@@ -46,7 +46,7 @@ extern "C" { - void av_read_frame_flush(AVFormatContext *s); - #else - #include "libavformat/avformat.h" -- void ff_read_frame_flush(AVFormatContext *s); // internal replacement -+ void av_read_frame_flush(AVFormatContext *s); - - #endif - } -@@ -117,7 +117,7 @@ public: - virtual AVInputFormat *av_find_input_format(const char *short_name) { return ::av_find_input_format(short_name); } - virtual void avformat_close_input(AVFormatContext **s) { ::avformat_close_input(s); } - virtual int av_read_frame(AVFormatContext *s, AVPacket *pkt) { return ::av_read_frame(s, pkt); } -- virtual void av_read_frame_flush(AVFormatContext *s) { ::ff_read_frame_flush(s); } // av_read_frame_flush decrepated -+ virtual void av_read_frame_flush(AVFormatContext *s) { ::av_read_frame_flush(s); } - virtual int av_read_play(AVFormatContext *s) { return ::av_read_play(s); } - virtual int av_read_pause(AVFormatContext *s) { return ::av_read_pause(s); } - virtual int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int flags) { return ::av_seek_frame(s, stream_index, timestamp, flags); } --- -1.7.10.4 - diff --git a/packages/mediacenter/xbmc/patches/83b16d0/xbmc-602-add_as.xml_busy_dialog_delay_control.patch b/packages/mediacenter/xbmc/patches/c68abb0/xbmc-602-add_as.xml_busy_dialog_delay_control.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/83b16d0/xbmc-602-add_as.xml_busy_dialog_delay_control.patch rename to packages/mediacenter/xbmc/patches/c68abb0/xbmc-602-add_as.xml_busy_dialog_delay_control.patch diff --git a/packages/mediacenter/xbmc/patches/83b16d0/xbmc-990.08-PR2637.patch b/packages/mediacenter/xbmc/patches/c68abb0/xbmc-990.08-PR2637.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/83b16d0/xbmc-990.08-PR2637.patch rename to packages/mediacenter/xbmc/patches/c68abb0/xbmc-990.08-PR2637.patch diff --git a/packages/mediacenter/xbmc/patches/83b16d0/xbmc-990.09-PR2579.patch b/packages/mediacenter/xbmc/patches/c68abb0/xbmc-990.09-PR2579.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/83b16d0/xbmc-990.09-PR2579.patch rename to packages/mediacenter/xbmc/patches/c68abb0/xbmc-990.09-PR2579.patch diff --git a/packages/mediacenter/xbmc/patches/83b16d0/xbmc-995.01-xvba_support-2260351.patch b/packages/mediacenter/xbmc/patches/c68abb0/xbmc-995.01-xvba_support-fc2b41b.patch similarity index 88% rename from packages/mediacenter/xbmc/patches/83b16d0/xbmc-995.01-xvba_support-2260351.patch rename to packages/mediacenter/xbmc/patches/c68abb0/xbmc-995.01-xvba_support-fc2b41b.patch index f10b03ed96..6b5f01aba8 100644 --- a/packages/mediacenter/xbmc/patches/83b16d0/xbmc-995.01-xvba_support-2260351.patch +++ b/packages/mediacenter/xbmc/patches/c68abb0/xbmc-995.01-xvba_support-fc2b41b.patch @@ -1,7 +1,7 @@ -From bc3f63795a66b28e39067f8df5b45834d308328b Mon Sep 17 00:00:00 2001 +From e6ff89ea67d5e992fa756d96310de21c4c678404 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:03:31 +0200 -Subject: [PATCH 001/107] VideoRenerers: add buffering +Subject: [PATCH 001/111] VideoRenerers: add buffering --- xbmc/Application.cpp | 3 + @@ -13,20 +13,20 @@ Subject: [PATCH 001/107] VideoRenerers: add buffering xbmc/cores/VideoRenderers/LinuxRendererGLES.h | 4 +- xbmc/cores/VideoRenderers/OverlayRenderer.cpp | 24 +- xbmc/cores/VideoRenderers/OverlayRenderer.h | 10 +- - xbmc/cores/VideoRenderers/RenderManager.cpp | 289 ++++++++++++++++++++---- - xbmc/cores/VideoRenderers/RenderManager.h | 63 +++++- + xbmc/cores/VideoRenderers/RenderManager.cpp | 296 ++++++++++++++++++++---- + xbmc/cores/VideoRenderers/RenderManager.h | 63 ++++- xbmc/cores/VideoRenderers/WinRenderer.cpp | 8 +- xbmc/cores/VideoRenderers/WinRenderer.h | 2 +- xbmc/cores/dvdplayer/DVDPlayer.cpp | 5 + xbmc/cores/dvdplayer/DVDPlayer.h | 2 + xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 34 ++- - 16 files changed, 410 insertions(+), 103 deletions(-) + 16 files changed, 417 insertions(+), 103 deletions(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index d99703a..e4d08da 100644 +index 9a493bf..264465a 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -2464,7 +2464,10 @@ void CApplication::Render() +@@ -2177,7 +2177,10 @@ void CApplication::Render() m_lastFrameTime = XbmcThreads::SystemClockMillis(); if (flip) @@ -51,10 +51,10 @@ index 6b713dc..9be9e22 100644 IPlayerCallback& m_callback; }; diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.h b/xbmc/cores/VideoRenderers/BaseRenderer.h -index 3e1944d..34fbd19 100644 +index 90c2d3a..76a59df 100644 --- a/xbmc/cores/VideoRenderers/BaseRenderer.h +++ b/xbmc/cores/VideoRenderers/BaseRenderer.h -@@ -80,10 +80,13 @@ class CBaseRenderer +@@ -96,10 +96,13 @@ class CBaseRenderer void GetVideoRect(CRect &source, CRect &dest); float GetAspectRatio() const; @@ -70,10 +70,10 @@ index 3e1944d..34fbd19 100644 virtual bool Supports(ERENDERFEATURE feature) { return false; } diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index 7d53d86..fb98d05 100644 +index 267dd40..27a0fc6 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -251,14 +251,6 @@ bool CLinuxRendererGL::ValidateRenderer() +@@ -250,14 +250,6 @@ bool CLinuxRendererGL::ValidateRenderer() return true; } @@ -88,7 +88,7 @@ index 7d53d86..fb98d05 100644 bool CLinuxRendererGL::ValidateRenderTarget() { if (!m_bValidated) -@@ -619,13 +611,28 @@ void CLinuxRendererGL::Flush() +@@ -618,13 +610,28 @@ void CLinuxRendererGL::Flush() glFinish(); m_bValidated = false; m_fbo.fbo.Cleanup(); @@ -118,7 +118,7 @@ index 7d53d86..fb98d05 100644 m_scalingMethodGui = (ESCALINGMETHOD)-1; } -@@ -642,7 +649,6 @@ void CLinuxRendererGL::RenderUpdate(bool clear, DWORD flags, DWORD alpha) +@@ -641,7 +648,6 @@ void CLinuxRendererGL::RenderUpdate(bool clear, DWORD flags, DWORD alpha) } ManageDisplay(); @@ -126,7 +126,7 @@ index 7d53d86..fb98d05 100644 g_graphicsContext.BeginPaint(); -@@ -799,7 +805,6 @@ unsigned int CLinuxRendererGL::PreInit() +@@ -798,7 +804,6 @@ unsigned int CLinuxRendererGL::PreInit() m_resolution = RES_DESKTOP; m_iYV12RenderBuffer = 0; @@ -134,7 +134,7 @@ index 7d53d86..fb98d05 100644 m_formats.push_back(RENDER_FMT_YUV420P); GLint size; -@@ -2482,7 +2487,7 @@ void CLinuxRendererGL::UploadVAAPITexture(int index) +@@ -2481,7 +2486,7 @@ void CLinuxRendererGL::UploadVAAPITexture(int index) || status == VA_STATUS_ERROR_INVALID_DISPLAY) { va.display->lost(true); @@ -143,7 +143,7 @@ index 7d53d86..fb98d05 100644 { m_buffers[i].vaapi.display.reset(); m_buffers[i].vaapi.surface.reset(); -@@ -3436,26 +3441,26 @@ void CLinuxRendererGL::UnBindPbo(YUVBUFFER& buff) +@@ -3435,26 +3440,26 @@ void CLinuxRendererGL::UnBindPbo(YUVBUFFER& buff) } #ifdef HAVE_LIBVDPAU @@ -221,10 +221,10 @@ index 40e31c5..fc513db 100644 virtual bool ValidateRenderTarget(); virtual void LoadShaders(int field=FIELD_FULL); diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp -index cca55c7..31b8de4 100644 +index 402f338..9e96660 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp -@@ -1992,16 +1992,16 @@ EINTERLACEMETHOD CLinuxRendererGLES::AutoInterlaceMethod() +@@ -1991,16 +1991,16 @@ EINTERLACEMETHOD CLinuxRendererGLES::AutoInterlaceMethod() } #ifdef HAVE_LIBOPENMAX @@ -263,10 +263,10 @@ index cf814d7..c1d51b9 100644 protected: diff --git a/xbmc/cores/VideoRenderers/OverlayRenderer.cpp b/xbmc/cores/VideoRenderers/OverlayRenderer.cpp -index 30267a2..41e1d35 100644 +index 59a4732..faa9dcb 100644 --- a/xbmc/cores/VideoRenderers/OverlayRenderer.cpp +++ b/xbmc/cores/VideoRenderers/OverlayRenderer.cpp -@@ -91,33 +91,32 @@ long COverlayMainThread::Release() +@@ -93,33 +93,32 @@ long COverlayMainThread::Release() CRenderer::CRenderer() { m_render = 0; @@ -305,7 +305,7 @@ index 30267a2..41e1d35 100644 } void CRenderer::AddCleanup(COverlay* o) -@@ -153,20 +152,23 @@ void CRenderer::Flush() +@@ -155,20 +154,23 @@ void CRenderer::Flush() { CSingleLock lock(m_section); @@ -367,7 +367,7 @@ index 5790703..becf2c2 100644 COverlayV m_cleanup; diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 14c3084..df15e0a 100644 +index 61410a8..2afead4 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp @@ -28,6 +28,7 @@ @@ -378,7 +378,7 @@ index 14c3084..df15e0a 100644 #include "Application.h" #include "ApplicationMessenger.h" -@@ -233,7 +234,7 @@ CStdString CXBMCRenderManager::GetVSyncState() +@@ -232,7 +233,7 @@ CStdString CXBMCRenderManager::GetVSyncState() return state; } @@ -387,7 +387,7 @@ index 14c3084..df15e0a 100644 { /* make sure any queued frame was fully presented */ double timeout = m_presenttime + 0.1; -@@ -253,6 +254,9 @@ bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsi +@@ -252,6 +253,9 @@ bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsi return false; } @@ -397,7 +397,7 @@ index 14c3084..df15e0a 100644 bool result = m_pRenderer->Configure(width, height, d_width, d_height, fps, flags, format, extended_format, orientation); if(result) { -@@ -267,6 +271,7 @@ bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsi +@@ -266,6 +270,7 @@ bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsi m_bReconfigured = true; m_presentstep = PRESENT_IDLE; m_presentevent.Set(); @@ -405,7 +405,7 @@ index 14c3084..df15e0a 100644 } return result; -@@ -298,8 +303,12 @@ void CXBMCRenderManager::RenderUpdate(bool clear, DWORD flags, DWORD alpha) +@@ -297,8 +302,12 @@ void CXBMCRenderManager::RenderUpdate(bool clear, DWORD flags, DWORD alpha) if (!m_pRenderer) return; @@ -418,7 +418,7 @@ index 14c3084..df15e0a 100644 m_overlays.Flip(); m_pRenderer->FlipPage(m_presentsource); m_presentstep = PRESENT_FRAME; -@@ -344,6 +353,10 @@ unsigned int CXBMCRenderManager::PreInit() +@@ -343,6 +352,10 @@ unsigned int CXBMCRenderManager::PreInit() UpdateDisplayLatency(); @@ -429,7 +429,7 @@ index 14c3084..df15e0a 100644 return m_pRenderer->PreInit(); } -@@ -372,7 +385,9 @@ bool CXBMCRenderManager::Flush() +@@ -371,7 +384,9 @@ bool CXBMCRenderManager::Flush() CRetakeLock lock(m_sharedSection); m_pRenderer->Flush(); @@ -439,7 +439,7 @@ index 14c3084..df15e0a 100644 } else { -@@ -540,25 +555,21 @@ void CXBMCRenderManager::SetViewMode(int iViewMode) +@@ -539,25 +554,21 @@ void CXBMCRenderManager::SetViewMode(int iViewMode) m_pRenderer->SetViewMode(iViewMode); } @@ -476,7 +476,7 @@ index 14c3084..df15e0a 100644 if(bStop) return; -@@ -566,57 +577,66 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L +@@ -565,57 +576,66 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L { CRetakeLock lock(m_sharedSection); if(!m_pRenderer) return; @@ -569,7 +569,7 @@ index 14c3084..df15e0a 100644 } } } -@@ -680,8 +700,12 @@ void CXBMCRenderManager::Present() +@@ -679,8 +699,12 @@ void CXBMCRenderManager::Present() if (!m_pRenderer) return; @@ -582,7 +582,7 @@ index 14c3084..df15e0a 100644 m_overlays.Flip(); m_pRenderer->FlipPage(m_presentsource); m_presentstep = PRESENT_FRAME; -@@ -805,11 +829,11 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) +@@ -804,11 +828,11 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) if (!m_pRenderer) return -1; @@ -596,7 +596,7 @@ index 14c3084..df15e0a 100644 if(index < 0) return index; -@@ -835,19 +859,19 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) +@@ -834,19 +858,19 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) } #ifdef HAVE_LIBVDPAU else if(pic.format == RENDER_FMT_VDPAU) @@ -620,7 +620,7 @@ index 14c3084..df15e0a 100644 #endif m_pRenderer->ReleaseImage(index, false); -@@ -909,3 +933,172 @@ EINTERLACEMETHOD CXBMCRenderManager::AutoInterlaceMethodInternal(EINTERLACEMETHO +@@ -908,3 +932,179 @@ EINTERLACEMETHOD CXBMCRenderManager::AutoInterlaceMethodInternal(EINTERLACEMETHO return mInt; } @@ -782,6 +782,13 @@ index 14c3084..df15e0a 100644 + int last = m_iDisplayedRenderBuffer; + m_iDisplayedRenderBuffer = (m_iCurrentRenderBuffer + m_iNumRenderBuffers - 1) % m_iNumRenderBuffers; + ++ // we have caught up with output so all buffers are re-usable ++ if (last != m_iDisplayedRenderBuffer ++ && m_iDisplayedRenderBuffer == m_iOutputRenderBuffer) ++ { ++ m_bAllRenderBuffersDisplayed = true; ++ } ++ + if (last != m_iDisplayedRenderBuffer + && m_iDisplayedRenderBuffer != m_iCurrentRenderBuffer) + { @@ -907,10 +914,10 @@ index e79a12b..6ba1653 100644 double m_presentcorr; double m_presenterr; diff --git a/xbmc/cores/VideoRenderers/WinRenderer.cpp b/xbmc/cores/VideoRenderers/WinRenderer.cpp -index 6ed53dc..c108096 100644 +index 0f38c9b..66bafbe 100644 --- a/xbmc/cores/VideoRenderers/WinRenderer.cpp +++ b/xbmc/cores/VideoRenderers/WinRenderer.cpp -@@ -262,12 +262,12 @@ int CWinRenderer::NextYV12Texture() +@@ -261,12 +261,12 @@ int CWinRenderer::NextYV12Texture() return -1; } @@ -926,7 +933,7 @@ index 6ed53dc..c108096 100644 return false; DXVABuffer *buf = (DXVABuffer*)m_VideoBuffers[source]; -@@ -283,7 +283,7 @@ int CWinRenderer::GetImage(YV12Image *image, int source, bool readonly) +@@ -282,7 +282,7 @@ int CWinRenderer::GetImage(YV12Image *image, int source, bool readonly) if( source == AUTOSOURCE ) source = NextYV12Texture(); @@ -949,7 +956,7 @@ index 251aa31..ff9dfdf 100644 virtual unsigned int PreInit(); virtual void UnInit(); diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 95eb8ae..031c94d 100644 +index 3080827..16fb578 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp @@ -4159,3 +4159,8 @@ bool CDVDPlayer::CachePVRStream(void) const @@ -975,7 +982,7 @@ index fa6c99f..a76b1ee 100644 { CACHESTATE_DONE = 0 , CACHESTATE_FULL // player is filling up the demux queue diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 5585de2..61841fe 100644 +index 26cdbc4..94b1b83 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -262,6 +262,7 @@ void CDVDPlayerVideo::OpenStream(CDVDStreamInfo &hint, CDVDVideoCodec* codec) @@ -1120,10 +1127,10 @@ index 5585de2..61841fe 100644 1.8.1.6 -From a6982044ebfd393393feb621a48bdd7aa7215ffa Mon Sep 17 00:00:00 2001 +From 129ef5c472f16fdf71a66e5997c140403d7bc329 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 16 Feb 2013 08:32:18 +0100 -Subject: [PATCH 002/107] add buffering for GLES +Subject: [PATCH 002/111] add buffering for GLES --- xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp | 10 ---------- @@ -1131,10 +1138,10 @@ Subject: [PATCH 002/107] add buffering for GLES 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp -index 31b8de4..086d9d5 100644 +index 9e96660..8586ad1 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp -@@ -145,13 +145,6 @@ +@@ -144,13 +144,6 @@ delete m_dllSwScale; } @@ -1148,7 +1155,7 @@ index 31b8de4..086d9d5 100644 bool CLinuxRendererGLES::ValidateRenderTarget() { if (!m_bValidated) -@@ -405,7 +398,6 @@ void CLinuxRendererGLES::Update(bool bPauseDrawing) +@@ -404,7 +397,6 @@ void CLinuxRendererGLES::Update(bool bPauseDrawing) { if (!m_bConfigured) return; ManageDisplay(); @@ -1156,7 +1163,7 @@ index 31b8de4..086d9d5 100644 } void CLinuxRendererGLES::RenderUpdate(bool clear, DWORD flags, DWORD alpha) -@@ -419,7 +411,6 @@ void CLinuxRendererGLES::RenderUpdate(bool clear, DWORD flags, DWORD alpha) +@@ -418,7 +410,6 @@ void CLinuxRendererGLES::RenderUpdate(bool clear, DWORD flags, DWORD alpha) if (m_renderMethod & RENDER_BYPASS) { ManageDisplay(); @@ -1164,7 +1171,7 @@ index 31b8de4..086d9d5 100644 // if running bypass, then the player might need the src/dst rects // for sizing video playback on a layer other than the gles layer. if (m_RenderUpdateCallBackFn) -@@ -459,7 +450,6 @@ void CLinuxRendererGLES::RenderUpdate(bool clear, DWORD flags, DWORD alpha) +@@ -458,7 +449,6 @@ void CLinuxRendererGLES::RenderUpdate(bool clear, DWORD flags, DWORD alpha) return; ManageDisplay(); @@ -1207,10 +1214,10 @@ index c1d51b9..eef86cd 100644 1.8.1.6 -From 8df844e1ff9cd4fd3e42a6a832e34f68389203f8 Mon Sep 17 00:00:00 2001 +From b7c7be714effc8fdb2380c53fea654ec45dd58e7 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 16 Feb 2013 11:17:02 +0100 -Subject: [PATCH 003/107] WinRenderer: add buffering +Subject: [PATCH 003/111] WinRenderer: add buffering --- xbmc/cores/VideoRenderers/WinRenderer.cpp | 14 ++++++-------- @@ -1218,10 +1225,10 @@ Subject: [PATCH 003/107] WinRenderer: add buffering 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/xbmc/cores/VideoRenderers/WinRenderer.cpp b/xbmc/cores/VideoRenderers/WinRenderer.cpp -index c108096..d470c25 100644 +index 66bafbe..e751590 100644 --- a/xbmc/cores/VideoRenderers/WinRenderer.cpp +++ b/xbmc/cores/VideoRenderers/WinRenderer.cpp -@@ -112,21 +112,19 @@ static enum PixelFormat PixelFormatFromFormat(ERenderFormat format) +@@ -111,21 +111,19 @@ static enum PixelFormat PixelFormatFromFormat(ERenderFormat format) void CWinRenderer::ManageTextures() { @@ -1290,17 +1297,17 @@ index ff9dfdf..755c1b9 100644 1.8.1.6 -From b1a409f6063e5df50675b34d0ca30e0a1b969962 Mon Sep 17 00:00:00 2001 +From 7522d558daabe79b54bce23fa49a73b8bd58e799 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 16 Feb 2013 11:17:32 +0100 -Subject: [PATCH 004/107] DXVA: activate buffering in renderer +Subject: [PATCH 004/111] DXVA: activate buffering in renderer --- xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 61841fe..ea68e9f 100644 +index 94b1b83..9e2e1e5 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -1142,7 +1142,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) @@ -1316,20 +1323,20 @@ index 61841fe..ea68e9f 100644 1.8.1.6 -From b476d31f184736193367424bce1cf809875e31d7 Mon Sep 17 00:00:00 2001 +From 31c95b5e1390436ff48c1b60d9176fe6fd1dda28 Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 2 Oct 2012 10:49:09 +0200 -Subject: [PATCH 005/107] linuxrenderer: delete all textures on reconfigure +Subject: [PATCH 005/111] linuxrenderer: delete all textures on reconfigure --- xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index fb98d05..cf258c0 100644 +index 27a0fc6..6cbbc78 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -267,7 +267,7 @@ bool CLinuxRendererGL::ValidateRenderTarget() +@@ -266,7 +266,7 @@ bool CLinuxRendererGL::ValidateRenderTarget() // function pointer for texture might change in // call to LoadShaders glFinish(); @@ -1342,10 +1349,10 @@ index fb98d05..cf258c0 100644 1.8.1.6 -From 9dcd4d76b8d74a483e84eb1b2ebaa6d7a156b327 Mon Sep 17 00:00:00 2001 +From cd9966ee78fe09a777fb00516888d3587795cfaf Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:17:33 +0200 -Subject: [PATCH 006/107] drop frame counter in application, ask render manager +Subject: [PATCH 006/111] drop frame counter in application, ask render manager instead --- @@ -1356,10 +1363,10 @@ Subject: [PATCH 006/107] drop frame counter in application, ask render manager 4 files changed, 23 insertions(+), 45 deletions(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index e4d08da..fd59535 100644 +index 264465a..ab09e86 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -425,8 +425,6 @@ +@@ -414,8 +414,6 @@ #endif m_currentStack = new CFileItemList; @@ -1368,7 +1375,7 @@ index e4d08da..fd59535 100644 m_bPresentFrame = false; m_bPlatformDirectories = true; -@@ -2328,28 +2326,18 @@ float CApplication::GetDimScreenSaverLevel() const +@@ -2041,28 +2039,18 @@ float CApplication::GetDimScreenSaverLevel() const bool CApplication::WaitFrame(unsigned int timeout) { @@ -1402,15 +1409,15 @@ index e4d08da..fd59535 100644 } void CApplication::Render() -@@ -2362,7 +2350,6 @@ void CApplication::Render() +@@ -2075,7 +2063,6 @@ void CApplication::Render() - int vsync_mode = g_guiSettings.GetInt("videoscreen.vsync"); + int vsync_mode = CSettings::Get().GetInt("videoscreen.vsync"); - bool decrement = false; bool hasRendered = false; bool limitFrames = false; unsigned int singleFrameTime = 10; // default limit 100 fps -@@ -2376,13 +2363,10 @@ void CApplication::Render() +@@ -2089,13 +2076,10 @@ void CApplication::Render() m_bPresentFrame = false; if (!extPlayerActive && g_graphicsContext.IsFullScreenVideo() && !IsPaused()) { @@ -1428,7 +1435,7 @@ index e4d08da..fd59535 100644 hasRendered = true; } else -@@ -2406,8 +2390,6 @@ void CApplication::Render() +@@ -2119,8 +2103,6 @@ void CApplication::Render() else if (lowfps) singleFrameTime = 200; // 5 fps, <=200 ms latency to wake up } @@ -1437,7 +1444,7 @@ index e4d08da..fd59535 100644 } } -@@ -2472,13 +2454,6 @@ void CApplication::Render() +@@ -2185,13 +2167,6 @@ void CApplication::Render() g_renderManager.UpdateResolution(); g_renderManager.ManageCaptures(); @@ -1451,7 +1458,7 @@ index e4d08da..fd59535 100644 } void CApplication::SetStandAlone(bool value) -@@ -5721,12 +5696,6 @@ bool CApplication::SwitchToFullScreen() +@@ -5415,12 +5390,6 @@ bool CApplication::SwitchToFullScreen() // See if we're playing a video, and are in GUI mode if ( IsPlayingVideo() && g_windowManager.GetActiveWindow() != WINDOW_FULLSCREEN_VIDEO) { @@ -1464,7 +1471,7 @@ index e4d08da..fd59535 100644 // then switch to fullscreen mode g_windowManager.ActivateWindow(WINDOW_FULLSCREEN_VIDEO); return true; -@@ -5959,7 +5928,6 @@ bool CApplication::IsCurrentThread() const +@@ -5653,7 +5622,6 @@ bool CApplication::IsCurrentThread() const bool CApplication::IsPresentFrame() { @@ -1473,10 +1480,10 @@ index e4d08da..fd59535 100644 return ret; diff --git a/xbmc/Application.h b/xbmc/Application.h -index 4e02f67..ed9cd5a 100644 +index c60195d..dafb59f 100644 --- a/xbmc/Application.h +++ b/xbmc/Application.h -@@ -444,10 +444,8 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs +@@ -414,10 +414,8 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs bool m_bEnableLegacyRes; bool m_bTestMode; bool m_bSystemScreenSaverEnable; @@ -1490,10 +1497,10 @@ index 4e02f67..ed9cd5a 100644 VIDEO::CVideoInfoScanner *m_videoInfoScanner; MUSIC_INFO::CMusicInfoScanner *m_musicInfoScanner; diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index df15e0a..03dfe2b 100644 +index 2afead4..31d4079 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -1102,3 +1102,14 @@ void CXBMCRenderManager::NotifyDisplayFlip() +@@ -1108,3 +1108,14 @@ void CXBMCRenderManager::NotifyDisplayFlip() lock.Leave(); m_flipEvent.Set(); } @@ -1524,10 +1531,10 @@ index 6ba1653..a215852 100644 1.8.1.6 -From 60eca0ba171fbc6d9be8fc74a4722cfdc727cf3d Mon Sep 17 00:00:00 2001 +From fdfe376302dd80cf24e3250bf7870f6bfbcc80f5 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 11:02:29 +0200 -Subject: [PATCH 007/107] vaapi: adopt to buffering in renderer +Subject: [PATCH 007/111] vaapi: adopt to buffering in renderer --- xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 2 +- @@ -1536,7 +1543,7 @@ Subject: [PATCH 007/107] vaapi: adopt to buffering in renderer 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index 6331722..72861e2 100644 +index eb45f9a..d553a74 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -112,7 +112,7 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx @@ -1585,10 +1592,10 @@ index 2840c52..1385833 100644 1.8.1.6 -From fd585da08117cd4be73d587d8a81fa8df78153c5 Mon Sep 17 00:00:00 2001 +From e9ce5ba22ea05b7f51acb383b88c62e7c14fbd70 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 16 Feb 2013 20:17:29 +0100 -Subject: [PATCH 008/107] add buffering - some documentation +Subject: [PATCH 008/111] add buffering - some documentation --- xbmc/cores/IPlayer.h | 3 +++ @@ -1678,10 +1685,10 @@ index a215852..f1ce77f 100644 1.8.1.6 -From 9e33869ee0d6a4dfca603cf0b2e73f1b41824eea Mon Sep 17 00:00:00 2001 +From 54308bc27085eff050689b6b4d45cdf33366361b Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 19 Feb 2013 09:06:22 +0100 -Subject: [PATCH 009/107] move NUM_BUFFERS up to BaseRenderer.h +Subject: [PATCH 009/111] move NUM_BUFFERS up to BaseRenderer.h --- xbmc/cores/VideoRenderers/BaseRenderer.h | 3 ++- @@ -1693,15 +1700,17 @@ Subject: [PATCH 009/107] move NUM_BUFFERS up to BaseRenderer.h 6 files changed, 5 insertions(+), 9 deletions(-) diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.h b/xbmc/cores/VideoRenderers/BaseRenderer.h -index 34fbd19..675ca35 100644 +index 76a59df..6f989ab 100644 --- a/xbmc/cores/VideoRenderers/BaseRenderer.h +++ b/xbmc/cores/VideoRenderers/BaseRenderer.h -@@ -26,10 +26,11 @@ +@@ -28,12 +28,13 @@ #define MAX_PLANES 3 #define MAX_FIELDS 3 +#define NUM_BUFFERS 10 + class CSetting; + typedef struct YV12Image { - BYTE * plane[MAX_PLANES]; @@ -1736,10 +1745,10 @@ index eef86cd..d5eefc6 100644 #undef ALIGN #define ALIGN(value, alignment) (((value)+((alignment)-1))&~((alignment)-1)) diff --git a/xbmc/cores/VideoRenderers/OverlayRenderer.cpp b/xbmc/cores/VideoRenderers/OverlayRenderer.cpp -index 41e1d35..03e9a62 100644 +index faa9dcb..660a3ce 100644 --- a/xbmc/cores/VideoRenderers/OverlayRenderer.cpp +++ b/xbmc/cores/VideoRenderers/OverlayRenderer.cpp -@@ -95,7 +95,7 @@ long COverlayMainThread::Release() +@@ -97,7 +97,7 @@ long COverlayMainThread::Release() CRenderer::~CRenderer() { @@ -1786,10 +1795,10 @@ index 755c1b9..4892500 100644 1.8.1.6 -From adf8512ec8f5035d810de94afe4098960ea7ddce Mon Sep 17 00:00:00 2001 +From d5f143a0b7b31b31684bb079cdba5274bef1959f Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 24 Feb 2013 09:55:00 +0100 -Subject: [PATCH 010/107] OverlayRenderer: align buffers with index in +Subject: [PATCH 010/111] OverlayRenderer: align buffers with index in renderManager --- @@ -1799,10 +1808,10 @@ Subject: [PATCH 010/107] OverlayRenderer: align buffers with index in 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/xbmc/cores/VideoRenderers/OverlayRenderer.cpp b/xbmc/cores/VideoRenderers/OverlayRenderer.cpp -index 03e9a62..8e958f6 100644 +index 660a3ce..abaaba6 100644 --- a/xbmc/cores/VideoRenderers/OverlayRenderer.cpp +++ b/xbmc/cores/VideoRenderers/OverlayRenderer.cpp -@@ -159,10 +159,13 @@ void CRenderer::Flush() +@@ -161,10 +161,13 @@ void CRenderer::Flush() Release(m_cleanup); } @@ -1832,10 +1841,10 @@ index cf1a8ea..83ea575 100644 void Flush(); void SetNumBuffers(int numBuffers) { m_iNumBuffers = numBuffers; } diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 03dfe2b..e400bdb 100644 +index 31d4079..9e12f24 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -309,7 +309,7 @@ void CXBMCRenderManager::RenderUpdate(bool clear, DWORD flags, DWORD alpha) +@@ -308,7 +308,7 @@ void CXBMCRenderManager::RenderUpdate(bool clear, DWORD flags, DWORD alpha) if(m_presentstep == PRESENT_FLIP) { FlipRenderBuffer(); @@ -1844,7 +1853,7 @@ index 03dfe2b..e400bdb 100644 m_pRenderer->FlipPage(m_presentsource); m_presentstep = PRESENT_FRAME; m_presentevent.Set(); -@@ -706,7 +706,7 @@ void CXBMCRenderManager::Present() +@@ -705,7 +705,7 @@ void CXBMCRenderManager::Present() if(m_presentstep == PRESENT_FLIP) { FlipRenderBuffer(); @@ -1853,7 +1862,7 @@ index 03dfe2b..e400bdb 100644 m_pRenderer->FlipPage(m_presentsource); m_presentstep = PRESENT_FRAME; m_presentevent.Set(); -@@ -958,6 +958,8 @@ int CXBMCRenderManager::WaitForBuffer(volatile bool& bStop, int timeout) +@@ -957,6 +957,8 @@ int CXBMCRenderManager::WaitForBuffer(volatile bool& bStop, int timeout) if (bStop) return -1; @@ -1866,10 +1875,10 @@ index 03dfe2b..e400bdb 100644 1.8.1.6 -From 4916d8f2b3a20d20db9b3ec1682ee6190f411964 Mon Sep 17 00:00:00 2001 +From 84507456fbf4cf6027c0e41fb278a6a029c98703 Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 26 Feb 2013 09:00:21 +0100 -Subject: [PATCH 011/107] add buffering - submit absolute time to render +Subject: [PATCH 011/111] add buffering - submit absolute time to render buffers --- @@ -1898,10 +1907,10 @@ index 3198aa5..6b713dc 100644 IPlayerCallback& m_callback; }; diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index e400bdb..be5e03f 100644 +index 9e12f24..9609e45 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -577,7 +577,6 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L +@@ -576,7 +576,6 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L { CRetakeLock lock(m_sharedSection); if(!m_pRenderer) return; @@ -1909,7 +1918,7 @@ index e400bdb..be5e03f 100644 EFIELDSYNC presentfield = sync; EPRESENTMETHOD presentmethod; -@@ -1022,7 +1021,6 @@ void CXBMCRenderManager::ResetRenderBuffer() +@@ -1021,7 +1020,6 @@ void CXBMCRenderManager::ResetRenderBuffer() m_iDisplayedRenderBuffer = 0; m_bAllRenderBuffersDisplayed = true; m_sleeptime = 1.0; @@ -1917,7 +1926,7 @@ index e400bdb..be5e03f 100644 m_speed = 0; } -@@ -1032,19 +1030,8 @@ void CXBMCRenderManager::PrepareNextRender() +@@ -1031,19 +1029,8 @@ void CXBMCRenderManager::PrepareNextRender() if (idx < 0) return; @@ -1939,7 +1948,7 @@ index e400bdb..be5e03f 100644 if(presenttime - clocktime > MAXPRESENTDELAY) presenttime = clocktime + MAXPRESENTDELAY; -@@ -1053,7 +1040,6 @@ void CXBMCRenderManager::PrepareNextRender() +@@ -1052,7 +1039,6 @@ void CXBMCRenderManager::PrepareNextRender() if (g_graphicsContext.IsFullScreenVideo() || presenttime <= clocktime + frametime) { @@ -1976,7 +1985,7 @@ index f1ce77f..ac404c2 100644 double m_presenttime; double m_presentcorr; diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 031c94d..95eb8ae 100644 +index 16fb578..3080827 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp @@ -4159,8 +4159,3 @@ bool CDVDPlayer::CachePVRStream(void) const @@ -2002,7 +2011,7 @@ index a76b1ee..fa6c99f 100644 { CACHESTATE_DONE = 0 , CACHESTATE_FULL // player is filling up the demux queue diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index ea68e9f..ca750ae 100644 +index 9e2e1e5..fbdd413 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -1377,7 +1377,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) @@ -2018,20 +2027,20 @@ index ea68e9f..ca750ae 100644 1.8.1.6 -From 21e4dd5f37c729e4efe39b44be869288d3288eb9 Mon Sep 17 00:00:00 2001 +From cb30c7755b88388edc08b4904e4a77d3b965d10d Mon Sep 17 00:00:00 2001 From: xbmc Date: Fri, 1 Mar 2013 08:05:00 +0100 -Subject: [PATCH 012/107] RenderManager: some rework to buffering +Subject: [PATCH 012/111] RenderManager: some rework to buffering --- xbmc/cores/VideoRenderers/RenderManager.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index be5e03f..71b7f87 100644 +index 9609e45..99f4c29 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -617,9 +617,11 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L +@@ -616,9 +616,11 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L } FlipFreeBuffer(); @@ -2044,7 +2053,7 @@ index be5e03f..71b7f87 100644 m_speed = speed; } -@@ -828,14 +830,14 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) +@@ -827,14 +829,14 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) if (!m_pRenderer) return -1; @@ -2064,7 +2073,7 @@ index be5e03f..71b7f87 100644 if(pic.format == RENDER_FMT_YUV420P || pic.format == RENDER_FMT_YUV420P10 -@@ -939,14 +941,14 @@ int CXBMCRenderManager::WaitForBuffer(volatile bool& bStop, int timeout) +@@ -938,14 +940,14 @@ int CXBMCRenderManager::WaitForBuffer(volatile bool& bStop, int timeout) if (!m_pRenderer) return -1; @@ -2086,10 +2095,10 @@ index be5e03f..71b7f87 100644 1.8.1.6 -From 56b8f6c8ed88a016433cc93f12ad4f941495fafe Mon Sep 17 00:00:00 2001 +From e89b99c23c20384204f85946b53fed5aba34931d Mon Sep 17 00:00:00 2001 From: xbmc Date: Fri, 1 Mar 2013 08:07:07 +0100 -Subject: [PATCH 013/107] dvdplayer: disable buffering unil dropping is +Subject: [PATCH 013/111] dvdplayer: disable buffering unil dropping is improved --- @@ -2097,7 +2106,7 @@ Subject: [PATCH 013/107] dvdplayer: disable buffering unil dropping is 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index ca750ae..1078180 100644 +index fbdd413..d02560e 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -1114,35 +1114,35 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) @@ -2148,20 +2157,20 @@ index ca750ae..1078180 100644 1.8.1.6 -From 122062ecba2442b68da62eb65dee441128f550ba Mon Sep 17 00:00:00 2001 +From 860076316108e18734df2c573d18be23f9f1117a Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 2 Mar 2013 12:00:51 +0100 -Subject: [PATCH 014/107] RenderManager: skip very late frames in render buffer +Subject: [PATCH 014/111] RenderManager: skip very late frames in render buffer --- xbmc/cores/VideoRenderers/RenderManager.cpp | 40 ++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 71b7f87..cd8c490 100644 +index 99f4c29..1c2d4bf 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -54,7 +54,7 @@ +@@ -53,7 +53,7 @@ #include "../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h" #include "../dvdplayer/DVDCodecs/DVDCodecUtils.h" @@ -2170,7 +2179,7 @@ index 71b7f87..cd8c490 100644 /* at any point we want an exclusive lock on rendermanager */ /* we must make sure we don't have a graphiccontext lock */ -@@ -1032,13 +1032,47 @@ void CXBMCRenderManager::PrepareNextRender() +@@ -1031,13 +1031,47 @@ void CXBMCRenderManager::PrepareNextRender() if (idx < 0) return; @@ -2224,10 +2233,10 @@ index 71b7f87..cd8c490 100644 1.8.1.6 -From acdeeaf1a8c278a31717a3d2680cd60f08bb84d1 Mon Sep 17 00:00:00 2001 +From aa215fabe3fa112298f3a55de30e50e219667c8d Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 2 Mar 2013 12:10:17 +0100 -Subject: [PATCH 015/107] renderbuffers: drop enable/disable in this iteration +Subject: [PATCH 015/111] renderbuffers: drop enable/disable in this iteration --- xbmc/cores/VideoRenderers/RenderManager.cpp | 4 ++++ @@ -2235,10 +2244,10 @@ Subject: [PATCH 015/107] renderbuffers: drop enable/disable in this iteration 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index cd8c490..374c138 100644 +index 1c2d4bf..321db13 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -272,6 +272,7 @@ bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsi +@@ -271,6 +271,7 @@ bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsi m_presentstep = PRESENT_IDLE; m_presentevent.Set(); ResetRenderBuffer(); @@ -2246,7 +2255,7 @@ index cd8c490..374c138 100644 } return result; -@@ -1089,7 +1090,10 @@ void CXBMCRenderManager::EnableBuffering(bool enable) +@@ -1088,7 +1089,10 @@ void CXBMCRenderManager::EnableBuffering(bool enable) CRetakeLock lock(m_sharedSection); if (m_iNumRenderBuffers < 3) @@ -2258,7 +2267,7 @@ index cd8c490..374c138 100644 m_bUseBuffering = enable; if (!m_bUseBuffering) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 1078180..367092a 100644 +index d02560e..d305ccc 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -262,7 +262,6 @@ void CDVDPlayerVideo::OpenStream(CDVDStreamInfo &hint, CDVDVideoCodec* codec) @@ -2297,10 +2306,10 @@ index 1078180..367092a 100644 1.8.1.6 -From 621c5f83f9bae82d6f80933bfe67deae9ae6ba52 Mon Sep 17 00:00:00 2001 +From aaad6432fd27033818638d373f44af53d0c27f81 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 2 Mar 2013 12:31:11 +0100 -Subject: [PATCH 016/107] RenderManager: add method SetSpeed +Subject: [PATCH 016/111] RenderManager: add method SetSpeed --- xbmc/cores/VideoRenderers/RenderManager.cpp | 10 +++++++--- @@ -2309,10 +2318,10 @@ Subject: [PATCH 016/107] RenderManager: add method SetSpeed 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 374c138..73dea8a 100644 +index 321db13..2964dc6 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -556,7 +556,7 @@ void CXBMCRenderManager::SetViewMode(int iViewMode) +@@ -555,7 +555,7 @@ void CXBMCRenderManager::SetViewMode(int iViewMode) m_pRenderer->SetViewMode(iViewMode); } @@ -2321,7 +2330,7 @@ index 374c138..73dea8a 100644 { if (!m_bUseBuffering) { -@@ -623,7 +623,6 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L +@@ -622,7 +622,6 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L m_renderBuffers[m_iOutputRenderBuffer].presentmethod = presentmethod; if (!m_bUseBuffering) PrepareNextRender(); @@ -2329,7 +2338,7 @@ index 374c138..73dea8a 100644 } g_application.NewFrame(); -@@ -1024,7 +1023,7 @@ void CXBMCRenderManager::ResetRenderBuffer() +@@ -1023,7 +1022,7 @@ void CXBMCRenderManager::ResetRenderBuffer() m_iDisplayedRenderBuffer = 0; m_bAllRenderBuffersDisplayed = true; m_sleeptime = 1.0; @@ -2338,7 +2347,7 @@ index 374c138..73dea8a 100644 } void CXBMCRenderManager::PrepareNextRender() -@@ -1108,6 +1107,11 @@ void CXBMCRenderManager::DiscardBuffer() +@@ -1107,6 +1106,11 @@ void CXBMCRenderManager::DiscardBuffer() m_iOutputRenderBuffer = m_iCurrentRenderBuffer; } @@ -2378,7 +2387,7 @@ index ac404c2..bb36a82 100644 void Render(bool clear, DWORD flags, DWORD alpha); diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 367092a..161f811 100644 +index d305ccc..7822b61 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -468,6 +468,7 @@ void CDVDPlayerVideo::Process() @@ -2402,20 +2411,20 @@ index 367092a..161f811 100644 1.8.1.6 -From d5b037289370c7eb8993dbb502ea774ec8b792f1 Mon Sep 17 00:00:00 2001 +From 381fd6c97b13ad526eca32b6962d0249462b93ac Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 4 Apr 2013 10:20:36 +0200 -Subject: [PATCH 017/107] RenderManager: return bufferlevel with WaitForBuffer +Subject: [PATCH 017/111] RenderManager: return bufferlevel with WaitForBuffer --- xbmc/cores/VideoRenderers/RenderManager.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 73dea8a..8e9b2c0 100644 +index 2964dc6..bba02ed 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -941,6 +941,7 @@ int CXBMCRenderManager::WaitForBuffer(volatile bool& bStop, int timeout) +@@ -940,6 +940,7 @@ int CXBMCRenderManager::WaitForBuffer(volatile bool& bStop, int timeout) if (!m_pRenderer) return -1; @@ -2423,7 +2432,7 @@ index 73dea8a..8e9b2c0 100644 XbmcThreads::EndTime endtime(timeout); while(!HasFreeBuffer() && !bStop) { -@@ -954,6 +955,9 @@ int CXBMCRenderManager::WaitForBuffer(volatile bool& bStop, int timeout) +@@ -953,6 +954,9 @@ int CXBMCRenderManager::WaitForBuffer(volatile bool& bStop, int timeout) } lock.Enter(); } @@ -2433,7 +2442,7 @@ index 73dea8a..8e9b2c0 100644 lock.Leave(); if (bStop) -@@ -961,7 +965,8 @@ int CXBMCRenderManager::WaitForBuffer(volatile bool& bStop, int timeout) +@@ -960,7 +964,8 @@ int CXBMCRenderManager::WaitForBuffer(volatile bool& bStop, int timeout) // make sure overlay buffer is released, this won't happen on AddOverlay m_overlays.ReleaseBuffer((m_iOutputRenderBuffer + 1) % m_iNumRenderBuffers); @@ -2447,20 +2456,78 @@ index 73dea8a..8e9b2c0 100644 1.8.1.6 -From 7468e144713b5e413f303e2390ef371a760ee400 Mon Sep 17 00:00:00 2001 +From c93ed1392e9933c53a1bfd3e401a9fd742b01aca Mon Sep 17 00:00:00 2001 From: xbmc -Date: Sun, 10 Feb 2013 18:40:30 +0100 -Subject: [PATCH 018/107] OMXPlayer: adapt to buffering +Date: Sun, 5 May 2013 09:21:32 +0200 +Subject: [PATCH 018/111] RenderManager: do not drop in renderbuffers, this + ruins detection of displayed frame --- - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 28 +++++++++++----------------- - 1 file changed, 11 insertions(+), 17 deletions(-) + xbmc/cores/VideoRenderers/RenderManager.cpp | 32 ----------------------------- + 1 file changed, 32 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp +index bba02ed..c818098 100644 +--- a/xbmc/cores/VideoRenderers/RenderManager.cpp ++++ b/xbmc/cores/VideoRenderers/RenderManager.cpp +@@ -1039,38 +1039,6 @@ void CXBMCRenderManager::PrepareNextRender() + double clocktime = GetPresentTime(); + double frametime = 1 / g_graphicsContext.GetFPS(); + +- // look ahead in the queue +- // if the next frame is already late, skip the one we are about to render +- // drop buffers if time has jumped back +- int skipToPos = 0; +- int count = 1; +- int i = idx; +- while (i != m_iOutputRenderBuffer) +- { +- int idx_next = (i + 1) % m_iNumRenderBuffers; +- if (m_renderBuffers[idx_next].timestamp < m_renderBuffers[i].timestamp-frametime || +- m_renderBuffers[idx_next].timestamp <= (clocktime-frametime)) +- { +- skipToPos = count; +- } +- count++; +- i = idx_next; +- } +- count = 1; +- while (idx != m_iOutputRenderBuffer) +- { +- int idx_next = (idx + 1) % m_iNumRenderBuffers; +- if (count <= skipToPos) +- { +- FlipRenderBuffer(); +- idx = idx_next; +- CLog::Log(LOGDEBUG,"%s - skip frame at render buffer index: %d", __FUNCTION__, idx); +- } +- else +- break; +- count++; +- } +- + double presenttime = m_renderBuffers[idx].timestamp; + + if(presenttime - clocktime > MAXPRESENTDELAY) +-- +1.8.1.6 + + +From 39f20064dd2d410a6d2bd7e8986c721cac0add36 Mon Sep 17 00:00:00 2001 +From: xbmc +Date: Sun, 10 Feb 2013 18:40:30 +0100 +Subject: [PATCH 019/111] OMXPlayer: adapt to buffering + +--- + xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 32 ++++++++++++++++---------------- + xbmc/cores/omxplayer/OMXPlayerVideo.h | 1 + + 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index bd5711c..d9168c6 100644 +index 9613e57..3703f7a 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -343,25 +343,19 @@ void OMXPlayerVideo::Output(int iGroupId, double pts, bool bDropPacket) +@@ -342,25 +342,25 @@ void OMXPlayerVideo::Output(int iGroupId, double pts, bool bDropPacket) m_dropbase = 0.0f; #endif @@ -2473,22 +2540,27 @@ index bd5711c..d9168c6 100644 - } - - if (!CThread::m_bStop && m_av_clock->GetAbsoluteClock(false) < m_iSleepEndTime + DVD_MSEC_TO_TIME(500)) -+ int timeout = 50; -+ if (GetDecoderFreeSpace() > 0.2 * GetDecoderBufferSize()) -+ timeout = 0; -+ int bufferlevel = g_renderManager.WaitForBuffer(m_bStop, timeout); -+ if (bufferlevel < 0) ++ // don't output we we have not moved forward ++ double currentMediaTime = m_av_clock->OMXMediaTime(false); ++ if ((currentMediaTime - m_LastOutputTime) < iFrameDuration / 2) return; - double pts_media = m_av_clock->OMXMediaTime(false); - ProcessOverlays(iGroupId, pts_media); - - g_renderManager.FlipPage(CThread::m_bStop, m_iSleepEndTime / DVD_TIME_BASE, -1, FS_NONE); -- ++ int timeout = 50; ++ if (GetDecoderFreeSpace() > 0.2 * GetDecoderBufferSize()) ++ timeout = 0; ++ int bufferlevel = g_renderManager.WaitForBuffer(m_bStop, timeout); ++ if (bufferlevel < 0) ++ return; + - m_iSleepEndTime = DVD_NOPTS_VALUE; + double pts_overlay = m_av_clock->OMXMediaTime(false) + + (bufferlevel+1)* iFrameDuration; + ProcessOverlays(iGroupId, pts_overlay); ++ m_LastOutputTime = pts_overlay; - //m_av_clock->WaitAbsoluteClock((iCurrentClock + iSleepTime)); + double timestamp = (CDVDClock::GetAbsoluteClock(false) + (bufferlevel+1) * iFrameDuration) / DVD_TIME_BASE; @@ -2496,7 +2568,7 @@ index bd5711c..d9168c6 100644 } void OMXPlayerVideo::Process() -@@ -813,7 +807,7 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height) +@@ -812,7 +812,7 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height) if(!g_renderManager.Configure(width, height, iDisplayWidth, iDisplayHeight, m_fFrameRate, flags, format, 0, @@ -2505,14 +2577,26 @@ index bd5711c..d9168c6 100644 { CLog::Log(LOGERROR, "%s - failed to configure renderer", __FUNCTION__); return; +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.h b/xbmc/cores/omxplayer/OMXPlayerVideo.h +index 064ff66..c055a97 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.h ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.h +@@ -59,6 +59,7 @@ class OMXPlayerVideo : public CThread + double m_iVideoDelay; + int m_speed; + double m_FlipTimeStamp; // time stamp of last flippage. used to play at a forced framerate ++ double m_LastOutputTime; + int m_audio_count; + bool m_stalled; + bool m_started; -- 1.8.1.6 -From 715d5805938104ba71ac343231fefbdbaec844d6 Mon Sep 17 00:00:00 2001 +From 74f151ac4eba50e7850409ccbc07ce9b094a0e12 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:34:39 +0200 -Subject: [PATCH 019/107] videoplayer: adapt lateness detection and dropping to +Subject: [PATCH 020/111] videoplayer: adapt lateness detection and dropping to buffering --- @@ -2526,10 +2610,10 @@ Subject: [PATCH 019/107] videoplayer: adapt lateness detection and dropping to 7 files changed, 283 insertions(+), 48 deletions(-) diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 8e9b2c0..2fdc9e5 100644 +index c818098..d9d4c33 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -556,7 +556,7 @@ void CXBMCRenderManager::SetViewMode(int iViewMode) +@@ -555,7 +555,7 @@ void CXBMCRenderManager::SetViewMode(int iViewMode) m_pRenderer->SetViewMode(iViewMode); } @@ -2538,7 +2622,7 @@ index 8e9b2c0..2fdc9e5 100644 { if (!m_bUseBuffering) { -@@ -618,6 +618,7 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L +@@ -617,6 +617,7 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L } FlipFreeBuffer(); @@ -2546,7 +2630,7 @@ index 8e9b2c0..2fdc9e5 100644 m_renderBuffers[m_iOutputRenderBuffer].timestamp = timestamp; m_renderBuffers[m_iOutputRenderBuffer].presentfield = presentfield; m_renderBuffers[m_iOutputRenderBuffer].presentmethod = presentmethod; -@@ -1029,6 +1030,7 @@ void CXBMCRenderManager::ResetRenderBuffer() +@@ -1028,6 +1029,7 @@ void CXBMCRenderManager::ResetRenderBuffer() m_bAllRenderBuffersDisplayed = true; m_sleeptime = 1.0; m_speed = DVD_PLAYSPEED_NORMAL; @@ -2554,7 +2638,7 @@ index 8e9b2c0..2fdc9e5 100644 } void CXBMCRenderManager::PrepareNextRender() -@@ -1081,6 +1083,7 @@ void CXBMCRenderManager::PrepareNextRender() +@@ -1048,6 +1050,7 @@ void CXBMCRenderManager::PrepareNextRender() if (g_graphicsContext.IsFullScreenVideo() || presenttime <= clocktime + frametime) { @@ -2562,7 +2646,7 @@ index 8e9b2c0..2fdc9e5 100644 m_presenttime = presenttime; m_presentmethod = m_renderBuffers[idx].presentmethod; m_presentfield = m_renderBuffers[idx].presentfield; -@@ -1140,6 +1143,18 @@ void CXBMCRenderManager::NotifyDisplayFlip() +@@ -1114,6 +1117,18 @@ void CXBMCRenderManager::NotifyDisplayFlip() m_flipEvent.Set(); } @@ -2664,7 +2748,7 @@ index 2c46b0b..5931e2f 100644 + virtual void SetCodecControl(int flags) {} }; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index 72861e2..4553368 100644 +index d553a74..df0e9c9 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -149,6 +149,7 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx @@ -2761,7 +2845,7 @@ index 75135ef..1d64356 100644 + int m_codecControlFlags; }; diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 161f811..ca8e4a1 100644 +index 7822b61..345d85b 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -326,8 +326,10 @@ void CDVDPlayerVideo::Process() @@ -3130,10 +3214,10 @@ index d1c9b94..5310522 100644 1.8.1.6 -From e7056ed198dd0f6acbb2ab39af9cb65a57c0cb45 Mon Sep 17 00:00:00 2001 +From 1a644c9bf0c6652d96107677a29931b3ca68d095 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 2 Sep 2012 16:05:21 +0200 -Subject: [PATCH 020/107] video player: present correct pts to user for a/v +Subject: [PATCH 021/111] video player: present correct pts to user for a/v sync (after buffering in renderer) --- @@ -3142,7 +3226,7 @@ Subject: [PATCH 020/107] video player: present correct pts to user for a/v 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index ca8e4a1..8da830c 100644 +index 345d85b..4566ff3 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -1275,22 +1275,6 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) @@ -3224,10 +3308,10 @@ index 5310522..f395897 100644 1.8.1.6 -From fdb4e0a8b1fe86b616db01f069ed495e9feeff8c Mon Sep 17 00:00:00 2001 +From 62c1f39bdebb2922f603ef2e21a9629d19e996fd Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 16 Feb 2013 18:25:53 +0100 -Subject: [PATCH 021/107] videoplayer: some rework and documentation +Subject: [PATCH 022/111] videoplayer: some rework and documentation --- .../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 29 ++++++++++++++++++++-- @@ -3287,7 +3371,7 @@ index 5931e2f..ac126fe 100644 virtual void SetCodecControl(int flags) {} }; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index 4553368..2d5d620 100644 +index df0e9c9..cae045a 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -914,6 +914,17 @@ unsigned CDVDVideoCodecFFmpeg::GetConvergeCount() @@ -3322,7 +3406,7 @@ index 1d64356..2826543 100644 bool IsHardwareAllowed() { return !m_bSoftware; } diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 8da830c..9c049a5 100644 +index 4566ff3..44871bb 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -1690,7 +1690,7 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts) @@ -3338,10 +3422,10 @@ index 8da830c..9c049a5 100644 1.8.1.6 -From 3a635eeeb38c0dad78114a01704893f43bd9d181 Mon Sep 17 00:00:00 2001 +From e22d43be4ea37d09193ec7c4765f1b558c374101 Mon Sep 17 00:00:00 2001 From: xbmc Date: Fri, 1 Mar 2013 09:57:16 +0100 -Subject: [PATCH 022/107] Revert "dvdplayer: disable buffering unit dropping is +Subject: [PATCH 023/111] Revert "dvdplayer: disable buffering unit dropping is improves" This reverts commit de1caf5686c1fb53cb7ab11b356e6c22770740db. @@ -3350,7 +3434,7 @@ This reverts commit de1caf5686c1fb53cb7ab11b356e6c22770740db. 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 9c049a5..a6aa456 100644 +index 44871bb..e553040 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -1133,35 +1133,35 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) @@ -3401,21 +3485,21 @@ index 9c049a5..a6aa456 100644 1.8.1.6 -From 2e432f4e99fc04e48a2ad5847eab0a902bbe2f35 Mon Sep 17 00:00:00 2001 +From fc6159d94e7acee1819b8883d5d77d6ebffafd61 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 4 Apr 2013 15:44:20 +0200 -Subject: [PATCH 023/107] OMXPlayerVideo: adapt to change in FlipPage +Subject: [PATCH 024/111] OMXPlayerVideo: adapt to change in FlipPage --- xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index d9168c6..67d3ea9 100644 +index 3703f7a..890dd38 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -355,7 +355,7 @@ void OMXPlayerVideo::Output(int iGroupId, double pts, bool bDropPacket) - ProcessOverlays(iGroupId, pts_overlay); +@@ -360,7 +360,7 @@ void OMXPlayerVideo::Output(int iGroupId, double pts, bool bDropPacket) + m_LastOutputTime = pts_overlay; double timestamp = (CDVDClock::GetAbsoluteClock(false) + (bufferlevel+1) * iFrameDuration) / DVD_TIME_BASE; - g_renderManager.FlipPage(CThread::m_bStop, timestamp, -1, FS_NONE); @@ -3427,13 +3511,14 @@ index d9168c6..67d3ea9 100644 1.8.1.6 -From ab95962634e6d2893d0c7a89217ac8f450701f45 Mon Sep 17 00:00:00 2001 +From b3ce54afbcde54508e4b5b5c4fe0e932bbdb94af Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 7 Apr 2012 09:19:00 +0200 -Subject: [PATCH 024/107] vdpau: redesign +Subject: [PATCH 025/111] vdpau: redesign --- language/English/strings.po | 12 +- + system/settings/settings.xml | 10 + system/shaders/yuv2rgb_basic.glsl | 12 + xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 203 +- xbmc/cores/VideoRenderers/LinuxRendererGL.h | 13 +- @@ -3449,23 +3534,21 @@ Subject: [PATCH 024/107] vdpau: redesign xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 4 + xbmc/settings/AdvancedSettings.cpp | 8 +- xbmc/settings/AdvancedSettings.h | 4 +- - xbmc/settings/GUISettings.cpp | 2 + - .../settings/windows/GUIWindowSettingsCategory.cpp | 34 + xbmc/utils/ActorProtocol.cpp | 253 ++ xbmc/utils/ActorProtocol.h | 87 + - xbmc/utils/Makefile | 1 + + xbmc/utils/Makefile.in | 1 + xbmc/video/dialogs/GUIDialogVideoSettings.cpp | 2 +- xbmc/windowing/X11/WinSystemX11.h | 1 + - 23 files changed, 3942 insertions(+), 1216 deletions(-) + 22 files changed, 3916 insertions(+), 1216 deletions(-) create mode 100644 xbmc/utils/ActorProtocol.cpp create mode 100644 xbmc/utils/ActorProtocol.h diff --git a/language/English/strings.po b/language/English/strings.po -index dfc125c..31b3f80 100644 +index c3df8dc..5492f99 100644 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -5672,7 +5672,15 @@ msgctxt "#13435" - msgid "Enable HQ Scalers for scalings above %" +@@ -5713,7 +5713,15 @@ msgctxt "#13435" + msgid "Enable HQ Scalers for scalings above" msgstr "" -#empty strings from id 13436 to 13499 @@ -3479,9 +3562,9 @@ index dfc125c..31b3f80 100644 + +#empty strings from id 13438 to 13499 - #: xbmc/settings/GUISettings.cpp + #: xbmc/settings/settings.xml msgctxt "#13500" -@@ -6746,7 +6754,7 @@ msgid "Software Blend" +@@ -6787,7 +6795,7 @@ msgid "Software Blend" msgstr "" msgctxt "#16325" @@ -3490,6 +3573,27 @@ index dfc125c..31b3f80 100644 msgstr "" #empty strings from id 16326 to 16399 +diff --git a/system/settings/settings.xml b/system/settings/settings.xml +index 63775f5..9991a8a 100644 +--- a/system/settings/settings.xml ++++ b/system/settings/settings.xml +@@ -385,6 +385,16 @@ + 2 + true + ++ ++ HAVE_LIBVDPAU ++ 2 ++ true ++ ++ ++ true ++ ++ ++ + + HAVE_LIBVA + 2 diff --git a/system/shaders/yuv2rgb_basic.glsl b/system/shaders/yuv2rgb_basic.glsl index c8c8a2e..0799a4b 100644 --- a/system/shaders/yuv2rgb_basic.glsl @@ -3514,10 +3618,10 @@ index c8c8a2e..0799a4b 100644 #if(XBMC_texture_rectangle) diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index cf258c0..556bed5 100644 +index 6cbbc78..6593418 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -706,6 +706,18 @@ void CLinuxRendererGL::RenderUpdate(bool clear, DWORD flags, DWORD alpha) +@@ -705,6 +705,18 @@ void CLinuxRendererGL::RenderUpdate(bool clear, DWORD flags, DWORD alpha) glDisable(GL_POLYGON_STIPPLE); } @@ -3536,7 +3640,7 @@ index cf258c0..556bed5 100644 else Render(flags, index); -@@ -786,11 +798,6 @@ void CLinuxRendererGL::FlipPage(int source) +@@ -785,11 +797,6 @@ void CLinuxRendererGL::FlipPage(int source) m_buffers[m_iYV12RenderBuffer].flipindex = ++m_flipindex; @@ -3548,7 +3652,7 @@ index cf258c0..556bed5 100644 return; } -@@ -1117,6 +1124,12 @@ void CLinuxRendererGL::LoadShaders(int field) +@@ -1116,6 +1123,12 @@ void CLinuxRendererGL::LoadShaders(int field) m_textureCreate = &CLinuxRendererGL::CreateVDPAUTexture; m_textureDelete = &CLinuxRendererGL::DeleteVDPAUTexture; } @@ -3561,7 +3665,7 @@ index cf258c0..556bed5 100644 else if (m_format == RENDER_FMT_VAAPI) { m_textureUpload = &CLinuxRendererGL::UploadVAAPITexture; -@@ -1192,7 +1205,10 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) +@@ -1191,7 +1204,10 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) m_currentField = FIELD_FULL; // call texture load function @@ -3572,7 +3676,7 @@ index cf258c0..556bed5 100644 if (m_renderMethod & RENDER_GLSL) { -@@ -1558,17 +1574,12 @@ void CLinuxRendererGL::RenderFromFBO() +@@ -1557,17 +1573,12 @@ void CLinuxRendererGL::RenderFromFBO() void CLinuxRendererGL::RenderVDPAU(int index, int field) { #ifdef HAVE_LIBVDPAU @@ -3592,7 +3696,7 @@ index cf258c0..556bed5 100644 // Try some clamping or wrapping glTexParameteri(m_textureTarget, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); -@@ -1626,8 +1637,6 @@ void CLinuxRendererGL::RenderVDPAU(int index, int field) +@@ -1625,8 +1636,6 @@ void CLinuxRendererGL::RenderVDPAU(int index, int field) if (m_pVideoFilterShader) m_pVideoFilterShader->Disable(); @@ -3601,7 +3705,7 @@ index cf258c0..556bed5 100644 glBindTexture (m_textureTarget, 0); glDisable(m_textureTarget); #endif -@@ -2312,12 +2321,14 @@ void CLinuxRendererGL::DeleteVDPAUTexture(int index) +@@ -2311,12 +2320,14 @@ void CLinuxRendererGL::DeleteVDPAUTexture(int index) { #ifdef HAVE_LIBVDPAU YUVPLANE &plane = m_buffers[index].fields[0][0]; @@ -3616,7 +3720,7 @@ index cf258c0..556bed5 100644 #endif } -@@ -2351,11 +2362,152 @@ bool CLinuxRendererGL::CreateVDPAUTexture(int index) +@@ -2350,11 +2361,152 @@ bool CLinuxRendererGL::CreateVDPAUTexture(int index) void CLinuxRendererGL::UploadVDPAUTexture(int index) { #ifdef HAVE_LIBVDPAU @@ -3770,7 +3874,7 @@ index cf258c0..556bed5 100644 void CLinuxRendererGL::DeleteVAAPITexture(int index) { -@@ -3293,12 +3445,13 @@ bool CLinuxRendererGL::Supports(EINTERLACEMETHOD method) +@@ -3292,12 +3444,13 @@ bool CLinuxRendererGL::Supports(EINTERLACEMETHOD method) if(method == VS_INTERLACEMETHOD_AUTO) return true; @@ -3788,7 +3892,7 @@ index cf258c0..556bed5 100644 #endif return false; } -@@ -3391,14 +3544,7 @@ EINTERLACEMETHOD CLinuxRendererGL::AutoInterlaceMethod() +@@ -3390,14 +3543,7 @@ EINTERLACEMETHOD CLinuxRendererGL::AutoInterlaceMethod() return VS_INTERLACEMETHOD_NONE; if(m_renderMethod & RENDER_VDPAU) @@ -3803,7 +3907,7 @@ index cf258c0..556bed5 100644 if(Supports(VS_INTERLACEMETHOD_RENDER_BOB)) return VS_INTERLACEMETHOD_RENDER_BOB; -@@ -3441,11 +3587,12 @@ void CLinuxRendererGL::UnBindPbo(YUVBUFFER& buff) +@@ -3440,11 +3586,12 @@ void CLinuxRendererGL::UnBindPbo(YUVBUFFER& buff) } #ifdef HAVE_LIBVDPAU @@ -3894,10 +3998,10 @@ index 4e8d7e9..6ed62be 100644 RENDER_FMT_UYVY422, RENDER_FMT_YUYV422, diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 2fdc9e5..2bfd270 100644 +index d9d4c33..c8b99d6 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -860,7 +860,8 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) +@@ -859,7 +859,8 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) CDVDCodecUtils::CopyDXVA2Picture(&image, &pic); } #ifdef HAVE_LIBVDPAU @@ -3956,15 +4060,15 @@ index ac126fe..2bf79fe 100644 struct { VAAPI::CHolder* vaapi; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index 2d5d620..37084b6 100644 +index cae045a..40ea3e0 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -72,14 +72,14 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx while(*cur != PIX_FMT_NONE) { #ifdef HAVE_LIBVDPAU -- if(CVDPAU::IsVDPAUFormat(*cur) && g_guiSettings.GetBool("videoplayer.usevdpau")) -+ if(VDPAU::CDecoder::IsVDPAUFormat(*cur) && g_guiSettings.GetBool("videoplayer.usevdpau")) +- if(CVDPAU::IsVDPAUFormat(*cur) && CSettings::Get().GetBool("videoplayer.usevdpau")) ++ if(VDPAU::CDecoder::IsVDPAUFormat(*cur) && CSettings::Get().GetBool("videoplayer.usevdpau")) { if(ctx->GetHardware()) return *cur; @@ -4020,10 +4124,10 @@ index 2826543..272fc6c 100644 class CDVDVideoCodecFFmpeg : public CDVDVideoCodec diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index a781585..8f1f5dc 100644 +index 9cf27be..3fda3f1 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -34,11 +34,16 @@ +@@ -33,11 +33,16 @@ #include "settings/MediaSettings.h" #include "Application.h" #include "utils/MathUtils.h" @@ -4041,7 +4145,7 @@ index a781585..8f1f5dc 100644 {"MPEG1", VDP_DECODER_PROFILE_MPEG1}, {"MPEG2_SIMPLE", VDP_DECODER_PROFILE_MPEG2_SIMPLE}, {"MPEG2_MAIN", VDP_DECODER_PROFILE_MPEG2_MAIN}, -@@ -52,14 +57,16 @@ +@@ -51,14 +56,16 @@ {"MPEG4_PART2_ASP", VDP_DECODER_PROFILE_MPEG4_PART2_ASP}, #endif }; @@ -4065,7 +4169,7 @@ index a781585..8f1f5dc 100644 static struct SInterlaceMapping { -@@ -70,113 +77,30 @@ +@@ -69,113 +76,30 @@ , {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} @@ -4193,7 +4297,7 @@ index a781585..8f1f5dc 100644 { if(avctx->coded_width == 0 || avctx->coded_height == 0) -@@ -184,6 +108,8 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su +@@ -183,6 +107,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; } @@ -4202,7 +4306,7 @@ index a781585..8f1f5dc 100644 if (!dl_handle) { -@@ -195,8 +121,6 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su +@@ -194,8 +120,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); @@ -4211,7 +4315,7 @@ index a781585..8f1f5dc 100644 return false; } } -@@ -205,8 +129,9 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su +@@ -204,8 +128,9 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su return false; InitVDPAUProcs(); @@ -4222,7 +4326,7 @@ index a781585..8f1f5dc 100644 { SpewHardwareAvailable(); -@@ -224,25 +149,23 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su +@@ -223,25 +148,23 @@ 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; @@ -4254,7 +4358,7 @@ index a781585..8f1f5dc 100644 avctx->slice_flags=SLICE_FLAG_CODED_ORDER|SLICE_FLAG_ALLOW_FIELD; g_Windowing.Register(this); -@@ -251,17 +174,20 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su +@@ -250,17 +173,20 @@ bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int su return false; } @@ -4277,7 +4381,7 @@ index a781585..8f1f5dc 100644 while (!m_videoSurfaces.empty()) { -@@ -277,188 +203,111 @@ void CVDPAU::Close() +@@ -276,188 +202,111 @@ void CVDPAU::Close() m_dllAvUtil.Unload(); } @@ -4523,7 +4627,7 @@ index a781585..8f1f5dc 100644 state = m_DisplayState; } -@@ -472,16 +321,13 @@ int CVDPAU::Check(AVCodecContext* avctx) +@@ -471,16 +320,13 @@ int CVDPAU::Check(AVCodecContext* avctx) } else { @@ -4542,7 +4646,7 @@ index a781585..8f1f5dc 100644 FiniVDPAUOutput(); FiniVDPAUProcs(); -@@ -496,7 +342,7 @@ int CVDPAU::Check(AVCodecContext* avctx) +@@ -495,7 +341,7 @@ int CVDPAU::Check(AVCodecContext* avctx) return 0; } @@ -4551,7 +4655,7 @@ index a781585..8f1f5dc 100644 { if ((format >= PIX_FMT_VDPAU_H264) && (format <= PIX_FMT_VDPAU_VC1)) return true; #if (defined PIX_FMT_VDPAU_MPEG4_IN_AVUTIL) -@@ -505,90 +351,28 @@ bool CVDPAU::IsVDPAUFormat(PixelFormat format) +@@ -504,90 +350,28 @@ bool CVDPAU::IsVDPAUFormat(PixelFormat format) else return false; } @@ -4644,7 +4748,7 @@ index a781585..8f1f5dc 100644 + || method == VS_INTERLACEMETHOD_AUTO) return true; -+ if (g_guiSettings.GetBool("videoplayer.usevdpauinteropyuv")) ++ if (CSettings::Get().GetBool("videoplayer.usevdpauinteropyuv")) + { + if (method == VS_INTERLACEMETHOD_RENDER_BOB) + return true; @@ -4653,7 +4757,7 @@ index a781585..8f1f5dc 100644 for(SInterlaceMapping* p = g_interlace_mapping; p->method != VS_INTERLACEMETHOD_NONE; p++) { if(p->method == method) -@@ -597,162 +381,12 @@ bool CVDPAU::Supports(EINTERLACEMETHOD method) +@@ -596,162 +380,12 @@ bool CVDPAU::Supports(EINTERLACEMETHOD method) return false; } @@ -4677,7 +4781,7 @@ index a781585..8f1f5dc 100644 - 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 (g_guiSettings.GetBool("videoscreen.limitedrange")) +- if (CSettings::Get().GetBool("videoscreen.limitedrange")) - { - void const * pm_CSCMatix[] = { &studioCSC }; - vdp_st = vdp_video_mixer_set_attribute_values(videoMixer, ARSIZE(attributes), attributes, pm_CSCMatix); @@ -4819,7 +4923,7 @@ index a781585..8f1f5dc 100644 { char* error; -@@ -762,151 +396,115 @@ void CVDPAU::InitVDPAUProcs() +@@ -761,151 +395,115 @@ void CVDPAU::InitVDPAUProcs() if (error) { CLog::Log(LOGERROR,"(VDPAU) - %s in %s",error,__FUNCTION__); @@ -5006,9 +5110,9 @@ index a781585..8f1f5dc 100644 -void CVDPAU::FiniVDPAUOutput() -{ - FiniOutputMethod(); -- -- if (vdp_device == VDP_INVALID_HANDLE || !vdpauConfigured) return; +- if (vdp_device == VDP_INVALID_HANDLE || !vdpauConfigured) return; +- - CLog::Log(LOGNOTICE, " (VDPAU) %s", __FUNCTION__); - - VdpStatus vdp_st; @@ -5019,11 +5123,11 @@ index a781585..8f1f5dc 100644 return; - decoder = VDP_INVALID_HANDLE; + m_vdpauConfig.vdpDecoder = VDP_INVALID_HANDLE; - -- 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) + for(unsigned int i = 0; i < m_videoSurfaces.size(); ++i) { vdpau_render_state *render = m_videoSurfaces[i]; @@ -5034,7 +5138,7 @@ index a781585..8f1f5dc 100644 render->surface = VDP_INVALID_HANDLE; } if (CheckStatus(vdp_st, __LINE__)) -@@ -914,8 +512,7 @@ void CVDPAU::FiniVDPAUOutput() +@@ -913,8 +511,7 @@ void CVDPAU::FiniVDPAUOutput() } } @@ -5044,7 +5148,7 @@ index a781585..8f1f5dc 100644 , VdpDecoderProfile &vdp_decoder_profile , VdpChromaType &vdp_chroma_type) { -@@ -942,9 +539,9 @@ void CVDPAU::ReadFormatOf( PixelFormat fmt +@@ -941,9 +538,9 @@ void CVDPAU::ReadFormatOf( PixelFormat fmt vdp_chroma_type = VDP_CHROMA_TYPE_420; break; #if (defined PIX_FMT_VDPAU_MPEG4_IN_AVUTIL) && \ @@ -5056,7 +5160,7 @@ index a781585..8f1f5dc 100644 vdp_chroma_type = VDP_CHROMA_TYPE_420; break; #endif -@@ -955,170 +552,78 @@ void CVDPAU::ReadFormatOf( PixelFormat fmt +@@ -954,170 +551,78 @@ void CVDPAU::ReadFormatOf( PixelFormat fmt } } @@ -5132,6 +5236,12 @@ index a781585..8f1f5dc 100644 - vdp_st = vdp_presentation_queue_target_create_x11(vdp_device, - m_Pixmap, //x_window, - &vdp_flip_target); +- if (CheckStatus(vdp_st, __LINE__)) +- return false; +- +- vdp_st = vdp_presentation_queue_create(vdp_device, +- vdp_flip_target, +- &vdp_flip_queue); + m_vdpauConfig.surfaceWidth, + m_vdpauConfig.surfaceHeight, + m_vdpauConfig.maxReferences, @@ -5139,12 +5249,6 @@ index a781585..8f1f5dc 100644 if (CheckStatus(vdp_st, __LINE__)) return false; -- vdp_st = vdp_presentation_queue_create(vdp_device, -- vdp_flip_target, -- &vdp_flip_queue); -- if (CheckStatus(vdp_st, __LINE__)) -- return false; -- - totalAvailableOutputSurfaces = 0; - - int tmpMaxOutputSurfaces = NUM_OUTPUT_SURFACES; @@ -5275,7 +5379,7 @@ index a781585..8f1f5dc 100644 { VdpStatus rv; CLog::Log(LOGNOTICE,"VDPAU Decoder capabilities:"); -@@ -1128,7 +633,7 @@ void CVDPAU::SpewHardwareAvailable() //Copyright (c) 2008 Wladimir J. van der L +@@ -1127,7 +632,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; @@ -5284,7 +5388,7 @@ index a781585..8f1f5dc 100644 &is_supported, &max_level, &max_macroblocks, &max_width, &max_height); if(rv == VDP_STATUS_OK && is_supported) { -@@ -1137,13 +642,13 @@ void CVDPAU::SpewHardwareAvailable() //Copyright (c) 2008 Wladimir J. van der L +@@ -1136,13 +641,13 @@ void CVDPAU::SpewHardwareAvailable() //Copyright (c) 2008 Wladimir J. van der L } } CLog::Log(LOGNOTICE,"------------------------------------"); @@ -5301,7 +5405,7 @@ index a781585..8f1f5dc 100644 } \ } while(false) -@@ -1167,7 +672,7 @@ void CVDPAU::SpewHardwareAvailable() //Copyright (c) 2008 Wladimir J. van der L +@@ -1166,7 +671,7 @@ void CVDPAU::SpewHardwareAvailable() //Copyright (c) 2008 Wladimir J. van der L } @@ -5310,7 +5414,7 @@ index a781585..8f1f5dc 100644 { // find render state in queue bool found(false); -@@ -1194,34 +699,33 @@ bool CVDPAU::IsSurfaceValid(vdpau_render_state *render) +@@ -1193,34 +698,33 @@ bool CVDPAU::IsSurfaceValid(vdpau_render_state *render) return true; } @@ -5360,7 +5464,7 @@ index a781585..8f1f5dc 100644 } } -@@ -1230,21 +734,22 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) +@@ -1229,21 +733,22 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) { // create a new surface VdpDecoderProfile profile; @@ -5386,7 +5490,7 @@ index a781585..8f1f5dc 100644 avctx->coded_width, avctx->coded_height, &render->surface); -@@ -1265,18 +770,6 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) +@@ -1264,18 +769,6 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) pic->linesize[0] = pic->linesize[1] = pic->linesize[2] = 0; @@ -5405,7 +5509,7 @@ index a781585..8f1f5dc 100644 pic->type= FF_BUFFER_TYPE_USER; render->state |= FF_VDPAU_STATE_USED_FOR_REFERENCE; -@@ -1284,15 +777,16 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) +@@ -1283,15 +776,16 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) return 0; } @@ -5425,7 +5529,7 @@ index a781585..8f1f5dc 100644 render=(vdpau_render_state*)pic->data[0]; if(!render) -@@ -1301,6 +795,8 @@ void CVDPAU::FFReleaseBuffer(AVCodecContext *avctx, AVFrame *pic) +@@ -1300,6 +794,8 @@ void CVDPAU::FFReleaseBuffer(AVCodecContext *avctx, AVFrame *pic) return; } @@ -5434,7 +5538,7 @@ index a781585..8f1f5dc 100644 for(i=0; i<4; i++) pic->data[i]= NULL; -@@ -1315,21 +811,18 @@ void CVDPAU::FFReleaseBuffer(AVCodecContext *avctx, AVFrame *pic) +@@ -1314,21 +810,18 @@ void CVDPAU::FFReleaseBuffer(AVCodecContext *avctx, AVFrame *pic) } @@ -5461,7 +5565,7 @@ index a781585..8f1f5dc 100644 if(src->linesize[0] || src->linesize[1] || src->linesize[2] || offset[0] || offset[1] || offset[2]) -@@ -1359,59 +852,41 @@ void CVDPAU::FFDrawSlice(struct AVCodecContext *s, +@@ -1358,59 +851,41 @@ void CVDPAU::FFDrawSlice(struct AVCodecContext *s, if(s->pix_fmt == PIX_FMT_VDPAU_H264) max_refs = render->info.h264.num_ref_frames; @@ -5536,7 +5640,7 @@ index a781585..8f1f5dc 100644 if(pFrame) { // we have a new frame from decoder -@@ -1419,7 +894,10 @@ int CVDPAU::Decode(AVCodecContext *avctx, AVFrame *pFrame) +@@ -1418,7 +893,10 @@ int CVDPAU::Decode(AVCodecContext *avctx, AVFrame *pFrame) if(!render) // old style ffmpeg gave data on plane 0 render = (vdpau_render_state*)pFrame->data[0]; if(!render) @@ -5547,7 +5651,7 @@ index a781585..8f1f5dc 100644 // ffmpeg vc-1 decoder does not flush, make sure the data buffer is still valid if (!IsSurfaceValid(render)) -@@ -1428,258 +906,166 @@ int CVDPAU::Decode(AVCodecContext *avctx, AVFrame *pFrame) +@@ -1427,258 +905,166 @@ int CVDPAU::Decode(AVCodecContext *avctx, AVFrame *pFrame) return VC_BUFFER; } @@ -5595,11 +5699,11 @@ index a781585..8f1f5dc 100644 } + msg->Release(); + } -+ -+ m_bufferStats.Get(decoded, processed, render); - if (mode == VS_DEINTERLACEMODE_FORCE - || (mode == VS_DEINTERLACEMODE_AUTO && m_DVDVideoPics.front().iFlags & DVP_FLAG_INTERLACED)) ++ m_bufferStats.Get(decoded, processed, render); ++ + uint64_t startTime = CurrentHostCounter(); + while (!retval) + { @@ -5822,14 +5926,14 @@ index a781585..8f1f5dc 100644 - if (m_DisplayState != VDPAU_OPEN) - return false; - } -+ CSingleLock lock(m_DecoderSection); - +- - *picture = m_DVDVideoPics.front(); - // if this is the first field of an interlaced frame, we'll need - // this same picture for the second field later - if (m_mixerstep != 1) - m_DVDVideoPics.pop(); -- ++ CSingleLock lock(m_DecoderSection); + - picture->format = RENDER_FMT_VDPAU; - picture->iFlags &= DVP_FLAG_DROPPED; - picture->iWidth = OutWidth; @@ -5916,7 +6020,7 @@ index a781585..8f1f5dc 100644 if(m_DisplayState == VDPAU_OPEN) { -@@ -1697,4 +1083,2424 @@ bool CVDPAU::CheckStatus(VdpStatus vdp_st, int line) +@@ -1696,4 +1082,2424 @@ bool CVDPAU::CheckStatus(VdpStatus vdp_st, int line) return false; } @@ -6537,7 +6641,7 @@ index a781585..8f1f5dc 100644 + //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 (g_guiSettings.GetBool("videoplayer.vdpaustudiolevel")) ++ if (CSettings::Get().GetBool("videoscreen.limitedrange")) + { + float studioCSC[3][4]; + GenerateStudioCSCMatrix(colorStandard, studioCSC); @@ -6686,7 +6790,7 @@ index a781585..8f1f5dc 100644 + + SetDeintSkipChroma(); + -+ m_config.useInteropYuv = g_guiSettings.GetBool("videoplayer.usevdpauinteropyuv"); ++ m_config.useInteropYuv = CSettings::Get().GetBool("videoplayer.usevdpauinteropyuv"); +} + +void CMixer::SetDeintSkipChroma() @@ -6878,7 +6982,7 @@ index a781585..8f1f5dc 100644 + m_vdpError = false; + + m_config.upscale = g_advancedSettings.m_videoVDPAUScaling; -+ m_config.useInteropYuv = g_guiSettings.GetBool("videoplayer.usevdpauinteropyuv"); ++ m_config.useInteropYuv = CSettings::Get().GetBool("videoplayer.usevdpauinteropyuv"); + + CreateVdpauMixer(); +} @@ -8024,7 +8128,7 @@ index a781585..8f1f5dc 100644 + glVDPAUGetSurfaceivNV = NULL; +#endif + -+ m_config.usePixmaps = !g_guiSettings.GetBool("videoplayer.usevdpauinterop"); ++ m_config.usePixmaps = !CSettings::Get().GetBool("videoplayer.usevdpauinterop"); + +#ifdef GL_NV_vdpau_interop + if (glewIsSupported("GL_NV_vdpau_interop")) @@ -8056,8 +8160,8 @@ index a781585..8f1f5dc 100644 +#endif + { + m_config.usePixmaps = true; -+ g_guiSettings.SetBool("videoplayer.usevdpauinterop",false); -+ g_guiSettings.SetBool("videoplayer.usevdpauinteropyuv",false); ++ CSettings::Get().SetBool("videoplayer.usevdpauinterop",false); ++ CSettings::Get().SetBool("videoplayer.usevdpauinteropyuv",false); + } + if (!glXBindTexImageEXT) + glXBindTexImageEXT = (PFNGLXBINDTEXIMAGEEXTPROC)glXGetProcAddress((GLubyte *) "glXBindTexImageEXT"); @@ -9075,7 +9179,7 @@ index fa1ca38..96c4de9 100644 + +} diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index a6aa456..8f9d5f6 100644 +index e553040..5559c8e 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -1159,6 +1159,10 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) @@ -9090,10 +9194,10 @@ index a6aa456..8f9d5f6 100644 formatstr = "DXVA"; buffering = true; diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index f4b02db..3b2f842 100644 +index 11fd1e7..4b3abd8 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp -@@ -122,7 +122,7 @@ void CAdvancedSettings::Initialize() +@@ -153,7 +153,7 @@ void CAdvancedSettings::Initialize() m_videoIgnoreSecondsAtStart = 3*60; m_videoIgnorePercentAtEnd = 8.0f; m_videoPlayCountMinimumPercent = 90.0f; @@ -9102,7 +9206,7 @@ index f4b02db..3b2f842 100644 m_videoNonLinStretchRatio = 0.5f; m_videoEnableHighQualityHwScalers = false; m_videoAutoScaleMaxFps = 30.0f; -@@ -130,6 +130,8 @@ void CAdvancedSettings::Initialize() +@@ -161,6 +161,8 @@ void CAdvancedSettings::Initialize() m_videoAllowMpeg4VAAPI = false; m_videoDisableBackgroundDeinterlace = false; m_videoCaptureUseOcclusionQuery = -1; //-1 is auto detect @@ -9111,7 +9215,7 @@ index f4b02db..3b2f842 100644 m_DXVACheckCompatibility = false; m_DXVACheckCompatibilityPresent = false; m_DXVAForceProcessorRenderer = true; -@@ -532,7 +534,7 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) +@@ -567,7 +569,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); @@ -9120,7 +9224,7 @@ index f4b02db..3b2f842 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); -@@ -541,6 +543,8 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) +@@ -576,6 +578,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); @@ -9130,10 +9234,10 @@ index f4b02db..3b2f842 100644 TiXmlElement* pAdjustRefreshrate = pElement->FirstChildElement("adjustrefreshrate"); if (pAdjustRefreshrate) diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h -index b6bf23a..8572436 100644 +index 8e9d9f2..be92bea 100644 --- a/xbmc/settings/AdvancedSettings.h +++ b/xbmc/settings/AdvancedSettings.h -@@ -137,6 +137,8 @@ class CAdvancedSettings : public ISettingsHandler +@@ -146,6 +146,8 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler int m_videoPercentSeekBackwardBig; CStdString m_videoPPFFmpegDeint; CStdString m_videoPPFFmpegPostProc; @@ -9142,7 +9246,7 @@ index b6bf23a..8572436 100644 bool m_musicUseTimeSeeking; int m_musicTimeSeekForward; int m_musicTimeSeekBackward; -@@ -152,7 +154,7 @@ class CAdvancedSettings : public ISettingsHandler +@@ -161,7 +163,7 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler CStdString m_audioHost; bool m_audioApplyDrc; @@ -9151,64 +9255,6 @@ index b6bf23a..8572436 100644 float m_videoNonLinStretchRatio; bool m_videoEnableHighQualityHwScalers; float m_videoAutoScaleMaxFps; -diff --git a/xbmc/settings/GUISettings.cpp b/xbmc/settings/GUISettings.cpp -index 128a711..ed26e55 100644 ---- a/xbmc/settings/GUISettings.cpp -+++ b/xbmc/settings/GUISettings.cpp -@@ -721,6 +721,8 @@ void CGUISettings::Initialize() - - #ifdef HAVE_LIBVDPAU - AddBool(vp, "videoplayer.usevdpau", 13425, true); -+ AddBool(vp, "videoplayer.usevdpauinterop", 13436, true); -+ AddBool(vp, "videoplayer.usevdpauinteropyuv", 13437, false); - #endif - #ifdef HAVE_LIBVA - AddBool(vp, "videoplayer.usevaapi", 13426, true); -diff --git a/xbmc/settings/windows/GUIWindowSettingsCategory.cpp b/xbmc/settings/windows/GUIWindowSettingsCategory.cpp -index 6f57416..a5d5b1e 100644 ---- a/xbmc/settings/windows/GUIWindowSettingsCategory.cpp -+++ b/xbmc/settings/windows/GUIWindowSettingsCategory.cpp -@@ -597,6 +597,40 @@ void CGUIWindowSettingsCategory::UpdateSettings() - pControl->SetEnabled(true); - } - } -+ else if (strSetting.Equals("videoplayer.usevdpauinteropyuv")) -+ { -+ bool hasInterop = g_guiSettings.GetBool("videoplayer.usevdpauinterop"); -+#ifndef GL_NV_vdpau_interop -+ hasInterop = false; -+#endif -+ CGUIControl *pControl = (CGUIControl *)GetControl(pSettingControl->GetID()); -+ if (pControl && hasInterop && glewIsSupported("GL_NV_vdpau_interop")) -+ { -+ pControl->SetEnabled(true); -+ } -+ else -+ { -+ pControl->SetEnabled(false); -+ g_guiSettings.SetBool("videoplayer.usevdpauinteropyuv",false); -+ } -+ } -+ else if (strSetting.Equals("videoplayer.usevdpauinterop")) -+ { -+ bool hasInterop = g_guiSettings.GetBool("videoplayer.usevdpau"); -+#ifndef GL_NV_vdpau_interop -+ hasInterop = false; -+#endif -+ CGUIControl *pControl = (CGUIControl *)GetControl(pSettingControl->GetID()); -+ if (pControl && hasInterop && glewIsSupported("GL_NV_vdpau_interop")) -+ { -+ pControl->SetEnabled(true); -+ } -+ else -+ { -+ pControl->SetEnabled(false); -+ g_guiSettings.SetBool("videoplayer.usevdpauinterop",false); -+ } -+ } - else - #endif - if (strSetting.Equals("videoscreen.resolution")) diff --git a/xbmc/utils/ActorProtocol.cpp b/xbmc/utils/ActorProtocol.cpp new file mode 100644 index 0000000..e0cfd0e @@ -9561,23 +9607,23 @@ index 0000000..e7108ac +}; + +} -diff --git a/xbmc/utils/Makefile b/xbmc/utils/Makefile -index eec7e1f..2329751 100644 ---- a/xbmc/utils/Makefile -+++ b/xbmc/utils/Makefile -@@ -69,6 +69,7 @@ SRCS=AlarmClock.cpp \ - Weather.cpp \ - XBMCTinyXML.cpp \ - XMLUtils.cpp \ -+ ActorProtocol.cpp \ +diff --git a/xbmc/utils/Makefile.in b/xbmc/utils/Makefile.in +index d675218..864cbee 100644 +--- a/xbmc/utils/Makefile.in ++++ b/xbmc/utils/Makefile.in +@@ -70,6 +70,7 @@ SRCS += Vector.cpp + SRCS += Weather.cpp + SRCS += XBMCTinyXML.cpp + SRCS += XMLUtils.cpp ++SRCS += ActorProtocol.cpp - LIB=utils.a + LIB = utils.a diff --git a/xbmc/video/dialogs/GUIDialogVideoSettings.cpp b/xbmc/video/dialogs/GUIDialogVideoSettings.cpp -index c90bf49..6fe786e 100644 +index 908b911..40d8c61 100644 --- a/xbmc/video/dialogs/GUIDialogVideoSettings.cpp +++ b/xbmc/video/dialogs/GUIDialogVideoSettings.cpp -@@ -105,7 +105,7 @@ void CGUIDialogVideoSettings::CreateSettings() +@@ -104,7 +104,7 @@ void CGUIDialogVideoSettings::CreateSettings() entries.push_back(make_pair(VS_INTERLACEMETHOD_INVERSE_TELECINE , 16314)); entries.push_back(make_pair(VS_INTERLACEMETHOD_VDPAU_TEMPORAL_SPATIAL , 16311)); entries.push_back(make_pair(VS_INTERLACEMETHOD_VDPAU_TEMPORAL , 16310)); @@ -9602,24 +9648,22 @@ index e425327..3dae22c 100644 1.8.1.6 -From e4a7ecbacfb3bfbed380625c13d8440c15988e3f Mon Sep 17 00:00:00 2001 +From fcf95cc7246f02fe27ec6c16d6f1d20b61afbea1 Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 12 Dec 2012 09:52:17 +0100 -Subject: [PATCH 025/107] vdpau: make interop gl default and remove setting, +Subject: [PATCH 026/111] vdpau: make interop gl default and remove setting, rename and intvert interop yuv --- - language/English/strings.po | 8 ++------ - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 17 +++++++++------- - xbmc/settings/GUISettings.cpp | 3 +-- - .../settings/windows/GUIWindowSettingsCategory.cpp | 23 +++------------------- - 4 files changed, 16 insertions(+), 35 deletions(-) + language/English/strings.po | 8 ++------ + xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 17 ++++++++++------- + 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index 31b3f80..3931f24 100644 +index 5492f99..c8651dd 100644 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -5673,14 +5673,10 @@ msgid "Enable HQ Scalers for scalings above %" +@@ -5714,14 +5714,10 @@ msgid "Enable HQ Scalers for scalings above" msgstr "" msgctxt "#13436" @@ -9634,17 +9678,17 @@ index 31b3f80..3931f24 100644 -#empty strings from id 13438 to 13499 +#empty strings from id 13437 to 13499 - #: xbmc/settings/GUISettings.cpp + #: xbmc/settings/settings.xml msgctxt "#13500" diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 8f1f5dc..67fa2c5 100644 +index 3fda3f1..9037f74 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -367,12 +367,15 @@ bool CDecoder::Supports(EINTERLACEMETHOD method) +@@ -366,12 +366,15 @@ bool CDecoder::Supports(EINTERLACEMETHOD method) || method == VS_INTERLACEMETHOD_AUTO) return true; -- if (g_guiSettings.GetBool("videoplayer.usevdpauinteropyuv")) +- if (CSettings::Get().GetBool("videoplayer.usevdpauinteropyuv")) + if (!m_vdpauConfig.usePixmaps) { if (method == VS_INTERLACEMETHOD_RENDER_BOB) @@ -9657,25 +9701,25 @@ index 8f1f5dc..67fa2c5 100644 for(SInterlaceMapping* p = g_interlace_mapping; p->method != VS_INTERLACEMETHOD_NONE; p++) { if(p->method == method) -@@ -1849,7 +1852,7 @@ void CMixer::SetDeinterlacing() +@@ -1848,7 +1851,7 @@ void CMixer::SetDeinterlacing() SetDeintSkipChroma(); -- m_config.useInteropYuv = g_guiSettings.GetBool("videoplayer.usevdpauinteropyuv"); -+ m_config.useInteropYuv = !g_guiSettings.GetBool("videoplayer.usevdpaumixer"); +- m_config.useInteropYuv = CSettings::Get().GetBool("videoplayer.usevdpauinteropyuv"); ++ m_config.useInteropYuv = !CSettings::Get().GetBool("videoplayer.usevdpaumixer"); } void CMixer::SetDeintSkipChroma() -@@ -2041,7 +2044,7 @@ void CMixer::Init() +@@ -2040,7 +2043,7 @@ void CMixer::Init() m_vdpError = false; m_config.upscale = g_advancedSettings.m_videoVDPAUScaling; -- m_config.useInteropYuv = g_guiSettings.GetBool("videoplayer.usevdpauinteropyuv"); -+ m_config.useInteropYuv = !g_guiSettings.GetBool("videoplayer.usevdpaumixer"); +- m_config.useInteropYuv = CSettings::Get().GetBool("videoplayer.usevdpauinteropyuv"); ++ m_config.useInteropYuv = !CSettings::Get().GetBool("videoplayer.usevdpaumixer"); CreateVdpauMixer(); } -@@ -2151,11 +2154,12 @@ void CMixer::InitCycle() +@@ -2150,11 +2153,12 @@ void CMixer::InitCycle() DVP_FLAG_INTERLACED); m_config.useInteropYuv = false; } @@ -9689,142 +9733,66 @@ index 8f1f5dc..67fa2c5 100644 } else { -@@ -3187,7 +3191,7 @@ bool COutput::GLInit() +@@ -3186,7 +3190,7 @@ bool COutput::GLInit() glVDPAUGetSurfaceivNV = NULL; #endif -- m_config.usePixmaps = !g_guiSettings.GetBool("videoplayer.usevdpauinterop"); +- m_config.usePixmaps = !CSettings::Get().GetBool("videoplayer.usevdpauinterop"); + m_config.usePixmaps = false; #ifdef GL_NV_vdpau_interop if (glewIsSupported("GL_NV_vdpau_interop")) -@@ -3219,8 +3223,7 @@ bool COutput::GLInit() +@@ -3218,8 +3222,7 @@ bool COutput::GLInit() #endif { m_config.usePixmaps = true; -- g_guiSettings.SetBool("videoplayer.usevdpauinterop",false); -- g_guiSettings.SetBool("videoplayer.usevdpauinteropyuv",false); -+ g_guiSettings.SetBool("videoplayer.usevdpaumixer",true); +- CSettings::Get().SetBool("videoplayer.usevdpauinterop",false); +- CSettings::Get().SetBool("videoplayer.usevdpauinteropyuv",false); ++ CSettings::Get().SetBool("videoplayer.usevdpaumixer",true); } if (!glXBindTexImageEXT) glXBindTexImageEXT = (PFNGLXBINDTEXIMAGEEXTPROC)glXGetProcAddress((GLubyte *) "glXBindTexImageEXT"); -diff --git a/xbmc/settings/GUISettings.cpp b/xbmc/settings/GUISettings.cpp -index ed26e55..6a2d352 100644 ---- a/xbmc/settings/GUISettings.cpp -+++ b/xbmc/settings/GUISettings.cpp -@@ -721,8 +721,7 @@ void CGUISettings::Initialize() - - #ifdef HAVE_LIBVDPAU - AddBool(vp, "videoplayer.usevdpau", 13425, true); -- AddBool(vp, "videoplayer.usevdpauinterop", 13436, true); -- AddBool(vp, "videoplayer.usevdpauinteropyuv", 13437, false); -+ AddBool(vp, "videoplayer.usevdpaumixer", 13436, true); - #endif - #ifdef HAVE_LIBVA - AddBool(vp, "videoplayer.usevaapi", 13426, true); -diff --git a/xbmc/settings/windows/GUIWindowSettingsCategory.cpp b/xbmc/settings/windows/GUIWindowSettingsCategory.cpp -index a5d5b1e..6973d12 100644 ---- a/xbmc/settings/windows/GUIWindowSettingsCategory.cpp -+++ b/xbmc/settings/windows/GUIWindowSettingsCategory.cpp -@@ -597,9 +597,9 @@ void CGUIWindowSettingsCategory::UpdateSettings() - pControl->SetEnabled(true); - } - } -- else if (strSetting.Equals("videoplayer.usevdpauinteropyuv")) -+ else if (strSetting.Equals("videoplayer.usevdpaumixer")) - { -- bool hasInterop = g_guiSettings.GetBool("videoplayer.usevdpauinterop"); -+ bool hasInterop = true; - #ifndef GL_NV_vdpau_interop - hasInterop = false; - #endif -@@ -611,24 +611,7 @@ void CGUIWindowSettingsCategory::UpdateSettings() - else - { - pControl->SetEnabled(false); -- g_guiSettings.SetBool("videoplayer.usevdpauinteropyuv",false); -- } -- } -- else if (strSetting.Equals("videoplayer.usevdpauinterop")) -- { -- bool hasInterop = g_guiSettings.GetBool("videoplayer.usevdpau"); --#ifndef GL_NV_vdpau_interop -- hasInterop = false; --#endif -- CGUIControl *pControl = (CGUIControl *)GetControl(pSettingControl->GetID()); -- if (pControl && hasInterop && glewIsSupported("GL_NV_vdpau_interop")) -- { -- pControl->SetEnabled(true); -- } -- else -- { -- pControl->SetEnabled(false); -- g_guiSettings.SetBool("videoplayer.usevdpauinterop",false); -+ g_guiSettings.SetBool("videoplayer.usevdpaumixer",true); - } - } - else -- 1.8.1.6 -From 5c8eb9e184a8fd2b8b3b330b8cca98fb41c23455 Mon Sep 17 00:00:00 2001 +From 111e05e821bc52bfd0ae316a5cb489ebcf60e09a Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 12 Dec 2012 18:34:47 +0100 -Subject: [PATCH 026/107] vdpau: drop studio level conversion +Subject: [PATCH 027/111] vdpau: drop studio level conversion --- - language/English/strings.po | 7 +- xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 4 +- xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 94 ++------------------------ - xbmc/settings/GUISettings.cpp | 1 - - 4 files changed, 7 insertions(+), 99 deletions(-) + 2 files changed, 6 insertions(+), 92 deletions(-) -diff --git a/language/English/strings.po b/language/English/strings.po -index 3931f24..f18acfb 100644 ---- a/language/English/strings.po -+++ b/language/English/strings.po -@@ -4872,12 +4872,7 @@ msgctxt "#13121" - msgid "VDPAU HQ Upscaling level" - msgstr "" - --#: xbmc/settings/GUISettings.cpp --msgctxt "#13122" --msgid "VDPAU Studio level color conversion" --msgstr "" -- --#empty strings from id 13123 to 13129 -+#empty strings from id 13122 to 13129 - - #: xbmc/settings/GUISettings.cpp - msgctxt "#13130" diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index 556bed5..7a6ccfb 100644 +index 6593418..895b5c1 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -3361,7 +3361,7 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) +@@ -3360,7 +3360,7 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) { if(feature == RENDERFEATURE_BRIGHTNESS) { -- if ((m_renderMethod & RENDER_VDPAU) && !g_guiSettings.GetBool("videoscreen.limitedrange")) +- if ((m_renderMethod & RENDER_VDPAU) && !CSettings::Get().GetBool("videoscreen.limitedrange")) + if (m_renderMethod & RENDER_VDPAU) return true; if (m_renderMethod & RENDER_VAAPI) -@@ -3374,7 +3374,7 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) +@@ -3373,7 +3373,7 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) if(feature == RENDERFEATURE_CONTRAST) { -- if ((m_renderMethod & RENDER_VDPAU) && !g_guiSettings.GetBool("videoscreen.limitedrange")) +- 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 67fa2c5..65c5e97 100644 +index 9037f74..b78e4f7 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -59,15 +59,6 @@ +@@ -58,15 +58,6 @@ }; const size_t decoder_profile_count = sizeof(decoder_profiles)/sizeof(CDecoder::Desc); @@ -9840,7 +9808,7 @@ index 67fa2c5..65c5e97 100644 static struct SInterlaceMapping { const EINTERLACEMETHOD method; -@@ -1616,74 +1607,6 @@ void CMixer::PostProcOff() +@@ -1615,74 +1606,6 @@ void CMixer::PostProcOff() DisableHQScaling(); } @@ -9915,11 +9883,11 @@ index 67fa2c5..65c5e97 100644 void CMixer::SetColor() { VdpStatus vdp_st; -@@ -1703,19 +1626,10 @@ void CMixer::SetColor() +@@ -1702,19 +1625,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 (g_guiSettings.GetBool("videoplayer.vdpaustudiolevel")) +- if (CSettings::Get().GetBool("videoscreen.limitedrange")) - { - float studioCSC[3][4]; - GenerateStudioCSCMatrix(colorStandard, studioCSC); @@ -9939,26 +9907,14 @@ index 67fa2c5..65c5e97 100644 CheckStatus(vdp_st, __LINE__); } -diff --git a/xbmc/settings/GUISettings.cpp b/xbmc/settings/GUISettings.cpp -index 6a2d352..51d04c0 100644 ---- a/xbmc/settings/GUISettings.cpp -+++ b/xbmc/settings/GUISettings.cpp -@@ -800,7 +800,6 @@ void CGUISettings::Initialize() - AddSeparator(vp, "videoplayer.sep1.5"); - #ifdef HAVE_LIBVDPAU - AddBool(NULL, "videoplayer.vdpauUpscalingLevel", 13121, false); -- AddBool(NULL, "videoplayer.vdpaustudiolevel", 0, false); //depreciated - #endif - #endif - AddSeparator(vp, "videoplayer.sep5"); -- 1.8.1.6 -From 5320f12184389aec495fd8b043efa71ee85b5208 Mon Sep 17 00:00:00 2001 +From 8511beecaf7033ca759e4638fe5bd32852f39b88 Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 12 Dec 2012 20:28:49 +0100 -Subject: [PATCH 027/107] vdpau: observe ffmpeg tags for color space +Subject: [PATCH 028/111] vdpau: observe ffmpeg tags for color space --- xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 38 ++++++++++++++++++-------- @@ -9966,10 +9922,10 @@ Subject: [PATCH 027/107] 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 65c5e97..1ad0701 100644 +index b78e4f7..98fd9db 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -909,6 +909,7 @@ int CDecoder::Decode(AVCodecContext *avctx, AVFrame *pFrame) +@@ -908,6 +908,7 @@ int CDecoder::Decode(AVCodecContext *avctx, AVFrame *pFrame) memset(&pic.DVDPic, 0, sizeof(pic.DVDPic)); ((CDVDVideoCodecFFmpeg*)avctx->opaque)->GetPictureCommon(&pic.DVDPic); pic.render = render; @@ -9977,7 +9933,7 @@ index 65c5e97..1ad0701 100644 m_bufferStats.IncDecoded(); m_vdpauOutput.m_dataPort.SendOutMessage(COutputDataProtocol::NEWFRAME, &pic, sizeof(pic)); -@@ -1515,10 +1516,6 @@ void CMixer::InitCSCMatrix(int Width) +@@ -1514,10 +1515,6 @@ void CMixer::InitCSCMatrix(int Width) m_Procamp.contrast = 1.0; m_Procamp.saturation = 1.0; m_Procamp.hue = 0; @@ -9988,7 +9944,7 @@ index 65c5e97..1ad0701 100644 } void CMixer::CheckFeatures() -@@ -1529,11 +1526,13 @@ void CMixer::CheckFeatures() +@@ -1528,11 +1525,13 @@ void CMixer::CheckFeatures() m_Upscale = m_config.upscale; } if (m_Brightness != CMediaSettings::Get().GetCurrentVideoSettings().m_Brightness || @@ -10003,7 +9959,7 @@ index 65c5e97..1ad0701 100644 } if (m_NoiseReduction != CMediaSettings::Get().GetCurrentVideoSettings().m_NoiseReduction) { -@@ -1617,13 +1616,27 @@ void CMixer::SetColor() +@@ -1616,13 +1615,27 @@ void CMixer::SetColor() m_Procamp.contrast = (float)((CMediaSettings::Get().GetCurrentVideoSettings().m_Contrast)+50) / 100; VdpColorStandard colorStandard; @@ -10038,7 +9994,7 @@ index 65c5e97..1ad0701 100644 VdpVideoMixerAttribute attributes[] = { VDP_VIDEO_MIXER_ATTRIBUTE_CSC_MATRIX }; vdp_st = m_config.vdpProcs.vdp_generate_csc_matrix(&m_Procamp, colorStandard, &m_CSCMatrix); -@@ -1954,6 +1967,7 @@ void CMixer::Init() +@@ -1953,6 +1966,7 @@ void CMixer::Init() m_Sharpness = 0.0; m_DeintMode = 0; m_Deint = 0; @@ -10062,20 +10018,20 @@ index 96c4de9..173de37 100644 1.8.1.6 -From 5826eba0774bfee9219ed5497d61ec71f5b2ea8f Mon Sep 17 00:00:00 2001 +From d0e37198236d4f3357a1ec9cae977052da7bd3e8 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 27 Jan 2013 12:10:19 +0100 -Subject: [PATCH 028/107] vdpau: switch off de-interlacing on ff +Subject: [PATCH 029/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 1ad0701..4212924 100644 +index 98fd9db..3b6318e 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -2045,8 +2045,9 @@ void CMixer::InitCycle() +@@ -2044,8 +2044,9 @@ void CMixer::InitCycle() EINTERLACEMETHOD method = GetDeinterlacingMethod(); bool interlaced = m_mixerInput[1].DVDPic.iFlags & DVP_FLAG_INTERLACED; @@ -10091,10 +10047,10 @@ index 1ad0701..4212924 100644 1.8.1.6 -From 03cda0f45471bf9f7334c3159127a5ab1954b654 Mon Sep 17 00:00:00 2001 +From d3eb5334d0e50b83829f2bcb56b0818e40040c23 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 2 Feb 2013 13:17:09 +0100 -Subject: [PATCH 029/107] vdpau: fix mp4 part2 decoding, activate by default +Subject: [PATCH 030/111] vdpau: fix mp4 part2 decoding, activate by default --- xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 8 ++------ @@ -10102,10 +10058,10 @@ Subject: [PATCH 029/107] vdpau: fix mp4 part2 decoding, activate by default 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 4212924..66985ae 100644 +index 3b6318e..71483af 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -129,10 +129,9 @@ bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int +@@ -128,10 +128,9 @@ bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int VdpDecoderProfile profile = 0; if(avctx->codec_id == CODEC_ID_H264) profile = VDP_DECODER_PROFILE_H264_HIGH; @@ -10117,7 +10073,7 @@ index 4212924..66985ae 100644 if(profile) { if (!CDVDCodecUtils::IsVP3CompatibleWidth(avctx->coded_width)) -@@ -532,13 +531,10 @@ void CDecoder::ReadFormatOf( PixelFormat fmt +@@ -531,13 +530,10 @@ void CDecoder::ReadFormatOf( PixelFormat fmt vdp_decoder_profile = VDP_DECODER_PROFILE_VC1_ADVANCED; vdp_chroma_type = VDP_CHROMA_TYPE_420; break; @@ -10133,10 +10089,10 @@ index 4212924..66985ae 100644 vdp_decoder_profile = 0; vdp_chroma_type = 0; diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index 3b2f842..256e6bd 100644 +index 4b3abd8..8d188ec 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp -@@ -126,7 +126,7 @@ void CAdvancedSettings::Initialize() +@@ -157,7 +157,7 @@ void CAdvancedSettings::Initialize() m_videoNonLinStretchRatio = 0.5f; m_videoEnableHighQualityHwScalers = false; m_videoAutoScaleMaxFps = 30.0f; @@ -10149,10 +10105,10 @@ index 3b2f842..256e6bd 100644 1.8.1.6 -From 1affad7eed453f10a3ba0818349bfe13a68a8d00 Mon Sep 17 00:00:00 2001 +From 2545246c0796af3f2fb640265192d9dc5d15eda6 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 2 Mar 2013 15:19:19 +0100 -Subject: [PATCH 030/107] vdpau: re-add limited range conversion +Subject: [PATCH 031/111] vdpau: re-add limited range conversion --- xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 4 +- @@ -10160,32 +10116,32 @@ Subject: [PATCH 030/107] vdpau: re-add limited range conversion 2 files changed, 85 insertions(+), 5 deletions(-) diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index 7a6ccfb..556bed5 100644 +index 895b5c1..6593418 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -3361,7 +3361,7 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) +@@ -3360,7 +3360,7 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) { if(feature == RENDERFEATURE_BRIGHTNESS) { - if (m_renderMethod & RENDER_VDPAU) -+ if ((m_renderMethod & RENDER_VDPAU) && !g_guiSettings.GetBool("videoscreen.limitedrange")) ++ if ((m_renderMethod & RENDER_VDPAU) && !CSettings::Get().GetBool("videoscreen.limitedrange")) return true; if (m_renderMethod & RENDER_VAAPI) -@@ -3374,7 +3374,7 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) +@@ -3373,7 +3373,7 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) if(feature == RENDERFEATURE_CONTRAST) { - if (m_renderMethod & RENDER_VDPAU) -+ if ((m_renderMethod & RENDER_VDPAU) && !g_guiSettings.GetBool("videoscreen.limitedrange")) ++ 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 66985ae..4bdfb5b 100644 +index 71483af..f58f0b2 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -72,6 +72,9 @@ +@@ -71,6 +71,9 @@ , {VS_INTERLACEMETHOD_NONE , (VdpVideoMixerFeature)-1} }; @@ -10195,7 +10151,7 @@ index 66985ae..4bdfb5b 100644 //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 -@@ -1602,6 +1605,73 @@ void CMixer::PostProcOff() +@@ -1601,6 +1604,73 @@ void CMixer::PostProcOff() DisableHQScaling(); } @@ -10269,14 +10225,14 @@ index 66985ae..4bdfb5b 100644 void CMixer::SetColor() { VdpStatus vdp_st; -@@ -1635,9 +1705,19 @@ void CMixer::SetColor() +@@ -1634,9 +1704,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 (g_guiSettings.GetBool("videoscreen.limitedrange")) ++ if (CSettings::Get().GetBool("videoscreen.limitedrange")) + { + float studioCSC[3][4]; + GenerateStudioCSCMatrix(colorStandard, studioCSC); @@ -10296,10 +10252,10 @@ index 66985ae..4bdfb5b 100644 1.8.1.6 -From 051bb8ca3d1c9f245ff9c9a65a90642fd456b709 Mon Sep 17 00:00:00 2001 +From 7854261201f7abd1d2f6cd3a06d3ad9fe2cb7df0 Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 25 Sep 2012 12:14:15 +0200 -Subject: [PATCH 031/107] linuxrenderer: drop method RenderMultiPass +Subject: [PATCH 032/111] linuxrenderer: drop method RenderMultiPass --- xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 9 ++------- @@ -10307,10 +10263,10 @@ Subject: [PATCH 031/107] 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 556bed5..4d987ea 100644 +index 6593418..fe3a8f5 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -1222,7 +1222,8 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) +@@ -1221,7 +1221,8 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) break; case RQ_MULTIPASS: @@ -10320,7 +10276,7 @@ index 556bed5..4d987ea 100644 VerifyGLState(); break; } -@@ -1345,12 +1346,6 @@ void CLinuxRendererGL::RenderSinglePass(int index, int field) +@@ -1344,12 +1345,6 @@ void CLinuxRendererGL::RenderSinglePass(int index, int field) VerifyGLState(); } @@ -10349,10 +10305,10 @@ index 67605fc..84ddbd8 100644 1.8.1.6 -From a761cf3769460cc112d6aabbca66270ed0a5c589 Mon Sep 17 00:00:00 2001 +From d7f2b0ca8b1a151780fc6d43a554816e6fef566e Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 25 Sep 2012 13:20:47 +0200 -Subject: [PATCH 032/107] linuxrenderer: implement progressive weave for vdpau +Subject: [PATCH 033/111] linuxrenderer: implement progressive weave for vdpau --- xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 55 +++++++++++++++++++-------- @@ -10360,10 +10316,10 @@ Subject: [PATCH 032/107] linuxrenderer: implement progressive weave for vdpau 2 files changed, 41 insertions(+), 18 deletions(-) diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index 4d987ea..aec758b 100644 +index fe3a8f5..c3aef83 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -706,18 +706,6 @@ void CLinuxRendererGL::RenderUpdate(bool clear, DWORD flags, DWORD alpha) +@@ -705,18 +705,6 @@ void CLinuxRendererGL::RenderUpdate(bool clear, DWORD flags, DWORD alpha) glDisable(GL_POLYGON_STIPPLE); } @@ -10382,7 +10338,7 @@ index 4d987ea..aec758b 100644 else Render(flags, index); -@@ -1217,13 +1205,21 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) +@@ -1216,13 +1204,21 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) { case RQ_LOW: case RQ_SINGLEPASS: @@ -10407,7 +10363,7 @@ index 4d987ea..aec758b 100644 VerifyGLState(); break; } -@@ -1346,7 +1342,7 @@ void CLinuxRendererGL::RenderSinglePass(int index, int field) +@@ -1345,7 +1341,7 @@ void CLinuxRendererGL::RenderSinglePass(int index, int field) VerifyGLState(); } @@ -10416,7 +10372,7 @@ index 4d987ea..aec758b 100644 { YUVPLANES &planes = m_buffers[index].fields[field]; -@@ -1448,6 +1444,8 @@ void CLinuxRendererGL::RenderToFBO(int index, int field) +@@ -1447,6 +1443,8 @@ void CLinuxRendererGL::RenderToFBO(int index, int field) } m_fbo.width *= planes[0].pixpertex_x; m_fbo.height *= planes[0].pixpertex_y; @@ -10425,7 +10381,7 @@ index 4d987ea..aec758b 100644 // 1st Pass to video frame size glBegin(GL_QUADS); -@@ -1566,6 +1564,31 @@ void CLinuxRendererGL::RenderFromFBO() +@@ -1565,6 +1563,31 @@ void CLinuxRendererGL::RenderFromFBO() VerifyGLState(); } @@ -10480,20 +10436,20 @@ index 84ddbd8..dff7e1c 100644 1.8.1.6 -From f557c16c38fe25cd3aa76ad1cbb825bbc73b8bd3 Mon Sep 17 00:00:00 2001 +From 3469117d37ffbb0ac9062ae0b7096c30467d83e1 Mon Sep 17 00:00:00 2001 From: fritsch Date: Thu, 28 Mar 2013 10:38:37 +0100 -Subject: [PATCH 033/107] VDPAU: silence compiler warnings +Subject: [PATCH 034/111] 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 4bdfb5b..e8f86c4 100644 +index f58f0b2..608ffb1 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -234,7 +234,7 @@ long CDecoder::Release() +@@ -233,7 +233,7 @@ long CDecoder::Release() } } } @@ -10502,7 +10458,7 @@ index 4bdfb5b..e8f86c4 100644 } long CDecoder::ReleasePicReference() -@@ -1403,8 +1403,8 @@ void CMixer::StateMachine(int signal, Protocol *port, Message *msg) +@@ -1402,8 +1402,8 @@ void CMixer::StateMachine(int signal, Protocol *port, Message *msg) void CMixer::Process() { @@ -10513,7 +10469,7 @@ index 4bdfb5b..e8f86c4 100644 bool gotMsg; m_state = M_TOP_UNCONFIGURED; -@@ -1509,7 +1509,6 @@ void CMixer::CreateVdpauMixer() +@@ -1508,7 +1508,6 @@ void CMixer::CreateVdpauMixer() void CMixer::InitCSCMatrix(int Width) { @@ -10521,7 +10477,7 @@ index 4bdfb5b..e8f86c4 100644 m_Procamp.struct_version = VDP_PROCAMP_VERSION; m_Procamp.brightness = 0.0; m_Procamp.contrast = 1.0; -@@ -2640,8 +2639,8 @@ void COutput::StateMachine(int signal, Protocol *port, Message *msg) +@@ -2639,8 +2638,8 @@ void COutput::StateMachine(int signal, Protocol *port, Message *msg) void COutput::Process() { @@ -10532,7 +10488,7 @@ index 4bdfb5b..e8f86c4 100644 bool gotMsg; m_state = O_TOP_UNCONFIGURED; -@@ -2852,7 +2851,6 @@ CVdpauRenderPicture* COutput::ProcessMixerPicture() +@@ -2851,7 +2850,6 @@ CVdpauRenderPicture* COutput::ProcessMixerPicture() pixmap->DVDPic = pic.DVDPic; pixmap->id = i; m_bufferPool.notVisiblePixmaps.push_back(pixmap); @@ -10540,7 +10496,7 @@ index 4bdfb5b..e8f86c4 100644 m_config.vdpProcs.vdp_presentation_queue_display(pixmap->vdp_flip_queue, pixmap->surface,0,0,0); } -@@ -3010,7 +3008,7 @@ bool COutput::EnsureBufferPool() +@@ -3009,7 +3007,7 @@ bool COutput::EnsureBufferPool() { // create pixmpas VdpauBufferPool::Pixmaps pixmap; @@ -10549,7 +10505,7 @@ index 4bdfb5b..e8f86c4 100644 for (unsigned int i = 0; i < numPixmaps; i++) { pixmap.pixmap = None; -@@ -3264,7 +3262,7 @@ void COutput::GLMapSurfaces() +@@ -3263,7 +3261,7 @@ void COutput::GLMapSurfaces() if (m_config.videoSurfaces->size() != m_bufferPool.glVideoSurfaceMap.size()) { CSingleLock lock(*m_config.videoSurfaceSec); @@ -10558,7 +10514,7 @@ index 4bdfb5b..e8f86c4 100644 { if ((*m_config.videoSurfaces)[i]->surface == VDP_INVALID_HANDLE) continue; -@@ -3312,7 +3310,7 @@ void COutput::GLMapSurfaces() +@@ -3311,7 +3309,7 @@ void COutput::GLMapSurfaces() if (m_bufferPool.glOutputSurfaceMap.size() != m_bufferPool.numOutputSurfaces) { VdpauBufferPool::GLVideoSurface glSurface; @@ -10567,7 +10523,7 @@ index 4bdfb5b..e8f86c4 100644 { glSurface.sourceRgb = m_bufferPool.outputSurfaces[i]; glGenTextures(1, glSurface.texture); -@@ -3436,7 +3434,6 @@ bool COutput::CheckStatus(VdpStatus vdp_st, int line) +@@ -3435,7 +3433,6 @@ bool COutput::CheckStatus(VdpStatus vdp_st, int line) bool COutput::CreateGlxContext() { GLXContext glContext; @@ -10579,10 +10535,10 @@ index 4bdfb5b..e8f86c4 100644 1.8.1.6 -From 6ea5c625e353741b8487bcaeab492fc5b6c4c32f Mon Sep 17 00:00:00 2001 +From eb8e42d3b27a0b9ffce140673849e257d7dd720a Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 25 Feb 2013 08:47:10 +0100 -Subject: [PATCH 034/107] vdpau: release more resources on pre-cleanup +Subject: [PATCH 035/111] vdpau: release more resources on pre-cleanup --- xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 72 +++++++++++++++++++++++--- @@ -10590,10 +10546,10 @@ Subject: [PATCH 034/107] vdpau: release more resources on pre-cleanup 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 e8f86c4..fb41a72 100644 +index 608ffb1..2abd099 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -1147,6 +1147,11 @@ void CMixer::Dispose() +@@ -1146,6 +1146,11 @@ void CMixer::Dispose() m_dataPort.Purge(); } @@ -10605,7 +10561,7 @@ index e8f86c4..fb41a72 100644 void CMixer::OnStartup() { CLog::Log(LOGNOTICE, "CMixer::OnStartup: Output Thread created"); -@@ -2536,6 +2541,7 @@ void COutput::StateMachine(int signal, Protocol *port, Message *msg) +@@ -2535,6 +2540,7 @@ void COutput::StateMachine(int signal, Protocol *port, Message *msg) return; case COutputControlProtocol::PRECLEANUP: Flush(); @@ -10613,7 +10569,7 @@ index e8f86c4..fb41a72 100644 msg->Reply(COutputControlProtocol::ACC); return; default: -@@ -2742,15 +2748,18 @@ bool COutput::Uninit() +@@ -2741,15 +2747,18 @@ bool COutput::Uninit() void COutput::Flush() { @@ -10638,7 +10594,7 @@ index e8f86c4..fb41a72 100644 Message *msg; while (m_mixer.m_dataPort.ReceiveInMessage(&msg)) -@@ -3088,6 +3097,57 @@ void COutput::ReleaseBufferPool() +@@ -3087,6 +3096,57 @@ void COutput::ReleaseBufferPool() } } @@ -10720,10 +10676,10 @@ index 173de37..4b1c53b 100644 1.8.1.6 -From ef28955e86c6325da36d4ce8f101bf7fe220c60b Mon Sep 17 00:00:00 2001 +From 0e59e4ecbefd2be5885bf6851b48913aabfa5192 Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 6 Mar 2013 07:35:10 +0100 -Subject: [PATCH 035/107] vdpau: set deinterlacing method to auto, if default +Subject: [PATCH 036/111] vdpau: set deinterlacing method to auto, if default method not supported --- @@ -10731,10 +10687,10 @@ Subject: [PATCH 035/107] 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 fb41a72..82a46aa 100644 +index 2abd099..222fb19 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -2172,13 +2172,15 @@ void CMixer::InitCycle() +@@ -2171,13 +2171,15 @@ void CMixer::InitCycle() } else { @@ -10755,10 +10711,382 @@ index fb41a72..82a46aa 100644 1.8.1.6 -From ad8ec75e430ab92db4127312cb01b250ad678ff4 Mon Sep 17 00:00:00 2001 +From 427caf68cf8ba9211077ef1d33606ba6a660b04a Mon Sep 17 00:00:00 2001 +From: xbmc +Date: Sun, 21 Apr 2013 09:19:34 +0200 +Subject: [PATCH 037/111] vdpau: fix deadlock if decoder is closed while + refresh rate changes + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +index 222fb19..a12233d 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +@@ -175,6 +175,8 @@ void CDecoder::Close() + { + CLog::Log(LOGNOTICE, " (VDPAU) %s", __FUNCTION__); + ++ g_Windowing.Unregister(this); ++ + CSingleLock lock(m_DecoderSection); + + FiniVDPAUOutput(); +@@ -191,7 +193,6 @@ void CDecoder::Close() + free(render); + } + +- g_Windowing.Unregister(this); + m_dllAvUtil.Unload(); + } + +-- +1.8.1.6 + + +From f7bb0fe1f6336ce3d5263680f2985fd0cedb719d Mon Sep 17 00:00:00 2001 +From: xbmc +Date: Wed, 1 May 2013 18:43:56 +0200 +Subject: [PATCH 038/111] ffmpeg: register vdpau hwaccel for mpeg12 + +--- + lib/ffmpeg/libavcodec/mpeg12.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/lib/ffmpeg/libavcodec/mpeg12.c b/lib/ffmpeg/libavcodec/mpeg12.c +index 9d2743a..0f94772 100644 +--- a/lib/ffmpeg/libavcodec/mpeg12.c ++++ b/lib/ffmpeg/libavcodec/mpeg12.c +@@ -1202,6 +1202,7 @@ static void quant_matrix_rebuild(uint16_t *matrix, const uint8_t *old_perm, + #endif + #if CONFIG_MPEG1_VDPAU_HWACCEL + AV_PIX_FMT_VDPAU_MPEG1, ++ AV_PIX_FMT_VDPAU, + #endif + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_NONE +@@ -1214,6 +1215,7 @@ static void quant_matrix_rebuild(uint16_t *matrix, const uint8_t *old_perm, + #endif + #if CONFIG_MPEG2_VDPAU_HWACCEL + AV_PIX_FMT_VDPAU_MPEG2, ++ AV_PIX_FMT_VDPAU, + #endif + #if CONFIG_MPEG2_DXVA2_HWACCEL + AV_PIX_FMT_DXVA2_VLD, +-- +1.8.1.6 + + +From 7c305a6fc9cd41a5eddf28cfbfc33bb98459c29e Mon Sep 17 00:00:00 2001 +From: xbmc +Date: Thu, 2 May 2013 19:29:05 +0200 +Subject: [PATCH 039/111] ffmpeg: fix vdpau vc1 field interlace + +--- + lib/ffmpeg/libavcodec/vdpau_vc1.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/lib/ffmpeg/libavcodec/vdpau_vc1.c b/lib/ffmpeg/libavcodec/vdpau_vc1.c +index f5da9bb..6831599 100644 +--- a/lib/ffmpeg/libavcodec/vdpau_vc1.c ++++ b/lib/ffmpeg/libavcodec/vdpau_vc1.c +@@ -59,7 +59,12 @@ static int vdpau_vc1_start_frame(AVCodecContext *avctx, + else + info->picture_type = s->pict_type - 1 + s->pict_type / 3; + +- info->frame_coding_mode = v->fcm; ++ if (v->fcm == PROGRESSIVE) ++ info->frame_coding_mode = 0; ++ else if (v->fcm == ILACE_FRAME) ++ info->frame_coding_mode = 2; ++ else if (v->fcm == ILACE_FIELD) ++ info->frame_coding_mode = 3; + info->postprocflag = v->postprocflag; + info->pulldown = v->broadcast; + info->interlace = v->interlace; +-- +1.8.1.6 + + +From 0cd5f6f0a45c6c83bfb10e50d842853d7b4b95ab Mon Sep 17 00:00:00 2001 +From: xbmc +Date: Wed, 1 May 2013 18:44:24 +0200 +Subject: [PATCH 040/111] vdpau: move vdpau into hwaccel + +--- + .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 49 ----------------- + xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 61 ++++++++++++++-------- + xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h | 7 ++- + 3 files changed, 45 insertions(+), 72 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +index 40ea3e0..b17261b 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +@@ -74,9 +74,6 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx + #ifdef HAVE_LIBVDPAU + if(VDPAU::CDecoder::IsVDPAUFormat(*cur) && CSettings::Get().GetBool("videoplayer.usevdpau")) + { +- if(ctx->GetHardware()) +- return *cur; +- + CLog::Log(LOGNOTICE,"CDVDVideoCodecFFmpeg::GetFormat - Creating VDPAU(%ix%i)", avctx->width, avctx->height); + VDPAU::CDecoder* vdp = new VDPAU::CDecoder(); + if(vdp->Open(avctx, *cur, ctx->m_uSurfacesCount)) +@@ -204,52 +201,6 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options + } + } + +-#ifdef HAVE_LIBVDPAU +- if(CSettings::Get().GetBool("videoplayer.usevdpau") && !m_bSoftware) +- { +- while((pCodec = m_dllAvCodec.av_codec_next(pCodec))) +- { +- if(pCodec->id == hints.codec +- && pCodec->capabilities & CODEC_CAP_HWACCEL_VDPAU) +- { +- if ((pCodec->id == CODEC_ID_MPEG4) && !g_advancedSettings.m_videoAllowMpeg4VDPAU) +- continue; +- +- CLog::Log(LOGNOTICE,"CDVDVideoCodecFFmpeg::Open() Creating VDPAU(%ix%i, %d)",hints.width, hints.height, hints.codec); +- +- VDPAU::CDecoder* vdp = new VDPAU::CDecoder(); +- m_pCodecContext = m_dllAvCodec.avcodec_alloc_context3(pCodec); +- m_pCodecContext->codec_id = hints.codec; +- m_pCodecContext->width = hints.width; +- m_pCodecContext->height = hints.height; +- m_pCodecContext->coded_width = hints.width; +- m_pCodecContext->coded_height = hints.height; +- +- // check number of surfaces used in renderer +- unsigned int surfaces = 0; +- for(std::vector::iterator it = options.m_keys.begin(); it != options.m_keys.end(); it++) +- { +- if (it->m_name == "surfaces") +- { +- surfaces = std::atoi(it->m_value.c_str()); +- break; +- } +- } +- +- if(vdp->Open(m_pCodecContext, pCodec->pix_fmts ? pCodec->pix_fmts[0] : PIX_FMT_NONE, surfaces)) +- { +- m_pHardware = vdp; +- m_pCodecContext->codec_id = CODEC_ID_NONE; // ffmpeg will complain if this has been set +- break; +- } +- m_dllAvUtil.av_freep(&m_pCodecContext); +- CLog::Log(LOGNOTICE,"CDVDVideoCodecFFmpeg::Open() Failed to get VDPAU device"); +- vdp->Release(); +- } +- } +- } +-#endif +- + if(pCodec == NULL) + pCodec = m_dllAvCodec.avcodec_find_decoder(hints.codec); + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +index a12233d..f285e4b 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +@@ -155,10 +155,15 @@ bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int + } + + /* finally setup ffmpeg */ ++ memset(&m_hwContext, 0, sizeof(AVVDPAUContext)); ++ m_hwContext.render = CDecoder::Render; ++ m_hwContext.bitstream_buffers_allocated = 0; + avctx->get_buffer = CDecoder::FFGetBuffer; + avctx->release_buffer = CDecoder::FFReleaseBuffer; + avctx->draw_horiz_band = CDecoder::FFDrawSlice; + avctx->slice_flags=SLICE_FLAG_CODED_ORDER|SLICE_FLAG_ALLOW_FIELD; ++ avctx->hwaccel_context = &m_hwContext; ++ avctx->thread_count = 1; + + g_Windowing.Register(this); + return true; +@@ -193,6 +198,11 @@ void CDecoder::Close() + free(render); + } + ++ if (m_hwContext.bitstream_buffers_allocated) ++ { ++ m_dllAvUtil.av_freep(&m_hwContext.bitstream_buffers); ++ } ++ + m_dllAvUtil.Unload(); + } + +@@ -337,11 +347,10 @@ int CDecoder::Check(AVCodecContext* avctx) + + bool CDecoder::IsVDPAUFormat(PixelFormat format) + { +- if ((format >= PIX_FMT_VDPAU_H264) && (format <= PIX_FMT_VDPAU_VC1)) return true; +-#if (defined PIX_FMT_VDPAU_MPEG4_IN_AVUTIL) +- if (format == PIX_FMT_VDPAU_MPEG4) return true; +-#endif +- else return false; ++ if (format == AV_PIX_FMT_VDPAU) ++ return true; ++ else ++ return false; + } + + bool CDecoder::Supports(VdpVideoMixerFeature feature) +@@ -508,33 +517,33 @@ void CDecoder::FiniVDPAUOutput() + } + } + +-void CDecoder::ReadFormatOf( PixelFormat fmt ++void CDecoder::ReadFormatOf( AVCodecID codec + , VdpDecoderProfile &vdp_decoder_profile + , VdpChromaType &vdp_chroma_type) + { +- switch (fmt) ++ switch (codec) + { +- case PIX_FMT_VDPAU_MPEG1: ++ case AV_CODEC_ID_MPEG1VIDEO: + vdp_decoder_profile = VDP_DECODER_PROFILE_MPEG1; + vdp_chroma_type = VDP_CHROMA_TYPE_420; + break; +- case PIX_FMT_VDPAU_MPEG2: ++ case AV_CODEC_ID_MPEG2VIDEO: + vdp_decoder_profile = VDP_DECODER_PROFILE_MPEG2_MAIN; + vdp_chroma_type = VDP_CHROMA_TYPE_420; + break; +- case PIX_FMT_VDPAU_H264: ++ case AV_CODEC_ID_H264: + vdp_decoder_profile = VDP_DECODER_PROFILE_H264_HIGH; + vdp_chroma_type = VDP_CHROMA_TYPE_420; + break; +- case PIX_FMT_VDPAU_WMV3: ++ case AV_CODEC_ID_WMV3: + vdp_decoder_profile = VDP_DECODER_PROFILE_VC1_MAIN; + vdp_chroma_type = VDP_CHROMA_TYPE_420; + break; +- case PIX_FMT_VDPAU_VC1: ++ case AV_CODEC_ID_VC1: + vdp_decoder_profile = VDP_DECODER_PROFILE_VC1_ADVANCED; + vdp_chroma_type = VDP_CHROMA_TYPE_420; + break; +- case PIX_FMT_VDPAU_MPEG4: ++ case AV_CODEC_ID_MPEG4: + vdp_decoder_profile = VDP_DECODER_PROFILE_MPEG4_PART2_ASP; + vdp_chroma_type = VDP_CHROMA_TYPE_420; + break; +@@ -562,9 +571,9 @@ bool CDecoder::ConfigVDPAU(AVCodecContext* avctx, int ref_frames) + CLog::Log(LOGNOTICE, " (VDPAU) screenWidth:%i vidWidth:%i surfaceWidth:%i",m_vdpauConfig.outWidth,m_vdpauConfig.vidWidth,m_vdpauConfig.surfaceWidth); + CLog::Log(LOGNOTICE, " (VDPAU) screenHeight:%i vidHeight:%i surfaceHeight:%i",m_vdpauConfig.outHeight,m_vdpauConfig.vidHeight,m_vdpauConfig.surfaceHeight); + +- ReadFormatOf(avctx->pix_fmt, vdp_decoder_profile, m_vdpauConfig.vdpChromaType); ++ ReadFormatOf(avctx->codec_id, vdp_decoder_profile, m_vdpauConfig.vdpChromaType); + +- if(avctx->pix_fmt == PIX_FMT_VDPAU_H264) ++ if(avctx->codec_id == AV_CODEC_ID_H264) + { + m_vdpauConfig.maxReferences = ref_frames; + if (m_vdpauConfig.maxReferences > 16) m_vdpauConfig.maxReferences = 16; +@@ -727,7 +736,7 @@ int CDecoder::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) + { + // create a new surface + VdpDecoderProfile profile; +- ReadFormatOf(avctx->pix_fmt, profile, vdp->m_vdpauConfig.vdpChromaType); ++ ReadFormatOf(avctx->codec_id, profile, vdp->m_vdpauConfig.vdpChromaType); + render = (vdpau_render_state*)calloc(sizeof(vdpau_render_state), 1); + if (render == NULL) + { +@@ -759,7 +768,8 @@ int CDecoder::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) + return -1; + + pic->data[1] = pic->data[2] = NULL; +- pic->data[0]= (uint8_t*)render; ++ pic->data[0] = (uint8_t*)render; ++ pic->data[3] = (uint8_t*)(uintptr_t)render->surface; + + pic->linesize[0] = pic->linesize[1] = pic->linesize[2] = 0; + +@@ -803,6 +813,13 @@ void CDecoder::FFReleaseBuffer(AVCodecContext *avctx, AVFrame *pic) + render->state &= ~FF_VDPAU_STATE_USED_FOR_REFERENCE; + } + ++VdpStatus CDecoder::Render( VdpDecoder decoder, VdpVideoSurface target, ++ VdpPictureInfo const *picture_info, ++ uint32_t bitstream_buffer_count, ++ VdpBitstreamBuffer const * bitstream_buffers) ++{ ++ return VDP_STATUS_OK; ++} + + void CDecoder::FFDrawSlice(struct AVCodecContext *s, + const AVFrame *src, int offset[4], +@@ -842,8 +859,8 @@ void CDecoder::FFDrawSlice(struct AVCodecContext *s, + } + + uint32_t max_refs = 0; +- if(s->pix_fmt == PIX_FMT_VDPAU_H264) +- max_refs = render->info.h264.num_ref_frames; ++ if(s->codec_id == AV_CODEC_ID_H264) ++ max_refs = vdp->m_hwContext.info.h264.num_ref_frames; + + if(vdp->m_vdpauConfig.vdpDecoder == VDP_INVALID_HANDLE + || vdp->m_vdpauConfigured == false +@@ -858,9 +875,9 @@ void CDecoder::FFDrawSlice(struct AVCodecContext *s, + vdp->m_bufferStats.Get(decoded, processed, rend); + vdp_st = vdp->m_vdpauConfig.vdpProcs.vdp_decoder_render(vdp->m_vdpauConfig.vdpDecoder, + render->surface, +- (VdpPictureInfo const *)&(render->info), +- render->bitstream_buffers_used, +- render->bitstream_buffers); ++ (VdpPictureInfo const *)&(vdp->m_hwContext.info), ++ 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) +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h +index 4b1c53b..08c90c7 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h +@@ -546,6 +546,10 @@ class CDecoder + const AVFrame *src, int offset[4], + int y, int type, int height); + static int FFGetBuffer(AVCodecContext *avctx, AVFrame *pic); ++ static VdpStatus Render( VdpDecoder decoder, VdpVideoSurface target, ++ VdpPictureInfo const *picture_info, ++ uint32_t bitstream_buffer_count, ++ VdpBitstreamBuffer const * bitstream_buffers); + + virtual void OnLostDevice(); + virtual void OnResetDevice(); +@@ -562,7 +566,7 @@ class CDecoder + void ReturnRenderPicture(CVdpauRenderPicture *renderPic); + long ReleasePicReference(); + +- static void ReadFormatOf( PixelFormat fmt ++ static void ReadFormatOf( AVCodecID codec + , VdpDecoderProfile &decoder_profile + , VdpChromaType &chroma_type); + +@@ -589,6 +593,7 @@ class CDecoder + bool m_vdpauConfigured; + CVdpauConfig m_vdpauConfig; + std::vector m_videoSurfaces; ++ AVVDPAUContext m_hwContext; + CCriticalSection m_videoSurfaceSec; + + COutput m_vdpauOutput; +-- +1.8.1.6 + + +From 2dcec2a82526f6fea6a6512eea462fd17e3504d5 Mon Sep 17 00:00:00 2001 From: wsnipex Date: Sun, 4 Nov 2012 14:05:52 +0100 -Subject: [PATCH 036/107] configure: add --enable-pvraddons-with-dependencies +Subject: [PATCH 041/111] configure: add --enable-pvraddons-with-dependencies switch for intree building of PVR Addons --- @@ -10766,7 +11094,7 @@ Subject: [PATCH 036/107] configure: add --enable-pvraddons-with-dependencies 1 file changed, 12 insertions(+) diff --git a/configure.in b/configure.in -index f0e4905..7fd9483 100644 +index d89353c..30db97c 100644 --- a/configure.in +++ b/configure.in @@ -527,6 +527,14 @@ AC_ARG_ENABLE([external-ffmpeg], @@ -10784,7 +11112,7 @@ index f0e4905..7fd9483 100644 if test "x$host_vendor" != "xapple"; then DEFAULT_COMPILE_FLAGS="-fPIC -DPIC -D_REENTRANT" -@@ -2785,12 +2793,16 @@ XB_CONFIG_MODULE([pvr-addons], [ +@@ -2811,12 +2819,16 @@ XB_CONFIG_MODULE([pvr-addons], [ if test "$USE_EXTERNAL_FFMPEG" = 1; then PVR_EXT_FFMPEG="--enable-external-ffmpeg" fi @@ -10805,10 +11133,10 @@ index f0e4905..7fd9483 100644 1.8.1.6 -From 45b912dad3f615291e621833520cab3870c13b84 Mon Sep 17 00:00:00 2001 +From 381cc1a7cda052c49c7fe12772de1260041af10f Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:41:31 +0200 -Subject: [PATCH 037/107] videoplayer: update frametime, it might change due to +Subject: [PATCH 042/111] videoplayer: update frametime, it might change due to fps detection --- @@ -10816,7 +11144,7 @@ Subject: [PATCH 037/107] 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 8f9d5f6..9b49386 100644 +index 5559c8e..c103b69 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -734,6 +734,8 @@ void CDVDPlayerVideo::Process() @@ -10832,10 +11160,10 @@ index 8f9d5f6..9b49386 100644 1.8.1.6 -From f3fd8aa3865ffc6ccb0fa41ed71a4d8526b9e8c5 Mon Sep 17 00:00:00 2001 +From 530d6260e153c28dfa2997294d014ddfbf8d402e Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:43:06 +0200 -Subject: [PATCH 038/107] videoplayer: give streams with invalid fps a chance +Subject: [PATCH 043/111] videoplayer: give streams with invalid fps a chance for fps detection --- @@ -10843,7 +11171,7 @@ Subject: [PATCH 038/107] 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 9b49386..4cbf6ad 100644 +index c103b69..bd26b2f 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -1625,7 +1625,7 @@ void CDVDPlayerVideo::CalcFrameRate() @@ -10859,10 +11187,10 @@ index 9b49386..4cbf6ad 100644 1.8.1.6 -From 62c0aa17f9279030a1d0ae1324ca37403cc2494c Mon Sep 17 00:00:00 2001 +From a686cab9448a1bb4f7aa6671cde865f45f80bdde Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:49:05 +0200 -Subject: [PATCH 039/107] dvdplayer: allow rewinding at end of stream, do a +Subject: [PATCH 044/111] dvdplayer: allow rewinding at end of stream, do a seek after rewind --- @@ -10870,7 +11198,7 @@ Subject: [PATCH 039/107] 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 95eb8ae..00d4237 100644 +index 3080827..93ec1c3 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp @@ -1561,7 +1561,7 @@ void CDVDPlayer::HandlePlaySpeed() @@ -10899,10 +11227,10 @@ index 95eb8ae..00d4237 100644 1.8.1.6 -From 9617e14e9d30492f2df8d89cf19ae6a65e2da111 Mon Sep 17 00:00:00 2001 +From 6c1cfea15a13add450b5f40fe86ca8cc90a83be3 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 15:22:05 +0200 -Subject: [PATCH 040/107] X11: ditch SDL for video and window events +Subject: [PATCH 045/111] X11: ditch SDL for video and window events --- xbmc/Application.cpp | 2 +- @@ -10918,10 +11246,10 @@ Subject: [PATCH 040/107] 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 fd59535..c72def4 100644 +index ab09e86..77d6931 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -851,7 +851,7 @@ bool CApplication::CreateGUI() +@@ -824,7 +824,7 @@ bool CApplication::CreateGUI() uint32_t sdlFlags = 0; @@ -10931,10 +11259,10 @@ index fd59535..c72def4 100644 #endif diff --git a/xbmc/system.h b/xbmc/system.h -index 8f099d3..ced8068 100644 +index 1bd0c98..a291a59 100644 --- a/xbmc/system.h +++ b/xbmc/system.h -@@ -160,16 +160,21 @@ +@@ -164,16 +164,21 @@ #define HAS_GL #ifdef HAVE_X11 #define HAS_GLX @@ -12386,10 +12714,10 @@ index 3dae22c..25faaef 100644 1.8.1.6 -From 9a9d63f1784bda2eea9db8d8b71dfed8c8d9a383 Mon Sep 17 00:00:00 2001 +From 6768ffb10bb8653b0b471f53a0512e5e487e1ef7 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 15:24:22 +0200 -Subject: [PATCH 041/107] X11: Add xbmc icon +Subject: [PATCH 046/111] X11: Add xbmc icon --- xbmc/windowing/X11/WinSystemX11.cpp | 126 +++++++++++++++++++++++++++++++++++- @@ -12578,10 +12906,10 @@ index 25faaef..c1e6cf1 100644 1.8.1.6 -From 5083da87ac2af5d85a1373afc1fa1238ebe63ce4 Mon Sep 17 00:00:00 2001 +From 652a952a7649b8ed23746e56ced4fd77b3bd5ed1 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 20 May 2012 14:11:26 +0200 -Subject: [PATCH 042/107] X11: add SDL joystick until we have a better solution +Subject: [PATCH 047/111] X11: add SDL joystick until we have a better solution --- xbmc/windowing/WinEventsX11.cpp | 26 ++++++++++++++++++++++++++ @@ -12635,10 +12963,10 @@ index 5a8bbb8..5bc1de0 100644 1.8.1.6 -From 2ccf6f21dcdf0446f07225071d2633bac3110ec0 Mon Sep 17 00:00:00 2001 +From 935dbfdc06dc5ce9f6b94895e8c9e250c40ec98d Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Thu, 5 Jul 2012 12:35:55 +0200 -Subject: [PATCH 043/107] X11: factor out code handling device reset +Subject: [PATCH 048/111] X11: factor out code handling device reset notification --- @@ -12702,10 +13030,10 @@ index c1e6cf1..041ea55 100644 1.8.1.6 -From cea17f9e47c3149ede37869e3d4d07d6a29de046 Mon Sep 17 00:00:00 2001 +From 7c17a504125d6678df160995b5c019c661df3b65 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 15:02:00 +0200 -Subject: [PATCH 044/107] X11: move xrandr events to WinEventsX11 +Subject: [PATCH 049/111] X11: move xrandr events to WinEventsX11 --- xbmc/windowing/WinEventsX11.cpp | 42 +++++++++++++++++++++++++++++++++++++ @@ -12849,10 +13177,10 @@ index fd51dc0..d495443 100644 1.8.1.6 -From 0b0261524254b16e92aeb4b1b1f3ae28abcc0d7f Mon Sep 17 00:00:00 2001 +From 264d0a30544ef12fbce2df40ab1b53bdc72416c5 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 12 Apr 2012 15:43:56 +0200 -Subject: [PATCH 045/107] xrandr: remove method RestoreState +Subject: [PATCH 050/111] xrandr: remove method RestoreState --- xbmc/windowing/X11/WinSystemX11.cpp | 13 +++++++++++-- @@ -12931,10 +13259,10 @@ index e3450fe..cf22fbf 100644 1.8.1.6 -From a7d560c9c367a1c965b3b62ed57846a759abe592 Mon Sep 17 00:00:00 2001 +From c449e6aef1095c4af275cf8c2d478791e5d672e1 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 20 May 2012 13:17:10 +0200 -Subject: [PATCH 046/107] xrandr: observe orientation +Subject: [PATCH 051/111] xrandr: observe orientation --- xbmc/windowing/X11/WinSystemX11.cpp | 89 ++++++++++++++++++++++++++++++------- @@ -13149,10 +13477,10 @@ index cf22fbf..71ffab4 100644 1.8.1.6 -From 9df5ca0e6d4656c3070ea58aa910b1b7f59cb0f5 Mon Sep 17 00:00:00 2001 +From 7094ccf3b0690e883dc0ed56caebcb7d774acc5f Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 11:54:15 +0200 -Subject: [PATCH 047/107] xrandr: allow getting info for multiple screen's +Subject: [PATCH 052/111] xrandr: allow getting info for multiple screen's Refactored by: Joakim Plate --- @@ -13327,26 +13655,25 @@ index 71ffab4..26c2653 100644 1.8.1.6 -From ba137b6043ef937f6f31152d15aaba52a2a34b76 Mon Sep 17 00:00:00 2001 +From e0e9e155cdd3a8a3f6031bbbf7d15b62b25398b5 Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 11:44:00 +0200 -Subject: [PATCH 048/107] X11: fix multi-head setups +Subject: [PATCH 053/111] X11: fix multi-head setups --- - language/English/strings.po | 4 +- - xbmc/rendering/gl/RenderSystemGL.h | 1 + - xbmc/settings/DisplaySettings.cpp | 9 + - xbmc/settings/DisplaySettings.h | 1 + - xbmc/settings/GUISettings.cpp | 5 + - .../settings/windows/GUIWindowSettingsCategory.cpp | 60 ++++- - xbmc/settings/windows/GUIWindowSettingsCategory.h | 1 + - xbmc/windowing/WinEventsX11.cpp | 7 + - xbmc/windowing/X11/WinSystemX11.cpp | 258 ++++++++++++--------- - xbmc/windowing/X11/WinSystemX11.h | 10 +- - 10 files changed, 241 insertions(+), 115 deletions(-) + language/English/strings.po | 4 +- + system/settings/settings.xml | 10 ++ + xbmc/rendering/gl/RenderSystemGL.h | 1 + + xbmc/settings/DisplaySettings.cpp | 40 +++++- + xbmc/settings/DisplaySettings.h | 2 + + xbmc/settings/Settings.cpp | 6 + + xbmc/windowing/WinEventsX11.cpp | 7 + + xbmc/windowing/X11/WinSystemX11.cpp | 260 +++++++++++++++++++++--------------- + xbmc/windowing/X11/WinSystemX11.h | 10 +- + 9 files changed, 224 insertions(+), 116 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index f18acfb..60b8e3c 100644 +index c8651dd..eec0add 100644 --- a/language/English/strings.po +++ b/language/English/strings.po @@ -997,7 +997,9 @@ msgctxt "#245" @@ -13360,6 +13687,34 @@ index f18acfb..60b8e3c 100644 msgctxt "#247" msgid "Scripts" +diff --git a/system/settings/settings.xml b/system/settings/settings.xml +index 9991a8a..c34c693 100644 +--- a/system/settings/settings.xml ++++ b/system/settings/settings.xml +@@ -1850,6 +1850,15 @@ +
+ + ++ ++ HAS_GLX ++ 0 ++ Default ++ ++ monitors ++ ++ ++ + + 0 + 0 +@@ -1868,6 +1877,7 @@ + + -1 + ++ + + + diff --git a/xbmc/rendering/gl/RenderSystemGL.h b/xbmc/rendering/gl/RenderSystemGL.h index 5c7a288..f3fd4fb 100644 --- a/xbmc/rendering/gl/RenderSystemGL.h @@ -13373,13 +13728,78 @@ index 5c7a288..f3fd4fb 100644 virtual void SetViewPort(CRect& viewPort); virtual void GetViewPort(CRect& viewPort); diff --git a/xbmc/settings/DisplaySettings.cpp b/xbmc/settings/DisplaySettings.cpp -index 7784641..3680a6a 100644 +index 40b1263..856fe3a 100644 --- a/xbmc/settings/DisplaySettings.cpp +++ b/xbmc/settings/DisplaySettings.cpp -@@ -380,3 +380,12 @@ RESOLUTION CDisplaySettings::GetResolutionFromString(const std::string &strResol +@@ -197,7 +197,8 @@ bool CDisplaySettings::OnSettingChanging(const CSetting *setting) + const std::string &settingId = setting->GetId(); + if (settingId == "videoscreen.resolution" || + settingId == "videoscreen.screen" || +- settingId == "videoscreen.screenmode") ++ settingId == "videoscreen.screenmode" || ++ settingId == "videoscreen.monitor") + { + // check if this is the revert call for a failed OnSettingChanging + // in which case we don't want to ask the user again +@@ -210,6 +211,11 @@ bool CDisplaySettings::OnSettingChanging(const CSetting *setting) + newRes = GetResolutionForScreen(); + else if (settingId == "videoscreen.screenmode") + newRes = GetResolutionFromString(((CSettingString*)setting)->GetValue()); ++ else if (settingId == "videoscreen.monitor") ++ { ++ g_Windowing.UpdateResolutions(); ++ newRes = GetResolutionForScreen(); ++ } - return RES_DESKTOP; + // We need to change and save videoscreen.screenmode which will + // trigger another call to this OnSettingChanging() which should not +@@ -218,8 +224,10 @@ bool CDisplaySettings::OnSettingChanging(const CSetting *setting) + bool save = settingId != "videoscreen.screenmode"; + if (save) + m_ignoreSettingChanging.insert(make_pair("videoscreen.screenmode", true)); ++ ++ bool outputChanged = !g_Windowing.IsCurrentOutput(CSettings::Get().GetString("videoscreen.monitor")); + SetCurrentResolution(newRes, save); +- g_graphicsContext.SetVideoResolution(newRes); ++ g_graphicsContext.SetVideoResolution(newRes, outputChanged); + + // check if this setting is temporarily blocked from showing the dialog + if (m_ignoreSettingChanging.find(make_pair(settingId, false)) == m_ignoreSettingChanging.end()) +@@ -565,11 +573,16 @@ void CDisplaySettings::SettingOptionsScreensFiller(const CSetting *setting, std: + if (g_advancedSettings.m_canWindowed) + list.push_back(make_pair(g_localizeStrings.Get(242), DM_WINDOWED)); + ++#if defined(HAS_GLX) ++ list.push_back(make_pair(g_localizeStrings.Get(244), 0)); ++#else ++ + for (int idx = 0; idx < g_Windowing.GetNumScreens(); idx++) + { + int screen = CDisplaySettings::Get().GetResolutionInfo(RES_DESKTOP + idx).iScreen; + list.push_back(make_pair(StringUtils::Format(g_localizeStrings.Get(241), screen + 1), screen)); + } ++#endif } + + void CDisplaySettings::SettingOptionsVerticalSyncsFiller(const CSetting *setting, std::vector< std::pair > &list, int ¤t) +@@ -581,3 +594,26 @@ void CDisplaySettings::SettingOptionsVerticalSyncsFiller(const CSetting *setting + list.push_back(make_pair(g_localizeStrings.Get(13107), VSYNC_VIDEO)); + list.push_back(make_pair(g_localizeStrings.Get(13108), VSYNC_ALWAYS)); + } ++ ++void CDisplaySettings::SettingOptionsMonitorsFiller(const CSetting *setting, std::vector< std::pair > &list, std::string ¤t) ++{ ++ std::vector monitors; ++ g_Windowing.GetConnectedOutputs(&monitors); ++ for (unsigned int i=0; i > &list, int ¤t); + static void SettingOptionsScreensFiller(const CSetting *setting, std::vector< std::pair > &list, int ¤t); + static void SettingOptionsVerticalSyncsFiller(const CSetting *setting, std::vector< std::pair > &list, int ¤t); ++ static void SettingOptionsMonitorsFiller(const CSetting *setting, std::vector< std::pair > &list, std::string ¤t); -+#if defined(HAS_GLX) -+ AddString(vs, "videoscreen.monitor", 246, "", SPIN_CONTROL_TEXT); -+#endif -+ - // this setting would ideally not be saved, as its value is systematically derived from videoscreen.screenmode. - // contains a DISPLAYMODE - #if !defined(TARGET_DARWIN_IOS_ATV2) && !defined(TARGET_RASPBERRY_PI) - AddInt(vs, "videoscreen.screen", 240, 0, -1, 1, 32, SPIN_CONTROL_TEXT); + protected: + CDisplaySettings(); +diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp +index d9cb651..e617f24 100644 +--- a/xbmc/settings/Settings.cpp ++++ b/xbmc/settings/Settings.cpp +@@ -363,6 +363,7 @@ void CSettings::Uninitialize() + m_settingsManager->UnregisterSettingOptionsFiller("rendermethods"); + m_settingsManager->UnregisterSettingOptionsFiller("resolutions"); + m_settingsManager->UnregisterSettingOptionsFiller("screens"); ++ m_settingsManager->UnregisterSettingOptionsFiller("monitors"); + m_settingsManager->UnregisterSettingOptionsFiller("shutdownstates"); + m_settingsManager->UnregisterSettingOptionsFiller("startupwindows"); + m_settingsManager->UnregisterSettingOptionsFiller("streamlanguages"); +@@ -669,6 +670,7 @@ void CSettings::InitializeOptionFillers() + m_settingsManager->RegisterSettingOptionsFiller("rendermethods", CBaseRenderer::SettingOptionsRenderMethodsFiller); + m_settingsManager->RegisterSettingOptionsFiller("resolutions", CDisplaySettings::SettingOptionsResolutionsFiller); + m_settingsManager->RegisterSettingOptionsFiller("screens", CDisplaySettings::SettingOptionsScreensFiller); ++ m_settingsManager->RegisterSettingOptionsFiller("monitors", CDisplaySettings::SettingOptionsMonitorsFiller); + m_settingsManager->RegisterSettingOptionsFiller("shutdownstates", CPowerManager::SettingOptionsShutdownStatesFiller); + m_settingsManager->RegisterSettingOptionsFiller("startupwindows", ADDON::CSkinInfo::SettingOptionsStartupWindowsFiller); + m_settingsManager->RegisterSettingOptionsFiller("streamlanguages", CLangInfo::SettingOptionsStreamLanguagesFiller); +@@ -696,6 +698,9 @@ void CSettings::InitializeConditions() + #ifdef HAS_GL + m_settingsManager->AddCondition("has_gl"); #endif -+ - // this setting would ideally not be saved, as its value is systematically derived from videoscreen.screenmode. - // contains an index to the resolution info array in CDisplaySettings. the only meaningful fields are iScreen, iWidth, iHeight. - #if defined(TARGET_DARWIN) -diff --git a/xbmc/settings/windows/GUIWindowSettingsCategory.cpp b/xbmc/settings/windows/GUIWindowSettingsCategory.cpp -index 6973d12..20719ba 100644 ---- a/xbmc/settings/windows/GUIWindowSettingsCategory.cpp -+++ b/xbmc/settings/windows/GUIWindowSettingsCategory.cpp -@@ -529,6 +529,12 @@ void CGUIWindowSettingsCategory::CreateSettings() - FillInRefreshRates(strSetting, CDisplaySettings::Get().GetDisplayResolution(), false); - continue; - } -+ else if (strSetting.Equals("videoscreen.monitor")) -+ { -+ AddSetting(pSetting, group->GetWidth(), iControlID); -+ FillInMonitors(strSetting); -+ continue; -+ } - else if (strSetting.Equals("lookandfeel.skintheme")) - { - AddSetting(pSetting, group->GetWidth(), iControlID); -@@ -1425,6 +1431,20 @@ void CGUIWindowSettingsCategory::OnSettingChanged(BaseSettingControlPtr pSetting - // Cascade - FillInResolutions("videoscreen.resolution", mode, RES_DESKTOP, true); - } -+ else if (strSetting.Equals("videoscreen.monitor")) -+ { -+ CSettingString *pSettingString = (CSettingString *)pSettingControl->GetSetting(); -+ CGUISpinControlEx *pControl = (CGUISpinControlEx *)GetControl(pSettingControl->GetID()); -+ CStdString currentMonitor = pControl->GetCurrentLabel(); -+ if (!g_Windowing.IsCurrentOutput(currentMonitor)) -+ { -+ g_guiSettings.SetString("videoscreen.monitor", currentMonitor); -+ g_Windowing.UpdateResolutions(); -+ DisplayMode mode = g_guiSettings.GetInt("videoscreen.screen"); -+ // Cascade -+ FillInResolutions("videoscreen.resolution", mode, RES_DESKTOP, true); -+ } -+ } - else if (strSetting.Equals("videoscreen.resolution")) - { - RESOLUTION nextRes = (RESOLUTION) g_guiSettings.GetInt("videoscreen.resolution"); -@@ -2362,11 +2382,15 @@ DisplayMode CGUIWindowSettingsCategory::FillInScreens(CStdString strSetting, RES - if (g_advancedSettings.m_canWindowed) - pControl->AddLabel(g_localizeStrings.Get(242), -1); - -+#if !defined(HAS_GLX) - for (int idx = 0; idx < g_Windowing.GetNumScreens(); idx++) - { - strScreen.Format(g_localizeStrings.Get(241), CDisplaySettings::Get().GetResolutionInfo(RES_DESKTOP + idx).iScreen + 1); - pControl->AddLabel(strScreen, CDisplaySettings::Get().GetResolutionInfo(RES_DESKTOP + idx).iScreen); - } -+#else -+ pControl->AddLabel(g_localizeStrings.Get(244), 0); ++#ifdef HAS_GLX ++ m_settingsManager->AddCondition("has_glx"); +#endif - pControl->SetValue(mode); - g_guiSettings.SetInt("videoscreen.screen", mode); - } -@@ -2374,6 +2398,36 @@ DisplayMode CGUIWindowSettingsCategory::FillInScreens(CStdString strSetting, RES - return mode; - } + #ifdef HAS_GLES + m_settingsManager->AddCondition("has_gles"); + #endif +@@ -833,6 +838,7 @@ void CSettings::InitializeISettingCallbacks() + settingSet.insert("videoscreen.screen"); + settingSet.insert("videoscreen.resolution"); + settingSet.insert("videoscreen.screenmode"); ++ settingSet.insert("videoscreen.monitor"); + m_settingsManager->RegisterCallback(&CDisplaySettings::Get(), settingSet); -+void CGUIWindowSettingsCategory::FillInMonitors(CStdString strSetting) -+{ -+ // we expect "videoscreen.monitor" but it might be hidden on some platforms, -+ // so check that we actually have a visable control. -+ CBaseSettingControl *control = GetSetting(strSetting); -+ if (control) -+ { -+ control->SetDelayed(); -+ CGUISpinControlEx *pControl = (CGUISpinControlEx *)GetControl(control->GetID()); -+ pControl->Clear(); -+ -+ std::vector monitors; -+ g_Windowing.GetConnectedOutputs(&monitors); -+ -+ int currentMonitor = 0; -+ for (unsigned int i=0; iAddLabel(monitors[i], i); -+ } -+ -+ pControl->SetValue(currentMonitor); -+ g_guiSettings.SetString("videoscreen.monitor", CDisplaySettings::Get().GetResolutionInfo(RES_DESKTOP).strOutput); -+ } -+} -+ -+ - void CGUIWindowSettingsCategory::FillInResolutions(CStdString strSetting, DisplayMode mode, RESOLUTION res, bool UserChange) - { - BaseSettingControlPtr control = GetSetting(strSetting); -@@ -2502,13 +2556,15 @@ void CGUIWindowSettingsCategory::OnRefreshRateChanged(RESOLUTION nextRes) - RESOLUTION lastRes = g_graphicsContext.GetVideoResolution(); - bool cancelled = false; - -+ bool outputChanged = !g_Windowing.IsCurrentOutput(g_guiSettings.GetString("videoscreen.monitor")); -+ - CDisplaySettings::Get().SetCurrentResolution(nextRes, true); -- g_graphicsContext.SetVideoResolution(nextRes); -+ g_graphicsContext.SetVideoResolution(nextRes, outputChanged); - - if (!CGUIDialogYesNo::ShowAndGetInput(13110, 13111, 20022, 20022, -1, -1, cancelled, 10000)) - { - CDisplaySettings::Get().SetCurrentResolution(lastRes, true); -- g_graphicsContext.SetVideoResolution(lastRes); -+ g_graphicsContext.SetVideoResolution(lastRes, outputChanged); - - DisplayMode mode = FillInScreens("videoscreen.screen", lastRes); - FillInResolutions("videoscreen.resolution", mode, lastRes, false); -diff --git a/xbmc/settings/windows/GUIWindowSettingsCategory.h b/xbmc/settings/windows/GUIWindowSettingsCategory.h -index 74b222c..7391d0b 100644 ---- a/xbmc/settings/windows/GUIWindowSettingsCategory.h -+++ b/xbmc/settings/windows/GUIWindowSettingsCategory.h -@@ -51,6 +51,7 @@ class CGUIWindowSettingsCategory : - void FillInSoundSkins(CSetting *pSetting); - void FillInLanguages(CSetting *pSetting, const std::vector &languages = std::vector(), const std::vector &languageKeys = std::vector()); - DisplayMode FillInScreens(CStdString strSetting, RESOLUTION res); -+ void FillInMonitors(CStdString strSetting); - void FillInResolutions(CStdString strSetting, DisplayMode mode, RESOLUTION res, bool UserChange); - void FillInRefreshRates(CStdString strSetting, RESOLUTION res, bool UserChange); - void OnRefreshRateChanged(RESOLUTION resolution); + settingSet.clear(); diff --git a/xbmc/windowing/WinEventsX11.cpp b/xbmc/windowing/WinEventsX11.cpp index d9dc911..c58067b 100644 --- a/xbmc/windowing/WinEventsX11.cpp @@ -13565,13 +13889,15 @@ index d9dc911..c58067b 100644 break; } diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp -index 6b320f2..eac6853 100644 +index 6b320f2..41e7d6e 100644 --- a/xbmc/windowing/X11/WinSystemX11.cpp +++ b/xbmc/windowing/X11/WinSystemX11.cpp -@@ -35,6 +35,7 @@ +@@ -34,7 +34,8 @@ + #include "threads/SingleLock.h" #include "cores/VideoRenderers/RenderManager.h" #include "utils/TimeUtils.h" - #include "settings/GUISettings.h" +-#include "settings/GUISettings.h" ++#include "settings/Settings.h" +#include "windowing/WindowingFactory.h" #if defined(HAS_XRANDR) @@ -13619,7 +13945,7 @@ index 6b320f2..eac6853 100644 return true; - if (!SetWindow(newWidth, newHeight, false)) -+ if (!SetWindow(newWidth, newHeight, false, g_guiSettings.GetString("videoscreen.monitor"))) ++ if (!SetWindow(newWidth, newHeight, false, CSettings::Get().GetString("videoscreen.monitor"))) { return false; } @@ -13627,7 +13953,7 @@ index 6b320f2..eac6853 100644 m_nWidth = newWidth; m_nHeight = newHeight; m_bFullScreen = false; -+ m_currentOutput = g_guiSettings.GetString("videoscreen.monitor"); ++ m_currentOutput = CSettings::Get().GetString("videoscreen.monitor"); return false; } @@ -13709,7 +14035,7 @@ index 6b320f2..eac6853 100644 #endif - if (!SetWindow(res.iWidth, res.iHeight, fullScreen)) -+ if (!SetWindow(res.iWidth, res.iHeight, fullScreen, g_guiSettings.GetString("videoscreen.monitor"))) ++ if (!SetWindow(res.iWidth, res.iHeight, fullScreen, CSettings::Get().GetString("videoscreen.monitor"))) return false; RefreshGlxContext(); @@ -13717,7 +14043,7 @@ index 6b320f2..eac6853 100644 m_nWidth = res.iWidth; m_nHeight = res.iHeight; m_bFullScreen = fullScreen; -+ m_currentOutput = g_guiSettings.GetString("videoscreen.monitor"); ++ m_currentOutput = CSettings::Get().GetString("videoscreen.monitor"); return true; } @@ -13737,7 +14063,7 @@ index 6b320f2..eac6853 100644 + g_xrandr.SetNumScreens(numScreens); + if(g_xrandr.Query(true)) + { -+ currentMonitor = g_guiSettings.GetString("videoscreen.monitor"); ++ currentMonitor = CSettings::Get().GetString("videoscreen.monitor"); + // check if the monitor is connected + XOutput *out = g_xrandr.GetOutput(currentMonitor); + if (!out) @@ -13745,7 +14071,7 @@ index 6b320f2..eac6853 100644 + // choose first output + currentMonitor = g_xrandr.GetModes()[0].name; + out = g_xrandr.GetOutput(currentMonitor); -+ g_guiSettings.SetString("videoscreen.monitor", currentMonitor); ++ CSettings::Get().SetString("videoscreen.monitor", currentMonitor); + } + XMode mode = g_xrandr.GetCurrentMode(currentMonitor); + m_bIsRotated = out->isRotated; @@ -13952,7 +14278,7 @@ index 6b320f2..eac6853 100644 - // tell any shared resources - for (vector::iterator i = m_resources.begin(); i != m_resources.end(); i++) - (*i)->OnResetDevice(); -+ CStdString currentOutput = g_guiSettings.GetString("videoscreen.monitor"); ++ CStdString currentOutput = CSettings::Get().GetString("videoscreen.monitor"); + XOutput *out = g_xrandr.GetOutput(currentOutput); + XMode mode = g_xrandr.GetCurrentMode(currentOutput); + @@ -14089,10 +14415,10 @@ index 0d4436b..0336b3b 100644 1.8.1.6 -From 1f6e1632679c0ac2a089ad8f53f54af457f8a6f4 Mon Sep 17 00:00:00 2001 +From 752ba21b150922bd4d90c97d88386d16d351e09e Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 11:36:32 +0200 -Subject: [PATCH 049/107] X11: remove all DefaultScreen and RootWindow macros +Subject: [PATCH 054/111] X11: remove all DefaultScreen and RootWindow macros --- xbmc/windowing/X11/WinSystemX11.cpp | 6 +++--- @@ -14101,7 +14427,7 @@ Subject: [PATCH 049/107] X11: remove all DefaultScreen and RootWindow macros 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp -index eac6853..4b7b43d 100644 +index 41e7d6e..fd07a80 100644 --- a/xbmc/windowing/X11/WinSystemX11.cpp +++ b/xbmc/windowing/X11/WinSystemX11.cpp @@ -269,7 +269,7 @@ void CWinSystemX11::UpdateResolutions() @@ -14160,10 +14486,10 @@ index 1bea366..cc39720 100644 1.8.1.6 -From 10af90643fb8d61bc71e93244977cfc612f927ec Mon Sep 17 00:00:00 2001 +From 19133eea074c6a32611367f44569b6b1bc54495e Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 11:45:22 +0200 -Subject: [PATCH 050/107] X11: remove all DefaultScreen and RootWindow macros +Subject: [PATCH 055/111] X11: remove all DefaultScreen and RootWindow macros (VideoRefClock) Note this is on a separate display connection. @@ -14235,10 +14561,10 @@ index cc20523..b70af17 100644 1.8.1.6 -From df540ab640e2ab40876349b577bbdf4b2636cdb9 Mon Sep 17 00:00:00 2001 +From c4ad6bdadfc8702cd1c8bc9fc13be78bd5178406 Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 20 Jun 2012 17:37:11 +0200 -Subject: [PATCH 051/107] X11: recreate gl context after output has changed +Subject: [PATCH 056/111] X11: recreate gl context after output has changed --- xbmc/windowing/X11/WinSystemX11.cpp | 24 ++++++++++++++---------- @@ -14247,7 +14573,7 @@ Subject: [PATCH 051/107] X11: recreate gl context after output has changed 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp -index 4b7b43d..21d38b3 100644 +index fd07a80..8f56cec 100644 --- a/xbmc/windowing/X11/WinSystemX11.cpp +++ b/xbmc/windowing/X11/WinSystemX11.cpp @@ -170,7 +170,6 @@ bool CWinSystemX11::ResizeWindow(int newWidth, int newHeight, int newLeft, int n @@ -14266,7 +14592,7 @@ index 4b7b43d..21d38b3 100644 } #endif - if (!SetWindow(res.iWidth, res.iHeight, fullScreen, g_guiSettings.GetString("videoscreen.monitor"))) + if (!SetWindow(res.iWidth, res.iHeight, fullScreen, CSettings::Get().GetString("videoscreen.monitor"))) return false; - RefreshGlxContext(); @@ -14389,10 +14715,10 @@ index cc39720..dda7b14 100644 1.8.1.6 -From 9fde720f97254f004705f5465e037865334f4d02 Mon Sep 17 00:00:00 2001 +From 7289666c974039c8a30bd3ba1f20f6dfd68e07bd Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 12:06:25 +0200 -Subject: [PATCH 052/107] X11: hook video reference clock in windowing +Subject: [PATCH 057/111] X11: hook video reference clock in windowing --- xbmc/video/VideoReferenceClock.cpp | 71 +++++++++++++++++++++++++++----------- @@ -14597,30 +14923,17 @@ index ace9bf5..5db85e5 100644 1.8.1.6 -From cce79d6678fd6fc760e58c90fb23c9de6529c018 Mon Sep 17 00:00:00 2001 +From 95f47073ef7f16d8c69869749170a6848dcec632 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 21 Jun 2012 17:26:51 +0200 -Subject: [PATCH 053/107] X11: fix video calibrations +Subject: [PATCH 058/111] X11: fix video calibrations --- - xbmc/settings/Settings.cpp | 1 + xbmc/windowing/WinSystem.h | 1 + xbmc/windowing/X11/WinSystemX11.cpp | 36 +++++++++++++++++++++++++++++++++++- xbmc/windowing/X11/WinSystemX11.h | 1 + - 4 files changed, 38 insertions(+), 1 deletion(-) + 3 files changed, 37 insertions(+), 1 deletion(-) -diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp -index 1083e23..3344db2 100644 ---- a/xbmc/settings/Settings.cpp -+++ b/xbmc/settings/Settings.cpp -@@ -25,6 +25,7 @@ - #include "threads/SingleLock.h" - #include "utils/log.h" - #include "utils/XBMCTinyXML.h" -+#include "windowing/WindowingFactory.h" - - using namespace std; - using namespace XFILE; diff --git a/xbmc/windowing/WinSystem.h b/xbmc/windowing/WinSystem.h index 118a076..2536c0a 100644 --- a/xbmc/windowing/WinSystem.h @@ -14634,7 +14947,7 @@ index 118a076..2536c0a 100644 protected: void UpdateDesktopResolution(RESOLUTION_INFO& newRes, int screen, int width, int height, float refreshRate, uint32_t dwFlags = 0); diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp -index 21d38b3..558f694 100644 +index 8f56cec..0ead0e8 100644 --- a/xbmc/windowing/X11/WinSystemX11.cpp +++ b/xbmc/windowing/X11/WinSystemX11.cpp @@ -318,7 +318,7 @@ void CWinSystemX11::UpdateResolutions() @@ -14705,10 +15018,10 @@ index 2227320..630c0e2 100644 1.8.1.6 -From c12ed9e133510c67de1270be5b0e9075ffcbfa9c Mon Sep 17 00:00:00 2001 +From 7a431ef2a65560a54af38ad97b639e12ba2625df Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 12:00:26 +0200 -Subject: [PATCH 054/107] X11: deactivate screen saver on startup +Subject: [PATCH 059/111] X11: deactivate screen saver on startup --- xbmc/windowing/X11/WinSystemX11.cpp | 29 +++++++++++++++++++++++++++++ @@ -14716,7 +15029,7 @@ Subject: [PATCH 054/107] X11: deactivate screen saver on startup 2 files changed, 30 insertions(+) diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp -index 558f694..706f8e4 100644 +index 0ead0e8..c643177 100644 --- a/xbmc/windowing/X11/WinSystemX11.cpp +++ b/xbmc/windowing/X11/WinSystemX11.cpp @@ -519,6 +519,33 @@ void CWinSystemX11::ResetOSScreensaver() @@ -14778,22 +15091,22 @@ index 630c0e2..f78f613 100644 1.8.1.6 -From 919407a69bd44975ac3dac96cc285514a0b5f2f2 Mon Sep 17 00:00:00 2001 +From fa8ce24d5ace2450991ae47d7f496dd59269efda Mon Sep 17 00:00:00 2001 From: FernetMenta Date: Thu, 5 Jul 2012 12:10:09 +0200 -Subject: [PATCH 055/107] X11: change method of going full-screen +Subject: [PATCH 060/111] X11: change method of going full-screen --- xbmc/windowing/X11/WinSystemX11.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp -index 706f8e4..a1ffb8d 100644 +index c643177..e1e1096 100644 --- a/xbmc/windowing/X11/WinSystemX11.cpp +++ b/xbmc/windowing/X11/WinSystemX11.cpp @@ -36,6 +36,7 @@ #include "utils/TimeUtils.h" - #include "settings/GUISettings.h" + #include "settings/Settings.h" #include "windowing/WindowingFactory.h" +#include @@ -14825,10 +15138,10 @@ index 706f8e4..a1ffb8d 100644 1.8.1.6 -From beba6e3208cd5f03f3665e0c9f2c60fea1c78673 Mon Sep 17 00:00:00 2001 +From 2b41fff69eac912ec081c6129cecffe14c7bb41f Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 28 Jun 2012 19:12:39 +0200 -Subject: [PATCH 056/107] X11: reset key repeat and key modifier on focus lost +Subject: [PATCH 061/111] X11: reset key repeat and key modifier on focus lost and gain --- @@ -14860,10 +15173,10 @@ index c58067b..c9f8a20 100644 1.8.1.6 -From b57ce3c13b03522a174f5e2be671001c7997c171 Mon Sep 17 00:00:00 2001 +From 98302a10371af45f2492a388294332062c32757b Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Thu, 5 Jul 2012 14:18:46 +0200 -Subject: [PATCH 057/107] X11: replace custom utf8 to unicode with charset +Subject: [PATCH 062/111] X11: replace custom utf8 to unicode with charset convertor (squash to x11 events) --- @@ -15080,10 +15393,10 @@ index 6100933..72955ad 100644 1.8.1.6 -From b432830f52db8ed392b995761624e3eb361f8988 Mon Sep 17 00:00:00 2001 +From 7929fab20da4e51009d75feb1a1c093f2ac9516d Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Thu, 5 Jul 2012 14:23:54 +0200 -Subject: [PATCH 058/107] X11: fixed invalid usage of sizeof() (squash into x11 +Subject: [PATCH 063/111] X11: fixed invalid usage of sizeof() (squash into x11 changes) --- @@ -15147,10 +15460,10 @@ index 72955ad..102a076 100644 1.8.1.6 -From f6af834a5fffdcd4915f8a402399b4011c6ac321 Mon Sep 17 00:00:00 2001 +From f8f88e3685dd8f8cdbb5fce0535572020a9b9af5 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 9 Jun 2012 18:23:53 +0200 -Subject: [PATCH 059/107] add missing keys to xbmc keytable +Subject: [PATCH 064/111] add missing keys to xbmc keytable --- xbmc/input/XBMC_keytable.cpp | 2 ++ @@ -15173,10 +15486,10 @@ index f18e9b1..066cd77 100644 1.8.1.6 -From 6eabe6d1bd637e5a15eae4de18979553c42ef0be Mon Sep 17 00:00:00 2001 +From 9b1cd30223b31019326296299e6c1bd627d5face Mon Sep 17 00:00:00 2001 From: xbmc Date: Fri, 16 Mar 2012 15:57:51 +0100 -Subject: [PATCH 060/107] videorefclock: temp deactivate of nv settings +Subject: [PATCH 065/111] videorefclock: temp deactivate of nv settings --- xbmc/video/VideoReferenceClock.cpp | 2 +- @@ -15199,10 +15512,10 @@ index 9b217d4..de1729b 100644 1.8.1.6 -From c454bc996857121e8e16c955f61a7b6fbe0e4a29 Mon Sep 17 00:00:00 2001 +From eb902d2867c252c48b02a017ac94a2e6c9a46009 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 20 Aug 2012 09:09:09 +0200 -Subject: [PATCH 061/107] videorefclock: ask graphics context for refresh rate +Subject: [PATCH 066/111] videorefclock: ask graphics context for refresh rate --- xbmc/video/VideoReferenceClock.cpp | 3 ++- @@ -15233,10 +15546,10 @@ index de1729b..6f2ed8e 100644 1.8.1.6 -From c2f6ca94ab60489ca33fcaa1711cd7734fd5a570 Mon Sep 17 00:00:00 2001 +From b93cfd14443dc9533890316782a05e9aa99900e8 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 9 Jul 2012 14:00:18 +0200 -Subject: [PATCH 062/107] X11: fix icon texture after +Subject: [PATCH 067/111] X11: fix icon texture after cc5ed3c2474084ebc0373a3046410e6f766e03f4 --- @@ -15244,7 +15557,7 @@ Subject: [PATCH 062/107] X11: fix icon texture after 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp -index a1ffb8d..3acc5d4 100644 +index e1e1096..ace57ff 100644 --- a/xbmc/windowing/X11/WinSystemX11.cpp +++ b/xbmc/windowing/X11/WinSystemX11.cpp @@ -872,22 +872,24 @@ bool CWinSystemX11::SetWindow(int width, int height, bool fullscreen, const CStd @@ -15344,10 +15657,10 @@ index a1ffb8d..3acc5d4 100644 1.8.1.6 -From 8572cd9dbea0dcec7e3f30e8916272ac47c54316 Mon Sep 17 00:00:00 2001 +From 941d55294966d26aa093c08b4277e6f76321261e Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 10 Jul 2012 11:14:12 +0200 -Subject: [PATCH 063/107] X11: check for window manager +Subject: [PATCH 068/111] X11: check for window manager --- xbmc/windowing/X11/WinSystemX11.cpp | 74 ++++++++++++++++++++++++++++++++++++- @@ -15355,7 +15668,7 @@ Subject: [PATCH 063/107] X11: check for window manager 2 files changed, 73 insertions(+), 2 deletions(-) diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp -index 3acc5d4..fea6ada 100644 +index ace57ff..188864b 100644 --- a/xbmc/windowing/X11/WinSystemX11.cpp +++ b/xbmc/windowing/X11/WinSystemX11.cpp @@ -814,8 +814,10 @@ bool CWinSystemX11::SetWindow(int width, int height, bool fullscreen, const CStd @@ -15468,17 +15781,17 @@ index f78f613..f479c27 100644 1.8.1.6 -From 3efa28f76c5ef4f95562f19a977ba74b06460b23 Mon Sep 17 00:00:00 2001 +From 7a110d0b9ecb9c9c5a2c719d21017097907b4bf6 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 12 Jul 2012 11:11:47 +0200 -Subject: [PATCH 064/107] X11: dont set window on xrandr if no mode available +Subject: [PATCH 069/111] X11: dont set window on xrandr if no mode available --- xbmc/windowing/X11/WinSystemX11.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp -index fea6ada..f38fb73 100644 +index 188864b..076ed82 100644 --- a/xbmc/windowing/X11/WinSystemX11.cpp +++ b/xbmc/windowing/X11/WinSystemX11.cpp @@ -663,16 +663,17 @@ void CWinSystemX11::NotifyXRREvent() @@ -15503,22 +15816,22 @@ index fea6ada..f38fb73 100644 - } m_bIsInternalXrr = false; - CStdString currentOutput = g_guiSettings.GetString("videoscreen.monitor"); + CStdString currentOutput = CSettings::Get().GetString("videoscreen.monitor"); -- 1.8.1.6 -From cc450b25fe97fedd673f2c051e8d1ef6754d94b2 Mon Sep 17 00:00:00 2001 +From f96c45ec1035e978c9c66be7db90bcea59bffbd4 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 26 Jul 2012 09:34:28 +0200 -Subject: [PATCH 065/107] X11: fix crash after a resolution change on startup +Subject: [PATCH 070/111] X11: fix crash after a resolution change on startup --- xbmc/windowing/X11/WinSystemX11.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp -index f38fb73..ea47a72 100644 +index 076ed82..ee339d9 100644 --- a/xbmc/windowing/X11/WinSystemX11.cpp +++ b/xbmc/windowing/X11/WinSystemX11.cpp @@ -221,7 +221,8 @@ bool CWinSystemX11::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl @@ -15535,17 +15848,17 @@ index f38fb73..ea47a72 100644 1.8.1.6 -From 672637abb7425282eab54110a77f6f1cad2c6911 Mon Sep 17 00:00:00 2001 +From 42a6b5162e0716b1b52fa2c759a8a16f3c9e9611 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 15 Sep 2012 18:27:29 +0200 -Subject: [PATCH 066/107] X11: lock graphics context in NotifyXRREvent +Subject: [PATCH 071/111] X11: lock graphics context in NotifyXRREvent --- xbmc/windowing/X11/WinSystemX11.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp -index ea47a72..d0fd15a 100644 +index ee339d9..d2dcccd 100644 --- a/xbmc/windowing/X11/WinSystemX11.cpp +++ b/xbmc/windowing/X11/WinSystemX11.cpp @@ -664,6 +664,8 @@ void CWinSystemX11::NotifyXRREvent() @@ -15561,10 +15874,10 @@ index ea47a72..d0fd15a 100644 1.8.1.6 -From c000db14290c144041f5b1d10ea66029a26ece7d Mon Sep 17 00:00:00 2001 +From 42603ec139f0916e59b9a2f2b13a7c153346b10d Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sat, 8 Oct 2011 16:45:13 +0200 -Subject: [PATCH 067/107] ffmpeg: add xvba hwaccel +Subject: [PATCH 072/111] ffmpeg: add xvba hwaccel --- lib/ffmpeg/configure | 11 ++ @@ -16413,14 +16726,15 @@ index 1c00ac4..6437e29 100644 1.8.1.6 -From dee6da96a02c3f6aad027a210a24ab959634331d Mon Sep 17 00:00:00 2001 +From dcae6c5ee342b7143ff1f674892418727acc48fe Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 12 Apr 2012 12:09:31 +0200 -Subject: [PATCH 068/107] xvba: add decoder +Subject: [PATCH 073/111] xvba: add decoder --- configure.in | 48 + language/English/strings.po | 12 +- + system/settings/settings.xml | 5 + xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 216 +- xbmc/cores/VideoRenderers/LinuxRendererGL.h | 15 +- xbmc/cores/VideoRenderers/RenderFormats.h | 1 + @@ -16428,18 +16742,17 @@ Subject: [PATCH 068/107] xvba: add decoder .../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 | 2368 ++++++++++++++++++++ + xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp | 2367 ++++++++++++++++++++ xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.h | 382 ++++ xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 4 + - xbmc/settings/GUISettings.cpp | 3 + xbmc/settings/VideoSettings.h | 2 + xbmc/video/dialogs/GUIDialogVideoSettings.cpp | 1 + - 15 files changed, 3074 insertions(+), 6 deletions(-) + 15 files changed, 3075 insertions(+), 6 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 7fd9483..054c49d 100644 +index 30db97c..0a5d832 100644 --- a/configure.in +++ b/configure.in @@ -126,6 +126,8 @@ vaapi_not_found="== Could not find libva. VAAPI support disabled. ==" @@ -16464,7 +16777,7 @@ index 7fd9483..054c49d 100644 AC_ARG_ENABLE([vdadecoder], [AS_HELP_STRING([--enable-vdadecoder], -@@ -1786,6 +1794,38 @@ else +@@ -1807,6 +1815,38 @@ else USE_CRYSTALHD=0 fi @@ -16503,7 +16816,7 @@ index 7fd9483..054c49d 100644 # VDADecoder if test "x$use_vdadecoder" != "xno"; then if test "$host_vendor" = "apple" ; then -@@ -1995,6 +2035,12 @@ else +@@ -2016,6 +2056,12 @@ else final_message="$final_message\n CrystalHD:\tNo" fi @@ -16516,7 +16829,7 @@ index 7fd9483..054c49d 100644 if test "x$use_vdadecoder" != "xno"; then final_message="$final_message\n VDADecoder:\tYes" else -@@ -2458,6 +2504,7 @@ AC_SUBST(USE_OPENGLES) +@@ -2484,6 +2530,7 @@ AC_SUBST(USE_OPENGLES) AC_SUBST(USE_VDPAU) AC_SUBST(USE_VAAPI) AC_SUBST(USE_CRYSTALHD) @@ -16524,7 +16837,7 @@ index 7fd9483..054c49d 100644 AC_SUBST(USE_LIBSMBCLIENT) AC_SUBST(USE_LIBNFS) AC_SUBST(USE_LIBAFPCLIENT) -@@ -2640,6 +2687,7 @@ XB_CONFIG_MODULE([lib/ffmpeg], [ +@@ -2666,6 +2713,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` \ @@ -16533,10 +16846,10 @@ index 7fd9483..054c49d 100644 --enable-pthreads \ --enable-runtime-cpudetect \ diff --git a/language/English/strings.po b/language/English/strings.po -index 60b8e3c..e48ad66 100644 +index eec0add..c832e99 100644 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -5673,7 +5673,11 @@ msgctxt "#13436" +@@ -5719,7 +5719,11 @@ msgctxt "#13436" msgid "Prefer VDPAU Video Mixer" msgstr "" @@ -16547,9 +16860,9 @@ index 60b8e3c..e48ad66 100644 + +#empty strings from id 13438 to 13499 - #: xbmc/settings/GUISettings.cpp + #: xbmc/settings/settings.xml msgctxt "#13500" -@@ -6750,7 +6754,11 @@ msgctxt "#16325" +@@ -6796,7 +6800,11 @@ msgctxt "#16325" msgid "VDPAU - Bob" msgstr "" @@ -16562,11 +16875,27 @@ index 60b8e3c..e48ad66 100644 msgctxt "#16400" msgid "Post-processing" +diff --git a/system/settings/settings.xml b/system/settings/settings.xml +index c34c693..da610a3 100644 +--- a/system/settings/settings.xml ++++ b/system/settings/settings.xml +@@ -425,6 +425,11 @@ + 2 + true + ++ ++ HAVE_LIBXVBA ++ 2 ++ true ++ + + HAS_GL + 4 diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -index aec758b..4c410f1 100644 +index c3aef83..6714b26 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp -@@ -66,6 +66,9 @@ +@@ -65,6 +65,9 @@ VA_MICRO_VERSION == 0 && VA_SDS_VERSION < 5))) #endif @@ -16576,7 +16905,7 @@ index aec758b..4c410f1 100644 #ifdef TARGET_DARWIN #include "osx/CocoaInterface.h" -@@ -132,6 +135,9 @@ +@@ -131,6 +134,9 @@ #ifdef HAVE_LIBVDPAU vdpau = NULL; #endif @@ -16586,7 +16915,7 @@ index aec758b..4c410f1 100644 } CLinuxRendererGL::YUVBUFFER::~YUVBUFFER() -@@ -620,6 +626,9 @@ void CLinuxRendererGL::ReleaseBuffer(int idx) +@@ -619,6 +625,9 @@ void CLinuxRendererGL::ReleaseBuffer(int idx) #ifdef HAVE_LIBVDPAU SAFE_RELEASE(buf.vdpau); #endif @@ -16596,7 +16925,7 @@ index aec758b..4c410f1 100644 #ifdef HAVE_LIBVA buf.vaapi.surface.reset(); #endif -@@ -896,7 +905,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; @@ -16605,7 +16934,7 @@ index aec758b..4c410f1 100644 { m_pVideoFilterShader = new StretchFilterShader(); if (!m_pVideoFilterShader->CompileAndLink()) -@@ -982,6 +991,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; } @@ -16616,8 +16945,8 @@ index aec758b..4c410f1 100644 + } else { - int requestedMethod = g_guiSettings.GetInt("videoplayer.rendermethod"); -@@ -1130,6 +1144,12 @@ void CLinuxRendererGL::LoadShaders(int field) + int requestedMethod = CSettings::Get().GetInt("videoplayer.rendermethod"); +@@ -1129,6 +1143,12 @@ void CLinuxRendererGL::LoadShaders(int field) m_textureCreate = &CLinuxRendererGL::CreateCVRefTexture; m_textureDelete = &CLinuxRendererGL::DeleteCVRefTexture; } @@ -16630,7 +16959,7 @@ index aec758b..4c410f1 100644 else { // setup default YV12 texture handlers -@@ -1242,6 +1262,13 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) +@@ -1241,6 +1261,13 @@ void CLinuxRendererGL::Render(DWORD flags, int renderBuffer) RenderVAAPI(renderBuffer, m_currentField); } #endif @@ -16644,7 +16973,7 @@ index aec758b..4c410f1 100644 else { // RENDER_CVREF uses the same render as the default case -@@ -1749,6 +1776,77 @@ void CLinuxRendererGL::RenderVAAPI(int index, int field) +@@ -1748,6 +1775,77 @@ void CLinuxRendererGL::RenderVAAPI(int index, int field) #endif } @@ -16722,7 +17051,7 @@ index aec758b..4c410f1 100644 void CLinuxRendererGL::RenderSoftware(int index, int field) { // used for textues uploaded from rgba or CVPixelBuffers. -@@ -2800,6 +2898,91 @@ bool CLinuxRendererGL::CreateCVRefTexture(int index) +@@ -2799,6 +2897,91 @@ bool CLinuxRendererGL::CreateCVRefTexture(int index) return true; } @@ -16814,7 +17143,7 @@ index aec758b..4c410f1 100644 void CLinuxRendererGL::UploadYUV422PackedTexture(int source) { YUVBUFFER& buf = m_buffers[source]; -@@ -3385,6 +3568,9 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) +@@ -3384,6 +3567,9 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) if (m_renderMethod & RENDER_VAAPI) return false; @@ -16824,7 +17153,7 @@ index aec758b..4c410f1 100644 return (m_renderMethod & RENDER_GLSL) || (m_renderMethod & RENDER_ARB) || ((m_renderMethod & RENDER_SW) && glewIsSupported("GL_ARB_imaging") == GL_TRUE); -@@ -3398,6 +3584,9 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) +@@ -3397,6 +3583,9 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) if (m_renderMethod & RENDER_VAAPI) return false; @@ -16834,7 +17163,7 @@ index aec758b..4c410f1 100644 return (m_renderMethod & RENDER_GLSL) || (m_renderMethod & RENDER_ARB) || ((m_renderMethod & RENDER_SW) && glewIsSupported("GL_ARB_imaging") == GL_TRUE); -@@ -3421,7 +3610,8 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) +@@ -3420,7 +3609,8 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature) if (feature == RENDERFEATURE_NONLINSTRETCH) { if (((m_renderMethod & RENDER_GLSL) && !(m_renderMethod & RENDER_POT)) || @@ -16844,7 +17173,7 @@ index aec758b..4c410f1 100644 return true; } -@@ -3493,6 +3683,16 @@ bool CLinuxRendererGL::Supports(EINTERLACEMETHOD method) +@@ -3492,6 +3682,16 @@ bool CLinuxRendererGL::Supports(EINTERLACEMETHOD method) return false; } @@ -16861,7 +17190,7 @@ index aec758b..4c410f1 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. -@@ -3542,7 +3742,7 @@ bool CLinuxRendererGL::Supports(ESCALINGMETHOD method) +@@ -3541,7 +3741,7 @@ bool CLinuxRendererGL::Supports(ESCALINGMETHOD method) return false; if ((glewIsSupported("GL_EXT_framebuffer_object") && (m_renderMethod & RENDER_GLSL)) || @@ -16870,7 +17199,7 @@ index aec758b..4c410f1 100644 { // spline36 and lanczos3 are only allowed through advancedsettings.xml if(method != VS_SCALINGMETHOD_SPLINE36 -@@ -3634,4 +3834,14 @@ void CLinuxRendererGL::AddProcessor(struct __CVBuffer *cvBufferRef, int index) +@@ -3633,4 +3833,14 @@ void CLinuxRendererGL::AddProcessor(struct __CVBuffer *cvBufferRef, int index) } #endif @@ -16959,10 +17288,10 @@ index 6ed62be..70ae9bf 100644 #endif diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 2bfd270..9e5a9d5 100644 +index c8b99d6..1a19c07 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -876,6 +876,10 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) +@@ -875,6 +875,10 @@ int CXBMCRenderManager::AddVideoPicture(DVDVideoPicture& pic) else if(pic.format == RENDER_FMT_VAAPI) m_pRenderer->AddProcessor(*pic.vaapi, index); #endif @@ -16996,7 +17325,7 @@ index 2bf79fe..4d7dbb1 100644 struct { COpenMax *openMax; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index 37084b6..37161ee 100644 +index b17261b..fc24228 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -57,6 +57,9 @@ @@ -17009,12 +17338,12 @@ index 37084b6..37161ee 100644 using namespace boost; -@@ -101,6 +104,19 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx +@@ -98,6 +101,19 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx dec->Release(); } #endif +#ifdef HAVE_LIBXVBA -+ if(*cur == AV_PIX_FMT_XVBA_VLD && g_guiSettings.GetBool("videoplayer.usexvba")) ++ if(*cur == AV_PIX_FMT_XVBA_VLD && CSettings::Get().GetBool("videoplayer.usexvba")) + { + XVBA::CDecoder* dec = new XVBA::CDecoder(); + if(dec->Open(avctx, *cur, ctx->m_uSurfacesCount)) @@ -17028,7 +17357,7 @@ index 37084b6..37161ee 100644 +#endif #ifdef HAVE_LIBVA // mpeg4 vaapi decoding is disabled - if(*cur == PIX_FMT_VAAPI_VLD && g_guiSettings.GetBool("videoplayer.usevaapi") + if(*cur == PIX_FMT_VAAPI_VLD && CSettings::Get().GetBool("videoplayer.usevaapi") diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in b/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in index 176ceff..c58422b 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in @@ -17046,10 +17375,10 @@ index 176ceff..c58422b 100644 endif diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp new file mode 100644 -index 0000000..41e6a5b +index 0000000..43a331f --- /dev/null +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp -@@ -0,0 +1,2368 @@ +@@ -0,0 +1,2367 @@ +/* + * Copyright (C) 2005-2011 Team XBMC + * http://www.xbmc.org @@ -17080,7 +17409,6 @@ index 0000000..41e6a5b +#include "XVBA.h" +#include "windowing/WindowingFactory.h" +#include "guilib/GraphicContext.h" -+#include "settings/GUISettings.h" +#include "settings/Settings.h" +#include "settings/MediaSettings.h" +#include "utils/TimeUtils.h" @@ -19807,7 +20135,7 @@ index 0000000..f38444c + +} diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 4cbf6ad..5bad9cf 100644 +index bd26b2f..a5c55c3 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -1189,6 +1189,10 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) @@ -19821,20 +20149,6 @@ index 4cbf6ad..5bad9cf 100644 } if(m_bAllowFullscreen) -diff --git a/xbmc/settings/GUISettings.cpp b/xbmc/settings/GUISettings.cpp -index 44f5bff..a11a906 100644 ---- a/xbmc/settings/GUISettings.cpp -+++ b/xbmc/settings/GUISettings.cpp -@@ -731,6 +731,9 @@ void CGUISettings::Initialize() - #ifdef HAVE_LIBVA - AddBool(vp, "videoplayer.usevaapi", 13426, true); - #endif -+#ifdef HAVE_LIBXVBA -+ AddBool(vp, "videoplayer.usexvba", 13437, true); -+#endif - #ifdef HAS_DX - AddBool(g_sysinfo.IsVistaOrHigher() ? vp: NULL, "videoplayer.usedxva2", 13427, g_sysinfo.IsVistaOrHigher() ? true : false); - #endif diff --git a/xbmc/settings/VideoSettings.h b/xbmc/settings/VideoSettings.h index 3ca4c8b..ae6221c 100644 --- a/xbmc/settings/VideoSettings.h @@ -19849,10 +20163,10 @@ index 3ca4c8b..ae6221c 100644 }; diff --git a/xbmc/video/dialogs/GUIDialogVideoSettings.cpp b/xbmc/video/dialogs/GUIDialogVideoSettings.cpp -index 6fe786e..2958744 100644 +index 40d8c61..9cb1c5c 100644 --- a/xbmc/video/dialogs/GUIDialogVideoSettings.cpp +++ b/xbmc/video/dialogs/GUIDialogVideoSettings.cpp -@@ -112,6 +112,7 @@ void CGUIDialogVideoSettings::CreateSettings() +@@ -111,6 +111,7 @@ void CGUIDialogVideoSettings::CreateSettings() entries.push_back(make_pair(VS_INTERLACEMETHOD_DXVA_BOB , 16320)); entries.push_back(make_pair(VS_INTERLACEMETHOD_DXVA_BEST , 16321)); entries.push_back(make_pair(VS_INTERLACEMETHOD_AUTO_ION , 16325)); @@ -19864,10 +20178,10 @@ index 6fe786e..2958744 100644 1.8.1.6 -From 42c4812a6b8a8ccb0a15f16f897a60e397fce217 Mon Sep 17 00:00:00 2001 +From 48e468848fd1ccbd3d478acae50181759c0d7d74 Mon Sep 17 00:00:00 2001 From: fritsch Date: Sun, 4 Nov 2012 16:24:10 +0100 -Subject: [PATCH 069/107] xvba: add string for available decoders - we are +Subject: [PATCH 074/111] xvba: add string for available decoders - we are important so make sure we are there --- @@ -19875,7 +20189,7 @@ Subject: [PATCH 069/107] xvba: add string for available decoders - we are 1 file changed, 5 insertions(+) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp -index 4ea6617..ec3e392 100644 +index 03429b5..688dc10 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp @@ -171,6 +171,11 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, unsigne @@ -19894,10 +20208,10 @@ index 4ea6617..ec3e392 100644 1.8.1.6 -From 9b9c42eff0ef16667399a8cfeab0cff3159f42ac Mon Sep 17 00:00:00 2001 +From ebae395e24d71592c050d5aa03d8c2377a49834c Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 16 Jun 2012 12:46:30 +0200 -Subject: [PATCH 070/107] xvba: do not use vaapi if xvba is present +Subject: [PATCH 075/111] xvba: do not use vaapi if xvba is present --- xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp | 9 +++++++++ @@ -19927,20 +20241,20 @@ index 0cd89e8..db251bc 100644 1.8.1.6 -From 33965123c3e71ee49259e39fedc8ffef62a26f0f Mon Sep 17 00:00:00 2001 +From 9b9a70b23c2c3aaf41754a974d057a7e7a78a0de Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 23 Aug 2012 19:39:49 +0200 -Subject: [PATCH 071/107] ffmpeg: add av_find_default_stream_index to interface +Subject: [PATCH 076/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 7fc831e..3e96bee 100644 +index b0dcb54..a556562 100644 --- a/lib/DllAvFormat.h +++ b/lib/DllAvFormat.h -@@ -100,6 +100,7 @@ class DllAvFormatInterface +@@ -101,6 +101,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; @@ -19948,7 +20262,7 @@ index 7fc831e..3e96bee 100644 }; #if (defined USE_EXTERNAL_FFMPEG) || (defined TARGET_DARWIN) -@@ -154,6 +155,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface +@@ -155,6 +156,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); } @@ -19956,7 +20270,7 @@ index 7fc831e..3e96bee 100644 // DLL faking. virtual bool ResolveExports() { return true; } -@@ -209,6 +211,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface +@@ -210,6 +212,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)) @@ -19964,7 +20278,7 @@ index 7fc831e..3e96bee 100644 BEGIN_METHOD_RESOLVE() RESOLVE_METHOD_RENAME(av_register_all, av_register_all_dont_call) RESOLVE_METHOD(av_find_input_format) -@@ -242,6 +245,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface +@@ -243,6 +246,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface RESOLVE_METHOD(avformat_write_header) RESOLVE_METHOD(av_write_trailer) RESOLVE_METHOD(av_write_frame) @@ -19976,18 +20290,18 @@ index 7fc831e..3e96bee 100644 1.8.1.6 -From 7036f32e8dfb44f0db0aa4a3f39a1346411bf5a4 Mon Sep 17 00:00:00 2001 +From 2ece44cf2827895ed483fd4858dd298282ec542e Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 20 Aug 2012 16:06:39 +0200 -Subject: [PATCH 072/107] dvdplayer: observe pts counter overflow +Subject: [PATCH 077/111] dvdplayer: observe pts counter overflow --- .../cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 198 ++++++++++++++++++++- - xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h | 3 + - 2 files changed, 200 insertions(+), 1 deletion(-) + xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h | 4 + + 2 files changed, 201 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index 0f2deaf..a3b0def 100644 +index 8a6fa22..56aa64c 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp @@ -18,13 +18,13 @@ @@ -20005,9 +20319,9 @@ index 0f2deaf..a3b0def 100644 #ifdef _LINUX #include "stdint.h" #endif -@@ -502,6 +502,9 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) - AddStream(i); - } +@@ -480,6 +480,9 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) + + CreateStreams(); + m_bPtsWrapChecked = false; + m_bPtsWrap = false; @@ -20015,7 +20329,7 @@ index 0f2deaf..a3b0def 100644 return true; } -@@ -606,6 +609,12 @@ double CDVDDemuxFFmpeg::ConvertTimestamp(int64_t pts, int den, int num) +@@ -582,6 +585,12 @@ double CDVDDemuxFFmpeg::ConvertTimestamp(int64_t pts, int den, int num) if (pts == (int64_t)AV_NOPTS_VALUE) return DVD_NOPTS_VALUE; @@ -20028,8 +20342,8 @@ index 0f2deaf..a3b0def 100644 // do calculations in floats as they can easily overflow otherwise // we don't care for having a completly exact timestamp anyway double timestamp = (double)pts * num / den; -@@ -728,6 +737,24 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() - pkt.pts = AV_NOPTS_VALUE; +@@ -717,6 +726,24 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() + m_pkt.pkt.pts = AV_NOPTS_VALUE; } + if (!m_bPtsWrapChecked && m_pFormatContext->iformat->flags & AVFMT_TS_DISCONT) @@ -20051,9 +20365,9 @@ index 0f2deaf..a3b0def 100644 + } + // copy contents into our own packet - pPacket->iSize = pkt.size; + pPacket->iSize = m_pkt.pkt.size; -@@ -842,10 +869,20 @@ bool CDVDDemuxFFmpeg::SeekTime(int time, bool backwords, double *startpts) +@@ -836,10 +863,20 @@ bool CDVDDemuxFFmpeg::SeekTime(int time, bool backwords, double *startpts) int ret; { CSingleLock lock(m_critSection); @@ -20074,7 +20388,7 @@ index 0f2deaf..a3b0def 100644 } if(m_iCurrentPts == DVD_NOPTS_VALUE) -@@ -864,6 +901,165 @@ bool CDVDDemuxFFmpeg::SeekTime(int time, bool backwords, double *startpts) +@@ -858,6 +895,165 @@ bool CDVDDemuxFFmpeg::SeekTime(int time, bool backwords, double *startpts) return (ret >= 0); } @@ -20241,10 +20555,10 @@ index 0f2deaf..a3b0def 100644 { CSingleLock lock(m_critSection); diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h -index eb2f68c..8a7a5de 100644 +index fe6b1f4..841b822 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h -@@ -97,6 +97,7 @@ class CDVDDemuxFFmpeg : public CDVDDemux +@@ -99,6 +99,7 @@ class CDVDDemuxFFmpeg : public CDVDDemux DemuxPacket* Read(); bool SeekTime(int time, bool backwords = false, double* startpts = NULL); @@ -20252,10 +20566,11 @@ index eb2f68c..8a7a5de 100644 bool SeekByte(int64_t pos); int GetStreamLength(); CDemuxStream* GetStream(int iStreamId); -@@ -141,5 +142,7 @@ class CDVDDemuxFFmpeg : public CDVDDemux - unsigned m_program; - XbmcThreads::EndTime m_timeout; - +@@ -156,5 +157,8 @@ class CDVDDemuxFFmpeg : public CDVDDemux + AVPacket pkt; // packet ffmpeg returned + int result; // result from av_read_packet + }m_pkt; ++ + bool m_bPtsWrap, m_bPtsWrapChecked; + int64_t m_iStartTime, m_iMaxTime, m_iEndTime; }; @@ -20264,10 +20579,10 @@ index eb2f68c..8a7a5de 100644 1.8.1.6 -From 3a418ee1b2d0b9330c08a113f59ba6a848cfbbfc Mon Sep 17 00:00:00 2001 +From 923f7f2fb9e9c05090d5968162e64432f1a04b6d Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 2 Oct 2012 13:02:10 +0200 -Subject: [PATCH 073/107] dvdplayer: avoid short screen flicker caused by +Subject: [PATCH 078/111] dvdplayer: avoid short screen flicker caused by unnecessary reconfigure of renderer --- @@ -20275,7 +20590,7 @@ Subject: [PATCH 073/107] 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 5bad9cf..b9ed56d 100644 +index a5c55c3..8a6a984 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -1045,7 +1045,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) @@ -20300,10 +20615,10 @@ index 5bad9cf..b9ed56d 100644 1.8.1.6 -From 2db313624eec4d15458c2bf0423da0b875aa1745 Mon Sep 17 00:00:00 2001 +From 1a50574d9d4599427d0c752f4af50252daf7b897 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 11 Oct 2012 12:05:50 +0200 -Subject: [PATCH 074/107] vdpau: advanced settings for auto deinterlacing +Subject: [PATCH 079/111] vdpau: advanced settings for auto deinterlacing --- xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 8 ++++---- @@ -20312,10 +20627,10 @@ Subject: [PATCH 074/107] 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 82a46aa..d96d8c2 100644 +index f285e4b..28f61ec 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -1782,10 +1782,10 @@ EINTERLACEMETHOD CMixer::GetDeinterlacingMethod(bool log /* = false */) +@@ -1799,10 +1799,10 @@ EINTERLACEMETHOD CMixer::GetDeinterlacingMethod(bool log /* = false */) if (method == VS_INTERLACEMETHOD_AUTO) { int deint = -1; @@ -20331,10 +20646,10 @@ index 82a46aa..d96d8c2 100644 if (deint != -1) { diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index 256e6bd..9d12c77 100644 +index 8d188ec..99ee625 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp -@@ -130,6 +130,8 @@ void CAdvancedSettings::Initialize() +@@ -161,6 +161,8 @@ void CAdvancedSettings::Initialize() m_videoAllowMpeg4VAAPI = false; m_videoDisableBackgroundDeinterlace = false; m_videoCaptureUseOcclusionQuery = -1; //-1 is auto detect @@ -20343,7 +20658,7 @@ index 256e6bd..9d12c77 100644 m_videoVDPAUtelecine = false; m_videoVDPAUdeintSkipChromaHD = false; m_DXVACheckCompatibility = false; -@@ -543,6 +545,8 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) +@@ -578,6 +580,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); @@ -20353,10 +20668,10 @@ index 256e6bd..9d12c77 100644 XMLUtils::GetBoolean(pElement,"vdpauHDdeintSkipChroma",m_videoVDPAUdeintSkipChromaHD); diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h -index 8572436..7ac18ed 100644 +index be92bea..2aee99b 100644 --- a/xbmc/settings/AdvancedSettings.h +++ b/xbmc/settings/AdvancedSettings.h -@@ -137,6 +137,8 @@ class CAdvancedSettings : public ISettingsHandler +@@ -146,6 +146,8 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler int m_videoPercentSeekBackwardBig; CStdString m_videoPPFFmpegDeint; CStdString m_videoPPFFmpegPostProc; @@ -20369,10 +20684,10 @@ index 8572436..7ac18ed 100644 1.8.1.6 -From 9117af579f9d4b370385684120ad7ff20f82beaa Mon Sep 17 00:00:00 2001 +From 018875a8345579b42751ca0b8c7263111e9da6ca Mon Sep 17 00:00:00 2001 From: xbmc Date: Fri, 2 Nov 2012 13:20:03 +0100 -Subject: [PATCH 075/107] player: fix rewind +Subject: [PATCH 080/111] player: fix rewind --- xbmc/cores/dvdplayer/DVDMessage.h | 5 ++++- @@ -20420,7 +20735,7 @@ index 0dac948..6de5207 100644 class CDVDMsgPlayerSeekChapter : public CDVDMsg diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 00d4237..2531642 100644 +index 93ec1c3..8b8b482 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp @@ -1562,11 +1562,13 @@ void CDVDPlayer::HandlePlaySpeed() @@ -20550,7 +20865,7 @@ index fa6c99f..6ca43d4 100644 int m_errorCount; diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index b9ed56d..ac39406 100644 +index 8a6a984..69cd5ba 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -1296,13 +1296,13 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) @@ -20604,10 +20919,10 @@ index f395897..c9bf2f4 100644 1.8.1.6 -From 803f52f573007dc626d67aad5606a4e9fbc55d14 Mon Sep 17 00:00:00 2001 +From 13407b92a0be5ac75ae716f8de25cafcff1e6f64 Mon Sep 17 00:00:00 2001 From: xbmc Date: Fri, 23 Nov 2012 17:41:12 +0100 -Subject: [PATCH 076/107] xrandr: fix query for multiple screens +Subject: [PATCH 081/111] xrandr: fix query for multiple screens --- xbmc/windowing/X11/XRandR.cpp | 10 ++++++---- @@ -20648,10 +20963,10 @@ index 75c84ea..2343ec0 100644 1.8.1.6 -From d20814c3afddc2ba9acb77c0c0f24036ed9ff616 Mon Sep 17 00:00:00 2001 +From 5c66629bedaf4a6100e5c6dd427d3154855dd0f5 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 2 Dec 2012 15:46:55 +0100 -Subject: [PATCH 077/107] X11: add debug log to print out refresh after xrr +Subject: [PATCH 082/111] X11: add debug log to print out refresh after xrr event --- @@ -20659,7 +20974,7 @@ Subject: [PATCH 077/107] X11: add debug log to print out refresh after xrr 1 file changed, 6 insertions(+) diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp -index d0fd15a..0c70c1f 100644 +index d2dcccd..7403785 100644 --- a/xbmc/windowing/X11/WinSystemX11.cpp +++ b/xbmc/windowing/X11/WinSystemX11.cpp @@ -683,6 +683,12 @@ void CWinSystemX11::NotifyXRREvent() @@ -20679,10 +20994,10 @@ index d0fd15a..0c70c1f 100644 1.8.1.6 -From f497e6e82b05485ac7e0dd310717fd4aaafdd2d6 Mon Sep 17 00:00:00 2001 +From d078656c31c295c35b393076c92be9028f500297 Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 11 Dec 2012 11:08:13 +0100 -Subject: [PATCH 078/107] X11: dont call XCloseDisplay on shutdown, it crashes +Subject: [PATCH 083/111] X11: dont call XCloseDisplay on shutdown, it crashes when powered doen by cec on ATI --- @@ -20690,7 +21005,7 @@ Subject: [PATCH 078/107] X11: dont call XCloseDisplay on shutdown, it crashes 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp -index 0c70c1f..0a1bafa 100644 +index 7403785..0e39867 100644 --- a/xbmc/windowing/X11/WinSystemX11.cpp +++ b/xbmc/windowing/X11/WinSystemX11.cpp @@ -110,7 +110,8 @@ bool CWinSystemX11::DestroyWindowSystem() @@ -20707,10 +21022,10 @@ index 0c70c1f..0a1bafa 100644 1.8.1.6 -From 915cd3636419b80c242c2d3f236ccff52e2abcd4 Mon Sep 17 00:00:00 2001 +From 94ae5cb301f63e27cc4ac72ae67ebfde497bf1fa 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 079/107] x11: support for multiple x screens +Subject: [PATCH 084/111] x11: support for multiple x screens --- xbmc/windowing/X11/XRandR.cpp | 2 +- @@ -20733,36 +21048,10 @@ index 2343ec0..9fcaec5 100644 1.8.1.6 -From 635e6ccc62f5e9a0f854b15569c88251e7e59150 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Thu, 20 Dec 2012 19:35:38 +0100 -Subject: [PATCH 080/107] fix compile error after recent change - ---- - xbmc/settings/windows/GUIWindowSettingsCategory.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/xbmc/settings/windows/GUIWindowSettingsCategory.cpp b/xbmc/settings/windows/GUIWindowSettingsCategory.cpp -index 20719ba..78dccb6 100644 ---- a/xbmc/settings/windows/GUIWindowSettingsCategory.cpp -+++ b/xbmc/settings/windows/GUIWindowSettingsCategory.cpp -@@ -2402,7 +2402,7 @@ void CGUIWindowSettingsCategory::FillInMonitors(CStdString strSetting) - { - // we expect "videoscreen.monitor" but it might be hidden on some platforms, - // so check that we actually have a visable control. -- CBaseSettingControl *control = GetSetting(strSetting); -+ BaseSettingControlPtr control = GetSetting(strSetting); - if (control) - { - control->SetDelayed(); --- -1.8.1.6 - - -From 373b3c8318372960af240bdf68701ac61af85dbd Mon Sep 17 00:00:00 2001 +From c1df02da715f9a80be7fcbaa2c4e9512c9633c2b Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 24 Dec 2012 16:02:42 +0100 -Subject: [PATCH 081/107] pvr: increase changes counter of stream on stream +Subject: [PATCH 085/111] pvr: increase changes counter of stream on stream change, cosmetics after dd307930d39d92f145a01a16600cd00e01ec39be --- @@ -20770,10 +21059,10 @@ Subject: [PATCH 081/107] 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 58bea8d..e4d2a18 100644 +index 2c10a7b..6ea1f23 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.cpp +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.cpp -@@ -349,9 +349,7 @@ void CDVDDemuxPVRClient::RequestStreams() +@@ -339,9 +339,7 @@ void CDVDDemuxPVRClient::RequestStreams() if (stm) { st = dynamic_cast(stm); @@ -20784,7 +21073,7 @@ index 58bea8d..e4d2a18 100644 DisposeStream(i); } if (!m_streams[i]) -@@ -368,6 +366,7 @@ void CDVDDemuxPVRClient::RequestStreams() +@@ -358,6 +356,7 @@ void CDVDDemuxPVRClient::RequestStreams() st->iBitsPerSample = props.stream[i].iBitsPerSample; m_streams[i] = st; st->m_parser_split = true; @@ -20796,10 +21085,10 @@ index 58bea8d..e4d2a18 100644 1.8.1.6 -From d1f7cd74378a7be912f8213e206e959a7cf8d556 Mon Sep 17 00:00:00 2001 +From 99846d0006cc3dd7165ecb0d6c834ec56d75375f Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 17 Jan 2013 16:03:22 +0100 -Subject: [PATCH 082/107] X11: add keymapping for XF86XK_Sleep +Subject: [PATCH 086/111] X11: add keymapping for XF86XK_Sleep --- xbmc/windowing/WinEventsX11.cpp | 1 + @@ -20821,17 +21110,17 @@ index 4a5aab4..da5d412 100644 1.8.1.6 -From 0755b57fe410c9671a81fa2aab805b9bd2feac5b Mon Sep 17 00:00:00 2001 +From cb5565797ef071b9a333eede558b272fac6c2c7b Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 21 Jan 2013 09:00:19 +0100 -Subject: [PATCH 083/107] X11: remove toggle full screen after resume +Subject: [PATCH 087/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 0756b1e..0d0ba71 100644 +index f671959..6d4e3e0 100644 --- a/xbmc/powermanagement/PowerManager.cpp +++ b/xbmc/powermanagement/PowerManager.cpp @@ -254,11 +254,6 @@ void CPowerManager::OnWake() @@ -20850,10 +21139,10 @@ index 0756b1e..0d0ba71 100644 1.8.1.6 -From 5cc69c4e6d60fa6662ec47ec0ed1dc04ebef14ae Mon Sep 17 00:00:00 2001 +From 2cba66d94191725934fa067a9f53a1f006501fdb Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 23 Jan 2013 17:03:02 +0100 -Subject: [PATCH 084/107] xrandr: set screen on mode change command +Subject: [PATCH 088/111] xrandr: set screen on mode change command --- xbmc/windowing/X11/XRandR.cpp | 2 +- @@ -20876,10 +21165,10 @@ index 9fcaec5..b91178e 100644 1.8.1.6 -From e64e22efe01a6c2b9f90c6e8db714eafbbba149a Mon Sep 17 00:00:00 2001 +From d9498a510e4d8526065bf0c0c4420af402c908fe Mon Sep 17 00:00:00 2001 From: xbmc Date: Wed, 23 Jan 2013 17:03:39 +0100 -Subject: [PATCH 085/107] X11: recreate glx context when output changes +Subject: [PATCH 089/111] X11: recreate glx context when output changes --- xbmc/windowing/X11/WinSystemX11.cpp | 6 +++--- @@ -20887,7 +21176,7 @@ Subject: [PATCH 085/107] X11: recreate glx context when output changes 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp -index 0a1bafa..cbff7e1 100644 +index 0e39867..d865cd7 100644 --- a/xbmc/windowing/X11/WinSystemX11.cpp +++ b/xbmc/windowing/X11/WinSystemX11.cpp @@ -407,11 +407,11 @@ bool CWinSystemX11::IsSuitableVisual(XVisualInfo *vInfo) @@ -20930,86 +21219,55 @@ index f479c27..7345c06 100644 1.8.1.6 -From b347b4d4bdcdfa7594e493d3ac8e09045bab1e43 Mon Sep 17 00:00:00 2001 +From 786b18f110be2af85922ec33532c4aba4df201d8 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 18 Jan 2013 15:16:38 +0100 -Subject: [PATCH 086/107] multi-screen: fix compilation on windows +Subject: [PATCH 090/111] multi-screen: fix compilation on windows --- - xbmc/settings/windows/GUIWindowSettingsCategory.cpp | 11 ++++++++++- - 1 file changed, 10 insertions(+), 1 deletion(-) + xbmc/settings/DisplaySettings.cpp | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) -diff --git a/xbmc/settings/windows/GUIWindowSettingsCategory.cpp b/xbmc/settings/windows/GUIWindowSettingsCategory.cpp -index 78dccb6..cafc732 100644 ---- a/xbmc/settings/windows/GUIWindowSettingsCategory.cpp -+++ b/xbmc/settings/windows/GUIWindowSettingsCategory.cpp -@@ -529,12 +529,14 @@ void CGUIWindowSettingsCategory::CreateSettings() - FillInRefreshRates(strSetting, CDisplaySettings::Get().GetDisplayResolution(), false); - continue; - } -+#if defined(HAS_GLX) - else if (strSetting.Equals("videoscreen.monitor")) - { - AddSetting(pSetting, group->GetWidth(), iControlID); - FillInMonitors(strSetting); - continue; - } -+#endif - else if (strSetting.Equals("lookandfeel.skintheme")) - { - AddSetting(pSetting, group->GetWidth(), iControlID); -@@ -1431,6 +1433,7 @@ void CGUIWindowSettingsCategory::OnSettingChanged(BaseSettingControlPtr pSetting - // Cascade - FillInResolutions("videoscreen.resolution", mode, RES_DESKTOP, true); - } -+#if defined(HAS_GLX) - else if (strSetting.Equals("videoscreen.monitor")) - { - CSettingString *pSettingString = (CSettingString *)pSettingControl->GetSetting(); -@@ -1445,6 +1448,7 @@ void CGUIWindowSettingsCategory::OnSettingChanged(BaseSettingControlPtr pSetting - FillInResolutions("videoscreen.resolution", mode, RES_DESKTOP, true); - } - } -+#endif - else if (strSetting.Equals("videoscreen.resolution")) - { - RESOLUTION nextRes = (RESOLUTION) g_guiSettings.GetInt("videoscreen.resolution"); -@@ -2400,6 +2404,7 @@ DisplayMode CGUIWindowSettingsCategory::FillInScreens(CStdString strSetting, RES +diff --git a/xbmc/settings/DisplaySettings.cpp b/xbmc/settings/DisplaySettings.cpp +index 856fe3a..b171d2c 100644 +--- a/xbmc/settings/DisplaySettings.cpp ++++ b/xbmc/settings/DisplaySettings.cpp +@@ -225,7 +225,10 @@ bool CDisplaySettings::OnSettingChanging(const CSetting *setting) + if (save) + m_ignoreSettingChanging.insert(make_pair("videoscreen.screenmode", true)); - void CGUIWindowSettingsCategory::FillInMonitors(CStdString strSetting) +- bool outputChanged = !g_Windowing.IsCurrentOutput(CSettings::Get().GetString("videoscreen.monitor")); ++ bool outputChanged = false; ++#if defined(HAS_GLX) ++ outputChanged = !g_Windowing.IsCurrentOutput(CSettings::Get().GetString("videoscreen.monitor")); ++#endif + SetCurrentResolution(newRes, save); + g_graphicsContext.SetVideoResolution(newRes, outputChanged); + +@@ -597,6 +600,7 @@ void CDisplaySettings::SettingOptionsVerticalSyncsFiller(const CSetting *setting + + void CDisplaySettings::SettingOptionsMonitorsFiller(const CSetting *setting, std::vector< std::pair > &list, std::string ¤t) { +#if defined(HAS_GLX) - // we expect "videoscreen.monitor" but it might be hidden on some platforms, - // so check that we actually have a visable control. - BaseSettingControlPtr control = GetSetting(strSetting); -@@ -2425,6 +2430,7 @@ void CGUIWindowSettingsCategory::FillInMonitors(CStdString strSetting) - pControl->SetValue(currentMonitor); - g_guiSettings.SetString("videoscreen.monitor", CDisplaySettings::Get().GetResolutionInfo(RES_DESKTOP).strOutput); + std::vector monitors; + g_Windowing.GetConnectedOutputs(&monitors); + for (unsigned int i=0; i Date: Fri, 14 Dec 2012 14:19:15 +0100 -Subject: [PATCH 087/107] pvr: do not show selection dialog for a single menu +Subject: [PATCH 091/111] pvr: do not show selection dialog for a single menu hook --- @@ -21017,10 +21275,10 @@ Subject: [PATCH 087/107] pvr: do not show selection dialog for a single menu 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/xbmc/pvr/addons/PVRClients.cpp b/xbmc/pvr/addons/PVRClients.cpp -index f3fb852..2c9b6fe 100644 +index 16fad44..1c95c76 100644 --- a/xbmc/pvr/addons/PVRClients.cpp +++ b/xbmc/pvr/addons/PVRClients.cpp -@@ -729,16 +729,19 @@ void CPVRClients::ProcessMenuHooks(int iClientID, PVR_MENUHOOK_CAT cat) +@@ -728,16 +728,19 @@ void CPVRClients::ProcessMenuHooks(int iClientID, PVR_MENUHOOK_CAT cat) if (GetConnectedClient(iClientID, client) && client->HaveMenuHooks(cat)) { hooks = client->GetMenuHooks(); @@ -21052,10 +21310,10 @@ index f3fb852..2c9b6fe 100644 1.8.1.6 -From e12b6aa0adba68b13e481b38f11c3eaeb0391363 Mon Sep 17 00:00:00 2001 +From 37f1a521654b437bd27f29870615acd8cf95078e Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 3 Feb 2013 08:17:16 +0100 -Subject: [PATCH 088/107] X11: use default screen parameters if no output +Subject: [PATCH 092/111] X11: use default screen parameters if no output connected --- @@ -21063,7 +21321,7 @@ Subject: [PATCH 088/107] X11: use default screen parameters if no output 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp -index cbff7e1..ea531ae 100644 +index d865cd7..97975dd 100644 --- a/xbmc/windowing/X11/WinSystemX11.cpp +++ b/xbmc/windowing/X11/WinSystemX11.cpp @@ -205,25 +205,27 @@ bool CWinSystemX11::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl @@ -21118,7 +21376,7 @@ index cbff7e1..ea531ae 100644 - int x11screen = m_nScreen; - int w = DisplayWidth(m_dpy, x11screen); - int h = DisplayHeight(m_dpy, x11screen); -+ g_guiSettings.SetString("videoscreen.monitor", "Default"); ++ CSettings::Get().SetString("videoscreen.monitor", "Default"); + m_nScreen = DefaultScreen(m_dpy); + int w = DisplayWidth(m_dpy, m_nScreen); + int h = DisplayHeight(m_dpy, m_nScreen); @@ -21159,10 +21417,10 @@ index cbff7e1..ea531ae 100644 1.8.1.6 -From 782fe066d31ad03ef3c285ededeccf1fccb00c9c Mon Sep 17 00:00:00 2001 +From 312f6da9b2bc4f04737112a6485df885b6a5e4bb Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 23 Mar 2013 15:13:32 +0100 -Subject: [PATCH 089/107] X11: create parent window +Subject: [PATCH 093/111] X11: create parent window --- xbmc/windowing/X11/WinSystemX11.cpp | 69 +++++++++++++++++++++++-------------- @@ -21170,7 +21428,7 @@ Subject: [PATCH 089/107] X11: create parent window 2 files changed, 44 insertions(+), 27 deletions(-) diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp -index ea531ae..2d9cf2a 100644 +index 97975dd..0a3efff 100644 --- a/xbmc/windowing/X11/WinSystemX11.cpp +++ b/xbmc/windowing/X11/WinSystemX11.cpp @@ -53,6 +53,7 @@ @@ -21428,10 +21686,10 @@ index 7345c06..770ae84 100644 1.8.1.6 -From 885b952efb920daa5d4d4c8c13d4d464477c22c0 Mon Sep 17 00:00:00 2001 +From 69c6aba35595141d43aa236323967867c5b90d2e Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 24 Mar 2013 12:30:12 +0100 -Subject: [PATCH 090/107] X11: use system key repeat rate instead of hardcoded +Subject: [PATCH 094/111] X11: use system key repeat rate instead of hardcoded one, taken from 58fd64b194e38b73b5f3132744bab35e994e7441 --- @@ -21633,10 +21891,10 @@ index 102a076..5b1f3fa 100644 1.8.1.6 -From 8638be447e2c18a4eca720acd0bf008561f983d6 Mon Sep 17 00:00:00 2001 +From 56d1eb281b479c9def4cf49e25068e389343f5a4 Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 24 Mar 2013 16:04:48 +0100 -Subject: [PATCH 091/107] linux: use CLOCK_MONOTONIC_RAW as this is not subject +Subject: [PATCH 095/111] linux: use CLOCK_MONOTONIC_RAW as this is not subject to NTP --- @@ -21674,128 +21932,17 @@ index 8304ef6..ba27257 100644 1.8.1.6 -From 3a4f66b1224a35c85c359505f85cd970a9d4ebfd Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Thu, 28 Mar 2013 15:18:05 +0100 -Subject: [PATCH 092/107] OMXPlayerAudio: fix incorrect usage of flag stalled - ---- - xbmc/cores/omxplayer/OMXPlayerAudio.cpp | 18 +++++++++++++----- - xbmc/cores/omxplayer/OMXPlayerAudio.h | 1 + - 2 files changed, 14 insertions(+), 5 deletions(-) - -diff --git a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp -index 3834444..0dad6c8 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp -@@ -79,6 +79,7 @@ class COMXMsgAudioCodecChange : public CDVDMsg - m_freq = CurrentHostFrequency(); - m_bad_state = false; - m_hints_current.Clear(); -+ m_output_stalled = false; - - m_av_clock->SetMasterClock(false); - -@@ -167,6 +168,7 @@ void OMXPlayerAudio::OpenStream(CDVDStreamInfo &hints, COMXAudioCodecOMX *codec) - m_stalled = m_messageQueue.GetPacketCount(CDVDMsg::DEMUXER_PACKET) == 0; - m_use_passthrough = (g_guiSettings.GetInt("audiooutput.mode") == AUDIO_HDMI) ? true : false ; - m_use_hw_decode = g_advancedSettings.m_omxHWAudioDecode; -+ m_output_stalled = m_stalled; - } - - bool OMXPlayerAudio::CloseStream(bool bWaitForBuffers) -@@ -455,11 +457,11 @@ bool OMXPlayerAudio::Decode(DemuxPacket *pkt, bool bDropPacket) - } - - if(bDropPacket) -- m_stalled = false; -+ m_stalled = m_output_stalled = false; - - if(m_omxAudio.GetCacheTime() < 0.1 /*&& min(99,m_messageQueue.GetLevel() + MathUtils::round_int(100.0/8.0*GetCacheTime())) > 10*/) - { -- m_stalled = true; -+ m_output_stalled = true; - if(!m_av_clock->OMXAudioBuffer() && m_av_clock->HasVideo() && m_speed == DVD_PLAYSPEED_NORMAL) - { - clock_gettime(CLOCK_REALTIME, &m_starttime); -@@ -467,6 +469,9 @@ bool OMXPlayerAudio::Decode(DemuxPacket *pkt, bool bDropPacket) - } - } - -+ if (m_stalled && m_omxAudio.GetCacheTime() > 0.0) -+ m_stalled = false; -+ - // signal to our parent that we have initialized - if(m_started == false) - { -@@ -491,6 +496,7 @@ void OMXPlayerAudio::Process() - - if (ret == MSGQ_TIMEOUT) - { -+ m_stalled = true; - Sleep(10); - continue; - } -@@ -510,12 +516,13 @@ void OMXPlayerAudio::Process() - CLog::Log(LOGINFO, "Audio: dts:%.0f pts:%.0f size:%d (s:%d f:%d d:%d l:%d) s:%d %d/%d late:%d,%d", pPacket->dts, pPacket->pts, - (int)pPacket->iSize, m_started, m_flush, bPacketDrop, m_stalled, m_speed, 0, 0, (int)m_omxAudio.GetAudioRenderingLatency(), (int)m_hints_current.samplerate); - #endif -+ m_stalled = false; - if(Decode(pPacket, m_speed > DVD_PLAYSPEED_NORMAL || m_speed < 0 || bPacketDrop)) - { -- if (m_stalled && (m_omxAudio.GetCacheTime() > (AUDIO_BUFFER_SECONDS * 0.75f))) -+ if (m_output_stalled && (m_omxAudio.GetCacheTime() > (AUDIO_BUFFER_SECONDS * 0.75f))) - { - CLog::Log(LOGINFO, "COMXPlayerAudio - Switching to normal playback"); -- m_stalled = false; -+ m_stalled = m_output_stalled = false; - if(m_av_clock->HasVideo() && m_av_clock->OMXAudioBuffer()) - m_av_clock->OMXAudioBufferStop(); - } -@@ -525,7 +532,7 @@ void OMXPlayerAudio::Process() - //int iLevel = min(99,m_messageQueue.GetLevel() + MathUtils::round_int(100.0/8.0*GetCacheTime())); - if(/*iLevel < 10 &&*/ m_stalled && m_av_clock->OMXAudioBuffer() && (m_endtime.tv_sec - m_starttime.tv_sec) > 1) - { -- m_stalled = false; -+ m_stalled = m_output_stalled = false; - if(m_av_clock->HasVideo() && m_av_clock->OMXAudioBuffer()) - m_av_clock->OMXAudioBufferStop(); - } -@@ -576,6 +583,7 @@ void OMXPlayerAudio::Process() - m_av_clock->UnLock(); - m_syncclock = true; - m_stalled = true; -+ m_output_stalled = true; - m_started = false; - - if (m_pAudioCodec) -diff --git a/xbmc/cores/omxplayer/OMXPlayerAudio.h b/xbmc/cores/omxplayer/OMXPlayerAudio.h -index 21d42c0..558b15c 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerAudio.h -+++ b/xbmc/cores/omxplayer/OMXPlayerAudio.h -@@ -76,6 +76,7 @@ class OMXPlayerAudio : public CThread - - bool m_stalled; - bool m_started; -+ bool m_output_stalled; - - BitstreamStats m_audioStats; - --- -1.8.1.6 - - -From d3093a129ca9f0d28b8f69a36674ebef6aca0653 Mon Sep 17 00:00:00 2001 +From 3b98ceabfe6b7b7a3f015cf3388d4c3accfb7888 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 28 Mar 2013 15:18:53 +0100 -Subject: [PATCH 093/107] OMXPlayer: some caching fixes for pvr +Subject: [PATCH 096/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 313833e..a962c19 100644 +index 035439a..6d0f0aa 100644 --- a/xbmc/cores/omxplayer/OMXPlayer.cpp +++ b/xbmc/cores/omxplayer/OMXPlayer.cpp @@ -2312,7 +2312,8 @@ void COMXPlayer::HandleMessages() @@ -21812,20 +21959,20 @@ index 313833e..a962c19 100644 1.8.1.6 -From 6b9524130eccd72ea75ac198b7072386cf7f800c Mon Sep 17 00:00:00 2001 +From 4941791d4201bc9d16cbfa53a83ff234af9b01a6 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 28 Mar 2013 20:50:59 +0100 -Subject: [PATCH 094/107] fix incorrect display of fps when dr kicks in +Subject: [PATCH 097/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 c72def4..3962cb8 100644 +index 77d6931..27a1285 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -2443,13 +2443,14 @@ void CApplication::Render() +@@ -2156,13 +2156,14 @@ void CApplication::Render() if (frameTime < singleFrameTime) Sleep(singleFrameTime - frameTime); } @@ -21845,20 +21992,20 @@ index c72def4..3962cb8 100644 1.8.1.6 -From e287a68257e575df8d9cd76ba52cdf6be666df2f Mon Sep 17 00:00:00 2001 +From 043752fb61780101454b301b311d2b36c41dc1db Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 8 Apr 2013 11:18:31 +0200 -Subject: [PATCH 095/107] squash to dropping control +Subject: [PATCH 098/111] 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 ac39406..7793c88 100644 +index 69cd5ba..91b92ce 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -40,6 +40,7 @@ +@@ -39,6 +39,7 @@ #include "DVDCodecs/DVDCodecs.h" #include "DVDCodecs/Overlay/DVDOverlayCodecCC.h" #include "DVDCodecs/Overlay/DVDOverlaySSA.h" @@ -21870,10 +22017,10 @@ index ac39406..7793c88 100644 1.8.1.6 -From e2a872a49b1b241b72fa33eaaca6c5e696555e80 Mon Sep 17 00:00:00 2001 +From 8699d7ef684debb63dc62d691e7c5d0794e9aa3b Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 6 Apr 2013 18:10:57 +0200 -Subject: [PATCH 096/107] enable dirty regions for video full screen +Subject: [PATCH 099/111] enable dirty regions for video full screen --- xbmc/Application.cpp | 13 ++----- @@ -21889,10 +22036,10 @@ Subject: [PATCH 096/107] enable dirty regions for video full screen 10 files changed, 68 insertions(+), 35 deletions(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index 3962cb8..a4b2423 100644 +index 27a1285..b21c7ab 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -2288,14 +2288,6 @@ bool CApplication::RenderNoPresent() +@@ -2001,14 +2001,6 @@ bool CApplication::RenderNoPresent() // dont show GUI when playing full screen video if (g_graphicsContext.IsFullScreenVideo()) { @@ -21907,7 +22054,7 @@ index 3962cb8..a4b2423 100644 // close window overlays CGUIDialog *overlay = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_OVERLAY); if (overlay) overlay->Close(true); -@@ -2367,7 +2359,6 @@ void CApplication::Render() +@@ -2080,7 +2072,6 @@ void CApplication::Render() m_bPresentFrame = g_renderManager.HasFrame(); if (!m_bPresentFrame && m_frameEvent.WaitMSec(100)) m_bPresentFrame = g_renderManager.HasFrame(); @@ -21915,7 +22062,7 @@ index 3962cb8..a4b2423 100644 } else { -@@ -2434,7 +2425,7 @@ void CApplication::Render() +@@ -2147,7 +2138,7 @@ void CApplication::Render() flip = true; //fps limiter, make sure each frame lasts at least singleFrameTime milliseconds @@ -21924,7 +22071,7 @@ index 3962cb8..a4b2423 100644 { if (!limitFrames) singleFrameTime = 40; //if not flipping, loop at 25 fps -@@ -2447,12 +2438,12 @@ void CApplication::Render() +@@ -2160,12 +2151,12 @@ void CApplication::Render() if (flip) { g_graphicsContext.Flip(dirtyRegions); @@ -21939,10 +22086,10 @@ index 3962cb8..a4b2423 100644 g_renderManager.ManageCaptures(); } diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.h b/xbmc/cores/VideoRenderers/BaseRenderer.h -index 675ca35..2044adf 100644 +index 6f989ab..7496ea6 100644 --- a/xbmc/cores/VideoRenderers/BaseRenderer.h +++ b/xbmc/cores/VideoRenderers/BaseRenderer.h -@@ -88,6 +88,7 @@ class CBaseRenderer +@@ -104,6 +104,7 @@ class CBaseRenderer virtual unsigned int GetMaxBufferSize() { return 0; } virtual void SetBufferSize(int numBuffers) { } virtual void ReleaseBuffer(int idx) { } @@ -21951,10 +22098,10 @@ index 675ca35..2044adf 100644 virtual bool Supports(ERENDERFEATURE feature) { return false; } diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp -index 086d9d5..12a9612 100644 +index 8586ad1..92ce209 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp -@@ -2000,5 +2000,13 @@ void CLinuxRendererGLES::AddProcessor(struct __CVBuffer *cvBufferRef, int index) +@@ -1999,5 +1999,13 @@ void CLinuxRendererGLES::AddProcessor(struct __CVBuffer *cvBufferRef, int index) } #endif @@ -21981,10 +22128,10 @@ index d5eefc6..39cc39c 100644 virtual void RenderUpdate(bool clear, DWORD flags = 0, DWORD alpha = 255); diff --git a/xbmc/cores/VideoRenderers/OverlayRenderer.cpp b/xbmc/cores/VideoRenderers/OverlayRenderer.cpp -index 8e958f6..c80a10b 100644 +index abaaba6..455ced4 100644 --- a/xbmc/cores/VideoRenderers/OverlayRenderer.cpp +++ b/xbmc/cores/VideoRenderers/OverlayRenderer.cpp -@@ -174,6 +174,20 @@ void CRenderer::ReleaseBuffer(int idx) +@@ -176,6 +176,20 @@ void CRenderer::ReleaseBuffer(int idx) Release(m_buffers[idx]); } @@ -22018,10 +22165,10 @@ index 83ea575..ae009ec 100644 protected: diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp -index 9e5a9d5..dc25281 100644 +index 1a19c07..73634dc 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp -@@ -300,22 +300,7 @@ void CXBMCRenderManager::Update(bool bPauseDrawing) +@@ -299,22 +299,7 @@ void CXBMCRenderManager::Update(bool bPauseDrawing) void CXBMCRenderManager::RenderUpdate(bool clear, DWORD flags, DWORD alpha) { @@ -22045,7 +22192,7 @@ index 9e5a9d5..dc25281 100644 if (g_advancedSettings.m_videoDisableBackgroundDeinterlace) { -@@ -696,11 +681,11 @@ void CXBMCRenderManager::Render(bool clear, DWORD flags, DWORD alpha) +@@ -695,11 +680,11 @@ void CXBMCRenderManager::Render(bool clear, DWORD flags, DWORD alpha) m_overlays.Render(); } @@ -22059,7 +22206,7 @@ index 9e5a9d5..dc25281 100644 if (m_presentstep == PRESENT_IDLE) PrepareNextRender(); -@@ -715,11 +700,29 @@ void CXBMCRenderManager::Present() +@@ -714,11 +699,29 @@ void CXBMCRenderManager::Present() } } @@ -22107,10 +22254,10 @@ index f0e2c18..26ba6ec 100644 CSharedSection& GetSection() { return m_sharedSection; }; diff --git a/xbmc/video/windows/GUIWindowFullScreen.cpp b/xbmc/video/windows/GUIWindowFullScreen.cpp -index d3786da..d51f6f1 100644 +index 559a04c..fcffd7f 100644 --- a/xbmc/video/windows/GUIWindowFullScreen.cpp +++ b/xbmc/video/windows/GUIWindowFullScreen.cpp -@@ -420,6 +420,7 @@ bool CGUIWindowFullScreen::OnMessage(CGUIMessage& message) +@@ -419,6 +419,7 @@ bool CGUIWindowFullScreen::OnMessage(CGUIMessage& message) else m_subsLayout = NULL; @@ -22118,7 +22265,7 @@ index d3786da..d51f6f1 100644 return true; } case GUI_MSG_WINDOW_DEINIT: -@@ -746,15 +747,23 @@ void CGUIWindowFullScreen::FrameMove() +@@ -745,15 +746,23 @@ void CGUIWindowFullScreen::FrameMove() void CGUIWindowFullScreen::Process(unsigned int currentTime, CDirtyRegionList &dirtyregion) { @@ -22144,7 +22291,7 @@ index d3786da..d51f6f1 100644 if (g_application.m_pPlayer) RenderTTFSubtitles(); CGUIWindow::Render(); -@@ -946,5 +955,7 @@ void CGUIWindowFullScreen::ToggleOSD() +@@ -945,5 +954,7 @@ void CGUIWindowFullScreen::ToggleOSD() pOSD->Close(); else pOSD->DoModal(); @@ -22153,10 +22300,10 @@ index d3786da..d51f6f1 100644 } } diff --git a/xbmc/video/windows/GUIWindowFullScreen.h b/xbmc/video/windows/GUIWindowFullScreen.h -index c0df834..8668432 100644 +index c42a095..0171c5e 100644 --- a/xbmc/video/windows/GUIWindowFullScreen.h +++ b/xbmc/video/windows/GUIWindowFullScreen.h -@@ -75,4 +75,6 @@ class CGUIWindowFullScreen : public CGUIWindow +@@ -84,4 +84,6 @@ class CGUIWindowFullScreen : public CGUIWindow CCriticalSection m_fontLock; CGUITextLayout* m_subsLayout; @@ -22167,10 +22314,10 @@ index c0df834..8668432 100644 1.8.1.6 -From 92cacbad6164c9d818fecec62d126dc92fa9f86a Mon Sep 17 00:00:00 2001 +From eba32e0b11cab7208fe3290ada6452489c3ded05 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 11 Apr 2013 12:33:46 +0200 -Subject: [PATCH 097/107] pvr: try SwtichChannel when selecting a channel via +Subject: [PATCH 100/111] pvr: try SwtichChannel when selecting a channel via EPG --- @@ -22178,7 +22325,7 @@ Subject: [PATCH 097/107] pvr: try SwtichChannel when selecting a channel via 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp -index 4dfd5fb..31e370a 100644 +index 129ccc4..256a295 100644 --- a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp +++ b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp @@ -427,7 +427,8 @@ bool CGUIWindowPVRGuide::PlayEpgItem(CFileItem *item) @@ -22195,10 +22342,10 @@ index 4dfd5fb..31e370a 100644 1.8.1.6 -From 1e3272a694ca5e54b1b23503186d98f674afffb5 Mon Sep 17 00:00:00 2001 +From d529bc5d5a8ff5ce21ae1418ac2313dfcf29df15 Mon Sep 17 00:00:00 2001 From: xbmc Date: Fri, 12 Apr 2013 21:01:24 +0200 -Subject: [PATCH 098/107] AE: temp fix for transcode after ffmpeg update +Subject: [PATCH 101/111] AE: temp fix for transcode after ffmpeg update --- .../cores/AudioEngine/Encoders/AEEncoderFFmpeg.cpp | 87 +++++++++++++++++++--- @@ -22206,7 +22353,7 @@ Subject: [PATCH 098/107] AE: temp fix for transcode after ffmpeg update 2 files changed, 77 insertions(+), 12 deletions(-) diff --git a/xbmc/cores/AudioEngine/Encoders/AEEncoderFFmpeg.cpp b/xbmc/cores/AudioEngine/Encoders/AEEncoderFFmpeg.cpp -index 34ddda6..b2d0b75 100644 +index 05b2bda..925e864 100644 --- a/xbmc/cores/AudioEngine/Encoders/AEEncoderFFmpeg.cpp +++ b/xbmc/cores/AudioEngine/Encoders/AEEncoderFFmpeg.cpp @@ -143,16 +143,47 @@ bool CAEEncoderFFmpeg::Initialize(AEAudioFormat &format) @@ -22355,10 +22502,10 @@ index 0cedf3f..90b0147 100644 1.8.1.6 -From 865dea32e3bf42a5f01fef0b5e6ae1ccb2517359 Mon Sep 17 00:00:00 2001 +From 88159684464f0c65d2564ffd7804a7fbfc05ca4d Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 13 Apr 2013 08:32:06 +0200 -Subject: [PATCH 099/107] X11: fix mouse coverage +Subject: [PATCH 102/111] X11: fix mouse coverage --- xbmc/windowing/X11/WinSystemX11.cpp | 11 ++++++++--- @@ -22366,7 +22513,7 @@ Subject: [PATCH 099/107] X11: fix mouse coverage 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp -index 2d9cf2a..d36765d 100644 +index 0a3efff..bf95bc7 100644 --- a/xbmc/windowing/X11/WinSystemX11.cpp +++ b/xbmc/windowing/X11/WinSystemX11.cpp @@ -581,10 +581,10 @@ void CWinSystemX11::NotifyAppFocusChange(bool bGaining) @@ -22424,10 +22571,10 @@ index 770ae84..084f546 100644 1.8.1.6 -From 135efc8e326e7d40a03eb37434bcd2101532962f Mon Sep 17 00:00:00 2001 +From c9c7d7d8b24f8a287a0af1b3ccbd169052d7250b Mon Sep 17 00:00:00 2001 From: fritsch Date: Sat, 13 Apr 2013 11:30:39 +0200 -Subject: [PATCH 100/107] XVBA: revisit draw functions +Subject: [PATCH 103/111] XVBA: revisit draw functions --- lib/ffmpeg/libavcodec/xvba_h264.c | 2 +- @@ -22464,10 +22611,10 @@ index bf3d9c2..ff35a28 100644 1.8.1.6 -From 2b0334917bb9938daf83a961b78a09d812b0a6a7 Mon Sep 17 00:00:00 2001 +From 30466ce19f01e549c3be96eeaa0fe64d2f4b3275 Mon Sep 17 00:00:00 2001 From: fritsch Date: Sat, 13 Apr 2013 12:06:02 +0200 -Subject: [PATCH 101/107] (ffmpeg): Make XVBA codec available +Subject: [PATCH 104/111] (ffmpeg): Make XVBA codec available --- lib/ffmpeg/libavcodec/vc1dec.c | 3 +++ @@ -22491,10 +22638,10 @@ index 2130c74..4d611f9 100644 1.8.1.6 -From 9389e01331a99f5e52d65dd35577aa66cafe93b2 Mon Sep 17 00:00:00 2001 +From 7eadcd87bee856b71d98f5a02ab210fcb7b57311 Mon Sep 17 00:00:00 2001 From: fritsch Date: Sat, 13 Apr 2013 16:38:50 +0200 -Subject: [PATCH 102/107] ffmpeg: XVBA-VC1 use v->second_field instead of +Subject: [PATCH 105/111] ffmpeg: XVBA-VC1 use v->second_field instead of !s->first_field to make VC1 interlaced working --- @@ -22518,1087 +22665,258 @@ index ff35a28..04e7983 100644 1.8.1.6 -From c6537645e633e6e003c70a2ea208973195815483 Mon Sep 17 00:00:00 2001 +From 2b6cd6a04eb38e0ac210c6e5c70267dd12512295 Mon Sep 17 00:00:00 2001 +From: fritsch +Date: Sat, 27 Apr 2013 17:36:15 +0200 +Subject: [PATCH 106/111] 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 e1c66a2726b0342bf8c166546838f72d3cfb26a8 Mon Sep 17 00:00:00 2001 +From: fritsch +Date: Sat, 27 Apr 2013 22:08:50 +0200 +Subject: [PATCH 107/111] 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 4474d708a96a2488f346a323cc79e6597c9326bf Mon Sep 17 00:00:00 2001 From: xbmc -Date: Wed, 10 Apr 2013 14:11:40 +0200 -Subject: [PATCH 103/107] demuxer ffmpeg: move m_streams into a map, drop - MAX_STREAMS +Date: Tue, 30 Apr 2013 21:18:55 +0200 +Subject: [PATCH 108/111] ffmpeg xvba: fix vc1 field interlace --- - .../cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 99 +++++++++++----------- - xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h | 5 +- - 2 files changed, 51 insertions(+), 53 deletions(-) + 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/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index a3b0def..5684361 100644 ---- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -+++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -@@ -207,7 +207,6 @@ static offset_t dvd_file_seek(void *h, offset_t pos, int whence) - m_pFormatContext = NULL; - m_pInput = NULL; - m_ioContext = NULL; -- for (int i = 0; i < MAX_STREAMS; i++) m_streams[i] = NULL; - m_iCurrentPts = DVD_NOPTS_VALUE; - m_bMatroska = false; - m_bAVI = false; -@@ -530,16 +529,18 @@ void CDVDDemuxFFmpeg::Dispose() - m_pFormatContext = NULL; - m_speed = DVD_PLAYSPEED_NORMAL; - -- for (int i = 0; i < MAX_STREAMS; i++) -+ std::map::iterator it; -+ for(it = m_streams.begin(); it != m_streams.end(); ++it) - { -- if (m_streams[i]) -+ if (it->second) - { -- if (m_streams[i]->ExtraData) -- delete[] (BYTE*)(m_streams[i]->ExtraData); -- delete m_streams[i]; -+ if (it->second->ExtraData) -+ delete[] (BYTE*)(it->second->ExtraData); -+ delete it->second; - } -- m_streams[i] = NULL; - } -+ m_streams.clear(); -+ - m_pInput = NULL; - - m_dllAvFormat.Unload(); -@@ -651,7 +652,6 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() - // keep track if ffmpeg doesn't always set these - pkt.size = 0; - pkt.data = NULL; -- pkt.stream_index = MAX_STREAMS; - - // timeout reads after 100ms - m_timeout.Set(20000); -@@ -667,7 +667,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() - { - Flush(); - } -- else if (pkt.size < 0 || pkt.stream_index >= MAX_STREAMS) -+ else if (pkt.size < 0 || !GetStream(pkt.stream_index)) - { - // XXX, in some cases ffmpeg returns a negative packet size - if(m_pFormatContext->pb && !m_pFormatContext->pb->eof_reached) -@@ -801,29 +801,30 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() - if (!pPacket) return NULL; - - // check streams, can we make this a bit more simple? -- if (pPacket && pPacket->iStreamId >= 0 && pPacket->iStreamId < MAX_STREAMS) -+ if (pPacket && pPacket->iStreamId >= 0) - { -- if (!m_streams[pPacket->iStreamId] || -- m_streams[pPacket->iStreamId]->pPrivate != m_pFormatContext->streams[pPacket->iStreamId] || -- m_streams[pPacket->iStreamId]->codec != m_pFormatContext->streams[pPacket->iStreamId]->codec->codec_id) -+ CDemuxStream *stream = GetStream(pPacket->iStreamId); -+ if (!stream || -+ stream->pPrivate != m_pFormatContext->streams[pPacket->iStreamId] || -+ stream->codec != m_pFormatContext->streams[pPacket->iStreamId]->codec->codec_id) - { - // content has changed, or stream did not yet exist - AddStream(pPacket->iStreamId); - } - // we already check for a valid m_streams[pPacket->iStreamId] above -- else if (m_streams[pPacket->iStreamId]->type == STREAM_AUDIO) -+ else if (stream->type == STREAM_AUDIO) - { -- if (((CDemuxStreamAudio*)m_streams[pPacket->iStreamId])->iChannels != m_pFormatContext->streams[pPacket->iStreamId]->codec->channels || -- ((CDemuxStreamAudio*)m_streams[pPacket->iStreamId])->iSampleRate != m_pFormatContext->streams[pPacket->iStreamId]->codec->sample_rate) -+ if (((CDemuxStreamAudio*)stream)->iChannels != m_pFormatContext->streams[pPacket->iStreamId]->codec->channels || -+ ((CDemuxStreamAudio*)stream)->iSampleRate != m_pFormatContext->streams[pPacket->iStreamId]->codec->sample_rate) - { - // content has changed - AddStream(pPacket->iStreamId); - } - } -- else if (m_streams[pPacket->iStreamId]->type == STREAM_VIDEO) -+ else if (stream->type == STREAM_VIDEO) - { -- if (((CDemuxStreamVideo*)m_streams[pPacket->iStreamId])->iWidth != m_pFormatContext->streams[pPacket->iStreamId]->codec->width || -- ((CDemuxStreamVideo*)m_streams[pPacket->iStreamId])->iHeight != m_pFormatContext->streams[pPacket->iStreamId]->codec->height) -+ if (((CDemuxStreamVideo*)stream)->iWidth != m_pFormatContext->streams[pPacket->iStreamId]->codec->width || -+ ((CDemuxStreamVideo*)stream)->iHeight != m_pFormatContext->streams[pPacket->iStreamId]->codec->height) - { - // content has changed - AddStream(pPacket->iStreamId); -@@ -1099,15 +1100,16 @@ int CDVDDemuxFFmpeg::GetStreamLength() - - CDemuxStream* CDVDDemuxFFmpeg::GetStream(int iStreamId) - { -- if (iStreamId < 0 || iStreamId >= MAX_STREAMS) return NULL; -- return m_streams[iStreamId]; -+ std::map::iterator it = m_streams.find(iStreamId); -+ if (it == m_streams.end()) -+ return NULL; -+ else -+ return it->second; - } - - int CDVDDemuxFFmpeg::GetNrOfStreams() - { -- int i = 0; -- while (i < MAX_STREAMS && m_streams[i]) i++; -- return i; -+ return m_streams.size(); - } - - static double SelectAspect(AVStream* st, bool* forced) -@@ -1128,16 +1130,10 @@ static double SelectAspect(AVStream* st, bool* forced) - - void CDVDDemuxFFmpeg::AddStream(int iId) - { -- if(iId >= MAX_STREAMS) -- { -- CLog::Log(LOGWARNING, "%s - streams id %d exeeds maximum supported", __FUNCTION__, iId); -- return; -- } -- - AVStream* pStream = m_pFormatContext->streams[iId]; - if (pStream) - { -- CDemuxStream* old = m_streams[iId]; -+ CDemuxStream* old = GetStream(iId); - - switch (pStream->codec->codec_type) - { -@@ -1294,25 +1290,26 @@ void CDVDDemuxFFmpeg::AddStream(int iId) - // generic stuff - if (pStream->duration != (int64_t)AV_NOPTS_VALUE) m_streams[iId]->iDuration = (int)((pStream->duration / AV_TIME_BASE) & 0xFFFFFFFF); - -- m_streams[iId]->codec = pStream->codec->codec_id; -- m_streams[iId]->codec_fourcc = pStream->codec->codec_tag; -- m_streams[iId]->profile = pStream->codec->profile; -- m_streams[iId]->level = pStream->codec->level; -+ CDemuxStream* stream = GetStream(iId); -+ stream->codec = pStream->codec->codec_id; -+ stream->codec_fourcc = pStream->codec->codec_tag; -+ stream->profile = pStream->codec->profile; -+ stream->level = pStream->codec->level; - -- m_streams[iId]->iId = iId; -- m_streams[iId]->source = STREAM_SOURCE_DEMUX; -- m_streams[iId]->pPrivate = pStream; -- m_streams[iId]->flags = (CDemuxStream::EFlags)pStream->disposition; -+ stream->iId = iId; -+ stream->source = STREAM_SOURCE_DEMUX; -+ stream->pPrivate = pStream; -+ stream->flags = (CDemuxStream::EFlags)pStream->disposition; - - AVDictionaryEntry *langTag = m_dllAvUtil.av_dict_get(pStream->metadata, "language", NULL, 0); - if (langTag) -- strncpy(m_streams[iId]->language, langTag->value, 3); -+ strncpy(stream->language, langTag->value, 3); - - if( pStream->codec->extradata && pStream->codec->extradata_size > 0 ) - { -- m_streams[iId]->ExtraSize = pStream->codec->extradata_size; -- m_streams[iId]->ExtraData = new BYTE[pStream->codec->extradata_size]; -- memcpy(m_streams[iId]->ExtraData, pStream->codec->extradata, pStream->codec->extradata_size); -+ stream->ExtraSize = pStream->codec->extradata_size; -+ stream->ExtraData = new BYTE[pStream->codec->extradata_size]; -+ memcpy(stream->ExtraData, pStream->codec->extradata, pStream->codec->extradata_size); - } - - #ifdef HAVE_LIBBLURAY -@@ -1324,30 +1321,30 @@ void CDVDDemuxFFmpeg::AddStream(int iId) - // this stuff is really only valid for dvd's. - // this is so that the physicalid matches the - // id's reported from libdvdnav -- switch(m_streams[iId]->codec) -+ switch(stream->codec) - { - case CODEC_ID_AC3: -- m_streams[iId]->iPhysicalId = pStream->id - 128; -+ stream->iPhysicalId = pStream->id - 128; - break; - case CODEC_ID_DTS: -- m_streams[iId]->iPhysicalId = pStream->id - 136; -+ stream->iPhysicalId = pStream->id - 136; - break; - case CODEC_ID_MP2: -- m_streams[iId]->iPhysicalId = pStream->id - 448; -+ stream->iPhysicalId = pStream->id - 448; - break; - case CODEC_ID_PCM_S16BE: -- m_streams[iId]->iPhysicalId = pStream->id - 160; -+ stream->iPhysicalId = pStream->id - 160; - break; - case CODEC_ID_DVD_SUBTITLE: -- m_streams[iId]->iPhysicalId = pStream->id - 0x20; -+ stream->iPhysicalId = pStream->id - 0x20; - break; - default: -- m_streams[iId]->iPhysicalId = pStream->id & 0x1f; -+ stream->iPhysicalId = pStream->id & 0x1f; - break; - } - } - else -- m_streams[iId]->iPhysicalId = pStream->id; -+ stream->iPhysicalId = pStream->id; - } - } - -diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h -index 8a7a5de..d5ff0df 100644 ---- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h -+++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h -@@ -28,6 +28,8 @@ - #include "threads/CriticalSection.h" - #include "threads/SystemClock.h" - -+#include -+ - class CDVDDemuxFFmpeg; - - class CDemuxStreamVideoFFmpeg -@@ -126,8 +128,7 @@ class CDVDDemuxFFmpeg : public CDVDDemux - void UpdateCurrentPTS(); - - CCriticalSection m_critSection; -- #define MAX_STREAMS 100 -- CDemuxStream* m_streams[MAX_STREAMS]; // maximum number of streams that ffmpeg can handle -+ std::map m_streams; - - AVIOContext* m_ioContext; - --- -1.8.1.6 - - -From c3c3fae22ac4315478f6bfae1e006e552c19b889 Mon Sep 17 00:00:00 2001 -From: Joakim Plate -Date: Thu, 11 Apr 2013 22:21:50 +0200 -Subject: [PATCH 104/107] dvdplayer: move extradata cleanup to CDVDDemuxStream - destructor - ---- - xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h | 7 +++++-- - xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 3 --- - xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.cpp | 12 +----------- - xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.cpp | 5 ++++- - 4 files changed, 10 insertions(+), 17 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h -index bdad65b..cb91d27 100644 ---- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h -+++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h -@@ -104,7 +104,10 @@ class CDemuxStream - flags = FLAG_NONE; - } - -- virtual ~CDemuxStream() {} -+ virtual ~CDemuxStream() -+ { -+ delete [] ExtraData; -+ } - - virtual void GetStreamInfo(std::string& strInfo) - { -@@ -127,7 +130,7 @@ class CDemuxStream - - int iDuration; // in mseconds - void* pPrivate; // private pointer for the demuxer -- void* ExtraData; // extra data for codec to use -+ uint8_t* ExtraData; // extra data for codec to use - unsigned int ExtraSize; // size of extra data - - char language[4]; // ISO 639 3-letter language code (empty string if undefined) -diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index 5684361..5f4da31 100644 ---- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -+++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -@@ -1282,10 +1282,7 @@ void CDVDDemuxFFmpeg::AddStream(int iId) - // since dvdplayer uses the pointer to know - // if something changed in the demuxer - if (old) -- { -- if( old->ExtraData ) delete[] (BYTE*)(old->ExtraData); - delete old; -- } - - // generic stuff - if (pStream->duration != (int64_t)AV_NOPTS_VALUE) m_streams[iId]->iDuration = (int)((pStream->duration / AV_TIME_BASE) & 0xFFFFFFFF); -diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.cpp -index e4d2a18..6ea1f23 100644 ---- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.cpp -+++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.cpp -@@ -136,12 +136,7 @@ void CDVDDemuxPVRClient::Dispose() - { - for (int i = 0; i < MAX_STREAMS; i++) - { -- if (m_streams[i]) -- { -- if (m_streams[i]->ExtraData) -- delete[] (BYTE*)(m_streams[i]->ExtraData); -- delete m_streams[i]; -- } -+ delete m_streams[i]; - m_streams[i] = NULL; - } - -@@ -154,11 +149,6 @@ void CDVDDemuxPVRClient::DisposeStream(int iStreamId) - { - if (iStreamId < 0 || iStreamId >= MAX_STREAMS) - return; -- if (m_streams[iStreamId]->ExtraData) -- { -- delete[] (uint8_t*)m_streams[iStreamId]->ExtraData; -- m_streams[iStreamId]->ExtraData = NULL; -- } - delete m_streams[iStreamId]; - m_streams[iStreamId] = NULL; - } -diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.cpp -index 88daeee..9524715 100644 ---- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.cpp -+++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.cpp -@@ -28,6 +28,8 @@ - #include "DVDClock.h" - #include "DVDSubtitles/DVDSubtitleStream.h" - -+#include -+ - using namespace std; - - CDVDDemuxVobsub::CDVDDemuxVobsub() -@@ -112,7 +114,8 @@ bool CDVDDemuxVobsub::Open(const string& filename, const string& subfilename) - for(unsigned i=0;iExtraSize = state.extra.length()+1; -- m_Streams[i]->ExtraData = strdup(state.extra.c_str()); -+ m_Streams[i]->ExtraData = new uint8_t[m_Streams[i]->ExtraSize]; -+ strcpy((char*)m_Streams[i]->ExtraData, state.extra.c_str()); - } - - return true; --- -1.8.1.6 - - -From 6702e5f7645c5fd274a7976f09aaffc9614cb223 Mon Sep 17 00:00:00 2001 -From: Joakim Plate -Date: Thu, 11 Apr 2013 22:26:11 +0200 -Subject: [PATCH 105/107] dvdplayer: keep temporary stream pointer in ffmpeg - AddStream - ---- - .../cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 29 ++++++++++++---------- - 1 file changed, 16 insertions(+), 13 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index 5f4da31..16d6cb4 100644 ---- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -+++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -@@ -1133,6 +1133,7 @@ void CDVDDemuxFFmpeg::AddStream(int iId) - AVStream* pStream = m_pFormatContext->streams[iId]; - if (pStream) - { -+ CDemuxStream* stream = NULL; - CDemuxStream* old = GetStream(iId); - - switch (pStream->codec->codec_type) -@@ -1140,7 +1141,7 @@ void CDVDDemuxFFmpeg::AddStream(int iId) - case AVMEDIA_TYPE_AUDIO: - { - CDemuxStreamAudioFFmpeg* st = new CDemuxStreamAudioFFmpeg(this, pStream); -- m_streams[iId] = st; -+ stream = st; - st->iChannels = pStream->codec->channels; - st->iSampleRate = pStream->codec->sample_rate; - st->iBlockAlign = pStream->codec->block_align; -@@ -1155,7 +1156,7 @@ void CDVDDemuxFFmpeg::AddStream(int iId) - case AVMEDIA_TYPE_VIDEO: - { - CDemuxStreamVideoFFmpeg* st = new CDemuxStreamVideoFFmpeg(this, pStream); -- m_streams[iId] = st; -+ stream = st; - if(strcmp(m_pFormatContext->iformat->name, "flv") == 0) - st->bVFR = true; - else -@@ -1219,8 +1220,8 @@ void CDVDDemuxFFmpeg::AddStream(int iId) - } - case AVMEDIA_TYPE_DATA: - { -- m_streams[iId] = new CDemuxStream(); -- m_streams[iId]->type = STREAM_DATA; -+ stream = new CDemuxStream(); -+ stream->type = STREAM_DATA; - break; - } - case AVMEDIA_TYPE_SUBTITLE: -@@ -1228,14 +1229,14 @@ void CDVDDemuxFFmpeg::AddStream(int iId) - if (pStream->codec->codec_id == CODEC_ID_DVB_TELETEXT && g_guiSettings.GetBool("videoplayer.teletextenabled")) - { - CDemuxStreamTeletext* st = new CDemuxStreamTeletext(); -- m_streams[iId] = st; -- m_streams[iId]->type = STREAM_TELETEXT; -+ stream = st; -+ stream->type = STREAM_TELETEXT; - break; - } - else - { - CDemuxStreamSubtitleFFmpeg* st = new CDemuxStreamSubtitleFFmpeg(this, pStream); -- m_streams[iId] = st; -+ stream = st; - - if(m_dllAvUtil.av_dict_get(pStream->metadata, "title", NULL, 0)) - st->m_description = m_dllAvUtil.av_dict_get(pStream->metadata, "title", NULL, 0)->value; -@@ -1266,14 +1267,14 @@ void CDVDDemuxFFmpeg::AddStream(int iId) - file.Close(); - } - } -- m_streams[iId] = new CDemuxStream(); -- m_streams[iId]->type = STREAM_NONE; -+ stream = new CDemuxStream(); -+ stream->type = STREAM_NONE; - break; - } - default: - { -- m_streams[iId] = new CDemuxStream(); -- m_streams[iId]->type = STREAM_NONE; -+ stream = new CDemuxStream(); -+ stream->type = STREAM_NONE; - break; - } - } -@@ -1285,9 +1286,9 @@ void CDVDDemuxFFmpeg::AddStream(int iId) - delete old; - - // generic stuff -- if (pStream->duration != (int64_t)AV_NOPTS_VALUE) m_streams[iId]->iDuration = (int)((pStream->duration / AV_TIME_BASE) & 0xFFFFFFFF); -+ if (pStream->duration != (int64_t)AV_NOPTS_VALUE) -+ stream->iDuration = (int)((pStream->duration / AV_TIME_BASE) & 0xFFFFFFFF); - -- CDemuxStream* stream = GetStream(iId); - stream->codec = pStream->codec->codec_id; - stream->codec_fourcc = pStream->codec->codec_tag; - stream->profile = pStream->codec->profile; -@@ -1342,6 +1343,8 @@ void CDVDDemuxFFmpeg::AddStream(int iId) - } - else - stream->iPhysicalId = pStream->id; -+ -+ m_streams[iId] = stream; - } - } - --- -1.8.1.6 - - -From 0abe66ca7ff49da4619f071df338a3389e08bfd0 Mon Sep 17 00:00:00 2001 -From: Joakim Plate -Date: Thu, 11 Apr 2013 22:40:54 +0200 -Subject: [PATCH 106/107] dvdplayer: keep ffmpeg demuxer indexes in continous - order - ---- - .../cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 59 +++++++++++++++++----- - xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h | 3 ++ - 2 files changed, 49 insertions(+), 13 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index 16d6cb4..2f18062 100644 ---- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -+++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -@@ -667,7 +667,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() - { - Flush(); - } -- else if (pkt.size < 0 || !GetStream(pkt.stream_index)) -+ else if (pkt.size < 0 || !GetStreamInternal(pkt.stream_index)) - { - // XXX, in some cases ffmpeg returns a negative packet size - if(m_pFormatContext->pb && !m_pFormatContext->pb->eof_reached) -@@ -803,7 +803,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() - // check streams, can we make this a bit more simple? - if (pPacket && pPacket->iStreamId >= 0) - { -- CDemuxStream *stream = GetStream(pPacket->iStreamId); -+ CDemuxStream *stream = GetStreamInternal(pPacket->iStreamId); - if (!stream || - stream->pPrivate != m_pFormatContext->streams[pPacket->iStreamId] || - stream->codec != m_pFormatContext->streams[pPacket->iStreamId]->codec->codec_id) -@@ -1098,9 +1098,23 @@ int CDVDDemuxFFmpeg::GetStreamLength() - return (int)(m_pFormatContext->duration / (AV_TIME_BASE / 1000)); - } - -+/** -+ * @brief Finds stream based on demuxer index -+ */ - CDemuxStream* CDVDDemuxFFmpeg::GetStream(int iStreamId) - { -- std::map::iterator it = m_streams.find(iStreamId); -+ if(iStreamId >= 0 && (size_t)iStreamId < m_stream_index.size()) -+ return m_stream_index[iStreamId]->second; -+ else -+ return NULL; -+} -+ -+/** -+ * @brief Finds stream based on ffmpeg index -+ */ -+CDemuxStream* CDVDDemuxFFmpeg::GetStreamInternal(int iId) -+{ -+ std::map::iterator it = m_streams.find(iId); - if (it == m_streams.end()) - return NULL; - else -@@ -1109,7 +1123,7 @@ CDemuxStream* CDVDDemuxFFmpeg::GetStream(int iStreamId) - - int CDVDDemuxFFmpeg::GetNrOfStreams() - { -- return m_streams.size(); -+ return m_stream_index.size(); - } - - static double SelectAspect(AVStream* st, bool* forced) -@@ -1134,7 +1148,6 @@ void CDVDDemuxFFmpeg::AddStream(int iId) - if (pStream) - { - CDemuxStream* stream = NULL; -- CDemuxStream* old = GetStream(iId); - - switch (pStream->codec->codec_type) - { -@@ -1279,12 +1292,6 @@ void CDVDDemuxFFmpeg::AddStream(int iId) - } - } - -- // delete old stream after new is created -- // since dvdplayer uses the pointer to know -- // if something changed in the demuxer -- if (old) -- delete old; -- - // generic stuff - if (pStream->duration != (int64_t)AV_NOPTS_VALUE) - stream->iDuration = (int)((pStream->duration / AV_TIME_BASE) & 0xFFFFFFFF); -@@ -1294,7 +1301,6 @@ void CDVDDemuxFFmpeg::AddStream(int iId) - stream->profile = pStream->codec->profile; - stream->level = pStream->codec->level; - -- stream->iId = iId; - stream->source = STREAM_SOURCE_DEMUX; - stream->pPrivate = pStream; - stream->flags = (CDemuxStream::EFlags)pStream->disposition; -@@ -1344,10 +1350,37 @@ void CDVDDemuxFFmpeg::AddStream(int iId) - else - stream->iPhysicalId = pStream->id; - -- m_streams[iId] = stream; -+ AddStream(iId, stream); -+ } -+} -+ -+/** -+ * @brief Adds or updates a demux stream based in ffmpeg id -+ */ -+void CDVDDemuxFFmpeg::AddStream(int iId, CDemuxStream* stream) -+{ -+ std::pair::iterator, bool> res; -+ -+ res = m_streams.insert(std::make_pair(iId, stream)); -+ if(res.second) -+ { -+ /* was new stream */ -+ stream->iId = m_stream_index.size(); -+ m_stream_index.push_back(res.first); -+ } -+ else -+ { -+ /* replace old stream, keeping old index */ -+ stream->iId = res.first->second->iId; -+ -+ delete res.first->second; -+ res.first->second = stream; - } -+ if(g_advancedSettings.m_logLevel > LOG_LEVEL_NORMAL) -+ CLog::Log(LOGDEBUG, "CDVDDemuxFFmpeg::AddStream(%d, ...) -> %d", iId, stream->iId); - } - -+ - std::string CDVDDemuxFFmpeg::GetFileName() - { - if(m_pInput) -diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h -index d5ff0df..353dfa4 100644 ---- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h -+++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h -@@ -123,12 +123,15 @@ class CDVDDemuxFFmpeg : public CDVDDemux - - int ReadFrame(AVPacket *packet); - void AddStream(int iId); -+ void AddStream(int iId, CDemuxStream* stream); -+ CDemuxStream* GetStreamInternal(int iStreamId); - - double ConvertTimestamp(int64_t pts, int den, int num); - void UpdateCurrentPTS(); - - CCriticalSection m_critSection; - std::map m_streams; -+ std::vector::iterator> m_stream_index; - - AVIOContext* m_ioContext; - --- -1.8.1.6 - - -From 226035154f00b406ab4d3f4a2db02e4d2a2896a0 Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Tue, 13 Nov 2012 14:04:49 +0100 -Subject: [PATCH 107/107] demuxer ffmpeg: handle pmt changes - ---- - xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h | 3 + - .../cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 218 ++++++++++++++------- - xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h | 12 ++ - 3 files changed, 161 insertions(+), 72 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h -index cb91d27..e45c5d0 100644 ---- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h -+++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h -@@ -102,6 +102,7 @@ class CDemuxStream - disabled = false; - changes = 0; - flags = FLAG_NONE; -+ orig_type = 0; - } - - virtual ~CDemuxStream() -@@ -138,6 +139,8 @@ class CDemuxStream - - int changes; // increment on change which player may need to know about - -+ int orig_type; // type of origininal source -+ - enum EFlags - { FLAG_NONE = 0x0000 - , FLAG_DEFAULT = 0x0001 -diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index 2f18062..317be28 100644 ---- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -+++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -@@ -212,6 +212,8 @@ static offset_t dvd_file_seek(void *h, offset_t pos, int whence) - m_bAVI = false; - m_speed = DVD_PLAYSPEED_NORMAL; - m_program = UINT_MAX; -+ m_pkt.result = -1; -+ memset(&m_pkt.pkt, 0, sizeof(AVPacket)); - } - - CDVDDemuxFFmpeg::~CDVDDemuxFFmpeg() -@@ -475,31 +477,7 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) - - UpdateCurrentPTS(); - -- // add the ffmpeg streams to our own stream array -- if (m_pFormatContext->nb_programs) -- { -- // look for first non empty stream and discard nonselected programs -- for (unsigned int i = 0; i < m_pFormatContext->nb_programs; i++) -- { -- if(m_program == UINT_MAX && m_pFormatContext->programs[i]->nb_stream_indexes > 0) -- m_program = i; -- -- if(i != m_program) -- m_pFormatContext->programs[i]->discard = AVDISCARD_ALL; -- } -- if(m_program != UINT_MAX) -- { -- // add streams from selected program -- for (unsigned int i = 0; i < m_pFormatContext->programs[m_program]->nb_stream_indexes; i++) -- AddStream(m_pFormatContext->programs[m_program]->stream_index[i]); -- } -- } -- // if there were no programs or they were all empty, add all streams -- if (m_program == UINT_MAX) -- { -- for (unsigned int i = 0; i < m_pFormatContext->nb_streams; i++) -- AddStream(i); -- } -+ CreateStreams(); - - m_bPtsWrapChecked = false; - m_bPtsWrap = false; -@@ -509,6 +487,9 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) - - void CDVDDemuxFFmpeg::Dispose() - { -+ m_pkt.result = -1; -+ m_dllAvCodec.av_free_packet(&m_pkt.pkt); -+ - if (m_pFormatContext) - { - if (m_ioContext && m_pFormatContext->pb && m_pFormatContext->pb != m_ioContext) -@@ -529,17 +510,7 @@ void CDVDDemuxFFmpeg::Dispose() - m_pFormatContext = NULL; - m_speed = DVD_PLAYSPEED_NORMAL; - -- std::map::iterator it; -- for(it = m_streams.begin(); it != m_streams.end(); ++it) -- { -- if (it->second) -- { -- if (it->second->ExtraData) -- delete[] (BYTE*)(it->second->ExtraData); -- delete it->second; -- } -- } -- m_streams.clear(); -+ DisposeStreams(); - - m_pInput = NULL; - -@@ -562,6 +533,9 @@ void CDVDDemuxFFmpeg::Flush() - m_dllAvFormat.av_read_frame_flush(m_pFormatContext); - - m_iCurrentPts = DVD_NOPTS_VALUE; -+ -+ m_pkt.result = -1; -+ m_dllAvCodec.av_free_packet(&m_pkt.pkt); - } - - void CDVDDemuxFFmpeg::Abort() -@@ -637,7 +611,6 @@ double CDVDDemuxFFmpeg::ConvertTimestamp(int64_t pts, int den, int num) - - DemuxPacket* CDVDDemuxFFmpeg::Read() - { -- AVPacket pkt; - DemuxPacket* pPacket = NULL; - // on some cases where the received packet is invalid we will need to return an empty packet (0 length) otherwise the main loop (in CDVDPlayer) - // would consider this the end of stream and stop. -@@ -649,25 +622,39 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() - if(m_pFormatContext->pb) - m_pFormatContext->pb->eof_reached = 0; - -- // keep track if ffmpeg doesn't always set these -- pkt.size = 0; -- pkt.data = NULL; -- -- // timeout reads after 100ms -- m_timeout.Set(20000); -- int result = m_dllAvFormat.av_read_frame(m_pFormatContext, &pkt); -- m_timeout.SetInfinite(); -+ // check for saved packet after a program change -+ if (m_pkt.result < 0) -+ { -+ // keep track if ffmpeg doesn't always set these -+ m_pkt.pkt.size = 0; -+ m_pkt.pkt.data = NULL; -+ -+ // timeout reads after 100ms -+ m_timeout.Set(20000); -+ m_pkt.result = m_dllAvFormat.av_read_frame(m_pFormatContext, &m_pkt.pkt); -+ m_timeout.SetInfinite(); -+ } - -- if (result == AVERROR(EINTR) || result == AVERROR(EAGAIN)) -+ if (m_pkt.result == AVERROR(EINTR) || m_pkt.result == AVERROR(EAGAIN)) - { - // timeout, probably no real error, return empty packet - bReturnEmpty = true; - } -- else if (result < 0) -+ else if (m_pkt.result < 0) - { - Flush(); - } -- else if (pkt.size < 0 || !GetStreamInternal(pkt.stream_index)) -+ else if (IsProgramChange()) -+ { -+ // update streams -+ CreateStreams(m_program); -+ -+ pPacket = CDVDDemuxUtils::AllocateDemuxPacket(0); -+ pPacket->iStreamId = DMX_SPECIALID_STREAMCHANGE; -+ -+ return pPacket; -+ } -+ else if (m_pkt.pkt.size < 0 || !GetStreamInternal(m_pkt.pkt.stream_index)) - { - // XXX, in some cases ffmpeg returns a negative packet size - if(m_pFormatContext->pb && !m_pFormatContext->pb->eof_reached) -@@ -679,20 +666,21 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() - else - CLog::Log(LOGERROR, "CDVDDemuxFFmpeg::Read() returned invalid packet and eof reached"); - -- m_dllAvCodec.av_free_packet(&pkt); -+ m_pkt.result = -1; -+ m_dllAvCodec.av_free_packet(&m_pkt.pkt); - } - else - { -- AVStream *stream = m_pFormatContext->streams[pkt.stream_index]; -+ AVStream *stream = m_pFormatContext->streams[m_pkt.pkt.stream_index]; - - if (m_program != UINT_MAX) - { - /* check so packet belongs to selected program */ - for (unsigned int i = 0; i < m_pFormatContext->programs[m_program]->nb_stream_indexes; i++) - { -- if(pkt.stream_index == (int)m_pFormatContext->programs[m_program]->stream_index[i]) -+ if(m_pkt.pkt.stream_index == (int)m_pFormatContext->programs[m_program]->stream_index[i]) - { -- pPacket = CDVDDemuxUtils::AllocateDemuxPacket(pkt.size); -+ pPacket = CDVDDemuxUtils::AllocateDemuxPacket(m_pkt.pkt.size); - break; - } - } -@@ -701,17 +689,17 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() - bReturnEmpty = true; - } - else -- pPacket = CDVDDemuxUtils::AllocateDemuxPacket(pkt.size); -+ pPacket = CDVDDemuxUtils::AllocateDemuxPacket(m_pkt.pkt.size); - - if (pPacket) - { - // lavf sometimes bugs out and gives 0 dts/pts instead of no dts/pts - // since this could only happens on initial frame under normal - // circomstances, let's assume it is wrong all the time -- if(pkt.dts == 0) -- pkt.dts = AV_NOPTS_VALUE; -- if(pkt.pts == 0) -- pkt.pts = AV_NOPTS_VALUE; -+ if(m_pkt.pkt.dts == 0) -+ m_pkt.pkt.dts = AV_NOPTS_VALUE; -+ if(m_pkt.pkt.pts == 0) -+ m_pkt.pkt.pts = AV_NOPTS_VALUE; - - if(m_bMatroska && stream->codec && stream->codec->codec_type == AVMEDIA_TYPE_VIDEO) - { // matroska can store different timestamps -@@ -721,20 +709,20 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() - // sets these two timestamps equal all the - // time, so we select it here instead - if(stream->codec->codec_tag == 0) -- pkt.dts = AV_NOPTS_VALUE; -+ m_pkt.pkt.dts = AV_NOPTS_VALUE; - else -- pkt.pts = AV_NOPTS_VALUE; -+ m_pkt.pkt.pts = AV_NOPTS_VALUE; - } - - // we need to get duration slightly different for matroska embedded text subtitels -- if(m_bMatroska && stream->codec->codec_id == CODEC_ID_TEXT && pkt.convergence_duration != 0) -- pkt.duration = pkt.convergence_duration; -+ if(m_bMatroska && stream->codec->codec_id == CODEC_ID_TEXT && m_pkt.pkt.convergence_duration != 0) -+ m_pkt.pkt.duration = m_pkt.pkt.convergence_duration; - - if(m_bAVI && stream->codec && stream->codec->codec_type == AVMEDIA_TYPE_VIDEO) - { - // AVI's always have borked pts, specially if m_pFormatContext->flags includes - // AVFMT_FLAG_GENPTS so always use dts -- pkt.pts = AV_NOPTS_VALUE; -+ m_pkt.pkt.pts = AV_NOPTS_VALUE; - } - - if (!m_bPtsWrapChecked && m_pFormatContext->iformat->flags & AVFMT_TS_DISCONT) -@@ -756,15 +744,15 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() - } - - // copy contents into our own packet -- pPacket->iSize = pkt.size; -+ pPacket->iSize = m_pkt.pkt.size; - - // maybe we can avoid a memcpy here by detecting where pkt.destruct is pointing too? -- if (pkt.data) -- memcpy(pPacket->pData, pkt.data, pPacket->iSize); -+ if (m_pkt.pkt.data) -+ memcpy(pPacket->pData, m_pkt.pkt.data, pPacket->iSize); - -- pPacket->pts = ConvertTimestamp(pkt.pts, stream->time_base.den, stream->time_base.num); -- pPacket->dts = ConvertTimestamp(pkt.dts, stream->time_base.den, stream->time_base.num); -- pPacket->duration = DVD_SEC_TO_TIME((double)pkt.duration * stream->time_base.num / stream->time_base.den); -+ pPacket->pts = ConvertTimestamp(m_pkt.pkt.pts, stream->time_base.den, stream->time_base.num); -+ pPacket->dts = ConvertTimestamp(m_pkt.pkt.dts, stream->time_base.den, stream->time_base.num); -+ pPacket->duration = DVD_SEC_TO_TIME((double)m_pkt.pkt.duration * stream->time_base.num / stream->time_base.den); - - // used to guess streamlength - if (pPacket->dts != DVD_NOPTS_VALUE && (pPacket->dts > m_iCurrentPts || m_iCurrentPts == DVD_NOPTS_VALUE)) -@@ -772,10 +760,10 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() - - - // check if stream has passed full duration, needed for live streams -- if(pkt.dts != (int64_t)AV_NOPTS_VALUE) -+ if(m_pkt.pkt.dts != (int64_t)AV_NOPTS_VALUE) - { - int64_t duration; -- duration = pkt.dts; -+ duration = m_pkt.pkt.dts; - if(stream->start_time != (int64_t)AV_NOPTS_VALUE) - duration -= stream->start_time; - -@@ -789,9 +777,10 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() - } - } - -- pPacket->iStreamId = pkt.stream_index; // XXX just for now -+ pPacket->iStreamId = m_pkt.pkt.stream_index; // XXX just for now - } -- m_dllAvCodec.av_free_packet(&pkt); -+ m_pkt.result = -1; -+ m_dllAvCodec.av_free_packet(&m_pkt.pkt); - } - } - } // end of lock scope -@@ -839,6 +828,9 @@ bool CDVDDemuxFFmpeg::SeekTime(int time, bool backwords, double *startpts) - if(time < 0) - time = 0; - -+ m_pkt.result = -1; -+ m_dllAvCodec.av_free_packet(&m_pkt.pkt); -+ - CDVDInputStream::ISeekTime* ist = dynamic_cast(m_pInput); - if (ist) - { -@@ -1069,6 +1061,9 @@ bool CDVDDemuxFFmpeg::SeekByte(int64_t pos) - if(ret >= 0) - UpdateCurrentPTS(); - -+ m_pkt.result = -1; -+ m_dllAvCodec.av_free_packet(&m_pkt.pkt); -+ - return (ret >= 0); - } - -@@ -1142,6 +1137,59 @@ static double SelectAspect(AVStream* st, bool* forced) - return 0.0; - } - -+void CDVDDemuxFFmpeg::CreateStreams(unsigned int program) -+{ -+ DisposeStreams(); -+ -+ // add the ffmpeg streams to our own stream map -+ if (m_pFormatContext->nb_programs) -+ { -+ // check if desired program is available -+ if (program < m_pFormatContext->nb_programs && m_pFormatContext->programs[program]->nb_stream_indexes > 0) -+ { -+ m_program = program; -+ } -+ else -+ m_program = UINT_MAX; -+ -+ // look for first non empty stream and discard nonselected programs -+ for (unsigned int i = 0; i < m_pFormatContext->nb_programs; i++) -+ { -+ if(m_program == UINT_MAX && m_pFormatContext->programs[i]->nb_stream_indexes > 0) -+ { -+ m_program = i; -+ } -+ -+ if(i != m_program) -+ m_pFormatContext->programs[i]->discard = AVDISCARD_ALL; -+ } -+ if(m_program != UINT_MAX) -+ { -+ // add streams from selected program -+ for (unsigned int i = 0; i < m_pFormatContext->programs[m_program]->nb_stream_indexes; i++) -+ AddStream(m_pFormatContext->programs[m_program]->stream_index[i]); -+ } -+ } -+ else -+ m_program = UINT_MAX; -+ -+ // if there were no programs or they were all empty, add all streams -+ if (m_program == UINT_MAX) -+ { -+ for (unsigned int i = 0; i < m_pFormatContext->nb_streams; i++) -+ AddStream(i); -+ } -+} -+ -+void CDVDDemuxFFmpeg::DisposeStreams() -+{ -+ std::map::iterator it; -+ for(it = m_streams.begin(); it != m_streams.end(); ++it) -+ delete it->second; -+ m_streams.clear(); -+ m_stream_index.clear(); -+} -+ - void CDVDDemuxFFmpeg::AddStream(int iId) - { - AVStream* pStream = m_pFormatContext->streams[iId]; -@@ -1292,6 +1340,9 @@ void CDVDDemuxFFmpeg::AddStream(int iId) - } - } - -+ // set ffmpeg type -+ stream->orig_type = pStream->codec->codec_type; -+ - // generic stuff - if (pStream->duration != (int64_t)AV_NOPTS_VALUE) - stream->iDuration = (int)((pStream->duration / AV_TIME_BASE) & 0xFFFFFFFF); -@@ -1519,3 +1570,26 @@ void CDVDDemuxFFmpeg::GetStreamCodecName(int iStreamId, CStdString &strName) - strName = codec->name; - } - } -+ -+bool CDVDDemuxFFmpeg::IsProgramChange() -+{ -+ if (m_program == UINT_MAX) -+ return false; -+ -+ if(m_pFormatContext->programs[m_program]->nb_stream_indexes != m_streams.size()) -+ return true; -+ -+ if (m_program >= m_pFormatContext->nb_programs) -+ return true; -+ -+ for (unsigned int i = 0; i < m_pFormatContext->programs[m_program]->nb_stream_indexes; i++) -+ { -+ int idx = m_pFormatContext->programs[m_program]->stream_index[i]; -+ CDemuxStream *stream = GetStreamInternal(idx); -+ if(!stream) -+ return true; -+ if(m_pFormatContext->streams[idx]->codec->codec_type != stream->orig_type) -+ return true; -+ } -+ return false; -+} -diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h -index 353dfa4..f56712e 100644 ---- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h -+++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h -@@ -125,9 +125,12 @@ class CDVDDemuxFFmpeg : public CDVDDemux - void AddStream(int iId); - void AddStream(int iId, CDemuxStream* stream); - CDemuxStream* GetStreamInternal(int iStreamId); -+ void CreateStreams(unsigned int program = UINT_MAX); -+ void DisposeStreams(); - - double ConvertTimestamp(int64_t pts, int den, int num); - void UpdateCurrentPTS(); -+ bool IsProgramChange(); - - CCriticalSection m_critSection; - std::map m_streams; -@@ -148,5 +151,14 @@ class CDVDDemuxFFmpeg : public CDVDDemux - - bool m_bPtsWrap, m_bPtsWrapChecked; - int64_t m_iStartTime, m_iMaxTime, m_iEndTime; -+ -+ // Due to limitations of ffmpeg, we only can detect a program change -+ // with a packet. This struct saves the packet for the next read and -+ // signals STREAMCHANGE to player -+ struct -+ { -+ AVPacket pkt; // packet ffmpeg returned -+ int result; // result from av_read_packet -+ }m_pkt; +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 9952462d03415fc44777599d120481e908bd4802 Mon Sep 17 00:00:00 2001 +From: xbmc +Date: Tue, 30 Apr 2013 21:19:07 +0200 +Subject: [PATCH 109/111] 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 3b6b4cb579d4f8fb280f293c76f7f578d4bbd158 Mon Sep 17 00:00:00 2001 +From: xbmc +Date: Tue, 30 Apr 2013 21:40:55 +0200 +Subject: [PATCH 110/111] 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 fc2b41b85a221337684253949ef58db61d68d745 Mon Sep 17 00:00:00 2001 +From: xbmc +Date: Sat, 4 May 2013 10:31:32 +0200 +Subject: [PATCH 111/111] 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 e617f24..c1000f4 100644 +--- a/xbmc/settings/Settings.cpp ++++ b/xbmc/settings/Settings.cpp +@@ -744,6 +744,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 diff --git a/packages/mediacenter/xbmc/patches/83b16d0/xbmc-995.10-disable-alt-tab.patch b/packages/mediacenter/xbmc/patches/c68abb0/xbmc-995.10-disable-alt-tab.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/83b16d0/xbmc-995.10-disable-alt-tab.patch rename to packages/mediacenter/xbmc/patches/c68abb0/xbmc-995.10-disable-alt-tab.patch diff --git a/packages/mediacenter/xbmc/patches/83b16d0/xbmc-999.01-automake-1.13.patch b/packages/mediacenter/xbmc/patches/c68abb0/xbmc-999.01-automake-1.13.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/83b16d0/xbmc-999.01-automake-1.13.patch rename to packages/mediacenter/xbmc/patches/c68abb0/xbmc-999.01-automake-1.13.patch diff --git a/packages/mediacenter/xbmc/patches/83b16d0/xbmc-999.07-PR2572.patch b/packages/mediacenter/xbmc/patches/c68abb0/xbmc-999.07-PR2572.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/83b16d0/xbmc-999.07-PR2572.patch rename to packages/mediacenter/xbmc/patches/c68abb0/xbmc-999.07-PR2572.patch diff --git a/packages/mediacenter/xbmc/patches/83b16d0/xbmc-999.08-PR2572-1.patch b/packages/mediacenter/xbmc/patches/c68abb0/xbmc-999.08-PR2572-1.patch similarity index 100% rename from packages/mediacenter/xbmc/patches/83b16d0/xbmc-999.08-PR2572-1.patch rename to packages/mediacenter/xbmc/patches/c68abb0/xbmc-999.08-PR2572-1.patch