From 8d361b078d844aab38657fdd898d6d85130b019f Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Tue, 13 Dec 2011 14:06:09 +0100 Subject: [PATCH] xbmc: update XVBA patches Signed-off-by: Stephan Raue --- ...31f741bc32f75374a698b9a39b387c9aa0ab.patch | 240 ++++-------------- 1 file changed, 56 insertions(+), 184 deletions(-) diff --git a/packages/mediacenter/xbmc/patches/xbmc-f3b0020-901-xvba_support-e8d631f741bc32f75374a698b9a39b387c9aa0ab.patch b/packages/mediacenter/xbmc/patches/xbmc-f3b0020-901-xvba_support-e8d631f741bc32f75374a698b9a39b387c9aa0ab.patch index 40bf2c2f94..0629cb582c 100644 --- a/packages/mediacenter/xbmc/patches/xbmc-f3b0020-901-xvba_support-e8d631f741bc32f75374a698b9a39b387c9aa0ab.patch +++ b/packages/mediacenter/xbmc/patches/xbmc-f3b0020-901-xvba_support-e8d631f741bc32f75374a698b9a39b387c9aa0ab.patch @@ -1,5 +1,5 @@ diff --git a/configure.in b/configure.in -index bca9239..66ccbcd 100755 +index e7045ba..e495665 100755 --- a/configure.in +++ b/configure.in @@ -98,6 +98,8 @@ vaapi_not_found="== Could not find libva. VAAPI support disabled. ==" @@ -76,7 +76,7 @@ index bca9239..66ccbcd 100755 if test "x$use_vdadecoder" != "xno"; then final_message="$final_message\n VDADecoder:\tYes" else -@@ -1943,6 +1989,7 @@ AC_SUBST(USE_OPENGLES) +@@ -1951,6 +1997,7 @@ AC_SUBST(USE_OPENGLES) AC_SUBST(USE_VDPAU) AC_SUBST(USE_VAAPI) AC_SUBST(USE_CRYSTALHD) @@ -84,7 +84,7 @@ index bca9239..66ccbcd 100755 AC_SUBST(USE_LIBSMBCLIENT) AC_SUBST(USE_LIBNFS) AC_SUBST(USE_LIBAFPCLIENT) -@@ -2085,6 +2132,7 @@ XB_CONFIG_MODULE([lib/ffmpeg], [ +@@ -2093,6 +2140,7 @@ XB_CONFIG_MODULE([lib/ffmpeg], [ --enable-gpl \ `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` \ @@ -93,10 +93,10 @@ index bca9239..66ccbcd 100755 --enable-pthreads \ --enable-runtime-cpudetect \ diff --git a/language/English/strings.xml b/language/English/strings.xml -index 73405bf..58887a4 100644 +index 1b2afe5..7b1b58d 100644 --- a/language/English/strings.xml +++ b/language/English/strings.xml -@@ -1230,6 +1230,8 @@ +@@ -1232,6 +1232,8 @@ Allow hardware acceleration (OpenMax) Pixel Shaders Allow hardware acceleration (VideoToolbox) @@ -963,10 +963,10 @@ index 8ec91c8..4803dd7 100644 PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0 PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0 diff --git a/xbmc/ApplicationMessenger.cpp b/xbmc/ApplicationMessenger.cpp -index adc89af..b5c6b1a 100644 +index b43f765..e68c630 100644 --- a/xbmc/ApplicationMessenger.cpp +++ b/xbmc/ApplicationMessenger.cpp -@@ -70,7 +70,7 @@ +@@ -72,7 +72,7 @@ using namespace std; @@ -3414,7 +3414,7 @@ index 0000000..f5c8a32 + +} diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index bb88c74..f5fd833 100644 +index 036d31d..86a4bdd 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp @@ -19,7 +19,6 @@ @@ -3425,7 +3425,7 @@ index bb88c74..f5fd833 100644 #include "system.h" #ifndef __STDC_CONSTANT_MACROS #define __STDC_CONSTANT_MACROS -@@ -43,6 +42,7 @@ +@@ -44,6 +43,7 @@ #include "filesystem/Directory.h" #include "utils/log.h" #include "threads/Thread.h" @@ -3433,7 +3433,7 @@ index bb88c74..f5fd833 100644 #include "utils/TimeUtils.h" void CDemuxStreamAudioFFmpeg::GetStreamInfo(std::string& strInfo) -@@ -152,16 +152,12 @@ static void ff_flush_avutil_log_buffers(void) +@@ -153,16 +153,12 @@ static void ff_flush_avutil_log_buffers(void) ++it; } @@ -3453,7 +3453,7 @@ index bb88c74..f5fd833 100644 return 1; return 0; } -@@ -233,7 +229,7 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) +@@ -234,7 +230,7 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) std::string strFile; m_iCurrentPts = DVD_NOPTS_VALUE; m_speed = DVD_PLAYSPEED_NORMAL; @@ -3462,7 +3462,7 @@ index bb88c74..f5fd833 100644 m_program = UINT_MAX; if (!pInput) return false; -@@ -505,7 +501,7 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) +@@ -506,7 +502,7 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) void CDVDDemuxFFmpeg::Dispose() { @@ -3471,7 +3471,7 @@ index bb88c74..f5fd833 100644 if (m_pFormatContext) { -@@ -554,7 +550,7 @@ void CDVDDemuxFFmpeg::Reset() +@@ -555,7 +551,7 @@ void CDVDDemuxFFmpeg::Reset() void CDVDDemuxFFmpeg::Flush() { @@ -3480,7 +3480,7 @@ index bb88c74..f5fd833 100644 // naughty usage of an internal ffmpeg function if (m_pFormatContext) -@@ -570,7 +566,7 @@ void CDVDDemuxFFmpeg::Abort() +@@ -571,7 +567,7 @@ void CDVDDemuxFFmpeg::Abort() void CDVDDemuxFFmpeg::SetSpeed(int iSpeed) { @@ -3489,7 +3489,7 @@ index bb88c74..f5fd833 100644 if(!m_pFormatContext) return; -@@ -632,7 +628,7 @@ double CDVDDemuxFFmpeg::ConvertTimestamp(int64_t pts, int den, int num) +@@ -633,7 +629,7 @@ double CDVDDemuxFFmpeg::ConvertTimestamp(int64_t pts, int den, int num) DemuxPacket* CDVDDemuxFFmpeg::Read() { @@ -3498,7 +3498,7 @@ index bb88c74..f5fd833 100644 AVPacket pkt; DemuxPacket* pPacket = NULL; -@@ -831,7 +827,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() +@@ -832,7 +828,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() bool CDVDDemuxFFmpeg::SeekTime(int time, bool backwords, double *startpts) { @@ -3507,7 +3507,7 @@ index bb88c74..f5fd833 100644 if(time < 0) time = 0; -@@ -891,7 +887,7 @@ bool CDVDDemuxFFmpeg::SeekTime(int time, bool backwords, double *startpts) +@@ -892,7 +888,7 @@ bool CDVDDemuxFFmpeg::SeekTime(int time, bool backwords, double *startpts) bool CDVDDemuxFFmpeg::SeekByte(__int64 pos) { @@ -3608,10 +3608,10 @@ index 2f0b5ac..e97a14c 100644 CDVDMessageQueue* m_pAudioQueue; CDVDMessageQueue* m_pVideoQueue; diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 6061909..af6175e 100644 +index 568ed10..abfdf2b 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -341,7 +341,7 @@ bool CDVDPlayer::OpenFile(const CFileItem& file, const CPlayerOptions &options) +@@ -348,7 +348,7 @@ bool CDVDPlayer::OpenFile(const CFileItem& file, const CPlayerOptions &options) // if playing a file close it first // this has to be changed so we won't have to close it. @@ -3620,7 +3620,7 @@ index 6061909..af6175e 100644 CloseFile(); m_bAbortRequest = false; -@@ -432,7 +432,7 @@ void CDVDPlayer::OnStartup() +@@ -440,7 +440,7 @@ void CDVDPlayer::OnStartup() m_messenger.Init(); @@ -3629,7 +3629,7 @@ index 6061909..af6175e 100644 CUtil::ClearTempFonts(); } -@@ -2710,7 +2710,7 @@ bool CDVDPlayer::OpenAudioStream(int iStream, int source) +@@ -2884,7 +2884,7 @@ bool CDVDPlayer::OpenAudioStream(int iStream, int source) m_dvdPlayerAudio.SendMessage(new CDVDMsg(CDVDMsg::PLAYER_STARTED), 1); /* audio normally won't consume full cpu, so let it have prio */ @@ -3638,7 +3638,7 @@ index 6061909..af6175e 100644 return true; } -@@ -2772,11 +2772,11 @@ bool CDVDPlayer::OpenVideoStream(int iStream, int source) +@@ -2946,11 +2946,11 @@ bool CDVDPlayer::OpenVideoStream(int iStream, int source) // the CoreAudio audio device handler thread. We do the same for // the DVDPlayerVideo thread so it can run to sleep without getting // swapped out by a busy OS. @@ -5226,11 +5226,23 @@ index e61aa23..1ea4b9c 100644 { //save current thread priority and set thread priority to THREAD_PRIORITY_TIME_CRITICAL int priority = GetThreadPriority(GetCurrentThread()); +diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h +index 927341b..a2f3f5a 100644 +--- a/xbmc/settings/AdvancedSettings.h ++++ b/xbmc/settings/AdvancedSettings.h +@@ -34,6 +34,7 @@ struct DatabaseSettings + CStdString user; + CStdString pass; + CStdString name; ++ DatabaseSettings() : type(""), host(""), port(""), user(""), pass(""), name("") {;}; + }; + + struct TVShowRegexp diff --git a/xbmc/settings/GUISettings.cpp b/xbmc/settings/GUISettings.cpp -index b87ab67..3084ae9 100644 +index a36ef58..4f1e329 100644 --- a/xbmc/settings/GUISettings.cpp +++ b/xbmc/settings/GUISettings.cpp -@@ -587,6 +587,10 @@ void CGUISettings::Initialize() +@@ -592,6 +592,10 @@ void CGUISettings::Initialize() #ifdef HAVE_LIBVA AddBool(vp, "videoplayer.usevaapi", 13426, true); #endif @@ -5242,10 +5254,10 @@ index b87ab67..3084ae9 100644 AddBool(g_sysinfo.IsVistaOrHigher() ? vp: NULL, "videoplayer.usedxva2", 13427, false); #endif diff --git a/xbmc/settings/GUIWindowSettingsCategory.cpp b/xbmc/settings/GUIWindowSettingsCategory.cpp -index d262f50..fb40609 100644 +index 596967c..15db1bc 100644 --- a/xbmc/settings/GUIWindowSettingsCategory.cpp +++ b/xbmc/settings/GUIWindowSettingsCategory.cpp -@@ -931,6 +931,15 @@ void CGUIWindowSettingsCategory::UpdateSettings() +@@ -946,6 +946,15 @@ void CGUIWindowSettingsCategory::UpdateSettings() pControl->SetEnabled(enabled); } } @@ -6924,165 +6936,25 @@ index 56856ac..8aa7da9 100644 { m_hwnd = NULL; m_hProcess = NULL; -diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp -index 62cf554..eb02e9a 100644 ---- a/xbmc/windowing/X11/WinSystemX11.cpp -+++ b/xbmc/windowing/X11/WinSystemX11.cpp -@@ -139,8 +139,14 @@ bool CWinSystemX11::CreateNewWindow(const CStdString& name, bool fullScreen, RES - // register XRandR Events - #if defined(HAS_XRANDR) - int iReturn; -+#if defined(HAS_SDL) -+ m_info.info.x11.lock_func(); -+#endif - XRRQueryExtension(m_dpy, &m_RREventBase, &iReturn); - XRRSelectInput(m_dpy, m_wmWindow, RRScreenChangeNotifyMask); -+#if defined(HAS_SDL) -+ m_info.info.x11.unlock_func(); -+#endif - #endif +diff --git a/xbmc/windowing/WinEventsSDL.cpp b/xbmc/windowing/WinEventsSDL.cpp +index afff390..2e8b869 100644 +--- a/xbmc/windowing/WinEventsSDL.cpp ++++ b/xbmc/windowing/WinEventsSDL.cpp +@@ -216,8 +216,16 @@ bool CWinEventsSDL::MessagePump() + SDL_Event event; + bool ret = false; - m_bWindowCreated = true; -@@ -190,7 +196,12 @@ bool CWinSystemX11::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl - mode.h = res.iHeight; - mode.hz = res.fRefreshRate; - mode.id = res.strId; -- -+ -+#if defined(HAS_SDL) -+ if (m_SDLSurface) -+ m_info.info.x11.lock_func(); -+#endif -+ - if(m_bFullScreen) +- while (SDL_PollEvent(&event)) ++ while (1) { - OnLostDevice(); -@@ -198,6 +209,11 @@ bool CWinSystemX11::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl - } - else - g_xrandr.RestoreState(); -+ -+#if defined(HAS_SDL) -+ if (m_SDLSurface) -+ m_info.info.x11.unlock_func(); ++ { ++#if defined(HAS_GLX) ++ CSingleLock lock(g_graphicsContext); +#endif - #endif - - int options = SDL_OPENGL; -@@ -316,30 +332,33 @@ bool CWinSystemX11::IsSuitableVisual(XVisualInfo *vInfo) - bool CWinSystemX11::RefreshGlxContext() - { - bool retVal = false; -- SDL_SysWMinfo info; -- SDL_VERSION(&info.version); -- if (SDL_GetWMInfo(&info) <= 0) -+ SDL_VERSION(&m_info.version); -+ if (SDL_GetWMInfo(&m_info) <= 0) - { - CLog::Log(LOGERROR, "Failed to get window manager info from SDL"); - return false; - } - -- if(m_glWindow == info.info.x11.window && m_glContext) -+ if(m_glWindow == m_info.info.x11.window && m_glContext) - { - CLog::Log(LOGERROR, "GLX: Same window as before, refreshing context"); -+ m_info.info.x11.lock_func(); - glXMakeCurrent(m_dpy, None, NULL); - glXMakeCurrent(m_dpy, m_glWindow, m_glContext); -+ m_info.info.x11.unlock_func(); - return true; - } - -+ m_info.info.x11.lock_func(); ++ if (!SDL_PollEvent(&event)) ++ break; ++ } + - XVisualInfo vMask; - XVisualInfo *visuals; - XVisualInfo *vInfo = NULL; - int availableVisuals = 0; - vMask.screen = DefaultScreen(m_dpy); - XWindowAttributes winAttr; -- m_glWindow = info.info.x11.window; -- m_wmWindow = info.info.x11.wmwindow; -+ m_glWindow = m_info.info.x11.window; -+ m_wmWindow = m_info.info.x11.wmwindow; - - /* Assume a depth of 24 in case the below calls to XGetWindowAttributes() - or XGetVisualInfo() fail. That shouldn't happen unless something is -@@ -405,6 +424,8 @@ bool CWinSystemX11::RefreshGlxContext() - else - CLog::Log(LOGERROR, "GLX Error: vInfo is NULL!"); - -+ m_info.info.x11.unlock_func(); -+ - return retVal; - } - -@@ -471,6 +492,7 @@ void CWinSystemX11::CheckDisplayEvents() - bool bGotEvent(false); - bool bTimeout(false); - XEvent Event; -+ - while (XCheckTypedEvent(m_dpy, m_RREventBase + RRScreenChangeNotify, &Event)) - { - if (Event.type == m_RREventBase + RRScreenChangeNotify) -@@ -501,6 +523,7 @@ void CWinSystemX11::CheckDisplayEvents() - // reset fail safe timer - m_dpyLostTime = 0; - } -+ - #endif - } - -diff --git a/xbmc/windowing/X11/WinSystemX11.h b/xbmc/windowing/X11/WinSystemX11.h -index 5b941be..4f1f2ae 100644 ---- a/xbmc/windowing/X11/WinSystemX11.h -+++ b/xbmc/windowing/X11/WinSystemX11.h -@@ -28,6 +28,10 @@ - #include - #include "threads/CriticalSection.h" - -+#ifdef HAS_SDL -+#include -+#endif -+ - class IDispResource; - - class CWinSystemX11 : public CWinSystemBase -@@ -66,7 +70,10 @@ protected: - void CheckDisplayEvents(); - void OnLostDevice(); - -+#ifdef HAS_SDL - SDL_Surface* m_SDLSurface; -+ SDL_SysWMinfo m_info; -+#endif - GLXContext m_glContext; - GLXWindow m_glWindow; - Window m_wmWindow; -diff --git a/xbmc/windowing/X11/WinSystemX11GL.cpp b/xbmc/windowing/X11/WinSystemX11GL.cpp -index ec02b10..1a10104 100644 ---- a/xbmc/windowing/X11/WinSystemX11GL.cpp -+++ b/xbmc/windowing/X11/WinSystemX11GL.cpp -@@ -43,6 +43,10 @@ CWinSystemX11GL::~CWinSystemX11GL() - - bool CWinSystemX11GL::PresentRenderImpl(const CDirtyRegionList& dirty) - { -+#if defined(HAS_SDL) -+ m_info.info.x11.lock_func(); -+#endif -+ - CheckDisplayEvents(); - - if(m_iVSyncMode == 3) -@@ -119,6 +123,10 @@ bool CWinSystemX11GL::PresentRenderImpl(const CDirtyRegionList& dirty) - else - glXSwapBuffers(m_dpy, m_glWindow); - -+#if defined(HAS_SDL) -+ m_info.info.x11.unlock_func(); -+#endif -+ - return true; - } - + switch(event.type) + { + case SDL_QUIT: