summaryrefslogtreecommitdiffstats
path: root/src/3rdparty
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/phonon/ds9/mediaobject.cpp34
-rw-r--r--src/3rdparty/phonon/ds9/mediaobject.h3
-rw-r--r--src/3rdparty/phonon/ds9/videowidget.cpp17
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp31
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/UString.h3
-rw-r--r--src/3rdparty/webkit/WebCore/WebCore.pro17
-rw-r--r--src/3rdparty/webkit/WebCore/plugins/win/PaintHooks.asm50
-rw-r--r--src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp46
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp2
9 files changed, 186 insertions, 17 deletions
diff --git a/src/3rdparty/phonon/ds9/mediaobject.cpp b/src/3rdparty/phonon/ds9/mediaobject.cpp
index b163ad4..22f1527 100644
--- a/src/3rdparty/phonon/ds9/mediaobject.cpp
+++ b/src/3rdparty/phonon/ds9/mediaobject.cpp
@@ -192,8 +192,11 @@ namespace Phonon
HRESULT hr = S_OK;
- m_currentRender = w.graph;
- m_currentRenderId = w.id;
+ {
+ QMutexLocker locker(&m_currentMutex);
+ m_currentRender = w.graph;
+ m_currentRenderId = w.id;
+ }
if (w.task == ReplaceGraph) {
int index = -1;
for(int i = 0; i < FILTER_COUNT; ++i) {
@@ -217,9 +220,6 @@ namespace Phonon
m_graphHandle[index].handle = h;
}
} else if (w.task == Render) {
- //we need to unlock here because the use might trigger a call to abort
- //which uses the same mutex
- locker.unlock();
if (w.filter) {
//let's render pins
w.graph->AddFilter(w.filter, 0);
@@ -238,7 +238,6 @@ namespace Phonon
if (hr != E_ABORT) {
emit asyncRenderFinished(w.id, hr, w.graph);
}
- locker.relock();
} else if (w.task == Seek) {
//that's a seekrequest
ComPointer<IMediaSeeking> mediaSeeking(w.graph, IID_IMediaSeeking);
@@ -311,12 +310,22 @@ namespace Phonon
}
}
- m_currentRender = Graph();
- m_currentRenderId = 0;
+ {
+ QMutexLocker locker(&m_currentMutex);
+ m_currentRender = Graph();
+ m_currentRenderId = 0;
+ }
}
void WorkerThread::abortCurrentRender(qint16 renderId)
{
+ {
+ QMutexLocker locker(&m_currentMutex);
+ if (m_currentRender && m_currentRenderId == renderId) {
+ m_currentRender->Abort();
+ }
+ }
+
QMutexLocker locker(&m_mutex);
bool found = false;
for(int i = 0; !found && i < m_queue.size(); ++i) {
@@ -324,12 +333,11 @@ namespace Phonon
if (w.id == renderId) {
found = true;
m_queue.removeAt(i);
+ if (m_queue.isEmpty()) {
+ m_waitCondition.reset();
+ }
}
}
-
- if (m_currentRender && m_currentRenderId == renderId) {
- m_currentRender->Abort();
- }
}
//tells the thread to stop processing
@@ -504,6 +512,8 @@ namespace Phonon
qSwap(m_graphs[0], m_graphs[1]); //swap the graphs
+ m_graphs[1]->stop(); //make sure we stop the previous graph
+
if (currentGraph()->mediaSource().type() != Phonon::MediaSource::Invalid &&
catchComError(currentGraph()->renderResult())) {
setState(Phonon::ErrorState);
diff --git a/src/3rdparty/phonon/ds9/mediaobject.h b/src/3rdparty/phonon/ds9/mediaobject.h
index fe52604..a6beb5f 100644
--- a/src/3rdparty/phonon/ds9/mediaobject.h
+++ b/src/3rdparty/phonon/ds9/mediaobject.h
@@ -143,7 +143,8 @@ namespace Phonon
bool m_finished;
quint16 m_currentWorkId;
QWinWaitCondition m_waitCondition;
- QMutex m_mutex;
+ QMutex m_mutex; // mutex for the m_queue, m_finished and m_currentWorkId
+ QMutex m_currentMutex; //mutex for current renderer and id
//this is for WaitForMultipleObjects
struct
diff --git a/src/3rdparty/phonon/ds9/videowidget.cpp b/src/3rdparty/phonon/ds9/videowidget.cpp
index 34ff8cb..091be16 100644
--- a/src/3rdparty/phonon/ds9/videowidget.cpp
+++ b/src/3rdparty/phonon/ds9/videowidget.cpp
@@ -84,7 +84,19 @@ namespace Phonon
void setCurrentRenderer(AbstractVideoRenderer *renderer)
{
m_currentRenderer = renderer;
- update();
+ //we disallow repaint on that widget for just a fraction of second
+ //this allows better transition between videos
+ setUpdatesEnabled(false);
+ m_flickerFreeTimer.start(20, this);
+ }
+
+ void timerEvent(QTimerEvent *e)
+ {
+ if (e->timerId() == m_flickerFreeTimer.timerId()) {
+ m_flickerFreeTimer.stop();
+ setUpdatesEnabled(true);
+ }
+ QWidget::timerEvent(e);
}
QSize sizeHint() const
@@ -106,6 +118,8 @@ namespace Phonon
void paintEvent(QPaintEvent *e)
{
+ if (!updatesEnabled())
+ return; //this avoids repaint from native events
checkCurrentRenderingMode();
m_currentRenderer->repaintCurrentFrame(this, e->rect());
}
@@ -160,6 +174,7 @@ namespace Phonon
VideoWidget *m_node;
AbstractVideoRenderer *m_currentRenderer;
QVariant m_restoreScreenSaverActive;
+ QBasicTimer m_flickerFreeTimer;
};
VideoWidget::VideoWidget(QWidget *parent)
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp
index 118751e..f64219c 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp
@@ -942,6 +942,37 @@ UString UString::from(int i)
return UString(p, static_cast<int>(end - p));
}
+#if PLATFORM(WIN_OS) && PLATFORM(X86_64) && COMPILER(MSVC)
+UString UString::from(int64_t i)
+{
+ UChar buf[1 + sizeof(i) * 3];
+ UChar* end = buf + sizeof(buf) / sizeof(UChar);
+ UChar* p = end;
+
+ if (i == 0)
+ *--p = '0';
+ else if (i == LLONG_MIN) {
+ char minBuf[1 + sizeof(i) * 3];
+ snprintf(minBuf, sizeof(minBuf) - 1, "%I64d", LLONG_MIN);
+ return UString(minBuf);
+ } else {
+ bool negative = false;
+ if (i < 0) {
+ negative = true;
+ i = -i;
+ }
+ while (i) {
+ *--p = static_cast<unsigned short>((i % 10) + '0');
+ i /= 10;
+ }
+ if (negative)
+ *--p = '-';
+ }
+
+ return UString(p, static_cast<int>(end - p));
+}
+#endif
+
UString UString::from(unsigned int u)
{
UChar buf[sizeof(u) * 3];
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/UString.h b/src/3rdparty/webkit/JavaScriptCore/runtime/UString.h
index d01b75d..f2572a9 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/UString.h
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/UString.h
@@ -256,6 +256,9 @@ namespace JSC {
}
static UString from(int);
+#if PLATFORM(WIN_OS) && PLATFORM(X86_64) && COMPILER(MSVC)
+ static UString from(int64_t i);
+#endif
static UString from(unsigned int);
static UString from(long);
static UString from(double);
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro
index 2eb7c08..68da1d6 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pro
+++ b/src/3rdparty/webkit/WebCore/WebCore.pro
@@ -3218,3 +3218,20 @@ CONFIG(QTDIR_build):isEqual(QT_MAJOR_VERSION, 4):greaterThan(QT_MINOR_VERSION, 4
CONFIG += no_debug_info
}
+!win32-g++:win32:contains(QMAKE_HOST.arch, x86_64):{
+ asm_compiler.commands = ml64 /c
+ asm_compiler.commands += /Fo ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
+ asm_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
+ asm_compiler.input = ASM_SOURCES
+ asm_compiler.variable_out = OBJECTS
+ asm_compiler.name = compiling[asm] ${QMAKE_FILE_IN}
+ silent:asm_compiler.commands = @echo compiling[asm] ${QMAKE_FILE_IN} && $$asm_compiler.commands
+ QMAKE_EXTRA_COMPILERS += asm_compiler
+
+ ASM_SOURCES += \
+ plugins/win/PaintHooks.asm
+ if(win32-msvc2005|win32-msvc2008):equals(TEMPLATE_PREFIX, "vc") {
+ SOURCES += \
+ plugins/win/PaintHooks.asm
+ }
+}
diff --git a/src/3rdparty/webkit/WebCore/plugins/win/PaintHooks.asm b/src/3rdparty/webkit/WebCore/plugins/win/PaintHooks.asm
new file mode 100644
index 0000000..1508813
--- /dev/null
+++ b/src/3rdparty/webkit/WebCore/plugins/win/PaintHooks.asm
@@ -0,0 +1,50 @@
+;/*
+; Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+;
+; This library is free software; you can redistribute it and/or
+; modify it under the terms of the GNU Library General Public
+; License as published by the Free Software Foundation; either
+; version 2 of the License, or (at your option) any later version.
+;
+; This library is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+; Library General Public License for more details.
+;
+; You should have received a copy of the GNU Library General Public License
+; along with this library; see the file COPYING.LIB. If not, write to
+; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+; Boston, MA 02110-1301, USA.
+;*/
+
+;HDC __stdcall _HBeginPaint(HWND hWnd, LPPAINTSTRUCT lpPaint);
+
+PUBLIC _HBeginPaint
+
+_TEXT SEGMENT
+
+_HBeginPaint PROC
+ mov r10,rcx
+ mov eax,1017h
+ syscall
+ ret
+_HBeginPaint ENDP
+
+_TEXT ENDS
+
+;BOOL __stdcall _HEndPaint(HWND hWnd, const PAINTSTRUCT* lpPaint);
+
+PUBLIC _HEndPaint
+
+_TEXT SEGMENT
+
+_HEndPaint PROC
+ mov r10,rcx
+ mov eax,1019h
+ syscall
+ ret
+_HEndPaint ENDP
+
+_TEXT ENDS
+
+END
diff --git a/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp b/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp
index c97984d..2687186 100644
--- a/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp
+++ b/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp
@@ -117,6 +117,14 @@ static BYTE* beginPaint;
static unsigned endPaintSysCall;
static BYTE* endPaint;
+typedef HDC (WINAPI *PtrBeginPaint)(HWND, PAINTSTRUCT*);
+typedef BOOL (WINAPI *PtrEndPaint)(HWND, const PAINTSTRUCT*);
+
+#if PLATFORM(WIN_OS) && PLATFORM(X86_64) && COMPILER(MSVC)
+extern "C" HDC __stdcall _HBeginPaint(HWND hWnd, LPPAINTSTRUCT lpPaint);
+extern "C" BOOL __stdcall _HEndPaint(HWND hWnd, const PAINTSTRUCT* lpPaint);
+#endif
+
HDC WINAPI PluginView::hookedBeginPaint(HWND hWnd, PAINTSTRUCT* lpPaint)
{
PluginView* pluginView = reinterpret_cast<PluginView*>(GetProp(hWnd, kWebPluginViewProperty));
@@ -139,12 +147,14 @@ HDC WINAPI PluginView::hookedBeginPaint(HWND hWnd, PAINTSTRUCT* lpPaint)
: "memory"
);
return result;
-#else
+#elif defined(_M_IX86)
// Call through to the original BeginPaint.
__asm mov eax, beginPaintSysCall
__asm push lpPaint
__asm push hWnd
__asm call beginPaint
+#else
+ return _HBeginPaint(hWnd, lpPaint);
#endif
}
@@ -166,12 +176,14 @@ BOOL WINAPI PluginView::hookedEndPaint(HWND hWnd, const PAINTSTRUCT* lpPaint)
: "a" (endPaintSysCall), "g" (lpPaint), "g" (hWnd), "m" (*endPaint)
);
return result;
-#else
+#elif defined (_M_IX86)
// Call through to the original EndPaint.
__asm mov eax, endPaintSysCall
__asm push lpPaint
__asm push hWnd
__asm call endPaint
+#else
+ return _HEndPaint(hWnd, lpPaint);
#endif
}
@@ -184,6 +196,7 @@ static void hook(const char* module, const char* proc, unsigned& sysCallID, BYTE
pProc = reinterpret_cast<BYTE*>(reinterpret_cast<ptrdiff_t>(GetProcAddress(hMod, proc)));
+#if COMPILER(GCC) || defined(_M_IX86)
if (pProc[0] != 0xB8)
return;
@@ -199,6 +212,35 @@ static void hook(const char* module, const char* proc, unsigned& sysCallID, BYTE
*reinterpret_cast<unsigned*>(pProc + 1) = reinterpret_cast<intptr_t>(pNewProc) - reinterpret_cast<intptr_t>(pProc + 5);
pProc += 5;
+#else
+ /* Disassembly of BeginPaint()
+ 00000000779FC5B0 4C 8B D1 mov r10,rcx
+ 00000000779FC5B3 B8 17 10 00 00 mov eax,1017h
+ 00000000779FC5B8 0F 05 syscall
+ 00000000779FC5BA C3 ret
+ 00000000779FC5BB 90 nop
+ 00000000779FC5BC 90 nop
+ 00000000779FC5BD 90 nop
+ 00000000779FC5BE 90 nop
+ 00000000779FC5BF 90 nop
+ 00000000779FC5C0 90 nop
+ 00000000779FC5C1 90 nop
+ 00000000779FC5C2 90 nop
+ 00000000779FC5C3 90 nop
+ */
+ // Check for the signature as in the above disassembly
+ DWORD guard = 0xB8D18B4C;
+ if (*reinterpret_cast<DWORD*>(pProc) != guard)
+ return;
+
+ DWORD flOldProtect;
+ VirtualProtect(pProc, 12, PAGE_EXECUTE_READWRITE, & flOldProtect);
+ pProc[0] = 0x48; // mov rax, this
+ pProc[1] = 0xb8;
+ *(__int64*)(pProc+2) = (__int64)pNewProc;
+ pProc[10] = 0xff; // jmp rax
+ pProc[11] = 0xe0;
+#endif
}
static void setUpOffscreenPaintingHooks(HDC (WINAPI*hookedBeginPaint)(HWND, PAINTSTRUCT*), BOOL (WINAPI*hookedEndPaint)(HWND, const PAINTSTRUCT*))
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
index 1a45fe6..613a72f 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
@@ -105,7 +105,7 @@ void QWEBKIT_EXPORT qt_drt_overwritePluginDirectories()
PluginDatabase* db = PluginDatabase::installedPlugins(/* populate */ false);
Vector<String> paths;
- String qtPath(getenv("QTWEBKIT_PLUGIN_PATH"));
+ String qtPath(qgetenv("QTWEBKIT_PLUGIN_PATH").data());
qtPath.split(UChar(':'), /* allowEmptyEntries */ false, paths);
db->setPluginDirectories(paths);