--- a/src/3rdparty/phonon/mmf/videowidget.cpp Tue Feb 02 00:43:10 2010 +0200
+++ b/src/3rdparty/phonon/mmf/videowidget.cpp Wed Mar 31 11:06:36 2010 +0300
@@ -18,10 +18,15 @@
#include "mediaobject.h"
#include "utils.h"
-#include "videooutput.h"
#include "videowidget.h"
+#ifdef PHONON_MMF_VIDEO_SURFACES
+#include "videooutput_surface.h"
+#else
+#include "videooutput_dsa.h"
+#endif
+
QT_BEGIN_NAMESPACE
using namespace Phonon;
@@ -45,10 +50,13 @@
// Constructor / destructor
//-----------------------------------------------------------------------------
-MMF::VideoWidget::VideoWidget
- (AncestorMoveMonitor* ancestorMoveMonitor, QWidget* parent)
+MMF::VideoWidget::VideoWidget(QWidget *parent)
: MediaNode(parent)
- , m_videoOutput(new VideoOutput(ancestorMoveMonitor, parent))
+#ifdef PHONON_MMF_VIDEO_SURFACES
+ , m_videoOutput(new SurfaceVideoOutput(parent))
+#else
+ , m_videoOutput(new DsaVideoOutput(parent))
+#endif
, m_brightness(DefaultBrightness)
, m_contrast(DefaultContrast)
, m_hue(DefaultHue)
@@ -68,6 +76,13 @@
TRACE_EXIT_0();
}
+#ifndef PHONON_MMF_VIDEO_SURFACES
+void MMF::VideoWidget::setAncestorMoveMonitor(AncestorMoveMonitor *monitor)
+{
+ static_cast<DsaVideoOutput *>(m_videoOutput.data())->setAncestorMoveMonitor(monitor);
+}
+#endif
+
//-----------------------------------------------------------------------------
// VideoWidgetInterface
@@ -157,10 +172,18 @@
return m_videoOutput.data();
}
-bool MMF::VideoWidget::activateOnMediaObject(MediaObject *mo)
+//-----------------------------------------------------------------------------
+// MediaNode
+//-----------------------------------------------------------------------------
+
+void MMF::VideoWidget::connectMediaObject(MediaObject *mediaObject)
{
- mo->setVideoOutput(m_videoOutput.data());
- return true;
+ mediaObject->setVideoOutput(m_videoOutput.data());
+}
+
+void MMF::VideoWidget::disconnectMediaObject(MediaObject *mediaObject)
+{
+ mediaObject->setVideoOutput(0);
}
QT_END_NAMESPACE