diff options
author | Gareth Stockwell <gareth.stockwell@sosco.com> | 2009-08-25 17:10:58 (GMT) |
---|---|---|
committer | Gareth Stockwell <gareth.stockwell@sosco.com> | 2009-08-25 17:10:58 (GMT) |
commit | 55dcdac49aeaf9a7af9d420140e7629682fa4573 (patch) | |
tree | 71ac31355439a48825654055a112faebbee21c5f /src/3rdparty/phonon/mmf/videooutput.cpp | |
parent | f3defb60f21cfe2456ace1148afcce43112f9c51 (diff) | |
download | Qt-55dcdac49aeaf9a7af9d420140e7629682fa4573.zip Qt-55dcdac49aeaf9a7af9d420140e7629682fa4573.tar.gz Qt-55dcdac49aeaf9a7af9d420140e7629682fa4573.tar.bz2 |
Made video playback visible using a couple of hacks
These hacks, which are enabled using macros in defs.h, are:
PHONON_MMF_HARD_CODE_VIDEO_RECT
VideoPlayer should obtain the screen rectangle into which video rendering will occur, using the CoeControl associated with the video widget (i.e. the VideoOutput object). However, this control always has co-ordinates (relative to its parent) of (0,0)-(100,30), regardless of whether updateGeometry() and show() are called on the widget. So, this macro just hard-codes the screen rectangle to a value which works when the breakfast.mp4 clip is used for testing.
PHONON_MMF_EXPLICITLY_SHOW_VIDEO_WIDGET
In order that the video region does not overwrite the slider and buttons below it, the parent widget of the VideoObject instance must be appropriately re-sized. Debugging showed that both the parent and grandparent of VideoObject are in fact invisible at the time playback begins, so for now we just manually call show() on the grandparent.
Clearly both of these are only temporary measures, for use until the underlying cause of the problem has been determined.
Diffstat (limited to 'src/3rdparty/phonon/mmf/videooutput.cpp')
-rw-r--r-- | src/3rdparty/phonon/mmf/videooutput.cpp | 69 |
1 files changed, 67 insertions, 2 deletions
diff --git a/src/3rdparty/phonon/mmf/videooutput.cpp b/src/3rdparty/phonon/mmf/videooutput.cpp index 30bf531..482d944 100644 --- a/src/3rdparty/phonon/mmf/videooutput.cpp +++ b/src/3rdparty/phonon/mmf/videooutput.cpp @@ -35,15 +35,63 @@ MMF::VideoOutput::VideoOutput(QWidget* parent) { TRACE_CONTEXT(VideoOutput::VideoOutput, EVideoInternal); TRACE_ENTRY("parent 0x%08x", parent); - + +#ifndef PHONON_MMF_VIDEOOUTPUT_IS_QWIDGET setPalette(QPalette(Qt::black)); setAttribute(Qt::WA_OpaquePaintEvent, true); setAttribute(Qt::WA_NoSystemBackground, true); setAutoFillBackground(false); +#endif // PHONON_MMF_VIDEOOUTPUT_IS_QWIDGET + + dump(); TRACE_EXIT_0(); } +// Debugging video visibility +void VideoOutput::dump() +{ + TRACE_CONTEXT(VideoOutput::dump, EVideoInternal); + TRACE_ENTRY_0(); + + TRACE("dumpObjectInfo this 0x%08x", this); + this->dumpObjectInfo(); + + TRACE_0("Traversing up object tree ..."); + QObject* node = this; + QObject* root = this; + while(node) + { + QWidget* widget = qobject_cast<QWidget*>(node); + const bool visible = widget ? widget->isVisible() : false; + TRACE("node 0x%08x widget 0x%08x visible %d", node, widget, visible); + + root = node; + node = node->parent(); + } + + TRACE("dumpObjectInfo root 0x%08x", root); + root->dumpObjectInfo(); + TRACE_0("+ dumpObjectTree"); + root->dumpObjectTree(); + TRACE_0("- dumpObjectTree"); + + TRACE("isVisible %d", isVisible()); + TRACE("pos %d %d", x(), y()); + TRACE("size %d %d", size().width(), size().height()); + TRACE("maxSize %d %d", maximumWidth(), maximumHeight()); + TRACE("sizeHint %d %d", sizeHint().width(), sizeHint().height()); + + QWidget& parentWidget = *qobject_cast<QWidget*>(parent()); + TRACE("parent.isVisible %d", parentWidget.isVisible()); + TRACE("parent.pos %d %d", parentWidget.x(), parentWidget.y()); + TRACE("parent.size %d %d", parentWidget.size().width(), parentWidget.size().height()); + TRACE("parent.maxSize %d %d", parentWidget.maximumWidth(), parentWidget.maximumHeight()); + TRACE("parent.sizeHint %d %d", parentWidget.sizeHint().width(), parentWidget.sizeHint().height()); + + TRACE_EXIT_0(); +} + MMF::VideoOutput::~VideoOutput() { TRACE_CONTEXT(VideoOutput::~VideoOutput, EVideoInternal); @@ -54,6 +102,9 @@ MMF::VideoOutput::~VideoOutput() void MMF::VideoOutput::setFrameSize(const QSize& frameSize) { +#ifdef PHONON_MMF_VIDEOOUTPUT_IS_QWIDGET + Q_UNUSED(frameSize); +#else TRACE_CONTEXT(VideoOutput::setFrameSize, EVideoInternal); TRACE("oldSize %d %d newSize %d %d", m_frameSize.width(), m_frameSize.height(), @@ -64,6 +115,7 @@ void MMF::VideoOutput::setFrameSize(const QSize& frameSize) m_frameSize = frameSize; updateGeometry(); } +#endif // PHONON_MMF_VIDEOOUTPUT_IS_QWIDGET } @@ -71,6 +123,8 @@ void MMF::VideoOutput::setFrameSize(const QSize& frameSize) // QWidget //----------------------------------------------------------------------------- +#ifndef PHONON_MMF_VIDEOOUTPUT_IS_QWIDGET + QSize MMF::VideoOutput::sizeHint() const { TRACE_CONTEXT(VideoOutput::sizeHint, EVideoApi); @@ -95,12 +149,17 @@ void MMF::VideoOutput::paintEvent(QPaintEvent* event) event->rect().right(), event->rect().bottom()); TRACE("regions %d", event->region().numRects()); TRACE("type %d", event->type()); + + QWidget::paintEvent(event); } QPaintEngine* MMF::VideoOutput::paintEngine() const { TRACE_CONTEXT(VideoOutput::sizeHint, EVideoApi); - TRACE_RETURN("0x%08x", NULL); + + QPaintEngine* const engine = QWidget::paintEngine(); + + TRACE_RETURN("0x%08x", engine); } void MMF::VideoOutput::resizeEvent(QResizeEvent* event) @@ -109,6 +168,8 @@ void MMF::VideoOutput::resizeEvent(QResizeEvent* event) TRACE("%d %d -> %d %d", event->oldSize().width(), event->oldSize().height(), event->size().width(), event->size().height()); + + QWidget::resizeEvent(event); } void MMF::VideoOutput::moveEvent(QMoveEvent* event) @@ -117,8 +178,12 @@ void MMF::VideoOutput::moveEvent(QMoveEvent* event) TRACE("%d %d -> %d %d", event->oldPos().x(), event->oldPos().y(), event->pos().x(), event->pos().y()); + + QWidget::moveEvent(event); } +#endif // PHONON_MMF_VIDEOOUTPUT_IS_QWIDGET + //----------------------------------------------------------------------------- // Private functions |