From 12f0835ca0a8c6b4cb2a516616882fa03ccfd05b Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Tue, 30 Mar 2010 09:42:05 +0100 Subject: Added additional logging to Phonon MMF backend In addition to dumping the widget tree which contains the VideoOutput widget, the backend now also dumps the widget tree from the application's active window. This is to allow debugging of problems which stem from the fact that the VideoOutput widget subtree root is not the application's main window. In addition to dumping the Qt widget tree, the backend now also requests the window server to dump the entire window tree. Together, these changes allow easier debugging of video visibility- related problems. Reviewed-by: trustme --- src/3rdparty/phonon/mmf/abstractvideooutput.cpp | 8 ++++++++ src/3rdparty/phonon/mmf/abstractvideoplayer.cpp | 8 +++++++- src/3rdparty/phonon/mmf/videooutput_dsa.cpp | 6 ++++++ src/3rdparty/phonon/mmf/videoplayer_dsa.cpp | 25 +++++++++++++++++++++++-- 4 files changed, 44 insertions(+), 3 deletions(-) diff --git a/src/3rdparty/phonon/mmf/abstractvideooutput.cpp b/src/3rdparty/phonon/mmf/abstractvideooutput.cpp index 3fe66fc..a8aabfd 100644 --- a/src/3rdparty/phonon/mmf/abstractvideooutput.cpp +++ b/src/3rdparty/phonon/mmf/abstractvideooutput.cpp @@ -28,6 +28,8 @@ along with this library. If not, see . #include #include +#include // for QApplication::activeWindow + #include QT_BEGIN_NAMESPACE @@ -162,6 +164,12 @@ void MMF::AbstractVideoOutput::dump() const QScopedPointer visitor(new ObjectDump::QVisitor); visitor->setPrefix("Phonon::MMF"); // to aid searchability of logs ObjectDump::addDefaultAnnotators(*visitor); + + if (QWidget *window = QApplication::activeWindow()) { + TRACE("Dumping from root window 0x%08x:", window); + ObjectDump::dumpTreeFromLeaf(*window, *visitor); + } + TRACE("Dumping tree from leaf 0x%08x:", this); ObjectDump::dumpTreeFromLeaf(*this, *visitor); diff --git a/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp b/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp index 8cb9db5..c2bcce0 100644 --- a/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp @@ -193,11 +193,14 @@ qint64 MMF::AbstractVideoPlayer::totalTime() const void MMF::AbstractVideoPlayer::videoWindowChanged() { - TRACE_CONTEXT(AbstractVideoPlayer::videoOutputRegionChanged, EVideoInternal); + TRACE_CONTEXT(AbstractVideoPlayer::videoWindowChanged, EVideoInternal); TRACE_ENTRY("state %d", state()); m_window = m_videoOutput ? m_videoOutput->videoWindow() : 0; + if (m_videoOutput) + m_videoOutput->dump(); + handleVideoWindowChanged(); TRACE_EXIT_0(); @@ -253,6 +256,9 @@ void MMF::AbstractVideoPlayer::MvpuoPrepareComplete(TInt aError) TRAPD(err, getVideoClipParametersL(aError)); if (KErrNone == err) { + if (m_videoOutput) + m_videoOutput->dump(); + maxVolumeChanged(m_player->MaxVolume()); if (m_videoOutput) diff --git a/src/3rdparty/phonon/mmf/videooutput_dsa.cpp b/src/3rdparty/phonon/mmf/videooutput_dsa.cpp index a5e2ac8..4f9ad7f 100644 --- a/src/3rdparty/phonon/mmf/videooutput_dsa.cpp +++ b/src/3rdparty/phonon/mmf/videooutput_dsa.cpp @@ -101,11 +101,17 @@ void MMF::DsaVideoOutput::ancestorMoved() void MMF::DsaVideoOutput::beginNativePaintEvent(const QRect & /*controlRect*/) { + TRACE_CONTEXT(DsaVideoOutput::beginNativePaintEvent, EVideoInternal); + TRACE_ENTRY_0(); + emit beginVideoWindowNativePaint(); } void MMF::DsaVideoOutput::endNativePaintEvent(const QRect & /*controlRect*/) { + TRACE_CONTEXT(DsaVideoOutput::endNativePaintEvent, EVideoInternal); + TRACE_ENTRY_0(); + // Ensure that draw ops are executed into the WSERV output framebuffer CCoeEnv::Static()->WsSession().Flush(); diff --git a/src/3rdparty/phonon/mmf/videoplayer_dsa.cpp b/src/3rdparty/phonon/mmf/videoplayer_dsa.cpp index 732d2d9..226d079 100644 --- a/src/3rdparty/phonon/mmf/videoplayer_dsa.cpp +++ b/src/3rdparty/phonon/mmf/videoplayer_dsa.cpp @@ -190,6 +190,9 @@ public: void getDsaRegion(RWsSession &session, const RWindowBase &window) { + // Dump complete window tree + session.LogCommand(RWsSession::ELoggingStatusDump); + RDirectScreenAccess dsa(session); TInt err = dsa.Construct(); CDummyAO ao; @@ -214,7 +217,7 @@ void getDsaRegion(RWsSession &session, const RWindowBase &window) void MMF::DsaVideoPlayer::handleParametersChanged(VideoParameters parameters) { TRACE_CONTEXT(DsaVideoPlayer::handleParametersChanged, EVideoInternal); - TRACE_ENTRY_0(); + TRACE_ENTRY("parameters 0x%x", parameters); if (!m_window) return; @@ -265,17 +268,32 @@ void MMF::DsaVideoPlayer::handleParametersChanged(VideoParameters parameters) void MMF::DsaVideoPlayer::startDirectScreenAccess() { + TRACE_CONTEXT(DsaVideoPlayer::startDirectScreenAccess, EVideoInternal); + TRACE_ENTRY("dsaActive %d", m_dsaActive); + + int err = KErrNone; + if (!m_dsaActive) { - TRAPD(err, m_player->StartDirectScreenAccessL()); + TRAP(err, m_player->StartDirectScreenAccessL()); if (KErrNone == err) m_dsaActive = true; else setError(tr("Video display error"), err); } + + if (m_videoOutput) + m_videoOutput->dump(); + + TRACE_EXIT("error %d", err); } bool MMF::DsaVideoPlayer::stopDirectScreenAccess() { + TRACE_CONTEXT(DsaVideoPlayer::stopDirectScreenAccess, EVideoInternal); + TRACE_ENTRY("dsaActive %d", m_dsaActive); + + int err = KErrNone; + const bool dsaWasActive = m_dsaActive; if (m_dsaActive) { TRAPD(err, m_player->StopDirectScreenAccessL()); @@ -284,6 +302,9 @@ bool MMF::DsaVideoPlayer::stopDirectScreenAccess() else setError(tr("Video display error"), err); } + + TRACE_EXIT("error %d", err); + return dsaWasActive; } -- cgit v0.12