Phonon Gstreamer backend in QGraphicsView

Andras Mantia amantia at kde.org
Tue Mar 2 10:13:12 GMT 2010


Hi,

 I try to use Phonon in QGraphicsView and it seems only the GStreamer 
backend can be used for this purpose (on Linux), with Xine all I get is 
a black frame.
 Anyway, it works, but I have a problem: the colors are messed up, red 
is used instead of blue and vice versa. It is like the data is in BGR, 
but the display is in RGB.
 I found that the code that might be doing this is in 
gstreamer/widgetrenderer.cpp:

void WidgetRenderer::setNextFrame(const QByteArray &array, int w, int h)
{
[...]
   m_frame = QImage(); 
    {
        m_frame = QImage((uchar *)array.constData(), w, h, 
QImage::Format_RGB32);
    }
[...]
}

If I change that to
  m_frame = QImage((uchar *)array.constData(), w, h, 
QImage::Format_RGB32).rgbSwapped();

works as expected.

Obviously I doubt that this should be always done, and there is similar 
code in glrenderer.cpp (which interestingly is not used even if I use a 
QGLWidget for graphicsview). Does anyone have an idea/hint how to detect 
when should the image be swapped?

Andras

-- 
András Manția | andras at kdab.com | Software Engineer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - Qt Experts - Platform-independent software solutions
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-multimedia/attachments/20100302/3989318f/attachment.sig>
-------------- next part --------------
_______________________________________________
kde-multimedia mailing list
kde-multimedia at kde.org
https://mail.kde.org/mailman/listinfo/kde-multimedia


More information about the kde-multimedia mailing list