--- a/qtmobility/plugins/multimedia/gstreamer/qx11videosurface.cpp Fri Apr 16 15:51:22 2010 +0300
+++ b/qtmobility/plugins/multimedia/gstreamer/qx11videosurface.cpp Mon May 03 13:18:40 2010 +0300
@@ -162,6 +162,8 @@
void QX11VideoSurface::setWinId(WId id)
{
+ //qDebug() << "setWinID:" << id;
+
if (id == m_winId)
return;
@@ -189,13 +191,18 @@
if (m_image) {
m_image = 0;
- if (!start(surfaceFormat()))
+ if (!start(surfaceFormat())) {
QAbstractVideoSurface::stop();
+ qWarning() << "Failed to start video surface with format" << surfaceFormat();
+ }
}
- } else if (m_image) {
- m_image = 0;
+ } else {
+ qWarning() << "Failed to find XVideo port";
+ if (m_image) {
+ m_image = 0;
- QAbstractVideoSurface::stop();
+ QAbstractVideoSurface::stop();
+ }
}
emit supportedFormatsChanged();
@@ -211,6 +218,16 @@
m_displayRect = rect;
}
+QRect QX11VideoSurface::viewport() const
+{
+ return m_viewport;
+}
+
+void QX11VideoSurface::setViewport(const QRect &rect)
+{
+ m_viewport = rect;
+}
+
int QX11VideoSurface::brightness() const
{
return getAttribute("XV_BRIGHTNESS", m_brightnessRange.first, m_brightnessRange.second);
@@ -440,7 +457,13 @@
bool portFound = false;
if (XvQueryAdaptors(QX11Info::display(), m_winId, &count, &adaptors) == Success) {
+#ifdef Q_WS_MAEMO_5
+ //the overlay xvideo adapter fails to switch winId,
+ //prefer the "SGX Textured Video" adapter instead
+ for (unsigned int i = count-1; i >=0 && !portFound; --i) {
+#else
for (unsigned int i = 0; i < count && !portFound; ++i) {
+#endif
if (adaptors[i].type & XvImageMask) {
m_portId = adaptors[i].base_id;