From 9373947ac1ab1cb93b20f1fd6c93f972a9d4d0be Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Sun, 12 Jun 2011 17:43:26 +0000 Subject: [PATCH] Use rgb instead of rgba to display capture preview svn path=/trunk/kdenlive/; revision=5707 --- src/mltdevicecapture.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/mltdevicecapture.cpp b/src/mltdevicecapture.cpp index 914ce5ae..b7037664 100644 --- a/src/mltdevicecapture.cpp +++ b/src/mltdevicecapture.cpp @@ -331,16 +331,15 @@ void MltDeviceCapture::gotCapturedFrame(Mlt::Frame& frame) m_frameCount++; if (m_livePreview == 2) return; if (m_livePreview == 0 && (m_frameCount % 10 > 0)) return; - mlt_image_format format = mlt_image_rgb24a; + mlt_image_format format = mlt_image_rgb24; int width = 0; int height = 0; - //QImage image(width, height, QImage::Format_ARGB32_Premultiplied); uint8_t *data = frame.get_image(format, width, height, 0); - QImage image((uchar *)data, width, height, QImage::Format_ARGB32_Premultiplied); - - /*uchar *buffer = frame.get_image(format, width, height); - memcpy(image.bits(), buffer, width * height * 4);*/ - m_captureDisplayWidget->setImage(image.rgbSwapped()); + //QImage image(width, height, QImage::Format_RGB888); + //memcpy(image.bits(), data, width * height * 3); + QImage image((uchar *)data, width, height, QImage::Format_RGB888); + + m_captureDisplayWidget->setImage(image); //TEST: is it better to process frame conversion ouside MLT??? /* -- 2.39.2