From 8076ee4317333112a529b9df5e7ab0a44e101d16 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Wed, 26 Aug 2009 09:38:13 +0100 Subject: Added a bit more tracing for debugging video visibility --- src/3rdparty/phonon/mmf/defs.h | 26 ++++++++++++++------------ src/3rdparty/phonon/mmf/videooutput.cpp | 3 ++- src/3rdparty/phonon/mmf/videoplayer.cpp | 6 +++++- src/3rdparty/phonon/mmf/videowidget.cpp | 8 ++++---- 4 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/3rdparty/phonon/mmf/defs.h b/src/3rdparty/phonon/mmf/defs.h index adf2882..0a9a683 100644 --- a/src/3rdparty/phonon/mmf/defs.h +++ b/src/3rdparty/phonon/mmf/defs.h @@ -25,8 +25,10 @@ along with this library. If not, see . // in order to debug the current problems with video visibility. // If this is defined, then VideoOutput is essentially just a typedef for -// QWidget -#define PHONON_MMF_VIDEOOUTPUT_IS_QWIDGET +// QWidget. This is to allow us to test whether the QWidget function +// overrides present in VideoOutput (e.g. sizeHint, paintEvent etc) may +// be the cause of the visibility problems. +//#define PHONON_MMF_VIDEOOUTPUT_IS_QWIDGET // Use hard-coded rectangle coordinates, rather than using CCoeControl // rect, i.e. QWidget::winId()->Rect() @@ -40,16 +42,16 @@ namespace Phonon { namespace MMF { - static const qint32 DefaultTickInterval = 10; - static const qreal InitialVolume = 0.5; - - enum MediaType - { - MediaTypeUnknown, - MediaTypeAudio, - MediaTypeVideo - }; + static const qint32 DefaultTickInterval = 10; + static const qreal InitialVolume = 0.5; + + enum MediaType + { + MediaTypeUnknown, + MediaTypeAudio, + MediaTypeVideo + }; } } -#endif +#endif // PHONON_MMF_DEFS_H diff --git a/src/3rdparty/phonon/mmf/videooutput.cpp b/src/3rdparty/phonon/mmf/videooutput.cpp index 482d944..2652844 100644 --- a/src/3rdparty/phonon/mmf/videooutput.cpp +++ b/src/3rdparty/phonon/mmf/videooutput.cpp @@ -64,7 +64,8 @@ void VideoOutput::dump() { QWidget* widget = qobject_cast(node); const bool visible = widget ? widget->isVisible() : false; - TRACE("node 0x%08x widget 0x%08x visible %d", node, widget, visible); + const QHBufC name(node->objectName()); + TRACE("node 0x%08x name %S widget 0x%08x visible %d", node, name.data(), widget, visible); root = node; node = node->parent(); diff --git a/src/3rdparty/phonon/mmf/videoplayer.cpp b/src/3rdparty/phonon/mmf/videoplayer.cpp index 584a4f0..419c83c 100644 --- a/src/3rdparty/phonon/mmf/videoplayer.cpp +++ b/src/3rdparty/phonon/mmf/videoplayer.cpp @@ -234,8 +234,12 @@ void MMF::VideoPlayer::MvpuoPrepareComplete(TInt aError) #ifdef PHONON_MMF_EXPLICITLY_SHOW_VIDEO_WIDGET // HACK: why do we need to explicitly show() the grandparent...? - static_cast(videoOutput().parent()->parent())->show(); + QWidget* grandparent = static_cast(videoOutput().parent()->parent()); + TRACE("Calling grandparent[0x%08x]->show()", grandparent); + grandparent->show(); + TRACE_0("Calling videoOutput().updateGeometry()"); videoOutput().updateGeometry(); + TRACE_0("Calling videoOutput().update()"); videoOutput().update(); #endif diff --git a/src/3rdparty/phonon/mmf/videowidget.cpp b/src/3rdparty/phonon/mmf/videowidget.cpp index 7849109..515f04e 100644 --- a/src/3rdparty/phonon/mmf/videowidget.cpp +++ b/src/3rdparty/phonon/mmf/videowidget.cpp @@ -42,7 +42,7 @@ static const qreal DefaultSaturation = 1.0; //----------------------------------------------------------------------------- MMF::VideoWidget::VideoWidget(QWidget* parent) - : m_videoOutput(new VideoOutput(parent)) + : m_widget(new VideoOutput(parent)) , m_aspectRatio(DefaultAspectRatio) , m_brightness(DefaultBrightness) , m_scaleMode(DefaultScaleMode) @@ -51,7 +51,7 @@ MMF::VideoWidget::VideoWidget(QWidget* parent) , m_saturation(DefaultSaturation) { TRACE_CONTEXT(VideoWidget::VideoWidget, EVideoApi); - TRACE_ENTRY_0(); + TRACE_ENTRY_0(); TRACE_EXIT_0(); } @@ -150,11 +150,11 @@ void MMF::VideoWidget::setSaturation(qreal saturation) QWidget* MMF::VideoWidget::widget() { - return m_videoOutput.data(); + return m_widget.data(); } VideoOutput& MMF::VideoWidget::videoOutput() { - return *m_videoOutput; + return *static_cast(widget()); } -- cgit v0.12