diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-12-02 13:31:07 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-12-02 13:31:07 (GMT) |
commit | f29f1bb287c6b39bd1270802d1579f1c1d53f905 (patch) | |
tree | f903e18b163591c3590473e4a117a3c8958d8847 /src/3rdparty | |
parent | 271936b063fb261293e3f77f7a2273e3a4dbb5d6 (diff) | |
parent | 25023911295c201758faaa2c800b2388ddf1e0b0 (diff) | |
download | Qt-f29f1bb287c6b39bd1270802d1579f1c1d53f905.zip Qt-f29f1bb287c6b39bd1270802d1579f1c1d53f905.tar.gz Qt-f29f1bb287c6b39bd1270802d1579f1c1d53f905.tar.bz2 |
Merge commit 'upstream/4.6' into 4.6
Diffstat (limited to 'src/3rdparty')
-rw-r--r-- | src/3rdparty/javascriptcore/JavaScriptCore/wtf/TypeTraits.h | 2 | ||||
-rw-r--r-- | src/3rdparty/javascriptcore/WebKit.pri | 2 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/mmf_videoplayer.cpp | 73 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/mmf_videoplayer.h | 7 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/objectdump_symbian.cpp | 2 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/videooutput.cpp | 23 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/videooutput.h | 6 |
7 files changed, 102 insertions, 13 deletions
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/TypeTraits.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/TypeTraits.h index 56659a8..c03e8a7 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/TypeTraits.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/TypeTraits.h @@ -155,7 +155,7 @@ namespace WTF { typedef IntegralConstant<bool, true> true_type; typedef IntegralConstant<bool, false> false_type; -#if defined(_MSC_VER) && (_MSC_VER >= 1400) +#if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(__INTEL_COMPILER) // VC8 (VS2005) and later have built-in compiler support for HasTrivialConstructor / HasTrivialDestructor, // but for some unexplained reason it doesn't work on built-in types. template <typename T> struct HasTrivialConstructor : public IntegralConstant<bool, __has_trivial_constructor(T)>{ }; diff --git a/src/3rdparty/javascriptcore/WebKit.pri b/src/3rdparty/javascriptcore/WebKit.pri index 8291f30..16f89bf 100644 --- a/src/3rdparty/javascriptcore/WebKit.pri +++ b/src/3rdparty/javascriptcore/WebKit.pri @@ -11,7 +11,7 @@ isEmpty(OUTPUT_DIR) { DEFINES += BUILDING_QT__=1 building-libs { - win32-msvc*: INCLUDEPATH += $$PWD/JavaScriptCore/os-win32 + win32-msvc*|win32-icc: INCLUDEPATH += $$PWD/JavaScriptCore/os-win32 } else { CONFIG(QTDIR_build) { QT += webkit diff --git a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp index 2059fbe..b6f53ae 100644 --- a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp +++ b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp @@ -50,6 +50,8 @@ MMF::VideoPlayer::VideoPlayer() , m_window(0) , m_totalTime(0) , m_pendingChanges(false) + , m_dsaActive(false) + , m_dsaWasActive(false) { construct(); } @@ -61,6 +63,7 @@ MMF::VideoPlayer::VideoPlayer(const AbstractPlayer& player) , m_window(0) , m_totalTime(0) , m_pendingChanges(false) + , m_dsaActive(false) { construct(); } @@ -86,6 +89,9 @@ void MMF::VideoPlayer::construct() )) ); + // CVideoPlayerUtility::NewL starts DSA + m_dsaActive = true; + if (KErrNone != err) changeState(ErrorState); @@ -315,8 +321,7 @@ void MMF::VideoPlayer::getVideoWindow() m_videoOutput->dump(); initVideoOutput(); - m_window = m_videoOutput->videoWindow(); - updateVideoRect(); + videoWindowChanged(); } else // Top-level window m_window = QApplication::activeWindow()->effectiveWinId()->DrawableWindow(); @@ -349,6 +354,18 @@ void MMF::VideoPlayer::initVideoOutput() Q_ASSERT(connected); connected = connect( + m_videoOutput, SIGNAL(beginVideoWindowNativePaint()), + this, SLOT(suspendDirectScreenAccess()) + ); + Q_ASSERT(connected); + + connected = connect( + m_videoOutput, SIGNAL(endVideoWindowNativePaint()), + this, SLOT(resumeDirectScreenAccess()) + ); + Q_ASSERT(connected); + + connected = connect( m_videoOutput, SIGNAL(aspectRatioChanged()), this, SLOT(aspectRatioChanged()) ); @@ -370,12 +387,48 @@ void MMF::VideoPlayer::videoWindowChanged() TRACE_ENTRY("state %d", state()); m_window = m_videoOutput->videoWindow(); - updateVideoRect(); TRACE_EXIT_0(); } +void MMF::VideoPlayer::suspendDirectScreenAccess() +{ + m_dsaWasActive = stopDirectScreenAccess(); +} + +void MMF::VideoPlayer::resumeDirectScreenAccess() +{ + if(m_dsaWasActive) { + startDirectScreenAccess(); + m_dsaWasActive = false; + } +} + +void MMF::VideoPlayer::startDirectScreenAccess() +{ + if(!m_dsaActive) { + TRAPD(err, m_player->StartDirectScreenAccessL()); + if(KErrNone == err) + m_dsaActive = true; + else + setError(NormalError); + } +} + +bool MMF::VideoPlayer::stopDirectScreenAccess() +{ + const bool dsaWasActive = m_dsaActive; + if(m_dsaActive) { + TRAPD(err, m_player->StopDirectScreenAccessL()); + if(KErrNone == err) + m_dsaActive = false; + else + setError(NormalError); + } + return dsaWasActive; +} + // Helper function for aspect ratio / scale mode handling QSize scaleToAspect(const QSize& srcRect, int aspectWidth, int aspectHeight) { @@ -393,7 +446,18 @@ QSize scaleToAspect(const QSize& srcRect, int aspectWidth, int aspectHeight) void MMF::VideoPlayer::updateVideoRect() { QRect videoRect; - const QRect windowRect = m_videoOutput->videoWindowRect(); + QRect windowRect = m_videoOutput->videoWindowRect(); + + // Clip to physical window size + // This is due to a defect in the layout when running on S60 3.2, which + // results in the rectangle of the video widget extending outside the + // screen in certain circumstances. These include the initial startup + // of the mediaplayer demo in portrait mode. When this rectangle is + // passed to the CVideoPlayerUtility, no video is rendered. + const TSize screenSize = m_screenDevice.SizeInPixels(); + const QRect screenRect(0, 0, screenSize.iWidth, screenSize.iHeight); + windowRect = windowRect.intersected(screenRect); + const QSize windowSize = windowRect.size(); // Calculate size of smallest rect which contains video frame size @@ -553,6 +617,7 @@ void MMF::VideoPlayer::applyVideoWindowChange() TRACE("SetDisplayWindowL err %d", err); setError(NormalError); } else { + m_dsaActive = true; TRAP(err, m_player->SetScaleFactorL(m_scaleWidth, m_scaleHeight, antialias)); if(KErrNone != err) { TRACE("SetScaleFactorL (2) err %d", err); diff --git a/src/3rdparty/phonon/mmf/mmf_videoplayer.h b/src/3rdparty/phonon/mmf/mmf_videoplayer.h index 599bb88..abb1da8 100644 --- a/src/3rdparty/phonon/mmf/mmf_videoplayer.h +++ b/src/3rdparty/phonon/mmf/mmf_videoplayer.h @@ -72,6 +72,8 @@ public Q_SLOTS: void videoWindowChanged(); void aspectRatioChanged(); void scaleModeChanged(); + void suspendDirectScreenAccess(); + void resumeDirectScreenAccess(); private: void construct(); @@ -89,6 +91,9 @@ private: void applyPendingChanges(); void applyVideoWindowChange(); + void startDirectScreenAccess(); + bool stopDirectScreenAccess(); + // AbstractMediaPlayer virtual int numberOfMetaDataEntries() const; virtual QPair<QString, QString> metaDataEntry(int index) const; @@ -111,6 +116,8 @@ private: qint64 m_totalTime; bool m_pendingChanges; + bool m_dsaActive; + bool m_dsaWasActive; }; diff --git a/src/3rdparty/phonon/mmf/objectdump_symbian.cpp b/src/3rdparty/phonon/mmf/objectdump_symbian.cpp index 2efebdb..edad537 100644 --- a/src/3rdparty/phonon/mmf/objectdump_symbian.cpp +++ b/src/3rdparty/phonon/mmf/objectdump_symbian.cpp @@ -46,7 +46,7 @@ QList<QByteArray> QAnnotatorWidget::annotation(const QObject& object) stream << "widget (Symbian): "; stream << "activated " << extra->activated << ' '; - stream << "disableBlit " << extra->disableBlit << ' '; + stream << "nativePaintMode " << extra->nativePaintMode << ' '; stream.flush(); result.append(array); diff --git a/src/3rdparty/phonon/mmf/videooutput.cpp b/src/3rdparty/phonon/mmf/videooutput.cpp index ddf30de..119dcb1 100644 --- a/src/3rdparty/phonon/mmf/videooutput.cpp +++ b/src/3rdparty/phonon/mmf/videooutput.cpp @@ -34,6 +34,8 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. #include <coecntrl.h> +#include <coemain.h> // for CCoeEnv + QT_BEGIN_NAMESPACE using namespace Phonon; @@ -72,12 +74,8 @@ MMF::VideoOutput::VideoOutput setAttribute(Qt::WA_NoSystemBackground, true); setAutoFillBackground(false); - // Causes QSymbianControl::Draw not to BitBlt this widget's region of the - // backing store. Since the backing store is (by default) a 16MU bitmap, - // blitting it results in this widget's screen region in the final - // framebuffer having opaque alpha values. This in turn causes the video - // to be invisible when running on the target device. - qt_widget_private(this)->extraData()->disableBlit = true; + qt_widget_private(this)->extraData()->nativePaintMode = QWExtra::ZeroFill; + qt_widget_private(this)->extraData()->receiveNativePaintEvents = true; getVideoWindowRect(); registerForAncestorMoved(); @@ -288,5 +286,18 @@ void MMF::VideoOutput::dump() const #endif } +void MMF::VideoOutput::beginNativePaintEvent(const QRect& /*controlRect*/) +{ + emit beginVideoWindowNativePaint(); +} + +void MMF::VideoOutput::endNativePaintEvent(const QRect& /*controlRect*/) +{ + // Ensure that draw ops are executed into the WSERV output framebuffer + CCoeEnv::Static()->WsSession().Flush(); + + emit endVideoWindowNativePaint(); +} + QT_END_NAMESPACE diff --git a/src/3rdparty/phonon/mmf/videooutput.h b/src/3rdparty/phonon/mmf/videooutput.h index 6dfe69d..2788401 100644 --- a/src/3rdparty/phonon/mmf/videooutput.h +++ b/src/3rdparty/phonon/mmf/videooutput.h @@ -63,10 +63,16 @@ public: // Debugging output void dump() const; +public Q_SLOTS: + void beginNativePaintEvent(const QRect& /*controlRect*/); + void endNativePaintEvent(const QRect& /*controlRect*/); + Q_SIGNALS: void videoWindowChanged(); void aspectRatioChanged(); void scaleModeChanged(); + void beginVideoWindowNativePaint(); + void endVideoWindowNativePaint(); protected: // Override QWidget functions |