summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/phonon/mmf/videooutput.cpp
diff options
context:
space:
mode:
authorGareth Stockwell <gareth.stockwell@sosco.com>2009-08-25 13:18:57 (GMT)
committerGareth Stockwell <gareth.stockwell@sosco.com>2009-08-25 13:18:57 (GMT)
commit9bcdcc33e1abd202a5b0ec156ff22624bd21740c (patch)
tree1dc9ed420b6f470efb9b98d1ba42085213aa147b /src/3rdparty/phonon/mmf/videooutput.cpp
parent4135d048eb7999927dc39a73df138922d4ba6278 (diff)
downloadQt-9bcdcc33e1abd202a5b0ec156ff22624bd21740c.zip
Qt-9bcdcc33e1abd202a5b0ec156ff22624bd21740c.tar.gz
Qt-9bcdcc33e1abd202a5b0ec156ff22624bd21740c.tar.bz2
Modified video player to call updateGeometry on video display widget; having no effect at present
Diffstat (limited to 'src/3rdparty/phonon/mmf/videooutput.cpp')
-rw-r--r--src/3rdparty/phonon/mmf/videooutput.cpp77
1 files changed, 75 insertions, 2 deletions
diff --git a/src/3rdparty/phonon/mmf/videooutput.cpp b/src/3rdparty/phonon/mmf/videooutput.cpp
index 3079668..828697c 100644
--- a/src/3rdparty/phonon/mmf/videooutput.cpp
+++ b/src/3rdparty/phonon/mmf/videooutput.cpp
@@ -19,10 +19,13 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include "utils.h"
#include "videooutput.h"
+#include <QPaintEvent>
+#include <QMoveEvent>
+#include <QResizeEvent>
+
using namespace Phonon;
using namespace Phonon::MMF;
-
//-----------------------------------------------------------------------------
// Constructor / destructor
//-----------------------------------------------------------------------------
@@ -33,6 +36,11 @@ MMF::VideoOutput::VideoOutput(QWidget* parent)
TRACE_CONTEXT(VideoOutput::VideoOutput, EVideoInternal);
TRACE_ENTRY("parent 0x%08x", parent);
+ setPalette(QPalette(Qt::black));
+ setAttribute(Qt::WA_OpaquePaintEvent, true);
+ setAttribute(Qt::WA_NoSystemBackground, true);
+ setAutoFillBackground(false);
+
TRACE_EXIT_0();
}
@@ -44,8 +52,73 @@ MMF::VideoOutput::~VideoOutput()
TRACE_EXIT_0();
}
+void MMF::VideoOutput::setFrameSize(const QSize& frameSize)
+{
+ TRACE_CONTEXT(VideoOutput::setFrameSize, EVideoInternal);
+ TRACE("oldSize %d %d newSize %d %d",
+ m_frameSize.width(), m_frameSize.height(),
+ frameSize.width(), frameSize.height());
+
+ if(frameSize != m_frameSize)
+ {
+ m_frameSize = frameSize;
+ updateGeometry();
+ }
+}
+
//-----------------------------------------------------------------------------
-// Public API
+// QWidget
//-----------------------------------------------------------------------------
+QSize MMF::VideoOutput::sizeHint() const
+{
+ if(m_frameSize.isNull())
+ {
+ // TODO: replace this with a more sensible default
+ return QSize(320, 240);
+ }
+ else
+ {
+ return m_frameSize;
+ }
+}
+
+void MMF::VideoOutput::paintEvent(QPaintEvent* event)
+{
+ TRACE_CONTEXT(VideoOutput::paintEvent, EVideoInternal);
+ TRACE("rect %d %d - %d %d",
+ event->rect().left(), event->rect().top(),
+ event->rect().right(), event->rect().bottom());
+ TRACE("regions %d", event->region().numRects());
+ TRACE("type %d", event->type());
+}
+
+QPaintEngine* MMF::VideoOutput::paintEngine() const
+{
+ return NULL;
+}
+
+void MMF::VideoOutput::resizeEvent(QResizeEvent* event)
+{
+ TRACE_CONTEXT(VideoOutput::resizeEvent, EVideoInternal);
+ TRACE("%d %d -> %d %d",
+ event->oldSize().width(), event->oldSize().height(),
+ event->size().width(), event->size().height());
+}
+
+void MMF::VideoOutput::moveEvent(QMoveEvent* event)
+{
+ TRACE_CONTEXT(VideoOutput::moveEvent, EVideoInternal);
+ TRACE("%d %d -> %d %d",
+ event->oldPos().x(), event->oldPos().y(),
+ event->pos().x(), event->pos().y());
+}
+
+
+//-----------------------------------------------------------------------------
+// Private functions
+//-----------------------------------------------------------------------------
+
+
+